@angular/router 14.0.0-next.9 → 14.0.0-rc.2

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.
Files changed (41) hide show
  1. package/esm2020/src/apply_redirects.mjs +52 -48
  2. package/esm2020/src/components/empty_outlet.mjs +3 -3
  3. package/esm2020/src/create_url_tree.mjs +25 -11
  4. package/esm2020/src/directives/router_link.mjs +6 -6
  5. package/esm2020/src/directives/router_link_active.mjs +22 -4
  6. package/esm2020/src/directives/router_outlet.mjs +25 -16
  7. package/esm2020/src/events.mjs +57 -1
  8. package/esm2020/src/index.mjs +1 -1
  9. package/esm2020/src/models.mjs +2 -7
  10. package/esm2020/src/operators/activate_routes.mjs +7 -14
  11. package/esm2020/src/operators/apply_redirects.mjs +3 -3
  12. package/esm2020/src/operators/resolve_data.mjs +14 -24
  13. package/esm2020/src/page_title_strategy.mjs +3 -3
  14. package/esm2020/src/recognize.mjs +24 -6
  15. package/esm2020/src/router.mjs +43 -25
  16. package/esm2020/src/router_config_loader.mjs +74 -27
  17. package/esm2020/src/router_module.mjs +14 -14
  18. package/esm2020/src/router_outlet_context.mjs +6 -1
  19. package/esm2020/src/router_preloader.mjs +48 -32
  20. package/esm2020/src/router_scroller.mjs +3 -3
  21. package/esm2020/src/router_state.mjs +4 -4
  22. package/esm2020/src/url_tree.mjs +1 -1
  23. package/esm2020/src/utils/config.mjs +86 -11
  24. package/esm2020/src/utils/config_matching.mjs +4 -1
  25. package/esm2020/src/utils/preactivation.mjs +5 -14
  26. package/esm2020/src/version.mjs +1 -1
  27. package/esm2020/testing/src/router_testing_module.mjs +4 -4
  28. package/fesm2015/router.mjs +927 -670
  29. package/fesm2015/router.mjs.map +1 -1
  30. package/fesm2015/testing.mjs +5 -5
  31. package/fesm2015/upgrade.mjs +1 -1
  32. package/fesm2020/router.mjs +912 -673
  33. package/fesm2020/router.mjs.map +1 -1
  34. package/fesm2020/testing.mjs +5 -5
  35. package/fesm2020/upgrade.mjs +1 -1
  36. package/{router.d.ts → index.d.ts} +3858 -3730
  37. package/package.json +9 -9
  38. package/testing/{testing.d.ts → index.d.ts} +65 -64
  39. package/upgrade/{upgrade.d.ts → index.d.ts} +51 -50
  40. package/testing/package.json +0 -9
  41. package/upgrade/package.json +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "14.0.0-next.9",
3
+ "version": "14.0.0-rc.2",
4
4
  "description": "Angular - the routing library",
5
5
  "keywords": [
6
6
  "angular",
@@ -19,14 +19,14 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/angular/angular/issues"
21
21
  },
22
- "homepage": "https://github.com/angular/angular/tree/master/packages/router",
22
+ "homepage": "https://github.com/angular/angular/tree/main/packages/router",
23
23
  "dependencies": {
24
24
  "tslib": "^2.3.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/core": "14.0.0-next.9",
28
- "@angular/common": "14.0.0-next.9",
29
- "@angular/platform-browser": "14.0.0-next.9",
27
+ "@angular/core": "14.0.0-rc.2",
28
+ "@angular/common": "14.0.0-rc.2",
29
+ "@angular/platform-browser": "14.0.0-rc.2",
30
30
  "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
@@ -53,7 +53,7 @@
53
53
  "fesm2020": "./fesm2020/router.mjs",
54
54
  "fesm2015": "./fesm2015/router.mjs",
55
55
  "esm2020": "./esm2020/router.mjs",
56
- "typings": "./router.d.ts",
56
+ "typings": "./index.d.ts",
57
57
  "module": "./fesm2015/router.mjs",
58
58
  "es2020": "./fesm2020/router.mjs",
59
59
  "type": "module",
@@ -62,7 +62,7 @@
62
62
  "default": "./package.json"
63
63
  },
64
64
  ".": {
65
- "types": "./router.d.ts",
65
+ "types": "./index.d.ts",
66
66
  "esm2020": "./esm2020/router.mjs",
67
67
  "es2020": "./fesm2020/router.mjs",
68
68
  "es2015": "./fesm2015/router.mjs",
@@ -70,7 +70,7 @@
70
70
  "default": "./fesm2020/router.mjs"
71
71
  },
