@angular/router 14.0.0-next.1 → 14.0.0-next.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.
- package/esm2020/src/apply_redirects.mjs +12 -13
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/create_url_tree.mjs +8 -7
- package/esm2020/src/directives/router_link.mjs +15 -18
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +4 -4
- package/esm2020/src/events.mjs +1 -1
- package/esm2020/src/index.mjs +1 -1
- package/esm2020/src/models.mjs +14 -0
- package/esm2020/src/operators/activate_routes.mjs +1 -1
- package/esm2020/src/operators/apply_redirects.mjs +1 -1
- package/esm2020/src/operators/check_guards.mjs +1 -1
- package/esm2020/src/operators/recognize.mjs +1 -1
- package/esm2020/src/operators/resolve_data.mjs +3 -3
- package/esm2020/src/page_title_strategy.mjs +3 -3
- package/esm2020/src/private_export.mjs +1 -1
- package/esm2020/src/recognize.mjs +4 -4
- package/esm2020/src/router.mjs +7 -19
- package/esm2020/src/router_config_loader.mjs +2 -2
- package/esm2020/src/router_module.mjs +8 -8
- package/esm2020/src/router_preloader.mjs +4 -4
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/router_state.mjs +1 -1
- package/esm2020/src/shared.mjs +1 -1
- package/esm2020/src/url_tree.mjs +2 -2
- package/esm2020/src/utils/config.mjs +1 -4
- package/esm2020/src/utils/config_matching.mjs +4 -4
- package/esm2020/src/utils/preactivation.mjs +1 -1
- package/esm2020/src/utils/type_guards.mjs +1 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +4 -4
- package/esm2020/upgrade/src/upgrade.mjs +15 -5
- package/fesm2015/router.mjs +75 -93
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +16 -5
- package/fesm2015/upgrade.mjs.map +1 -1
- package/fesm2020/router.mjs +72 -90
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +15 -5
- package/fesm2020/upgrade.mjs.map +1 -1
- package/package.json +5 -5
- package/router.d.ts +38 -8
- package/testing/testing.d.ts +1 -1
- package/upgrade/upgrade.d.ts +1 -1
- package/esm2020/src/config.mjs +0 -14
- package/esm2020/src/interfaces.mjs +0 -9
package/fesm2020/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.10
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import * as i3 from '@angular/common';
|
|
8
8
|
import { Location, LocationStrategy, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';
|
|
11
|
-
import { from, of, BehaviorSubject, combineLatest,
|
|
10
|
+
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';
|
|
11
|
+
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
12
12
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, refCount, finalize, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
@@ -1131,7 +1131,7 @@ class UrlParser {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
let outletName = undefined;
|
|
1133
1133
|
if (path.indexOf(':') > -1) {
|
|
1134
|
-
outletName = path.
|
|
1134
|
+
outletName = path.slice(0, path.indexOf(':'));
|
|
1135
1135
|
this.capture(outletName);
|
|
1136
1136
|
this.capture(':');
|
|
1137
1137
|
}
|
|
@@ -1713,17 +1713,17 @@ function createActivatedRoute(c) {
|
|
|
1713
1713
|
*/
|
|
1714
1714
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
1715
1715
|
if (commands.length === 0) {
|
|
1716
|
-
return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);
|
|
1716
|
+
return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment);
|
|
1717
1717
|
}
|
|
1718
1718
|
const nav = computeNavigation(commands);
|
|
1719
1719
|
if (nav.toRoot()) {
|
|
1720
|
-
return tree(urlTree.root, new UrlSegmentGroup([], {}),
|
|
1720
|
+
return tree(urlTree.root, urlTree.root, new UrlSegmentGroup([], {}), queryParams, fragment);
|
|
1721
1721
|
}
|
|
1722
1722
|
const startingPosition = findStartingPosition(nav, urlTree, route);
|
|
1723
1723
|
const segmentGroup = startingPosition.processChildren ?
|
|
1724
1724
|
updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :
|
|
1725
1725
|
updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);
|
|
1726
|
-
return tree(startingPosition.segmentGroup, segmentGroup,
|
|
1726
|
+
return tree(urlTree.root, startingPosition.segmentGroup, segmentGroup, queryParams, fragment);
|
|
1727
1727
|
}
|
|
1728
1728
|
function isMatrixParams(command) {
|
|
1729
1729
|
return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
|
|
@@ -1735,17 +1735,18 @@ function isMatrixParams(command) {
|
|
|
1735
1735
|
function isCommandWithOutlets(command) {
|
|
1736
1736
|
return typeof command === 'object' && command != null && command.outlets;
|
|
1737
1737
|
}
|
|
1738
|
-
function tree(oldSegmentGroup, newSegmentGroup,
|
|
1738
|
+
function tree(oldRoot, oldSegmentGroup, newSegmentGroup, queryParams, fragment) {
|
|
1739
1739
|
let qp = {};
|
|
1740
1740
|
if (queryParams) {
|
|
1741
1741
|
forEach(queryParams, (value, name) => {
|
|
1742
1742
|
qp[name] = Array.isArray(value) ? value.map((v) => `${v}`) : `${value}`;
|
|
1743
1743
|
});
|
|
1744
1744
|
}
|
|
1745
|
-
if (
|
|
1745
|
+
if (oldRoot === oldSegmentGroup) {
|
|
1746
1746
|
return new UrlTree(newSegmentGroup, qp, fragment);
|
|
1747
1747
|
}
|
|
1748
|
-
|
|
1748
|
+
const newRoot = replaceSegment(oldRoot, oldSegmentGroup, newSegmentGroup);
|
|
1749
|
+
return new UrlTree(newRoot, qp, fragment);
|
|
1749
1750
|
}
|
|
1750
1751
|
function replaceSegment(current, oldSegment, newSegment) {
|
|
1751
1752
|
const children = {};
|
|
@@ -2525,9 +2526,9 @@ class RouterOutlet {
|
|
|
2525
2526
|
this.activateEvents.emit(this.activated.instance);
|
|
2526
2527
|
}
|
|
2527
2528
|
}
|
|
2528
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2529
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2530
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2529
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2530
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.10", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2531
2532
|
type: Directive,
|
|
2532
2533
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2533
2534
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }, { type: undefined, decorators: [{
|
|
@@ -2581,9 +2582,9 @@ class OutletInjector {
|
|
|
2581
2582
|
*/
|
|
2582
2583
|
class ɵEmptyOutletComponent {
|
|
2583
2584
|
}
|
|
2584
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2585
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2585
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2586
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.10", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, directives: [{ type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2587
2588
|
type: Component,
|
|
2588
2589
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2589
2590
|
}] });
|
|
@@ -2657,9 +2658,6 @@ function validateNode(route, fullPath) {
|
|
|
2657
2658
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2658
2659
|
throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2659
2660
|
}
|
|
2660
|
-
if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
|
|
2661
|
-
throw new Error(`Invalid configuration of route '${fullPath}': pathMatch can only be set to 'prefix' or 'full'`);
|
|
2662
|
-
}
|
|
2663
2661
|
}
|
|
2664
2662
|
if (route.children) {
|
|
2665
2663
|
validateConfig(route.children, fullPath);
|
|
@@ -2717,7 +2715,7 @@ function sortByMatchingOutlets(routes, outletName) {
|
|
|
2717
2715
|
const noMatch$1 = {
|
|
2718
2716
|
matched: false,
|
|
2719
2717
|
consumedSegments: [],
|
|
2720
|
-
|
|
2718
|
+
remainingSegments: [],
|
|
2721
2719
|
parameters: {},
|
|
2722
2720
|
positionalParamSegments: {}
|
|
2723
2721
|
};
|
|
@@ -2729,7 +2727,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2729
2727
|
return {
|
|
2730
2728
|
matched: true,
|
|
2731
2729
|
consumedSegments: [],
|
|
2732
|
-
|
|
2730
|
+
remainingSegments: segments,
|
|
2733
2731
|
parameters: {},
|
|
2734
2732
|
positionalParamSegments: {}
|
|
2735
2733
|
};
|
|
@@ -2748,7 +2746,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2748
2746
|
return {
|
|
2749
2747
|
matched: true,
|
|
2750
2748
|
consumedSegments: res.consumed,
|
|
2751
|
-
|
|
2749
|
+
remainingSegments: segments.slice(res.consumed.length),
|
|
2752
2750
|
// TODO(atscott): investigate combining parameters and positionalParamSegments
|
|
2753
2751
|
parameters,
|
|
2754
2752
|
positionalParamSegments: res.posParams ?? {}
|
|
@@ -2866,16 +2864,16 @@ class AbsoluteRedirect {
|
|
|
2866
2864
|
}
|
|
2867
2865
|
}
|
|
2868
2866
|
function noMatch(segmentGroup) {
|
|
2869
|
-
return
|
|
2867
|
+
return throwError(new NoMatch$1(segmentGroup));
|
|
2870
2868
|
}
|
|
2871
2869
|
function absoluteRedirect(newTree) {
|
|
2872
|
-
return
|
|
2870
|
+
return throwError(new AbsoluteRedirect(newTree));
|
|
2873
2871
|
}
|
|
2874
2872
|
function namedOutletsRedirect(redirectTo) {
|
|
2875
|
-
return
|
|
2873
|
+
return throwError(new Error(`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
2876
2874
|
}
|
|
2877
2875
|
function canLoadFails(route) {
|
|
2878
|
-
return
|
|
2876
|
+
return throwError(navigationCancelingError(`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
|
|
2879
2877
|
}
|
|
2880
2878
|
/**
|
|
2881
2879
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -2990,7 +2988,7 @@ class ApplyRedirects {
|
|
|
2990
2988
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
2991
2989
|
return of(new UrlSegmentGroup([], {}));
|
|
2992
2990
|
}
|
|
2993
|
-
|
|
2991
|
+
return noMatch(segmentGroup);
|
|
2994
2992
|
}
|
|
2995
2993
|
throw e;
|
|
2996
2994
|
}));
|
|
@@ -3024,7 +3022,7 @@ class ApplyRedirects {
|
|
|
3024
3022
|
}));
|
|
3025
3023
|
}
|
|
3026
3024
|
expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
|
|
3027
|
-
const { matched, consumedSegments,
|
|
3025
|
+
const { matched, consumedSegments, remainingSegments, positionalParamSegments } = match(segmentGroup, route, segments);
|
|
3028
3026
|
if (!matched)
|
|
3029
3027
|
return noMatch(segmentGroup);
|
|
3030
3028
|
const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
|
|
@@ -3032,7 +3030,7 @@ class ApplyRedirects {
|
|
|
3032
3030
|
return absoluteRedirect(newTree);
|
|
3033
3031
|
}
|
|
3034
3032
|
return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
|
|
3035
|
-
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(
|
|
3033
|
+
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(remainingSegments), outlet, false);
|
|
3036
3034
|
}));
|
|
3037
3035
|
}
|
|
3038
3036
|
matchSegmentAgainstRoute(ngModule, rawSegmentGroup, route, segments, outlet) {
|
|
@@ -3047,15 +3045,14 @@ class ApplyRedirects {
|
|
|
3047
3045
|
}
|
|
3048
3046
|
return of(new UrlSegmentGroup(segments, {}));
|
|
3049
3047
|
}
|
|
3050
|
-
const { matched, consumedSegments,
|
|
3048
|
+
const { matched, consumedSegments, remainingSegments } = match(rawSegmentGroup, route, segments);
|
|
3051
3049
|
if (!matched)
|
|
3052
3050
|
return noMatch(rawSegmentGroup);
|
|
3053
|
-
const rawSlicedSegments = segments.slice(lastChild);
|
|
3054
3051
|
const childConfig$ = this.getChildConfig(ngModule, route, segments);
|
|
3055
3052
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
3056
3053
|
const childModule = routerConfig.module;
|
|
3057
3054
|
const childConfig = routerConfig.routes;
|
|
3058
|
-
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments,
|
|
3055
|
+
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments, remainingSegments, childConfig);
|
|
3059
3056
|
// See comment on the other call to `split` about why this is necessary.
|
|
3060
3057
|
const segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);
|
|
3061
3058
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
@@ -3632,7 +3629,7 @@ class Recognizer {
|
|
|
3632
3629
|
return null;
|
|
3633
3630
|
let snapshot;
|
|
3634
3631
|
let consumedSegments = [];
|
|
3635
|
-
let
|
|
3632
|
+
let remainingSegments = [];
|
|
3636
3633
|
if (route.path === '**') {
|
|
3637
3634
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
3638
3635
|
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
|
|
@@ -3643,11 +3640,11 @@ class Recognizer {
|
|
|
3643
3640
|
return null;
|
|
3644
3641
|
}
|
|
3645
3642
|
consumedSegments = result.consumedSegments;
|
|
3646
|
-
|
|
3643
|
+
remainingSegments = result.remainingSegments;
|
|
3647
3644
|
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
|
|
3648
3645
|
}
|
|
3649
3646
|
const childConfig = getChildConfig(route);
|
|
3650
|
-
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments,
|
|
3647
|
+
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments,
|
|
3651
3648
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
3652
3649
|
// snapshots and don't handle redirects here. That should have been done in
|
|
3653
3650
|
// `applyRedirects`.
|
|
@@ -3833,7 +3830,7 @@ function resolveNode(resolve, futureARS, futureRSS, moduleInjector) {
|
|
|
3833
3830
|
}
|
|
3834
3831
|
const data = {};
|
|
3835
3832
|
return from(keys).pipe(mergeMap(key => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)
|
|
3836
|
-
.pipe(tap((value) => {
|
|
3833
|
+
.pipe(take(1), tap((value) => {
|
|
3837
3834
|
data[key] = value;
|
|
3838
3835
|
}))), takeLast(1), mergeMap(() => {
|
|
3839
3836
|
// Ensure all resolvers returned values, otherwise don't emit any "next" and just complete
|
|
@@ -4186,6 +4183,8 @@ class Router {
|
|
|
4186
4183
|
/**
|
|
4187
4184
|
* Enables a bug fix that corrects relative link resolution in components with empty paths.
|
|
4188
4185
|
* @see `RouterModule`
|
|
4186
|
+
*
|
|
4187
|
+
* @deprecated
|
|
4189
4188
|
*/
|
|
4190
4189
|
this.relativeLinkResolution = 'corrected';
|
|
4191
4190
|
/**
|
|
@@ -4269,7 +4268,7 @@ class Router {
|
|
|
4269
4268
|
tap(t => {
|
|
4270
4269
|
this.currentNavigation = {
|
|
4271
4270
|
id: t.id,
|
|
4272
|
-
initialUrl: t.
|
|
4271
|
+
initialUrl: t.rawUrl,
|
|
4273
4272
|
extractedUrl: t.extractedUrl,
|
|
4274
4273
|
trigger: t.source,
|
|
4275
4274
|
extras: t.extras,
|
|
@@ -4848,20 +4847,6 @@ class Router {
|
|
|
4848
4847
|
if (this.disposed) {
|
|
4849
4848
|
return Promise.resolve(false);
|
|
4850
4849
|
}
|
|
4851
|
-
// Duplicate navigations may be triggered by attempts to sync AngularJS and
|
|
4852
|
-
// Angular router states. We have the setTimeout in the location listener to
|
|
4853
|
-
// ensure the imperative nav is scheduled before the browser nav.
|
|
4854
|
-
const lastNavigation = this.transitions.value;
|
|
4855
|
-
const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
|
|
4856
|
-
!isBrowserTriggeredNavigation(lastNavigation.source);
|
|
4857
|
-
const navToSameUrl = lastNavigation.rawUrl.toString() === rawUrl.toString();
|
|
4858
|
-
const lastNavigationInProgress = lastNavigation.id === this.currentNavigation?.id;
|
|
4859
|
-
// We consider duplicates as ones that goes to the same URL while the first
|
|
4860
|
-
// is still processing.
|
|
4861
|
-
const isDuplicateNav = navToSameUrl && lastNavigationInProgress;
|
|
4862
|
-
if (browserNavPrecededByRouterNav && isDuplicateNav) {
|
|
4863
|
-
return Promise.resolve(true); // return value is not used
|
|
4864
|
-
}
|
|
4865
4850
|
let resolve;
|
|
4866
4851
|
let reject;
|
|
4867
4852
|
let promise;
|
|
@@ -5003,9 +4988,9 @@ class Router {
|
|
|
5003
4988
|
return { navigationId };
|
|
5004
4989
|
}
|
|
5005
4990
|
}
|
|
5006
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5007
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5008
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4991
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
4992
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: Router });
|
|
4993
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: Router, decorators: [{
|
|
5009
4994
|
type: Injectable
|
|
5010
4995
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5011
4996
|
function validateCommands(commands) {
|
|
@@ -5044,7 +5029,7 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
5044
5029
|
* For example, `['/team', teamId, 'user', userName, {details: true}]`
|
|
5045
5030
|
* generates a link to `/team/11/user/bob;details=true`.
|
|
5046
5031
|
*
|
|
5047
|
-
* Multiple static segments can be merged into one term and combined with dynamic
|
|
5032
|
+
* Multiple static segments can be merged into one term and combined with dynamic segments.
|
|
5048
5033
|
* For example, `['/team/11/user', userName, {details: true}]`
|
|
5049
5034
|
*
|
|
5050
5035
|
* The input that you provide to the link is treated as a delta to the current URL.
|
|
@@ -5182,8 +5167,8 @@ class RouterLink {
|
|
|
5182
5167
|
return true;
|
|
5183
5168
|
}
|
|
5184
5169
|
const extras = {
|
|
5185
|
-
skipLocationChange:
|
|
5186
|
-
replaceUrl:
|
|
5170
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5171
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5187
5172
|
state: this.state,
|
|
5188
5173
|
};
|
|
5189
5174
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5200,13 +5185,13 @@ class RouterLink {
|
|
|
5200
5185
|
queryParams: this.queryParams,
|
|
5201
5186
|
fragment: this.fragment,
|
|
5202
5187
|
queryParamsHandling: this.queryParamsHandling,
|
|
5203
|
-
preserveFragment:
|
|
5188
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5204
5189
|
});
|
|
5205
5190
|
}
|
|
5206
5191
|
}
|
|
5207
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5208
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5209
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5192
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5193
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.10", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
|
|
5194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLink, decorators: [{
|
|
5210
5195
|
type: Directive,
|
|
5211
5196
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5212
5197
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5296,8 +5281,8 @@ class RouterLinkWithHref {
|
|
|
5296
5281
|
return true;
|
|
5297
5282
|
}
|
|
5298
5283
|
const extras = {
|
|
5299
|
-
skipLocationChange:
|
|
5300
|
-
replaceUrl:
|
|
5284
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5285
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5301
5286
|
state: this.state
|
|
5302
5287
|
};
|
|
5303
5288
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5319,13 +5304,13 @@ class RouterLinkWithHref {
|
|
|
5319
5304
|
queryParams: this.queryParams,
|
|
5320
5305
|
fragment: this.fragment,
|
|
5321
5306
|
queryParamsHandling: this.queryParamsHandling,
|
|
5322
|
-
preserveFragment:
|
|
5307
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5323
5308
|
});
|
|
5324
5309
|
}
|
|
5325
5310
|
}
|
|
5326
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5327
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5311
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5312
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.10", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", 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 });
|
|
5313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5329
5314
|
type: Directive,
|
|
5330
5315
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5331
5316
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5359,9 +5344,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.1",
|
|
|
5359
5344
|
args: ['click',
|
|
5360
5345
|
['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']]
|
|
5361
5346
|
}] } });
|
|
5362
|
-
function attrBoolValue(s) {
|
|
5363
|
-
return s === '' || !!s;
|
|
5364
|
-
}
|
|
5365
5347
|
|
|
5366
5348
|
/**
|
|
5367
5349
|
* @license
|
|
@@ -5537,9 +5519,9 @@ class RouterLinkActive {
|
|
|
5537
5519
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5538
5520
|
}
|
|
5539
5521
|
}
|
|
5540
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5541
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5542
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5522
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5523
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.10", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
5524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5543
5525
|
type: Directive,
|
|
5544
5526
|
args: [{
|
|
5545
5527
|
selector: '[routerLinkActive]',
|
|
@@ -5640,9 +5622,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5640
5622
|
}
|
|
5641
5623
|
}
|
|
5642
5624
|
}
|
|
5643
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5644
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5625
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5626
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5646
5628
|
type: Injectable,
|
|
5647
5629
|
args: [{ providedIn: 'root' }]
|
|
5648
5630
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -5760,9 +5742,9 @@ class RouterPreloader {
|
|
|
5760
5742
|
});
|
|
5761
5743
|
}
|
|
5762
5744
|
}
|
|
5763
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5764
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5765
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5745
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.Injector }, { token: PreloadingStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5746
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterPreloader });
|
|
5747
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5766
5748
|
type: Injectable
|
|
5767
5749
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.Injector }, { type: PreloadingStrategy }]; } });
|
|
5768
5750
|
|
|
@@ -5848,9 +5830,9 @@ class RouterScroller {
|
|
|
5848
5830
|
}
|
|
5849
5831
|
}
|
|
5850
5832
|
}
|
|
5851
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5852
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5853
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5833
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5834
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterScroller });
|
|
5835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterScroller, decorators: [{
|
|
5854
5836
|
type: Injectable
|
|
5855
5837
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
5856
5838
|
|
|
@@ -5991,10 +5973,10 @@ class RouterModule {
|
|
|
5991
5973
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
5992
5974
|
}
|
|
5993
5975
|
}
|
|
5994
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5995
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5996
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5997
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5976
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5977
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
5978
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterModule });
|
|
5979
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterModule, decorators: [{
|
|
5998
5980
|
type: NgModule,
|
|
5999
5981
|
args: [{
|
|
6000
5982
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6173,9 +6155,9 @@ class RouterInitializer {
|
|
|
6173
6155
|
this.destroyed = true;
|
|
6174
6156
|
}
|
|
6175
6157
|
}
|
|
6176
|
-
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6177
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6158
|
+
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6159
|
+
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterInitializer });
|
|
6160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.10", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6179
6161
|
type: Injectable
|
|
6180
6162
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6181
6163
|
function getAppInitializer(r) {
|
|
@@ -6215,7 +6197,7 @@ function provideRouterInitializer() {
|
|
|
6215
6197
|
/**
|
|
6216
6198
|
* @publicApi
|
|
6217
6199
|
*/
|
|
6218
|
-
const VERSION = new Version('14.0.0-next.
|
|
6200
|
+
const VERSION = new Version('14.0.0-next.10');
|
|
6219
6201
|
|
|
6220
6202
|
/**
|
|
6221
6203
|
* @license
|