@angular/router 13.0.0-next.9 → 13.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  3. package/esm2020/router.mjs +5 -0
  4. package/{esm2015/src/apply_redirects.js → esm2020/src/apply_redirects.mjs} +0 -0
  5. package/esm2020/src/components/empty_outlet.mjs +29 -0
  6. package/{esm2015/src/config.js → esm2020/src/config.mjs} +0 -0
  7. package/esm2020/src/create_router_state.mjs +52 -0
  8. package/{esm2015/src/create_url_tree.js → esm2020/src/create_url_tree.mjs} +0 -0
  9. package/esm2020/src/directives/router_link.mjs +353 -0
  10. package/esm2020/src/directives/router_link_active.mjs +215 -0
  11. package/esm2020/src/directives/router_outlet.mjs +219 -0
  12. package/{esm2015/src/events.js → esm2020/src/events.mjs} +0 -0
  13. package/{esm2015/src/index.js → esm2020/src/index.mjs} +0 -0
  14. package/{esm2015/src/interfaces.js → esm2020/src/interfaces.mjs} +0 -0
  15. package/{esm2015/src/operators/activate_routes.js → esm2020/src/operators/activate_routes.mjs} +8 -6
  16. package/esm2020/src/operators/apply_redirects.mjs +14 -0
  17. package/esm2020/src/operators/check_guards.mjs +138 -0
  18. package/{esm2015/src/operators/prioritized_guard_value.js → esm2020/src/operators/prioritized_guard_value.mjs} +0 -0
  19. package/esm2020/src/operators/recognize.mjs +14 -0
  20. package/esm2020/src/operators/resolve_data.mjs +59 -0
  21. package/{esm2015/src/operators/switch_tap.js → esm2020/src/operators/switch_tap.mjs} +0 -0
  22. package/{esm2015/src/private_export.js → esm2020/src/private_export.mjs} +0 -0
  23. package/esm2020/src/recognize.mjs +262 -0
  24. package/{esm2015/src/route_reuse_strategy.js → esm2020/src/route_reuse_strategy.mjs} +0 -0
  25. package/esm2020/src/router.mjs +1009 -0
  26. package/{esm2015/src/router_config_loader.js → esm2020/src/router_config_loader.mjs} +0 -0
  27. package/esm2020/src/router_module.mjs +370 -0
  28. package/esm2020/src/router_outlet_context.mjs +74 -0
  29. package/esm2020/src/router_preloader.mjs +127 -0
  30. package/esm2020/src/router_scroller.mjs +95 -0
  31. package/esm2020/src/router_state.mjs +404 -0
  32. package/{esm2015/src/shared.js → esm2020/src/shared.mjs} +0 -0
  33. package/{esm2015/src/url_handling_strategy.js → esm2020/src/url_handling_strategy.mjs} +0 -0
  34. package/{esm2015/src/url_tree.js → esm2020/src/url_tree.mjs} +0 -0
  35. package/{esm2015/src/utils/collection.js → esm2020/src/utils/collection.mjs} +0 -0
  36. package/{esm2015/src/utils/config.js → esm2020/src/utils/config.mjs} +2 -2
  37. package/esm2020/src/utils/config_matching.mjs +145 -0
  38. package/{esm2015/src/utils/preactivation.js → esm2020/src/utils/preactivation.mjs} +0 -0
  39. package/{esm2015/src/utils/tree.js → esm2020/src/utils/tree.mjs} +0 -0
  40. package/{esm2015/src/utils/type_guards.js → esm2020/src/utils/type_guards.mjs} +0 -0
  41. package/{esm2015/src/version.js → esm2020/src/version.mjs} +1 -1
  42. package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
  43. package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
  44. package/esm2020/testing/src/extra_router_testing_providers.mjs +10 -0
  45. package/esm2020/testing/src/router_testing_module.mjs +122 -0
  46. package/esm2020/testing/src/spy_ng_module_factory_loader.mjs +10 -0
  47. package/esm2020/testing/src/testing.mjs +15 -0
  48. package/{esm2015/testing/testing.js → esm2020/testing/testing.mjs} +0 -0
  49. package/{esm2015/upgrade/index.js → esm2020/upgrade/index.mjs} +0 -0
  50. package/{esm2015/upgrade/public_api.js → esm2020/upgrade/public_api.mjs} +0 -0
  51. package/esm2020/upgrade/src/upgrade.mjs +120 -0
  52. package/{esm2015/upgrade/upgrade.js → esm2020/upgrade/upgrade.mjs} +0 -0
  53. package/fesm2015/{router.js → router.mjs} +507 -505
  54. package/fesm2015/router.mjs.map +1 -0
  55. package/fesm2015/{testing.js → testing.mjs} +66 -21
  56. package/fesm2015/testing.mjs.map +1 -0
  57. package/fesm2015/{upgrade.js → upgrade.mjs} +4 -5
  58. package/fesm2015/upgrade.mjs.map +1 -0
  59. package/fesm2020/router.mjs +6157 -0
  60. package/fesm2020/router.mjs.map +1 -0
  61. package/fesm2020/testing.mjs +179 -0
  62. package/fesm2020/testing.mjs.map +1 -0
  63. package/fesm2020/upgrade.mjs +150 -0
  64. package/fesm2020/upgrade.mjs.map +1 -0
  65. package/package.json +41 -11
  66. package/router.d.ts +84 -93
  67. package/testing/package.json +5 -5
  68. package/testing/testing.d.ts +6 -1
  69. package/upgrade/package.json +5 -5
  70. package/upgrade/upgrade.d.ts +1 -1
  71. package/bundles/router-testing.umd.js +0 -143
  72. package/bundles/router-testing.umd.js.map +0 -1
  73. package/bundles/router-upgrade.umd.js +0 -157
  74. package/bundles/router-upgrade.umd.js.map +0 -1
  75. package/bundles/router.umd.js +0 -6878
  76. package/bundles/router.umd.js.map +0 -1
  77. package/esm2015/router.externs.js +0 -6
  78. package/esm2015/router.js +0 -9
  79. package/esm2015/src/components/empty_outlet.js +0 -24
  80. package/esm2015/src/create_router_state.js +0 -63
  81. package/esm2015/src/directives/router_link.js +0 -328
  82. package/esm2015/src/directives/router_link_active.js +0 -210
  83. package/esm2015/src/directives/router_outlet.js +0 -212
  84. package/esm2015/src/operators/apply_redirects.js +0 -14
  85. package/esm2015/src/operators/check_guards.js +0 -138
  86. package/esm2015/src/operators/recognize.js +0 -14
  87. package/esm2015/src/operators/resolve_data.js +0 -56
  88. package/esm2015/src/recognize.js +0 -262
  89. package/esm2015/src/router.js +0 -1011
  90. package/esm2015/src/router_module.js +0 -362
  91. package/esm2015/src/router_outlet_context.js +0 -73
  92. package/esm2015/src/router_preloader.js +0 -129
  93. package/esm2015/src/router_scroller.js +0 -95
  94. package/esm2015/src/router_state.js +0 -404
  95. package/esm2015/src/utils/config_matching.js +0 -145
  96. package/esm2015/testing/src/router_testing_module.js +0 -96
  97. package/esm2015/testing/src/testing.js +0 -14
  98. package/esm2015/testing/testing.externs.js +0 -6
  99. package/esm2015/upgrade/src/upgrade.js +0 -122
  100. package/esm2015/upgrade/upgrade.externs.js +0 -6
  101. package/fesm2015/router.js.map +0 -1
  102. package/fesm2015/testing.js.map +0 -1
  103. package/fesm2015/upgrade.js.map +0 -1
  104. package/router.metadata.json +0 -1
  105. package/testing/testing.metadata.json +0 -1
  106. package/testing.d.ts +0 -7
  107. package/testing.metadata.json +0 -1
  108. package/upgrade/upgrade.metadata.json +0 -1
  109. package/upgrade.d.ts +0 -7
  110. package/upgrade.metadata.json +0 -1