72
72
  "./testing": {
73
- "types": "./testing/testing.d.ts",
73
+ "types": "./testing/index.d.ts",
74
74
  "esm2020": "./esm2020/testing/testing.mjs",
75
75
  "es2020": "./fesm2020/testing.mjs",
76
76
  "es2015": "./fesm2015/testing.mjs",
@@ -78,7 +78,7 @@
78
78
  "default": "./fesm2020/testing.mjs"
79
79
  },
80
80
  "./upgrade": {
81
- "types": "./upgrade/upgrade.d.ts",
81
+ "types": "./upgrade/index.d.ts",
82
82
  "esm2020": "./esm2020/upgrade/upgrade.mjs",
83
83
  "es2020": "./fesm2020/upgrade.mjs",
84
84
  "es2015": "./fesm2015/upgrade.mjs",
@@ -1,69 +1,70 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.9
2
+ * @license Angular v14.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ChildrenOutletContexts } from '@angular/router';
8
- import { Compiler } from '@angular/core';
9
- import { DefaultTitleStrategy } from '@angular/router';
10
- import { ExtraOptions } from '@angular/router';
11
- import * as i0 from '@angular/core';
12
- import * as i1 from '@angular/router';
13
- import { Injector } from '@angular/core';
14
- import { Location as Location_2 } from '@angular/common';
15
- import { ModuleWithProviders } from '@angular/core';
16
- import { Route } from '@angular/router';
17
- import { Router } from '@angular/router';
18
- import { RouteReuseStrategy } from '@angular/router';
19
- import { Routes } from '@angular/router';
20
- import { TitleStrategy } from '@angular/router';
21
- import { UrlHandlingStrategy } from '@angular/router';
22
- import { UrlSerializer } from '@angular/router';
23
-
24
- /**
25
- * @description
26
- *
27
- * Sets up the router to be used for testing.
28
- *
29
- * The modules sets up the router to be used for testing.
30
- * It provides spy implementations of `Location` and `LocationStrategy`.
31
- *
32
- * @usageNotes
33
- * ### Example
34
- *
35
- * ```
36
- * beforeEach(() => {
37
- * TestBed.configureTestingModule({
38
- * imports: [
39
- * RouterTestingModule.withRoutes(
40
- * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
41
- * )
42
- * ]
43
- * });
44
- * });
45
- * ```
46
- *
47
- * @publicApi
48
- */
49
- export declare class RouterTestingModule {
50
- static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<RouterTestingModule, never>;
52
- static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof i1.RouterModule]>;
53
- static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
54
- }
55
-
56
- /**
57
- * Router setup factory function used for testing.
58
- *
59
- * @publicApi
60
- */
61
- export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy): Router;
62
-
63
- /**
64
- * Router setup factory function used for testing. Only used internally to keep the factory that's
65
- * marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).
66
- */
67
- export declare function setupTestingRouterInternal(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, defaultTitleStrategy?: DefaultTitleStrategy, titleStrategy?: TitleStrategy): Router;
68
-
69
- export { }
7
+
8
+ import { ChildrenOutletContexts } from '@angular/router';
9
+ import { Compiler } from '@angular/core';
10
+ import { DefaultTitleStrategy } from '@angular/router';
11
+ import { ExtraOptions } from '@angular/router';
12
+ import * as i0 from '@angular/core';
13
+ import * as i1 from '@angular/router';
14
+ import { Injector } from '@angular/core';
15
+ import { Location as Location_2 } from '@angular/common';
16
+ import { ModuleWithProviders } from '@angular/core';
17
+ import { Route } from '@angular/router';
18
+ import { Router } from '@angular/router';
19
+ import { RouteReuseStrategy } from '@angular/router';
20
+ import { Routes } from '@angular/router';
21
+ import { TitleStrategy } from '@angular/router';
22
+ import { UrlHandlingStrategy } from '@angular/router';
23
+ import { UrlSerializer } from '@angular/router';
24
+
25
+ /**
26
+ * @description
27
+ *
28
+ * Sets up the router to be used for testing.
29
+ *
30
+ * The modules sets up the router to be used for testing.
31
+ * It provides spy implementations of `Location` and `LocationStrategy`.
32
+ *
33
+ * @usageNotes
34
+ * ### Example
35
+ *
36
+ * ```
37
+ * beforeEach(() => {
38
+ * TestBed.configureTestingModule({
39
+ * imports: [
40
+ * RouterTestingModule.withRoutes(
41
+ * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
42
+ * )
43
+ * ]
44
+ * });
45
+ * });
46
+ * ```
47
+ *
48
+ * @publicApi
49
+ */
50
+ export declare class RouterTestingModule {
51
+ static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterTestingModule, never>;
53
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof i1.RouterModule]>;
54
+ static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
55
+ }
56
+
57
+ /**
58
+ * Router setup factory function used for testing.
59
+ *
60
+ * @publicApi
61
+ */
62
+ export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy): Router;
63
+
64
+ /**
65
+ * Router setup factory function used for testing. Only used internally to keep the factory that's
66
+ * marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).
67
+ */
68
+ export declare function setupTestingRouterInternal(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, defaultTitleStrategy?: DefaultTitleStrategy, titleStrategy?: TitleStrategy): Router;
69
+
70
+ export { }
@@ -1,55 +1,56 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.9
2
+ * @license Angular v14.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ComponentRef } from '@angular/core';
8
- import { InjectionToken } from '@angular/core';
9
- import { UpgradeModule } from '@angular/upgrade/static';
10
-
11
- /**
12
- * Creates an initializer that sets up `ngRoute` integration
13
- * along with setting up the Angular router.
14
- *
15
- * @usageNotes
16
- *
17
- * <code-example language="typescript">
18
- * @NgModule({
19
- * imports: [
20
- * RouterModule.forRoot(SOME_ROUTES),
21
- * UpgradeModule
22
- * ],
23
- * providers: [
24
- * RouterUpgradeInitializer
25
- * ]
26
- * })
27
- * export class AppModule {
28
- * ngDoBootstrap() {}
29
- * }
30
- * </code-example>
31
- *
32
- * @publicApi
33
- */
34
- export declare const RouterUpgradeInitializer: {
35
- provide: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
36
- multi: boolean;
37
- useFactory: (ngUpgrade: UpgradeModule) => () => void;
38
- deps: (typeof UpgradeModule)[];
39
- };
40
-
41
- /**
42
- * Sets up a location change listener to trigger `history.pushState`.
43
- * Works around the problem that `onPopState` does not trigger `history.pushState`.
44
- * Must be called *after* calling `UpgradeModule.bootstrap`.
45
- *
46
- * @param ngUpgrade The upgrade NgModule.
47
- * @param urlType The location strategy.
48
- * @see `HashLocationStrategy`
49
- * @see `PathLocationStrategy`
50
- *
51
- * @publicApi
52
- */
53
- export declare function setUpLocationSync(ngUpgrade: UpgradeModule, urlType?: 'path' | 'hash'): void;
54
-
55
- export { }
7
+
8
+ import { ComponentRef } from '@angular/core';
9
+ import { InjectionToken } from '@angular/core';
10
+ import { UpgradeModule } from '@angular/upgrade/static';
11
+
12
+ /**
13
+ * Creates an initializer that sets up `ngRoute` integration
14
+ * along with setting up the Angular router.
15
+ *
16
+ * @usageNotes
17
+ *
18
+ * <code-example language="typescript">
19
+ * @NgModule({
20
+ * imports: [
21
+ * RouterModule.forRoot(SOME_ROUTES),
22
+ * UpgradeModule
23
+ * ],
24
+ * providers: [
25
+ * RouterUpgradeInitializer
26
+ * ]
27
+ * })
28
+ * export class AppModule {
29
+ * ngDoBootstrap() {}
30
+ * }
31
+ * </code-example>
32
+ *
33
+ * @publicApi
34
+ */
35
+ export declare const RouterUpgradeInitializer: {
36
+ provide: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
37
+ multi: boolean;
38
+ useFactory: (ngUpgrade: UpgradeModule) => () => void;
39
+ deps: (typeof UpgradeModule)[];
40
+ };
41
+
42
+ /**
43
+ * Sets up a location change listener to trigger `history.pushState`.
44
+ * Works around the problem that `onPopState` does not trigger `history.pushState`.
45
+ * Must be called *after* calling `UpgradeModule.bootstrap`.
46
+ *
47
+ * @param ngUpgrade The upgrade NgModule.
48
+ * @param urlType The location strategy.
49
+ * @see `HashLocationStrategy`
50
+ * @see `PathLocationStrategy`
51
+ *
52
+ * @publicApi
53
+ */
54
+ export declare function setUpLocationSync(ngUpgrade: UpgradeModule, urlType?: 'path' | 'hash'): void;
55
+
56
+ export { }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "@angular/router/testing",
3
- "fesm2020": "../fesm2020/testing.mjs",
4
- "fesm2015": "../fesm2015/testing.mjs",
5
- "esm2020": "../esm2020/testing/testing.mjs",
6
- "typings": "./testing.d.ts",
7
- "module": "../fesm2015/testing.mjs",
8
- "es2020": "../fesm2020/testing.mjs"
9
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@angular/router/upgrade",
3
- "sideEffects": false,
4
- "fesm2020": "../fesm2020/upgrade.mjs",
5
- "fesm2015": "../fesm2015/upgrade.mjs",
6
- "esm2020": "../esm2020/upgrade/upgrade.mjs",
7
- "typings": "./upgrade.d.ts",
8
- "module": "../fesm2015/upgrade.mjs",
9
- "es2020": "../fesm2020/upgrade.mjs"
10
- }