@ngxs/router-plugin 3.7.4 → 3.7.5
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/README.md +4 -4
- package/bundles/ngxs-router-plugin.umd.js +751 -854
- package/bundles/ngxs-router-plugin.umd.js.map +1 -1
- package/bundles/ngxs-router-plugin.umd.min.js +2 -2
- package/bundles/ngxs-router-plugin.umd.min.js.map +1 -1
- package/esm2015/index.js +9 -9
- package/esm2015/ngxs-router-plugin.js +8 -8
- package/esm2015/src/public_api.js +9 -9
- package/esm2015/src/router.actions.js +172 -172
- package/esm2015/src/router.module.js +25 -25
- package/esm2015/src/router.state.js +368 -463
- package/esm2015/src/serializer.js +72 -72
- package/esm5/index.js +9 -9
- package/esm5/ngxs-router-plugin.js +8 -8
- package/esm5/src/public_api.js +9 -9
- package/esm5/src/router.actions.js +227 -227
- package/esm5/src/router.module.js +32 -32
- package/esm5/src/router.state.js +446 -552
- package/esm5/src/serializer.js +98 -98
- package/fesm2015/ngxs-router-plugin.js +623 -718
- package/fesm2015/ngxs-router-plugin.js.map +1 -1
- package/fesm5/ngxs-router-plugin.js +757 -863
- package/fesm5/ngxs-router-plugin.js.map +1 -1
- package/index.d.ts +4 -4
- package/ngxs-router-plugin.d.ts +5 -5
- package/ngxs-router-plugin.metadata.json +1 -1
- package/package.json +2 -2
- package/src/public_api.d.ts +4 -4
- package/src/router.actions.d.ts +63 -63
- package/src/router.module.d.ts +4 -4
- package/src/router.state.d.ts +50 -60
- package/src/serializer.d.ts +12 -12
|
@@ -1,883 +1,777 @@
|
|
|
1
1
|
import { NgZone, Injectable, NgModule } from '@angular/core';
|
|
2
2
|
import { Store, Action, Selector, State, NgxsModule } from '@ngxs/store';
|
|
3
3
|
import { __assign, __decorate, __metadata } from 'tslib';
|
|
4
|
-
import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router
|
|
5
|
-
import { LocationStrategy, Location } from '@angular/common';
|
|
6
|
-
import { isAngularInTestMode } from '@ngxs/store/internals';
|
|
4
|
+
import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router } from '@angular/router';
|
|
7
5
|
import { Subscription } from 'rxjs';
|
|
8
|
-
import { first } from 'rxjs/operators';
|
|
9
6
|
|
|
10
|
-
/**
|
|
11
|
-
* @fileoverview added by tsickle
|
|
12
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Public event api of the router
|
|
16
|
-
*/
|
|
17
|
-
var /**
|
|
18
|
-
* Public event api of the router
|
|
19
|
-
*/
|
|
20
|
-
Navigate = /** @class */ (function () {
|
|
21
|
-
function Navigate(path, queryParams, extras) {
|
|
22
|
-
this.path = path;
|
|
23
|
-
this.queryParams = queryParams;
|
|
24
|
-
this.extras = extras;
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(Navigate, "type", {
|
|
27
|
-
get: /**
|
|
28
|
-
* @return {?}
|
|
29
|
-
*/
|
|
30
|
-
function () {
|
|
31
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
32
|
-
return '[Router] Navigate';
|
|
33
|
-
},
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
return Navigate;
|
|
38
|
-
}());
|
|
39
|
-
if (false) {
|
|
40
|
-
/** @type {?} */
|
|
41
|
-
Navigate.prototype.path;
|
|
42
|
-
/** @type {?} */
|
|
43
|
-
Navigate.prototype.queryParams;
|
|
44
|
-
/** @type {?} */
|
|
45
|
-
Navigate.prototype.extras;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* Angular Routers internal state events
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* An action dispatched when the router navigates.
|
|
54
|
-
* @template T
|
|
55
|
-
*/
|
|
56
|
-
var /**
|
|
57
|
-
*
|
|
58
|
-
* Angular Routers internal state events
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* An action dispatched when the router navigates.
|
|
63
|
-
* @template T
|
|
64
|
-
*/
|
|
65
|
-
RouterNavigation = /** @class */ (function () {
|
|
66
|
-
function RouterNavigation(routerState, event, trigger) {
|
|
67
|
-
if (trigger === void 0) { trigger = 'none'; }
|
|
68
|
-
this.routerState = routerState;
|
|
69
|
-
this.event = event;
|
|
70
|
-
this.trigger = trigger;
|
|
71
|
-
}
|
|
72
|
-
Object.defineProperty(RouterNavigation, "type", {
|
|
73
|
-
get: /**
|
|
74
|
-
* @return {?}
|
|
75
|
-
*/
|
|
76
|
-
function () {
|
|
77
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
78
|
-
return '[Router] RouterNavigation';
|
|
79
|
-
},
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true
|
|
82
|
-
});
|
|
83
|
-
return RouterNavigation;
|
|
84
|
-
}());
|
|
85
|
-
if (false) {
|
|
86
|
-
/** @type {?} */
|
|
87
|
-
RouterNavigation.prototype.routerState;
|
|
88
|
-
/** @type {?} */
|
|
89
|
-
RouterNavigation.prototype.event;
|
|
90
|
-
/** @type {?} */
|
|
91
|
-
RouterNavigation.prototype.trigger;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* An action dispatched when the router cancel navigation.
|
|
95
|
-
* @template T, V
|
|
96
|
-
*/
|
|
97
|
-
var /**
|
|
98
|
-
* An action dispatched when the router cancel navigation.
|
|
99
|
-
* @template T, V
|
|
100
|
-
*/
|
|
101
|
-
RouterCancel = /** @class */ (function () {
|
|
102
|
-
function RouterCancel(routerState, storeState, event, trigger) {
|
|
103
|
-
if (trigger === void 0) { trigger = 'none'; }
|
|
104
|
-
this.routerState = routerState;
|
|
105
|
-
this.storeState = storeState;
|
|
106
|
-
this.event = event;
|
|
107
|
-
this.trigger = trigger;
|
|
108
|
-
}
|
|
109
|
-
Object.defineProperty(RouterCancel, "type", {
|
|
110
|
-
get: /**
|
|
111
|
-
* @return {?}
|
|
112
|
-
*/
|
|
113
|
-
function () {
|
|
114
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
115
|
-
return '[Router] RouterCancel';
|
|
116
|
-
},
|
|
117
|
-
enumerable: true,
|
|
118
|
-
configurable: true
|
|
119
|
-
});
|
|
120
|
-
return RouterCancel;
|
|
121
|
-
}());
|
|
122
|
-
if (false) {
|
|
123
|
-
/** @type {?} */
|
|
124
|
-
RouterCancel.prototype.routerState;
|
|
125
|
-
/** @type {?} */
|
|
126
|
-
RouterCancel.prototype.storeState;
|
|
127
|
-
/** @type {?} */
|
|
128
|
-
RouterCancel.prototype.event;
|
|
129
|
-
/** @type {?} */
|
|
130
|
-
RouterCancel.prototype.trigger;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* An action dispatched when the router errors.
|
|
134
|
-
* @template T, V
|
|
135
|
-
*/
|
|
136
|
-
var /**
|
|
137
|
-
* An action dispatched when the router errors.
|
|
138
|
-
* @template T, V
|
|
139
|
-
*/
|
|
140
|
-
RouterError = /** @class */ (function () {
|
|
141
|
-
function RouterError(routerState, storeState, event, trigger) {
|
|
142
|
-
if (trigger === void 0) { trigger = 'none'; }
|
|
143
|
-
this.routerState = routerState;
|
|
144
|
-
this.storeState = storeState;
|
|
145
|
-
this.event = event;
|
|
146
|
-
this.trigger = trigger;
|
|
147
|
-
}
|
|
148
|
-
Object.defineProperty(RouterError, "type", {
|
|
149
|
-
get: /**
|
|
150
|
-
* @return {?}
|
|
151
|
-
*/
|
|
152
|
-
function () {
|
|
153
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
154
|
-
return '[Router] RouterError';
|
|
155
|
-
},
|
|
156
|
-
enumerable: true,
|
|
157
|
-
configurable: true
|
|
158
|
-
});
|
|
159
|
-
return RouterError;
|
|
160
|
-
}());
|
|
161
|
-
if (false) {
|
|
162
|
-
/** @type {?} */
|
|
163
|
-
RouterError.prototype.routerState;
|
|
164
|
-
/** @type {?} */
|
|
165
|
-
RouterError.prototype.storeState;
|
|
166
|
-
/** @type {?} */
|
|
167
|
-
RouterError.prototype.event;
|
|
168
|
-
/** @type {?} */
|
|
169
|
-
RouterError.prototype.trigger;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* An action dispatched when the `ResolveEnd` event is triggered.
|
|
173
|
-
* @template T
|
|
174
|
-
*/
|
|
175
|
-
var /**
|
|
176
|
-
* An action dispatched when the `ResolveEnd` event is triggered.
|
|
177
|
-
* @template T
|
|
178
|
-
*/
|
|
179
|
-
RouterDataResolved = /** @class */ (function () {
|
|
180
|
-
function RouterDataResolved(routerState, event, trigger) {
|
|
181
|
-
if (trigger === void 0) { trigger = 'none'; }
|
|
182
|
-
this.routerState = routerState;
|
|
183
|
-
this.event = event;
|
|
184
|
-
this.trigger = trigger;
|
|
185
|
-
}
|
|
186
|
-
Object.defineProperty(RouterDataResolved, "type", {
|
|
187
|
-
get: /**
|
|
188
|
-
* @return {?}
|
|
189
|
-
*/
|
|
190
|
-
function () {
|
|
191
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
192
|
-
return '[Router] RouterDataResolved';
|
|
193
|
-
},
|
|
194
|
-
enumerable: true,
|
|
195
|
-
configurable: true
|
|
196
|
-
});
|
|
197
|
-
return RouterDataResolved;
|
|
198
|
-
}());
|
|
199
|
-
if (false) {
|
|
200
|
-
/** @type {?} */
|
|
201
|
-
RouterDataResolved.prototype.routerState;
|
|
202
|
-
/** @type {?} */
|
|
203
|
-
RouterDataResolved.prototype.event;
|
|
204
|
-
/** @type {?} */
|
|
205
|
-
RouterDataResolved.prototype.trigger;
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview added by tsickle
|
|
9
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Public event api of the router
|
|
13
|
+
*/
|
|
14
|
+
var /**
|
|
15
|
+
* Public event api of the router
|
|
16
|
+
*/
|
|
17
|
+
Navigate = /** @class */ (function () {
|
|
18
|
+
function Navigate(path, queryParams, extras) {
|
|
19
|
+
this.path = path;
|
|
20
|
+
this.queryParams = queryParams;
|
|
21
|
+
this.extras = extras;
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(Navigate, "type", {
|
|
24
|
+
get: /**
|
|
25
|
+
* @return {?}
|
|
26
|
+
*/
|
|
27
|
+
function () {
|
|
28
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
29
|
+
return '[Router] Navigate';
|
|
30
|
+
},
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true
|
|
33
|
+
});
|
|
34
|
+
return Navigate;
|
|
35
|
+
}());
|
|
36
|
+
if (false) {
|
|
37
|
+
/** @type {?} */
|
|
38
|
+
Navigate.prototype.path;
|
|
39
|
+
/** @type {?} */
|
|
40
|
+
Navigate.prototype.queryParams;
|
|
41
|
+
/** @type {?} */
|
|
42
|
+
Navigate.prototype.extras;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* Angular Routers internal state events
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* An action dispatched when the router navigates.
|
|
51
|
+
* @template T
|
|
52
|
+
*/
|
|
53
|
+
var /**
|
|
54
|
+
*
|
|
55
|
+
* Angular Routers internal state events
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* An action dispatched when the router navigates.
|
|
60
|
+
* @template T
|
|
61
|
+
*/
|
|
62
|
+
RouterNavigation = /** @class */ (function () {
|
|
63
|
+
function RouterNavigation(routerState, event, trigger) {
|
|
64
|
+
if (trigger === void 0) { trigger = 'none'; }
|
|
65
|
+
this.routerState = routerState;
|
|
66
|
+
this.event = event;
|
|
67
|
+
this.trigger = trigger;
|
|
68
|
+
}
|
|
69
|
+
Object.defineProperty(RouterNavigation, "type", {
|
|
70
|
+
get: /**
|
|
71
|
+
* @return {?}
|
|
72
|
+
*/
|
|
73
|
+
function () {
|
|
74
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
75
|
+
return '[Router] RouterNavigation';
|
|
76
|
+
},
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true
|
|
79
|
+
});
|
|
80
|
+
return RouterNavigation;
|
|
81
|
+
}());
|
|
82
|
+
if (false) {
|
|
83
|
+
/** @type {?} */
|
|
84
|
+
RouterNavigation.prototype.routerState;
|
|
85
|
+
/** @type {?} */
|
|
86
|
+
RouterNavigation.prototype.event;
|
|
87
|
+
/** @type {?} */
|
|
88
|
+
RouterNavigation.prototype.trigger;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* An action dispatched when the router cancel navigation.
|
|
92
|
+
* @template T, V
|
|
93
|
+
*/
|
|
94
|
+
var /**
|
|
95
|
+
* An action dispatched when the router cancel navigation.
|
|
96
|
+
* @template T, V
|
|
97
|
+
*/
|
|
98
|
+
RouterCancel = /** @class */ (function () {
|
|
99
|
+
function RouterCancel(routerState, storeState, event, trigger) {
|
|
100
|
+
if (trigger === void 0) { trigger = 'none'; }
|
|
101
|
+
this.routerState = routerState;
|
|
102
|
+
this.storeState = storeState;
|
|
103
|
+
this.event = event;
|
|
104
|
+
this.trigger = trigger;
|
|
105
|
+
}
|
|
106
|
+
Object.defineProperty(RouterCancel, "type", {
|
|
107
|
+
get: /**
|
|
108
|
+
* @return {?}
|
|
109
|
+
*/
|
|
110
|
+
function () {
|
|
111
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
112
|
+
return '[Router] RouterCancel';
|
|
113
|
+
},
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true
|
|
116
|
+
});
|
|
117
|
+
return RouterCancel;
|
|
118
|
+
}());
|
|
119
|
+
if (false) {
|
|
120
|
+
/** @type {?} */
|
|
121
|
+
RouterCancel.prototype.routerState;
|
|
122
|
+
/** @type {?} */
|
|
123
|
+
RouterCancel.prototype.storeState;
|
|
124
|
+
/** @type {?} */
|
|
125
|
+
RouterCancel.prototype.event;
|
|
126
|
+
/** @type {?} */
|
|
127
|
+
RouterCancel.prototype.trigger;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* An action dispatched when the router errors.
|
|
131
|
+
* @template T, V
|
|
132
|
+
*/
|
|
133
|
+
var /**
|
|
134
|
+
* An action dispatched when the router errors.
|
|
135
|
+
* @template T, V
|
|
136
|
+
*/
|
|
137
|
+
RouterError = /** @class */ (function () {
|
|
138
|
+
function RouterError(routerState, storeState, event, trigger) {
|
|
139
|
+
if (trigger === void 0) { trigger = 'none'; }
|
|
140
|
+
this.routerState = routerState;
|
|
141
|
+
this.storeState = storeState;
|
|
142
|
+
this.event = event;
|
|
143
|
+
this.trigger = trigger;
|
|
144
|
+
}
|
|
145
|
+
Object.defineProperty(RouterError, "type", {
|
|
146
|
+
get: /**
|
|
147
|
+
* @return {?}
|
|
148
|
+
*/
|
|
149
|
+
function () {
|
|
150
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
151
|
+
return '[Router] RouterError';
|
|
152
|
+
},
|
|
153
|
+
enumerable: true,
|
|
154
|
+
configurable: true
|
|
155
|
+
});
|
|
156
|
+
return RouterError;
|
|
157
|
+
}());
|
|
158
|
+
if (false) {
|
|
159
|
+
/** @type {?} */
|
|
160
|
+
RouterError.prototype.routerState;
|
|
161
|
+
/** @type {?} */
|
|
162
|
+
RouterError.prototype.storeState;
|
|
163
|
+
/** @type {?} */
|
|
164
|
+
RouterError.prototype.event;
|
|
165
|
+
/** @type {?} */
|
|
166
|
+
RouterError.prototype.trigger;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* An action dispatched when the `ResolveEnd` event is triggered.
|
|
170
|
+
* @template T
|
|
171
|
+
*/
|
|
172
|
+
var /**
|
|
173
|
+
* An action dispatched when the `ResolveEnd` event is triggered.
|
|
174
|
+
* @template T
|
|
175
|
+
*/
|
|
176
|
+
RouterDataResolved = /** @class */ (function () {
|
|
177
|
+
function RouterDataResolved(routerState, event, trigger) {
|
|
178
|
+
if (trigger === void 0) { trigger = 'none'; }
|
|
179
|
+
this.routerState = routerState;
|
|
180
|
+
this.event = event;
|
|
181
|
+
this.trigger = trigger;
|
|
182
|
+
}
|
|
183
|
+
Object.defineProperty(RouterDataResolved, "type", {
|
|
184
|
+
get: /**
|
|
185
|
+
* @return {?}
|
|
186
|
+
*/
|
|
187
|
+
function () {
|
|
188
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
189
|
+
return '[Router] RouterDataResolved';
|
|
190
|
+
},
|
|
191
|
+
enumerable: true,
|
|
192
|
+
configurable: true
|
|
193
|
+
});
|
|
194
|
+
return RouterDataResolved;
|
|
195
|
+
}());
|
|
196
|
+
if (false) {
|
|
197
|
+
/** @type {?} */
|
|
198
|
+
RouterDataResolved.prototype.routerState;
|
|
199
|
+
/** @type {?} */
|
|
200
|
+
RouterDataResolved.prototype.event;
|
|
201
|
+
/** @type {?} */
|
|
202
|
+
RouterDataResolved.prototype.trigger;
|
|
206
203
|
}
|
|
207
204
|
|
|
208
|
-
/**
|
|
209
|
-
* @fileoverview added by tsickle
|
|
210
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
211
|
-
*/
|
|
212
|
-
/**
|
|
213
|
-
* @abstract
|
|
214
|
-
* @template T
|
|
215
|
-
*/
|
|
216
|
-
var /**
|
|
217
|
-
* @abstract
|
|
218
|
-
* @template T
|
|
219
|
-
*/
|
|
220
|
-
RouterStateSerializer = /** @class */ (function () {
|
|
221
|
-
function RouterStateSerializer() {
|
|
222
|
-
}
|
|
223
|
-
return RouterStateSerializer;
|
|
224
|
-
}());
|
|
225
|
-
if (false) {
|
|
226
|
-
/**
|
|
227
|
-
* @abstract
|
|
228
|
-
* @param {?} routerState
|
|
229
|
-
* @return {?}
|
|
230
|
-
*/
|
|
231
|
-
RouterStateSerializer.prototype.serialize = function (routerState) { };
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* @record
|
|
235
|
-
*/
|
|
236
|
-
function SerializedRouterStateSnapshot() { }
|
|
237
|
-
if (false) {
|
|
238
|
-
/** @type {?} */
|
|
239
|
-
SerializedRouterStateSnapshot.prototype.root;
|
|
240
|
-
/** @type {?} */
|
|
241
|
-
SerializedRouterStateSnapshot.prototype.url;
|
|
242
|
-
}
|
|
243
|
-
var DefaultRouterStateSerializer = /** @class */ (function () {
|
|
244
|
-
function DefaultRouterStateSerializer() {
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* @param {?} routerState
|
|
248
|
-
* @return {?}
|
|
249
|
-
*/
|
|
250
|
-
DefaultRouterStateSerializer.prototype.serialize = /**
|
|
251
|
-
* @param {?} routerState
|
|
252
|
-
* @return {?}
|
|
253
|
-
*/
|
|
254
|
-
function (routerState) {
|
|
255
|
-
return {
|
|
256
|
-
root: this.serializeRoute(routerState.root),
|
|
257
|
-
url: routerState.url
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* @private
|
|
262
|
-
* @param {?} route
|
|
263
|
-
* @return {?}
|
|
264
|
-
*/
|
|
265
|
-
DefaultRouterStateSerializer.prototype.serializeRoute = /**
|
|
266
|
-
* @private
|
|
267
|
-
* @param {?} route
|
|
268
|
-
* @return {?}
|
|
269
|
-
*/
|
|
270
|
-
function (route) {
|
|
271
|
-
var _this = this;
|
|
272
|
-
/** @type {?} */
|
|
273
|
-
var children = route.children.map((/**
|
|
274
|
-
* @param {?} c
|
|
275
|
-
* @return {?}
|
|
276
|
-
*/
|
|
277
|
-
function (c) { return _this.serializeRoute(c); }));
|
|
278
|
-
return {
|
|
279
|
-
url: route.url,
|
|
280
|
-
params: route.params,
|
|
281
|
-
queryParams: route.queryParams,
|
|
282
|
-
fragment: route.fragment,
|
|
283
|
-
data: route.data,
|
|
284
|
-
outlet: route.outlet,
|
|
285
|
-
component: null,
|
|
286
|
-
routeConfig: null,
|
|
287
|
-
root: (/** @type {?} */ (null)),
|
|
288
|
-
parent: null,
|
|
289
|
-
firstChild: children[0],
|
|
290
|
-
children: children,
|
|
291
|
-
pathFromRoot: (/** @type {?} */ (null)),
|
|
292
|
-
paramMap: route.paramMap,
|
|
293
|
-
queryParamMap: route.queryParamMap,
|
|
294
|
-
toString: route.toString
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
return DefaultRouterStateSerializer;
|
|
205
|
+
/**
|
|
206
|
+
* @fileoverview added by tsickle
|
|
207
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
208
|
+
*/
|
|
209
|
+
/**
|
|
210
|
+
* @abstract
|
|
211
|
+
* @template T
|
|
212
|
+
*/
|
|
213
|
+
var /**
|
|
214
|
+
* @abstract
|
|
215
|
+
* @template T
|
|
216
|
+
*/
|
|
217
|
+
RouterStateSerializer = /** @class */ (function () {
|
|
218
|
+
function RouterStateSerializer() {
|
|
219
|
+
}
|
|
220
|
+
return RouterStateSerializer;
|
|
221
|
+
}());
|
|
222
|
+
if (false) {
|
|
223
|
+
/**
|
|
224
|
+
* @abstract
|
|
225
|
+
* @param {?} routerState
|
|
226
|
+
* @return {?}
|
|
227
|
+
*/
|
|
228
|
+
RouterStateSerializer.prototype.serialize = function (routerState) { };
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @record
|
|
232
|
+
*/
|
|
233
|
+
function SerializedRouterStateSnapshot() { }
|
|
234
|
+
if (false) {
|
|
235
|
+
/** @type {?} */
|
|
236
|
+
SerializedRouterStateSnapshot.prototype.root;
|
|
237
|
+
/** @type {?} */
|
|
238
|
+
SerializedRouterStateSnapshot.prototype.url;
|
|
239
|
+
}
|
|
240
|
+
var DefaultRouterStateSerializer = /** @class */ (function () {
|
|
241
|
+
function DefaultRouterStateSerializer() {
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* @param {?} routerState
|
|
245
|
+
* @return {?}
|
|
246
|
+
*/
|
|
247
|
+
DefaultRouterStateSerializer.prototype.serialize = /**
|
|
248
|
+
* @param {?} routerState
|
|
249
|
+
* @return {?}
|
|
250
|
+
*/
|
|
251
|
+
function (routerState) {
|
|
252
|
+
return {
|
|
253
|
+
root: this.serializeRoute(routerState.root),
|
|
254
|
+
url: routerState.url
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* @private
|
|
259
|
+
* @param {?} route
|
|
260
|
+
* @return {?}
|
|
261
|
+
*/
|
|
262
|
+
DefaultRouterStateSerializer.prototype.serializeRoute = /**
|
|
263
|
+
* @private
|
|
264
|
+
* @param {?} route
|
|
265
|
+
* @return {?}
|
|
266
|
+
*/
|
|
267
|
+
function (route) {
|
|
268
|
+
var _this = this;
|
|
269
|
+
/** @type {?} */
|
|
270
|
+
var children = route.children.map((/**
|
|
271
|
+
* @param {?} c
|
|
272
|
+
* @return {?}
|
|
273
|
+
*/
|
|
274
|
+
function (c) { return _this.serializeRoute(c); }));
|
|
275
|
+
return {
|
|
276
|
+
url: route.url,
|
|
277
|
+
params: route.params,
|
|
278
|
+
queryParams: route.queryParams,
|
|
279
|
+
fragment: route.fragment,
|
|
280
|
+
data: route.data,
|
|
281
|
+
outlet: route.outlet,
|
|
282
|
+
component: null,
|
|
283
|
+
routeConfig: null,
|
|
284
|
+
root: (/** @type {?} */ (null)),
|
|
285
|
+
parent: null,
|
|
286
|
+
firstChild: children[0],
|
|
287
|
+
children: children,
|
|
288
|
+
pathFromRoot: (/** @type {?} */ (null)),
|
|
289
|
+
paramMap: route.paramMap,
|
|
290
|
+
queryParamMap: route.queryParamMap,
|
|
291
|
+
toString: route.toString
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
return DefaultRouterStateSerializer;
|
|
298
295
|
}());
|
|
299
296
|
|
|
300
|
-
/**
|
|
301
|
-
* @fileoverview added by tsickle
|
|
302
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
303
|
-
*/
|
|
304
|
-
/**
|
|
305
|
-
* @record
|
|
306
|
-
* @template T
|
|
307
|
-
*/
|
|
308
|
-
function RouterStateModel() { }
|
|
309
|
-
if (false) {
|
|
310
|
-
/** @type {?|undefined} */
|
|
311
|
-
RouterStateModel.prototype.state;
|
|
312
|
-
/** @type {?|undefined} */
|
|
313
|
-
RouterStateModel.prototype.navigationId;
|
|
314
|
-
/** @type {?} */
|
|
315
|
-
RouterStateModel.prototype.trigger;
|
|
316
|
-
}
|
|
317
|
-
var RouterState = /** @class */ (function () {
|
|
318
|
-
function RouterState(_store, _router, _serializer, _ngZone
|
|
319
|
-
this._store = _store;
|
|
320
|
-
this._router = _router;
|
|
321
|
-
this._serializer = _serializer;
|
|
322
|
-
this._ngZone = _ngZone;
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
* @
|
|
349
|
-
* @
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @param {?} state
|
|
361
|
-
* @return {?}
|
|
362
|
-
*/
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
* @param {?}
|
|
382
|
-
* @
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
* @param {?}
|
|
401
|
-
* @
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* @private
|
|
413
|
-
* @return {?}
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* @private
|
|
435
|
-
* @return {?}
|
|
436
|
-
*/
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
_this.
|
|
457
|
-
}
|
|
458
|
-
else if (event instanceof
|
|
459
|
-
_this.
|
|
460
|
-
_this.reset();
|
|
461
|
-
}
|
|
462
|
-
else if (event instanceof
|
|
463
|
-
_this.
|
|
464
|
-
_this.reset();
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* @private
|
|
475
|
-
* @return {?}
|
|
476
|
-
*/
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* @private
|
|
489
|
-
* @return {?}
|
|
490
|
-
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* @private
|
|
502
|
-
* @return {?}
|
|
503
|
-
*/
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
* @
|
|
516
|
-
* @
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
!
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
this.
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
* @
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
* @
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
* @
|
|
557
|
-
* @
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
* @
|
|
562
|
-
* @
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
* @
|
|
570
|
-
* @
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
* @
|
|
575
|
-
* @
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
* @
|
|
583
|
-
* @
|
|
584
|
-
* @
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
* @
|
|
589
|
-
* @
|
|
590
|
-
* @
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
* @
|
|
604
|
-
* @
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
* @
|
|
609
|
-
* @
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
* @
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
* @
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
this.
|
|
627
|
-
this.
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
], RouterState.prototype, "navigate", null);
|
|
737
|
-
__decorate([
|
|
738
|
-
Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
|
|
739
|
-
__metadata("design:type", Function),
|
|
740
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
741
|
-
__metadata("design:returntype", void 0)
|
|
742
|
-
], RouterState.prototype, "angularRouterAction", null);
|
|
743
|
-
__decorate([
|
|
744
|
-
Selector(),
|
|
745
|
-
__metadata("design:type", Function),
|
|
746
|
-
__metadata("design:paramtypes", [Object]),
|
|
747
|
-
__metadata("design:returntype", void 0)
|
|
748
|
-
], RouterState, "state", null);
|
|
749
|
-
__decorate([
|
|
750
|
-
Selector(),
|
|
751
|
-
__metadata("design:type", Function),
|
|
752
|
-
__metadata("design:paramtypes", [Object]),
|
|
753
|
-
__metadata("design:returntype", Object)
|
|
754
|
-
], RouterState, "url", null);
|
|
755
|
-
RouterState = RouterState_1 = __decorate([
|
|
756
|
-
State({
|
|
757
|
-
name: 'router',
|
|
758
|
-
defaults: {
|
|
759
|
-
state: undefined,
|
|
760
|
-
navigationId: undefined,
|
|
761
|
-
trigger: 'none'
|
|
762
|
-
}
|
|
763
|
-
}),
|
|
764
|
-
__metadata("design:paramtypes", [Store,
|
|
765
|
-
Router,
|
|
766
|
-
RouterStateSerializer,
|
|
767
|
-
NgZone,
|
|
768
|
-
UrlSerializer,
|
|
769
|
-
LocationStrategy,
|
|
770
|
-
Location])
|
|
771
|
-
], RouterState);
|
|
772
|
-
return RouterState;
|
|
773
|
-
}());
|
|
774
|
-
if (false) {
|
|
775
|
-
/**
|
|
776
|
-
* Determines how navigation was performed by the `RouterState` itself
|
|
777
|
-
* or outside via `new Navigate(...)`
|
|
778
|
-
* @type {?}
|
|
779
|
-
* @private
|
|
780
|
-
*/
|
|
781
|
-
RouterState.prototype._trigger;
|
|
782
|
-
/**
|
|
783
|
-
* That's the serialized state from the `Router` class
|
|
784
|
-
* @type {?}
|
|
785
|
-
* @private
|
|
786
|
-
*/
|
|
787
|
-
RouterState.prototype._routerState;
|
|
788
|
-
/**
|
|
789
|
-
* That's the value of the `RouterState` state
|
|
790
|
-
* @type {?}
|
|
791
|
-
* @private
|
|
792
|
-
*/
|
|
793
|
-
RouterState.prototype._storeState;
|
|
794
|
-
/**
|
|
795
|
-
* @type {?}
|
|
796
|
-
* @private
|
|
797
|
-
*/
|
|
798
|
-
RouterState.prototype._lastRoutesRecognized;
|
|
799
|
-
/**
|
|
800
|
-
* @type {?}
|
|
801
|
-
* @private
|
|
802
|
-
*/
|
|
803
|
-
RouterState.prototype._subscription;
|
|
804
|
-
/**
|
|
805
|
-
* @type {?}
|
|
806
|
-
* @private
|
|
807
|
-
*/
|
|
808
|
-
RouterState.prototype._store;
|
|
809
|
-
/**
|
|
810
|
-
* @type {?}
|
|
811
|
-
* @private
|
|
812
|
-
*/
|
|
813
|
-
RouterState.prototype._router;
|
|
814
|
-
/**
|
|
815
|
-
* @type {?}
|
|
816
|
-
* @private
|
|
817
|
-
*/
|
|
818
|
-
RouterState.prototype._serializer;
|
|
819
|
-
/**
|
|
820
|
-
* @type {?}
|
|
821
|
-
* @private
|
|
822
|
-
*/
|
|
823
|
-
RouterState.prototype._ngZone;
|
|
824
|
-
/**
|
|
825
|
-
* @type {?}
|
|
826
|
-
* @private
|
|
827
|
-
*/
|
|
828
|
-
RouterState.prototype._urlSerializer;
|
|
829
|
-
/**
|
|
830
|
-
* @type {?}
|
|
831
|
-
* @private
|
|
832
|
-
*/
|
|
833
|
-
RouterState.prototype._locationStrategy;
|
|
834
|
-
/**
|
|
835
|
-
* @type {?}
|
|
836
|
-
* @private
|
|
837
|
-
*/
|
|
838
|
-
RouterState.prototype._location;
|
|
297
|
+
/**
|
|
298
|
+
* @fileoverview added by tsickle
|
|
299
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
300
|
+
*/
|
|
301
|
+
/**
|
|
302
|
+
* @record
|
|
303
|
+
* @template T
|
|
304
|
+
*/
|
|
305
|
+
function RouterStateModel() { }
|
|
306
|
+
if (false) {
|
|
307
|
+
/** @type {?|undefined} */
|
|
308
|
+
RouterStateModel.prototype.state;
|
|
309
|
+
/** @type {?|undefined} */
|
|
310
|
+
RouterStateModel.prototype.navigationId;
|
|
311
|
+
/** @type {?} */
|
|
312
|
+
RouterStateModel.prototype.trigger;
|
|
313
|
+
}
|
|
314
|
+
var RouterState = /** @class */ (function () {
|
|
315
|
+
function RouterState(_store, _router, _serializer, _ngZone) {
|
|
316
|
+
this._store = _store;
|
|
317
|
+
this._router = _router;
|
|
318
|
+
this._serializer = _serializer;
|
|
319
|
+
this._ngZone = _ngZone;
|
|
320
|
+
/**
|
|
321
|
+
* Determines how navigation was performed by the `RouterState` itself
|
|
322
|
+
* or outside via `new Navigate(...)`
|
|
323
|
+
*/
|
|
324
|
+
this._trigger = 'none';
|
|
325
|
+
/**
|
|
326
|
+
* That's the serialized state from the `Router` class
|
|
327
|
+
*/
|
|
328
|
+
this._routerState = null;
|
|
329
|
+
/**
|
|
330
|
+
* That's the value of the `RouterState` state
|
|
331
|
+
*/
|
|
332
|
+
this._storeState = null;
|
|
333
|
+
this._lastRoutesRecognized = (/** @type {?} */ (null));
|
|
334
|
+
this._subscription = new Subscription();
|
|
335
|
+
this.setUpStoreListener();
|
|
336
|
+
this.setUpRouterEventsListener();
|
|
337
|
+
}
|
|
338
|
+
RouterState_1 = RouterState;
|
|
339
|
+
/**
|
|
340
|
+
* @template T
|
|
341
|
+
* @param {?} state
|
|
342
|
+
* @return {?}
|
|
343
|
+
*/
|
|
344
|
+
RouterState.state = /**
|
|
345
|
+
* @template T
|
|
346
|
+
* @param {?} state
|
|
347
|
+
* @return {?}
|
|
348
|
+
*/
|
|
349
|
+
function (state) {
|
|
350
|
+
return state && state.state;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* @param {?} state
|
|
354
|
+
* @return {?}
|
|
355
|
+
*/
|
|
356
|
+
RouterState.url = /**
|
|
357
|
+
* @param {?} state
|
|
358
|
+
* @return {?}
|
|
359
|
+
*/
|
|
360
|
+
function (state) {
|
|
361
|
+
return state && state.state && state.state.url;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* @return {?}
|
|
365
|
+
*/
|
|
366
|
+
RouterState.prototype.ngOnDestroy = /**
|
|
367
|
+
* @return {?}
|
|
368
|
+
*/
|
|
369
|
+
function () {
|
|
370
|
+
this._subscription.unsubscribe();
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* @param {?} _
|
|
374
|
+
* @param {?} action
|
|
375
|
+
* @return {?}
|
|
376
|
+
*/
|
|
377
|
+
RouterState.prototype.navigate = /**
|
|
378
|
+
* @param {?} _
|
|
379
|
+
* @param {?} action
|
|
380
|
+
* @return {?}
|
|
381
|
+
*/
|
|
382
|
+
function (_, action) {
|
|
383
|
+
var _this = this;
|
|
384
|
+
return this._ngZone.run((/**
|
|
385
|
+
* @return {?}
|
|
386
|
+
*/
|
|
387
|
+
function () {
|
|
388
|
+
return _this._router.navigate(action.path, __assign({ queryParams: action.queryParams }, action.extras));
|
|
389
|
+
}));
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* @param {?} ctx
|
|
393
|
+
* @param {?} action
|
|
394
|
+
* @return {?}
|
|
395
|
+
*/
|
|
396
|
+
RouterState.prototype.angularRouterAction = /**
|
|
397
|
+
* @param {?} ctx
|
|
398
|
+
* @param {?} action
|
|
399
|
+
* @return {?}
|
|
400
|
+
*/
|
|
401
|
+
function (ctx, action) {
|
|
402
|
+
ctx.setState(__assign({}, ctx.getState(), { trigger: action.trigger, state: action.routerState, navigationId: action.event.id }));
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* @private
|
|
406
|
+
* @return {?}
|
|
407
|
+
*/
|
|
408
|
+
RouterState.prototype.setUpStoreListener = /**
|
|
409
|
+
* @private
|
|
410
|
+
* @return {?}
|
|
411
|
+
*/
|
|
412
|
+
function () {
|
|
413
|
+
var _this = this;
|
|
414
|
+
/** @type {?} */
|
|
415
|
+
var subscription = this._store
|
|
416
|
+
.select(RouterState_1)
|
|
417
|
+
.subscribe((/**
|
|
418
|
+
* @param {?} state
|
|
419
|
+
* @return {?}
|
|
420
|
+
*/
|
|
421
|
+
function (state) {
|
|
422
|
+
_this.navigateIfNeeded(state);
|
|
423
|
+
}));
|
|
424
|
+
this._subscription.add(subscription);
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* @private
|
|
428
|
+
* @return {?}
|
|
429
|
+
*/
|
|
430
|
+
RouterState.prototype.setUpRouterEventsListener = /**
|
|
431
|
+
* @private
|
|
432
|
+
* @return {?}
|
|
433
|
+
*/
|
|
434
|
+
function () {
|
|
435
|
+
var _this = this;
|
|
436
|
+
/** @type {?} */
|
|
437
|
+
var subscription = this._router.events.subscribe((/**
|
|
438
|
+
* @param {?} event
|
|
439
|
+
* @return {?}
|
|
440
|
+
*/
|
|
441
|
+
function (event) {
|
|
442
|
+
if (event instanceof NavigationStart) {
|
|
443
|
+
_this.navigationStart();
|
|
444
|
+
}
|
|
445
|
+
else if (event instanceof RoutesRecognized) {
|
|
446
|
+
_this._lastRoutesRecognized = event;
|
|
447
|
+
}
|
|
448
|
+
else if (event instanceof ResolveEnd) {
|
|
449
|
+
_this.dispatchRouterDataResolved(event);
|
|
450
|
+
}
|
|
451
|
+
else if (event instanceof NavigationCancel) {
|
|
452
|
+
_this.dispatchRouterCancel(event);
|
|
453
|
+
_this.reset();
|
|
454
|
+
}
|
|
455
|
+
else if (event instanceof NavigationError) {
|
|
456
|
+
_this.dispatchRouterError(event);
|
|
457
|
+
_this.reset();
|
|
458
|
+
}
|
|
459
|
+
else if (event instanceof NavigationEnd) {
|
|
460
|
+
_this.navigationEnd();
|
|
461
|
+
_this.reset();
|
|
462
|
+
}
|
|
463
|
+
}));
|
|
464
|
+
this._subscription.add(subscription);
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* @private
|
|
468
|
+
* @return {?}
|
|
469
|
+
*/
|
|
470
|
+
RouterState.prototype.navigationStart = /**
|
|
471
|
+
* @private
|
|
472
|
+
* @return {?}
|
|
473
|
+
*/
|
|
474
|
+
function () {
|
|
475
|
+
this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
|
|
476
|
+
if (this._trigger !== 'none') {
|
|
477
|
+
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* @private
|
|
482
|
+
* @return {?}
|
|
483
|
+
*/
|
|
484
|
+
RouterState.prototype.navigationEnd = /**
|
|
485
|
+
* @private
|
|
486
|
+
* @return {?}
|
|
487
|
+
*/
|
|
488
|
+
function () {
|
|
489
|
+
if (this.shouldDispatchRouterNavigation()) {
|
|
490
|
+
this.dispatchRouterNavigation();
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* @private
|
|
495
|
+
* @return {?}
|
|
496
|
+
*/
|
|
497
|
+
RouterState.prototype.shouldDispatchRouterNavigation = /**
|
|
498
|
+
* @private
|
|
499
|
+
* @return {?}
|
|
500
|
+
*/
|
|
501
|
+
function () {
|
|
502
|
+
if (!this._storeState)
|
|
503
|
+
return true;
|
|
504
|
+
return this._trigger !== 'store';
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* @private
|
|
508
|
+
* @param {?} state
|
|
509
|
+
* @return {?}
|
|
510
|
+
*/
|
|
511
|
+
RouterState.prototype.navigateIfNeeded = /**
|
|
512
|
+
* @private
|
|
513
|
+
* @param {?} state
|
|
514
|
+
* @return {?}
|
|
515
|
+
*/
|
|
516
|
+
function (state) {
|
|
517
|
+
var _this = this;
|
|
518
|
+
if (state && state.trigger === 'devtools') {
|
|
519
|
+
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
520
|
+
}
|
|
521
|
+
/** @type {?} */
|
|
522
|
+
var canSkipNavigation = !this._storeState ||
|
|
523
|
+
!this._storeState.state ||
|
|
524
|
+
!state ||
|
|
525
|
+
state.trigger === 'router' ||
|
|
526
|
+
this._router.url === this._storeState.state.url;
|
|
527
|
+
if (canSkipNavigation) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
this._trigger = 'store';
|
|
531
|
+
this._ngZone.run((/**
|
|
532
|
+
* @return {?}
|
|
533
|
+
*/
|
|
534
|
+
function () {
|
|
535
|
+
_this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (_this._storeState)).state)).url);
|
|
536
|
+
}));
|
|
537
|
+
};
|
|
538
|
+
/**
|
|
539
|
+
* @private
|
|
540
|
+
* @return {?}
|
|
541
|
+
*/
|
|
542
|
+
RouterState.prototype.dispatchRouterNavigation = /**
|
|
543
|
+
* @private
|
|
544
|
+
* @return {?}
|
|
545
|
+
*/
|
|
546
|
+
function () {
|
|
547
|
+
/** @type {?} */
|
|
548
|
+
var nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
|
|
549
|
+
this.dispatchRouterAction(new RouterNavigation(nextRouterState, new RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
|
|
550
|
+
};
|
|
551
|
+
/**
|
|
552
|
+
* @private
|
|
553
|
+
* @param {?} event
|
|
554
|
+
* @return {?}
|
|
555
|
+
*/
|
|
556
|
+
RouterState.prototype.dispatchRouterCancel = /**
|
|
557
|
+
* @private
|
|
558
|
+
* @param {?} event
|
|
559
|
+
* @return {?}
|
|
560
|
+
*/
|
|
561
|
+
function (event) {
|
|
562
|
+
this.dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* @private
|
|
566
|
+
* @param {?} event
|
|
567
|
+
* @return {?}
|
|
568
|
+
*/
|
|
569
|
+
RouterState.prototype.dispatchRouterError = /**
|
|
570
|
+
* @private
|
|
571
|
+
* @param {?} event
|
|
572
|
+
* @return {?}
|
|
573
|
+
*/
|
|
574
|
+
function (event) {
|
|
575
|
+
this.dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new NavigationError(event.id, event.url, "" + event), this._trigger));
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* @private
|
|
579
|
+
* @template T
|
|
580
|
+
* @param {?} action
|
|
581
|
+
* @return {?}
|
|
582
|
+
*/
|
|
583
|
+
RouterState.prototype.dispatchRouterAction = /**
|
|
584
|
+
* @private
|
|
585
|
+
* @template T
|
|
586
|
+
* @param {?} action
|
|
587
|
+
* @return {?}
|
|
588
|
+
*/
|
|
589
|
+
function (action) {
|
|
590
|
+
this._trigger = 'router';
|
|
591
|
+
try {
|
|
592
|
+
this._store.dispatch(action);
|
|
593
|
+
}
|
|
594
|
+
finally {
|
|
595
|
+
this._trigger = 'none';
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* @private
|
|
600
|
+
* @param {?} event
|
|
601
|
+
* @return {?}
|
|
602
|
+
*/
|
|
603
|
+
RouterState.prototype.dispatchRouterDataResolved = /**
|
|
604
|
+
* @private
|
|
605
|
+
* @param {?} event
|
|
606
|
+
* @return {?}
|
|
607
|
+
*/
|
|
608
|
+
function (event) {
|
|
609
|
+
/** @type {?} */
|
|
610
|
+
var routerState = this._serializer.serialize(event.state);
|
|
611
|
+
this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
|
|
612
|
+
};
|
|
613
|
+
/**
|
|
614
|
+
* @private
|
|
615
|
+
* @return {?}
|
|
616
|
+
*/
|
|
617
|
+
RouterState.prototype.reset = /**
|
|
618
|
+
* @private
|
|
619
|
+
* @return {?}
|
|
620
|
+
*/
|
|
621
|
+
function () {
|
|
622
|
+
this._trigger = 'none';
|
|
623
|
+
this._storeState = null;
|
|
624
|
+
this._routerState = null;
|
|
625
|
+
};
|
|
626
|
+
var RouterState_1;
|
|
627
|
+
RouterState.ctorParameters = function () { return [
|
|
628
|
+
{ type: Store },
|
|
629
|
+
{ type: Router },
|
|
630
|
+
{ type: RouterStateSerializer },
|
|
631
|
+
{ type: NgZone }
|
|
632
|
+
]; };
|
|
633
|
+
RouterState.decorators = [
|
|
634
|
+
{ type: Injectable }
|
|
635
|
+
];
|
|
636
|
+
/** @nocollapse */
|
|
637
|
+
RouterState.ctorParameters = function () { return [
|
|
638
|
+
{ type: Store },
|
|
639
|
+
{ type: Router },
|
|
640
|
+
{ type: RouterStateSerializer },
|
|
641
|
+
{ type: NgZone }
|
|
642
|
+
]; };
|
|
643
|
+
__decorate([
|
|
644
|
+
Action(Navigate),
|
|
645
|
+
__metadata("design:type", Function),
|
|
646
|
+
__metadata("design:paramtypes", [Object, Navigate]),
|
|
647
|
+
__metadata("design:returntype", void 0)
|
|
648
|
+
], RouterState.prototype, "navigate", null);
|
|
649
|
+
__decorate([
|
|
650
|
+
Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
|
|
651
|
+
__metadata("design:type", Function),
|
|
652
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
653
|
+
__metadata("design:returntype", void 0)
|
|
654
|
+
], RouterState.prototype, "angularRouterAction", null);
|
|
655
|
+
__decorate([
|
|
656
|
+
Selector(),
|
|
657
|
+
__metadata("design:type", Function),
|
|
658
|
+
__metadata("design:paramtypes", [Object]),
|
|
659
|
+
__metadata("design:returntype", void 0)
|
|
660
|
+
], RouterState, "state", null);
|
|
661
|
+
__decorate([
|
|
662
|
+
Selector(),
|
|
663
|
+
__metadata("design:type", Function),
|
|
664
|
+
__metadata("design:paramtypes", [Object]),
|
|
665
|
+
__metadata("design:returntype", Object)
|
|
666
|
+
], RouterState, "url", null);
|
|
667
|
+
RouterState = RouterState_1 = __decorate([
|
|
668
|
+
State({
|
|
669
|
+
name: 'router',
|
|
670
|
+
defaults: {
|
|
671
|
+
state: undefined,
|
|
672
|
+
navigationId: undefined,
|
|
673
|
+
trigger: 'none'
|
|
674
|
+
}
|
|
675
|
+
}),
|
|
676
|
+
__metadata("design:paramtypes", [Store,
|
|
677
|
+
Router,
|
|
678
|
+
RouterStateSerializer,
|
|
679
|
+
NgZone])
|
|
680
|
+
], RouterState);
|
|
681
|
+
return RouterState;
|
|
682
|
+
}());
|
|
683
|
+
if (false) {
|
|
684
|
+
/**
|
|
685
|
+
* Determines how navigation was performed by the `RouterState` itself
|
|
686
|
+
* or outside via `new Navigate(...)`
|
|
687
|
+
* @type {?}
|
|
688
|
+
* @private
|
|
689
|
+
*/
|
|
690
|
+
RouterState.prototype._trigger;
|
|
691
|
+
/**
|
|
692
|
+
* That's the serialized state from the `Router` class
|
|
693
|
+
* @type {?}
|
|
694
|
+
* @private
|
|
695
|
+
*/
|
|
696
|
+
RouterState.prototype._routerState;
|
|
697
|
+
/**
|
|
698
|
+
* That's the value of the `RouterState` state
|
|
699
|
+
* @type {?}
|
|
700
|
+
* @private
|
|
701
|
+
*/
|
|
702
|
+
RouterState.prototype._storeState;
|
|
703
|
+
/**
|
|
704
|
+
* @type {?}
|
|
705
|
+
* @private
|
|
706
|
+
*/
|
|
707
|
+
RouterState.prototype._lastRoutesRecognized;
|
|
708
|
+
/**
|
|
709
|
+
* @type {?}
|
|
710
|
+
* @private
|
|
711
|
+
*/
|
|
712
|
+
RouterState.prototype._subscription;
|
|
713
|
+
/**
|
|
714
|
+
* @type {?}
|
|
715
|
+
* @private
|
|
716
|
+
*/
|
|
717
|
+
RouterState.prototype._store;
|
|
718
|
+
/**
|
|
719
|
+
* @type {?}
|
|
720
|
+
* @private
|
|
721
|
+
*/
|
|
722
|
+
RouterState.prototype._router;
|
|
723
|
+
/**
|
|
724
|
+
* @type {?}
|
|
725
|
+
* @private
|
|
726
|
+
*/
|
|
727
|
+
RouterState.prototype._serializer;
|
|
728
|
+
/**
|
|
729
|
+
* @type {?}
|
|
730
|
+
* @private
|
|
731
|
+
*/
|
|
732
|
+
RouterState.prototype._ngZone;
|
|
839
733
|
}
|
|
840
734
|
|
|
841
|
-
/**
|
|
842
|
-
* @fileoverview added by tsickle
|
|
843
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
844
|
-
*/
|
|
845
|
-
var NgxsRouterPluginModule = /** @class */ (function () {
|
|
846
|
-
function NgxsRouterPluginModule() {
|
|
847
|
-
}
|
|
848
|
-
/**
|
|
849
|
-
* @return {?}
|
|
850
|
-
*/
|
|
851
|
-
NgxsRouterPluginModule.forRoot = /**
|
|
852
|
-
* @return {?}
|
|
853
|
-
*/
|
|
854
|
-
function () {
|
|
855
|
-
return {
|
|
856
|
-
ngModule: NgxsRouterPluginModule,
|
|
857
|
-
providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
|
|
858
|
-
};
|
|
859
|
-
};
|
|
860
|
-
NgxsRouterPluginModule.decorators = [
|
|
861
|
-
{ type: NgModule, args: [{
|
|
862
|
-
imports: [NgxsModule.forFeature([RouterState])]
|
|
863
|
-
},] }
|
|
864
|
-
];
|
|
865
|
-
return NgxsRouterPluginModule;
|
|
735
|
+
/**
|
|
736
|
+
* @fileoverview added by tsickle
|
|
737
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
738
|
+
*/
|
|
739
|
+
var NgxsRouterPluginModule = /** @class */ (function () {
|
|
740
|
+
function NgxsRouterPluginModule() {
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* @return {?}
|
|
744
|
+
*/
|
|
745
|
+
NgxsRouterPluginModule.forRoot = /**
|
|
746
|
+
* @return {?}
|
|
747
|
+
*/
|
|
748
|
+
function () {
|
|
749
|
+
return {
|
|
750
|
+
ngModule: NgxsRouterPluginModule,
|
|
751
|
+
providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
NgxsRouterPluginModule.decorators = [
|
|
755
|
+
{ type: NgModule, args: [{
|
|
756
|
+
imports: [NgxsModule.forFeature([RouterState])]
|
|
757
|
+
},] }
|
|
758
|
+
];
|
|
759
|
+
return NgxsRouterPluginModule;
|
|
866
760
|
}());
|
|
867
761
|
|
|
868
|
-
/**
|
|
869
|
-
* @fileoverview added by tsickle
|
|
870
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
762
|
+
/**
|
|
763
|
+
* @fileoverview added by tsickle
|
|
764
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
871
765
|
*/
|
|
872
766
|
|
|
873
|
-
/**
|
|
874
|
-
* @fileoverview added by tsickle
|
|
875
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
767
|
+
/**
|
|
768
|
+
* @fileoverview added by tsickle
|
|
769
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
876
770
|
*/
|
|
877
771
|
|
|
878
|
-
/**
|
|
879
|
-
* @fileoverview added by tsickle
|
|
880
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
772
|
+
/**
|
|
773
|
+
* @fileoverview added by tsickle
|
|
774
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
881
775
|
*/
|
|
882
776
|
|
|
883
777
|
export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigation, RouterState, RouterStateSerializer };
|