@@ -0,0 +1,179 @@
1
+ /**
2
+ * @license Angular v13.0.0-rc.3
3
+ * (c) 2010-2021 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import { Location, LocationStrategy } from '@angular/common';
8
+ import { SpyLocation, MockLocationStrategy } from '@angular/common/testing';
9
+ import * as i0 from '@angular/core';
10
+ import { Compiler, Injector, Optional, NgModule } from '@angular/core';
11
+ import { Router, ɵflatten, ɵassignExtraOptionsToRouter, provideRoutes, ROUTER_CONFIGURATION, RouterModule, ɵROUTER_PROVIDERS, UrlSerializer, ChildrenOutletContexts, ROUTES, UrlHandlingStrategy, RouteReuseStrategy, PreloadingStrategy, NoPreloading } from '@angular/router';
12
+
13
+ /**
14
+ * @license
15
+ * Copyright Google LLC All Rights Reserved.
16
+ *
17
+ * Use of this source code is governed by an MIT-style license that can be
18
+ * found in the LICENSE file at https://angular.io/license
19
+ */
20
+ // This file exists to easily patch the SpyNgModuleFactoryLoader into g3
21
+ const EXTRA_ROUTER_TESTING_PROVIDERS = [];
22
+
23
+ /**
24
+ * @license
25
+ * Copyright Google LLC All Rights Reserved.
26
+ *
27
+ * Use of this source code is governed by an MIT-style license that can be
28
+ * found in the LICENSE file at https://angular.io/license
29
+ */
30
+ function isUrlHandlingStrategy(opts) {
31
+ // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at
32
+ // runtime.
33
+ return 'shouldProcessUrl' in opts;
34
+ }
35
+ /**
36
+ * Router setup factory function used for testing.
37
+ *
38
+ * @publicApi
39
+ */
40
+ function setupTestingRouter(urlSerializer, contexts, location, compiler, injector, routes, opts, urlHandlingStrategy, routeReuseStrategy) {
41
+ const router = new Router(null, urlSerializer, contexts, location, injector, compiler, ɵflatten(routes));
42
+ if (opts) {
43
+ // Handle deprecated argument ordering.
44
+ if (isUrlHandlingStrategy(opts)) {
45
+ router.urlHandlingStrategy = opts;
46
+ }
47
+ else {
48
+ // Handle ExtraOptions
49
+ ɵassignExtraOptionsToRouter(opts, router);
50
+ }
51
+ }
52
+ if (urlHandlingStrategy) {
53
+ router.urlHandlingStrategy = urlHandlingStrategy;
54
+ }
55
+ if (routeReuseStrategy) {
56
+ router.routeReuseStrategy = routeReuseStrategy;
57
+ }
58
+ return router;
59
+ }
60
+ /**
61
+ * @description
62
+ *
63
+ * Sets up the router to be used for testing.
64
+ *
65
+ * The modules sets up the router to be used for testing.
66
+ * It provides spy implementations of `Location` and `LocationStrategy`.
67
+ *
68
+ * @usageNotes
69
+ * ### Example
70
+ *
71
+ * ```
72
+ * beforeEach(() => {
73
+ * TestBed.configureTestingModule({
74
+ * imports: [
75
+ * RouterTestingModule.withRoutes(
76
+ * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
77
+ * )
78
+ * ]
79
+ * });
80
+ * });
81
+ * ```
82
+ *
83
+ * @publicApi
84
+ */
85
+ class RouterTestingModule {
86
+ static withRoutes(routes, config) {
87
+ return {
88
+ ngModule: RouterTestingModule,
89
+ providers: [
90
+ provideRoutes(routes),
91
+ { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
92
+ ]
93
+ };
94
+ }
95
+ }
96
+ RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
97
+ RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
98
+ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: RouterTestingModule, providers: [
99
+ ɵROUTER_PROVIDERS,
100
+ EXTRA_ROUTER_TESTING_PROVIDERS,
101
+ { provide: Location, useClass: SpyLocation },
102
+ { provide: LocationStrategy, useClass: MockLocationStrategy },
103
+ {
104
+ provide: Router,
105
+ useFactory: setupTestingRouter,
106
+ deps: [
107
+ UrlSerializer, ChildrenOutletContexts, Location, Compiler, Injector, ROUTES,
108
+ ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
109
+ [RouteReuseStrategy, new Optional()]
110
+ ]
111
+ },
112
+ { provide: PreloadingStrategy, useExisting: NoPreloading },
113
+ provideRoutes([]),
114
+ ], imports: [RouterModule] });
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: RouterTestingModule, decorators: [{
116
+ type: NgModule,
117
+ args: [{
118
+ exports: [RouterModule],
119
+ providers: [
120
+ ɵROUTER_PROVIDERS,
121
+ EXTRA_ROUTER_TESTING_PROVIDERS,
122
+ { provide: Location, useClass: SpyLocation },
123
+ { provide: LocationStrategy, useClass: MockLocationStrategy },
124
+ {
125
+ provide: Router,
126
+ useFactory: setupTestingRouter,
127
+ deps: [
128
+ UrlSerializer, ChildrenOutletContexts, Location, Compiler, Injector, ROUTES,
129
+ ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
130
+ [RouteReuseStrategy, new Optional()]
131
+ ]
132
+ },
133
+ { provide: PreloadingStrategy, useExisting: NoPreloading },
134
+ provideRoutes([]),
135
+ ]
136
+ }]
137
+ }] });
138
+
139
+ /**
140
+ * @license
141
+ * Copyright Google LLC All Rights Reserved.
142
+ *
143
+ * Use of this source code is governed by an MIT-style license that can be
144
+ * found in the LICENSE file at https://angular.io/license
145
+ */
146
+ // This file exists for easily patching SpyNgModuleFactoryLoader in g3
147
+ var spy_ng_module_factory_loader = {};
148
+
149
+ /**
150
+ * @license
151
+ * Copyright Google LLC All Rights Reserved.
152
+ *
153
+ * Use of this source code is governed by an MIT-style license that can be
154
+ * found in the LICENSE file at https://angular.io/license
155
+ */
156
+
157
+ /**
158
+ * @license
159
+ * Copyright Google LLC All Rights Reserved.
160
+ *
161
+ * Use of this source code is governed by an MIT-style license that can be
162
+ * found in the LICENSE file at https://angular.io/license
163
+ */
164
+ // This file only reexports content of the `src` folder. Keep it that way.
165
+
166
+ /**
167
+ * @license
168
+ * Copyright Google LLC All Rights Reserved.
169
+ *
170
+ * Use of this source code is governed by an MIT-style license that can be
171
+ * found in the LICENSE file at https://angular.io/license
172
+ */
173
+
174
+ /**
175
+ * Generated bundle index. Do not edit.
176
+ */
177
+
178
+ export { RouterTestingModule, setupTestingRouter };
179
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../../packages/router/testing/src/extra_router_testing_providers.ts","../../../../../../packages/router/testing/src/router_testing_module.ts","../../../../../../packages/router/testing/src/spy_ng_module_factory_loader.ts","../../../../../../packages/router/testing/src/testing.ts","../../../../../../packages/router/testing/public_api.ts","../../../../../../packages/router/testing/index.ts","../../../../../../packages/router/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file exists to easily patch the SpyNgModuleFactoryLoader into g3\nexport const EXTRA_ROUTER_TESTING_PROVIDERS = [];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location, LocationStrategy} from '@angular/common';\nimport {MockLocationStrategy, SpyLocation} from '@angular/common/testing';\nimport {Compiler, Injector, ModuleWithProviders, NgModule, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, PreloadingStrategy, provideRoutes, Route, Router, ROUTER_CONFIGURATION, RouteReuseStrategy, RouterModule, ROUTES, Routes, UrlHandlingStrategy, UrlSerializer, ɵassignExtraOptionsToRouter as assignExtraOptionsToRouter, ɵflatten as flatten, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS} from '@angular/router';\nimport {EXTRA_ROUTER_TESTING_PROVIDERS} from './extra_router_testing_providers';\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions|\n UrlHandlingStrategy): opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions|UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy,\n routeReuseStrategy?: RouteReuseStrategy) {\n const router =\n new Router(null!, urlSerializer, contexts, location, injector, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n assignExtraOptionsToRouter(opts, router);\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n\n return router;\n}\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location` and `LocationStrategy`.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * beforeEach(() => {\n * TestBed.configureTestingModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS,\n EXTRA_ROUTER_TESTING_PROVIDERS,\n {provide: Location, useClass: SpyLocation},\n {provide: LocationStrategy, useClass: MockLocationStrategy},\n {\n provide: Router,\n useFactory: setupTestingRouter,\n deps: [\n UrlSerializer, ChildrenOutletContexts, Location, Compiler, Injector, ROUTES,\n ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],\n [RouteReuseStrategy, new Optional()]\n ]\n },\n {provide: PreloadingStrategy, useExisting: NoPreloading},\n provideRoutes([]),\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, config?: ExtraOptions):\n ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n provideRoutes(routes),\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ]\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file exists for easily patching SpyNgModuleFactoryLoader in g3\nexport default {};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router/testing package.\n */\nexport * from './router_testing_module';\nexport * from './spy_ng_module_factory_loader';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","assignExtraOptionsToRouter","ROUTER_PROVIDERS"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;AAQA;AACO,MAAM,8BAA8B,GAAG,EAAE;;ACThD;;;;;;;AAcA,SAAS,qBAAqB,CAAC,IACmB;;;IAGhD,OAAO,kBAAkB,IAAI,IAAI,CAAC;AACpC,CAAC;AAED;;;;;SAKgB,kBAAkB,CAC9B,aAA4B,EAAE,QAAgC,EAAE,QAAkB,EAClF,QAAkB,EAAE,QAAkB,EAAE,MAAiB,EACzD,IAAuC,EAAE,mBAAyC,EAClF,kBAAuC;IACzC,MAAM,MAAM,GACR,IAAI,MAAM,CAAC,IAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAEA,QAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9F,IAAI,IAAI,EAAE;;QAER,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC;SACnC;aAAM;;YAELC,2BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC1C;KACF;IAED,IAAI,mBAAmB,EAAE;QACvB,MAAM,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;KAClD;IAED,IAAI,kBAAkB,EAAE;QACtB,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;KAChD;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;MA6Ca,mBAAmB;IAC9B,OAAO,UAAU,CAAC,MAAc,EAAE,MAAqB;QAErD,OAAO;YACL,QAAQ,EAAE,mBAAmB;YAC7B,SAA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AmB,EAAE,IAAI,QAAQ,EAAE,CAAC;gCAC3D,CAAC,kBAAkB,EAAE,IAAI,QAAQ,EAAE,CAAC;6BACrC;yBACF;wBACD,EAAC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAC;wBACxD,aAAa,CAAC,EAAE,CAAC;qBAClB;iBACF;;;AClGD;;;;;;;AAQA;AACA,mCAAe,EAAE;;ACTjB;;;;;;;;ACAA;;;;;;;AAeA;;ACfA;;;;;;;;ACAA;;;;;;"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * @license Angular v13.0.0-rc.3
3
+ * (c) 2010-2021 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import { Location } from '@angular/common';
8
+ import { APP_BOOTSTRAP_LISTENER } from '@angular/core';
9
+ import { Router } from '@angular/router';
10
+ import { UpgradeModule } from '@angular/upgrade/static';
11
+
12
+ /**
13
+ * @license
14
+ * Copyright Google LLC All Rights Reserved.
15
+ *
16
+ * Use of this source code is governed by an MIT-style license that can be
17
+ * found in the LICENSE file at https://angular.io/license
18
+ */
19
+ /**
20
+ * Creates an initializer that sets up `ngRoute` integration
21
+ * along with setting up the Angular router.
22
+ *
23
+ * @usageNotes
24
+ *
25
+ * <code-example language="typescript">
26
+ * @NgModule({
27
+ * imports: [
28
+ * RouterModule.forRoot(SOME_ROUTES),
29
+ * UpgradeModule
30
+ * ],
31
+ * providers: [
32
+ * RouterUpgradeInitializer
33
+ * ]
34
+ * })
35
+ * export class AppModule {
36
+ * ngDoBootstrap() {}
37
+ * }
38
+ * </code-example>
39
+ *
40
+ * @publicApi
41
+ */
42
+ const RouterUpgradeInitializer = {
43
+ provide: APP_BOOTSTRAP_LISTENER,
44
+ multi: true,
45
+ useFactory: locationSyncBootstrapListener,
46
+ deps: [UpgradeModule]
47
+ };
48
+ /**
49
+ * @internal
50
+ */
51
+ function locationSyncBootstrapListener(ngUpgrade) {
52
+ return () => {
53
+ setUpLocationSync(ngUpgrade);
54
+ };
55
+ }
56
+ /**
57
+ * Sets up a location change listener to trigger `history.pushState`.
58
+ * Works around the problem that `onPopState` does not trigger `history.pushState`.
59
+ * Must be called *after* calling `UpgradeModule.bootstrap`.
60
+ *
61
+ * @param ngUpgrade The upgrade NgModule.
62
+ * @param urlType The location strategy.
63
+ * @see `HashLocationStrategy`
64
+ * @see `PathLocationStrategy`
65
+ *
66
+ * @publicApi
67
+ */
68
+ function setUpLocationSync(ngUpgrade, urlType = 'path') {
69
+ if (!ngUpgrade.$injector) {
70
+ throw new Error(`
71
+ RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.
72
+ Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.
73
+ `);
74
+ }
75
+ const router = ngUpgrade.injector.get(Router);
76
+ const location = ngUpgrade.injector.get(Location);
77
+ ngUpgrade.$injector.get('$rootScope')
78
+ .$on('$locationChangeStart', (_, next, __) => {
79
+ let url;
80
+ if (urlType === 'path') {
81
+ url = resolveUrl(next);
82
+ }
83
+ else if (urlType === 'hash') {
84
+ // Remove the first hash from the URL
85
+ const hashIdx = next.indexOf('#');
86
+ url = resolveUrl(next.substring(0, hashIdx) + next.substring(hashIdx + 1));
87
+ }
88
+ else {
89
+ throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;
90
+ }
91
+ const path = location.normalize(url.pathname);
92
+ router.navigateByUrl(path + url.search + url.hash);
93
+ });
94
+ }
95
+ /**
96
+ * Normalizes and parses a URL.
97
+ *
98
+ * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of
99
+ * the application document.
100
+ * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related
101
+ * properties are all populated to reflect the normalized URL.
102
+ *
103
+ * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing
104
+ * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign
105
+ * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)
106
+ * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL
107
+ * and assigning it again. This correctly populates all properties.
108
+ *
109
+ * See
110
+ * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33
111
+ * for more info.
112
+ */
113
+ let anchor;
114
+ function resolveUrl(url) {
115
+ if (!anchor) {
116
+ anchor = document.createElement('a');
117
+ }
118
+ anchor.setAttribute('href', url);
119
+ anchor.setAttribute('href', anchor.href);
120
+ return {
121
+ // IE does not start `pathname` with `/` like other browsers.
122
+ pathname: `/${anchor.pathname.replace(/^\//, '')}`,
123
+ search: anchor.search,
124
+ hash: anchor.hash
125
+ };
126
+ }
127
+
128
+ /**
129
+ * @license
130
+ * Copyright Google LLC All Rights Reserved.
131
+ *
132
+ * Use of this source code is governed by an MIT-style license that can be
133
+ * found in the LICENSE file at https://angular.io/license
134
+ */
135
+ // This file only reexports content of the `src` folder. Keep it that way.
136
+
137
+ /**
138
+ * @license
139
+ * Copyright Google LLC All Rights Reserved.
140
+ *
141
+ * Use of this source code is governed by an MIT-style license that can be
142
+ * found in the LICENSE file at https://angular.io/license
143
+ */
144
+
145
+ /**
146
+ * Generated bundle index. Do not edit.
147
+ */
148
+
149
+ export { RouterUpgradeInitializer, locationSyncBootstrapListener, setUpLocationSync };
150
+ //# sourceMappingURL=upgrade.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.mjs","sources":["../../../../../../packages/router/upgrade/src/upgrade.ts","../../../../../../packages/router/upgrade/public_api.ts","../../../../../../packages/router/upgrade/index.ts","../../../../../../packages/router/upgrade/upgrade.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location} from '@angular/common';\nimport {APP_BOOTSTRAP_LISTENER, ComponentRef, InjectionToken} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {UpgradeModule} from '@angular/upgrade/static';\n\n/**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * <code-example language=\"typescript\">\n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * </code-example>\n *\n * @publicApi\n */\nexport const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as (ngUpgrade: UpgradeModule) => () => void,\n deps: [UpgradeModule]\n};\n\n/**\n * @internal\n */\nexport function locationSyncBootstrapListener(ngUpgrade: UpgradeModule) {\n return () => {\n setUpLocationSync(ngUpgrade);\n };\n}\n\n/**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see `HashLocationStrategy`\n * @see `PathLocationStrategy`\n *\n * @publicApi\n */\nexport function setUpLocationSync(ngUpgrade: UpgradeModule, urlType: 'path'|'hash' = 'path') {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n\n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n\n ngUpgrade.$injector.get('$rootScope')\n .$on('$locationChangeStart', (_: any, next: string, __: string) => {\n let url;\n if (urlType === 'path') {\n url = resolveUrl(next);\n } else if (urlType === 'hash') {\n // Remove the first hash from the URL\n const hashIdx = next.indexOf('#');\n url = resolveUrl(next.substring(0, hashIdx) + next.substring(hashIdx + 1));\n } else {\n throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;\n }\n const path = location.normalize(url.pathname);\n router.navigateByUrl(path + url.search + url.hash);\n });\n}\n\n/**\n * Normalizes and parses a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\nlet anchor: HTMLAnchorElement|undefined;\nfunction resolveUrl(url: string): {pathname: string, search: string, hash: string} {\n if (!anchor) {\n anchor = document.createElement('a');\n }\n\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n\n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/upgrade';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;MAuB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GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;KACpD,CAAC,CAAC;AACT,CAAC;AAED;;;;;;;;;;;;;;;;;;AAkBA,IAAI,MAAmC,CAAC;AACxC,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;KACtC;IAED,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO;;QAEL,QAAQ,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE;QAClD,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC;AACJ;;AC7HA;;;;;;;AAeA;;ACfA;;;;;;;;ACAA;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "13.0.0-next.9",
3
+ "version": "13.0.0-rc.3",
4
4
  "description": "Angular - the routing library",
5
5
  "keywords": [
6
6
  "angular",
@@ -14,7 +14,7 @@
14
14
  "author": "angular",
15
15
  "license": "MIT",
16
16
  "engines": {
17
- "node": "^12.14.1 || >=14.0.0"
17
+ "node": "^12.20.0 || ^14.15.0 || >=16.10.0"
18
18
  },
19
19
  "bugs": {
20
20
  "url": "https://github.com/angular/angular/issues"
@@ -24,10 +24,10 @@
24
24
  "tslib": "^2.3.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/core": "13.0.0-next.9",
28
- "@angular/common": "13.0.0-next.9",
29
- "@angular/platform-browser": "13.0.0-next.9",
30
- "rxjs": "^6.5.3 || ^7.0.0"
27
+ "@angular/core": "13.0.0-rc.3",
28
+ "@angular/common": "13.0.0-rc.3",
29
+ "@angular/platform-browser": "13.0.0-rc.3",
30
+ "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
33
33
  "packageGroup": [
@@ -50,10 +50,40 @@
50
50
  ]
51
51
  },
52
52
  "sideEffects": false,
53
- "main": "./bundles/router.umd.js",
54
- "fesm2015": "./fesm2015/router.js",
55
- "esm2015": "./esm2015/router.js",
53
+ "fesm2020": "./fesm2020/router.mjs",
54
+ "fesm2015": "./fesm2015/router.mjs",
55
+ "esm2020": "./esm2020/router.mjs",
56
56
  "typings": "./router.d.ts",
57
- "module": "./fesm2015/router.js",
58
- "es2015": "./fesm2015/router.js"
57
+ "module": "./fesm2015/router.mjs",
58
+ "es2020": "./fesm2020/router.mjs",
59
+ "type": "module",
60
+ "exports": {
61
+ "./package.json": {
62
+ "default": "./package.json"
63
+ },
64
+ ".": {
65
+ "types": "./router.d.ts",
66
+ "esm2020": "./esm2020/router.mjs",
67
+ "es2020": "./fesm2020/router.mjs",
68
+ "es2015": "./fesm2015/router.mjs",
69
+ "node": "./fesm2015/router.mjs",
70
+ "default": "./fesm2020/router.mjs"
71
+ },
72
+ "./testing": {
73
+ "types": "./testing/testing.d.ts",
74
+ "esm2020": "./esm2020/testing/testing.mjs",
75
+ "es2020": "./fesm2020/testing.mjs",
76
+ "es2015": "./fesm2015/testing.mjs",
77
+ "node": "./fesm2015/testing.mjs",
78
+ "default": "./fesm2020/testing.mjs"
79
+ },
80
+ "./upgrade": {
81
+ "types": "./upgrade/upgrade.d.ts",
82
+ "esm2020": "./esm2020/upgrade/upgrade.mjs",
83
+ "es2020": "./fesm2020/upgrade.mjs",
84
+ "es2015": "./fesm2015/upgrade.mjs",
85
+ "node": "./fesm2015/upgrade.mjs",
86
+ "default": "./fesm2020/upgrade.mjs"
87
+ }
88
+ }
59
89
  }