@coolon/angular-ui-powerups 0.0.89 → 0.0.90
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/bundles/coolon-angular-ui-powerups.umd.js +208 -127
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +2 -2
- package/esm2015/lib/interaction/interaction-context.js +18 -2
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +2 -2
- package/esm2015/lib/place/place-definition.js +16 -19
- package/esm2015/lib/place/place-router.js +122 -18
- package/esm2015/lib/place/route/guards/enter-place-guard.service.js +3 -38
- package/esm2015/lib/place/visit.js +4 -11
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +2 -2
- package/esm5/lib/interaction/interaction-context.js +29 -2
- package/esm5/lib/interaction/services/dialog-interaction.service.js +2 -2
- package/esm5/lib/place/place-definition.js +17 -39
- package/esm5/lib/place/place-router.js +143 -16
- package/esm5/lib/place/route/guards/enter-place-guard.service.js +3 -44
- package/esm5/lib/place/visit.js +4 -14
- package/fesm2015/coolon-angular-ui-powerups.js +160 -85
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +195 -113
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -1
- package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +1 -1
- package/lib/interaction/interaction-context.d.ts +2 -1
- package/lib/interaction/services/dialog-interaction.service.d.ts +1 -1
- package/lib/place/place-definition.d.ts +0 -4
- package/lib/place/place-router.d.ts +18 -2
- package/lib/place/route/guards/enter-place-guard.service.d.ts +0 -1
- package/lib/place/visit.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1095,6 +1095,33 @@
|
|
|
1095
1095
|
enumerable: true,
|
|
1096
1096
|
configurable: true
|
|
1097
1097
|
});
|
|
1098
|
+
/**
|
|
1099
|
+
* @param {?} confirm
|
|
1100
|
+
* @return {?}
|
|
1101
|
+
*/
|
|
1102
|
+
InteractionContext.prototype.confirm = /**
|
|
1103
|
+
* @param {?} confirm
|
|
1104
|
+
* @return {?}
|
|
1105
|
+
*/
|
|
1106
|
+
function (confirm) {
|
|
1107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1108
|
+
var _a;
|
|
1109
|
+
return __generator(this, function (_b) {
|
|
1110
|
+
switch (_b.label) {
|
|
1111
|
+
case 0:
|
|
1112
|
+
_b.trys.push([0, 2, , 3]);
|
|
1113
|
+
return [4 /*yield*/, this.confirmOrReject(confirm)];
|
|
1114
|
+
case 1:
|
|
1115
|
+
_b.sent();
|
|
1116
|
+
return [2 /*return*/, true];
|
|
1117
|
+
case 2:
|
|
1118
|
+
_a = _b.sent();
|
|
1119
|
+
return [2 /*return*/, false];
|
|
1120
|
+
case 3: return [2 /*return*/];
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
});
|
|
1124
|
+
};
|
|
1098
1125
|
return InteractionContext;
|
|
1099
1126
|
}(pectin.GarbageCollector));
|
|
1100
1127
|
if (false) {
|
|
@@ -1123,7 +1150,7 @@
|
|
|
1123
1150
|
* @param {?} confirm
|
|
1124
1151
|
* @return {?}
|
|
1125
1152
|
*/
|
|
1126
|
-
InteractionContext.prototype.
|
|
1153
|
+
InteractionContext.prototype.confirmOrReject = function (confirm) { };
|
|
1127
1154
|
/**
|
|
1128
1155
|
* Presents the confirmation to the user and runs the activity only if the user confirms.
|
|
1129
1156
|
* @abstract
|
|
@@ -1911,7 +1938,7 @@
|
|
|
1911
1938
|
* @param {?} confirm
|
|
1912
1939
|
* @return {?}
|
|
1913
1940
|
*/
|
|
1914
|
-
ActivityContainerComponent.prototype.
|
|
1941
|
+
ActivityContainerComponent.prototype.confirmOrReject = /**
|
|
1915
1942
|
* @param {?} confirm
|
|
1916
1943
|
* @return {?}
|
|
1917
1944
|
*/
|
|
@@ -2167,7 +2194,7 @@
|
|
|
2167
2194
|
* @param {?} confirm
|
|
2168
2195
|
* @return {?}
|
|
2169
2196
|
*/
|
|
2170
|
-
InplaceInteractionContextComponent.prototype.
|
|
2197
|
+
InplaceInteractionContextComponent.prototype.confirmOrReject = /**
|
|
2171
2198
|
* @param {?} confirm
|
|
2172
2199
|
* @return {?}
|
|
2173
2200
|
*/
|
|
@@ -2543,7 +2570,7 @@
|
|
|
2543
2570
|
* @param {?} confirm
|
|
2544
2571
|
* @return {?}
|
|
2545
2572
|
*/
|
|
2546
|
-
DialogInteractionService.prototype.
|
|
2573
|
+
DialogInteractionService.prototype.confirmOrReject = /**
|
|
2547
2574
|
* @param {?} confirm
|
|
2548
2575
|
* @return {?}
|
|
2549
2576
|
*/
|
|
@@ -3096,49 +3123,25 @@
|
|
|
3096
3123
|
return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;
|
|
3097
3124
|
};
|
|
3098
3125
|
/**
|
|
3099
|
-
* Returns angular router commands that specify the route id and any route parameters. The result does
|
|
3100
|
-
* not include any path information.
|
|
3101
|
-
*/
|
|
3102
|
-
// getFormattedRouterCommands(visit: Visit): any[] {
|
|
3103
|
-
// return this.hasRouteId() ?
|
|
3104
|
-
// [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
|
|
3105
|
-
// [this.getFormattedRouteParameters(visit)];
|
|
3106
|
-
// }
|
|
3107
|
-
/**
|
|
3108
|
-
* Returns angular router commands that specify the route id and any route parameters. The result does
|
|
3109
|
-
* not include any path information.
|
|
3110
3126
|
* @param {?} visit
|
|
3111
3127
|
* @return {?}
|
|
3112
3128
|
*/
|
|
3113
|
-
// getFormattedRouterCommands(visit: Visit): any[] {
|
|
3114
|
-
// return this.hasRouteId() ?
|
|
3115
|
-
// [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
|
|
3116
|
-
// [this.getFormattedRouteParameters(visit)];
|
|
3117
|
-
// }
|
|
3118
3129
|
PlaceDefinition.prototype.getFormattedRouteId = /**
|
|
3119
|
-
* Returns angular router commands that specify the route id and any route parameters. The result does
|
|
3120
|
-
* not include any path information.
|
|
3121
3130
|
* @param {?} visit
|
|
3122
3131
|
* @return {?}
|
|
3123
3132
|
*/
|
|
3124
|
-
// getFormattedRouterCommands(visit: Visit): any[] {
|
|
3125
|
-
// return this.hasRouteId() ?
|
|
3126
|
-
// [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
|
|
3127
|
-
// [this.getFormattedRouteParameters(visit)];
|
|
3128
|
-
// }
|
|
3129
3133
|
function (visit) {
|
|
3130
|
-
|
|
3134
|
+
// Note: RouteIds are always present in the url and are just empty strings when not defined. This is
|
|
3135
|
+
// mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as
|
|
3136
|
+
// an empty string.
|
|
3137
|
+
return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : "";
|
|
3131
3138
|
};
|
|
3132
|
-
// @Trace()
|
|
3133
|
-
// @Trace()
|
|
3134
3139
|
/**
|
|
3135
3140
|
* @param {?} visit
|
|
3136
3141
|
* @param {?=} includeRouteId
|
|
3137
3142
|
* @return {?}
|
|
3138
3143
|
*/
|
|
3139
|
-
PlaceDefinition.prototype.getFormattedRouteParameters =
|
|
3140
|
-
// @Trace()
|
|
3141
|
-
/**
|
|
3144
|
+
PlaceDefinition.prototype.getFormattedRouteParameters = /**
|
|
3142
3145
|
* @param {?} visit
|
|
3143
3146
|
* @param {?=} includeRouteId
|
|
3144
3147
|
* @return {?}
|
|
@@ -3234,15 +3237,17 @@
|
|
|
3234
3237
|
}
|
|
3235
3238
|
else {
|
|
3236
3239
|
/** @type {?} */
|
|
3237
|
-
var value =
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3240
|
+
var value = params.get(def.name);
|
|
3241
|
+
if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern
|
|
3242
|
+
// because our id routes redirect if the id isn't present we always have a id
|
|
3243
|
+
// parameter in our params. This will bugger our remember and defaultvalue sanitisation
|
|
3244
|
+
// as it'll see that the id is present (event thought its a blank string).
|
|
3245
|
+
if (!___default__default.isEmpty(value)) {
|
|
3246
|
+
result[def.name] = def.urlFormat.parse(value);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
else {
|
|
3250
|
+
result[def.name] = def.urlFormat.parse(value);
|
|
3246
3251
|
}
|
|
3247
3252
|
}
|
|
3248
3253
|
}
|
|
@@ -3612,8 +3617,10 @@
|
|
|
3612
3617
|
else {
|
|
3613
3618
|
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
3614
3619
|
// defaults and remember sanitisation process.
|
|
3620
|
+
/** @type {?} */
|
|
3621
|
+
var value = _this.getParameter(def.name);
|
|
3615
3622
|
if (_this.hasParameter(def.name)) {
|
|
3616
|
-
params[def.name] =
|
|
3623
|
+
params[def.name] = value;
|
|
3617
3624
|
}
|
|
3618
3625
|
}
|
|
3619
3626
|
}));
|
|
@@ -3647,17 +3654,6 @@
|
|
|
3647
3654
|
var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
3648
3655
|
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
3649
3656
|
};
|
|
3650
|
-
/**
|
|
3651
|
-
* @return {?}
|
|
3652
|
-
*/
|
|
3653
|
-
Visit.prototype.getUrlSegments = /**
|
|
3654
|
-
* @return {?}
|
|
3655
|
-
*/
|
|
3656
|
-
function () {
|
|
3657
|
-
return this.placeDefinition.hasRouteId() ?
|
|
3658
|
-
[new router.UrlSegment(this.placeDefinition.path, {}), new router.UrlSegment(this.placeDefinition.getFormattedRouteId(this), this.placeDefinition.getFormattedRouteParameters(this))] :
|
|
3659
|
-
[new router.UrlSegment(this.placeDefinition.path, this.placeDefinition.getFormattedRouteParameters(this))];
|
|
3660
|
-
};
|
|
3661
3657
|
return Visit;
|
|
3662
3658
|
}());
|
|
3663
3659
|
if (false) {
|
|
@@ -3957,11 +3953,12 @@
|
|
|
3957
3953
|
* @fileoverview added by tsickle
|
|
3958
3954
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3959
3955
|
*/
|
|
3960
|
-
|
|
3956
|
+
exports.ɵt = /** @class */ (function (_super) {
|
|
3961
3957
|
__extends(PlaceRouter, _super);
|
|
3962
|
-
function PlaceRouter(router$1, angularLocation, placeHistory) {
|
|
3958
|
+
function PlaceRouter(router$1, urlSerializer, angularLocation, placeHistory) {
|
|
3963
3959
|
var _this = _super.call(this) || this;
|
|
3964
3960
|
_this.router = router$1;
|
|
3961
|
+
_this.urlSerializer = urlSerializer;
|
|
3965
3962
|
_this.angularLocation = angularLocation;
|
|
3966
3963
|
_this.placeHistory = placeHistory;
|
|
3967
3964
|
_this.firstRoute = true;
|
|
@@ -4112,19 +4109,19 @@
|
|
|
4112
4109
|
* @return {?}
|
|
4113
4110
|
*/
|
|
4114
4111
|
function (router) {
|
|
4115
|
-
// we have to to use the definition for route id as our redirection always includes
|
|
4116
|
-
// the id in the url segements (but leaves it blank when there's no id). I.e. in the
|
|
4117
|
-
// no id case we're doing the following redirect [<placePath>, ""] -> ["..", <id>]
|
|
4118
|
-
/** @type {?} */
|
|
4119
|
-
var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
|
|
4120
4112
|
/** @type {?} */
|
|
4121
|
-
var commands =
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4113
|
+
var commands = _this.createUrlManipulator(_this.router.routerState.snapshot).createRedirectCommandsFor(next);
|
|
4114
|
+
// // we have to to use the definition for route id as our redirection always includes
|
|
4115
|
+
// // the id in the url segements (but leaves it blank when there's no id). I.e. in the
|
|
4116
|
+
// // no id case we're doing the following redirect [<placePath>, ""] -> ["..", <id>]
|
|
4117
|
+
// const relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
|
|
4118
|
+
// const commands = [
|
|
4119
|
+
// relativePath,
|
|
4120
|
+
// ...this.createRouteParameters(next),
|
|
4121
|
+
// ...this.extractChildPath(activatedRoute.snapshot)
|
|
4122
|
+
// ];
|
|
4123
|
+
console.log('### Push Changes to route Redirect', { commands: commands });
|
|
4124
|
+
return router.navigate(commands);
|
|
4128
4125
|
}))];
|
|
4129
4126
|
}
|
|
4130
4127
|
return [2 /*return*/];
|
|
@@ -4252,6 +4249,17 @@
|
|
|
4252
4249
|
*/
|
|
4253
4250
|
function (child) { return child.url; })));
|
|
4254
4251
|
};
|
|
4252
|
+
/**
|
|
4253
|
+
* @param {?} snapshot
|
|
4254
|
+
* @return {?}
|
|
4255
|
+
*/
|
|
4256
|
+
PlaceRouter.prototype.createUrlManipulator = /**
|
|
4257
|
+
* @param {?} snapshot
|
|
4258
|
+
* @return {?}
|
|
4259
|
+
*/
|
|
4260
|
+
function (snapshot) {
|
|
4261
|
+
return new PlaceRouter.UrlManipulator(this.urlSerializer.parse(snapshot.url));
|
|
4262
|
+
};
|
|
4255
4263
|
PlaceRouter.decorators = [
|
|
4256
4264
|
{ type: core.Injectable, args: [{
|
|
4257
4265
|
providedIn: 'root'
|
|
@@ -4260,10 +4268,11 @@
|
|
|
4260
4268
|
/** @nocollapse */
|
|
4261
4269
|
PlaceRouter.ctorParameters = function () { return [
|
|
4262
4270
|
{ type: router.Router },
|
|
4271
|
+
{ type: router.UrlSerializer },
|
|
4263
4272
|
{ type: common.Location },
|
|
4264
4273
|
{ type: PlaceHistory }
|
|
4265
4274
|
]; };
|
|
4266
|
-
/** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(common.Location), core.ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
|
|
4275
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(common.Location), core.ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
|
|
4267
4276
|
__decorate([
|
|
4268
4277
|
pectin.Trace(),
|
|
4269
4278
|
__metadata("design:type", Function),
|
|
@@ -4277,31 +4286,145 @@
|
|
|
4277
4286
|
* @type {?}
|
|
4278
4287
|
* @private
|
|
4279
4288
|
*/
|
|
4280
|
-
|
|
4289
|
+
exports.ɵt.prototype.firstRoute;
|
|
4281
4290
|
/**
|
|
4282
4291
|
* @type {?}
|
|
4283
4292
|
* @private
|
|
4284
4293
|
*/
|
|
4285
|
-
|
|
4294
|
+
exports.ɵt.prototype._navigationSessionModel;
|
|
4286
4295
|
/**
|
|
4287
4296
|
* @type {?}
|
|
4288
4297
|
* @private
|
|
4289
4298
|
*/
|
|
4290
|
-
|
|
4299
|
+
exports.ɵt.prototype._activeVisits;
|
|
4291
4300
|
/** @type {?} */
|
|
4292
|
-
|
|
4301
|
+
exports.ɵt.prototype.navigationSessionActive;
|
|
4293
4302
|
/** @type {?} */
|
|
4294
|
-
|
|
4303
|
+
exports.ɵt.prototype.activeVisitIndex;
|
|
4295
4304
|
/**
|
|
4296
4305
|
* @type {?}
|
|
4297
4306
|
* @private
|
|
4298
4307
|
*/
|
|
4299
|
-
|
|
4308
|
+
exports.ɵt.prototype.router;
|
|
4309
|
+
/**
|
|
4310
|
+
* @type {?}
|
|
4311
|
+
* @private
|
|
4312
|
+
*/
|
|
4313
|
+
exports.ɵt.prototype.urlSerializer;
|
|
4300
4314
|
/** @type {?} */
|
|
4301
|
-
|
|
4315
|
+
exports.ɵt.prototype.angularLocation;
|
|
4302
4316
|
/** @type {?} */
|
|
4303
|
-
|
|
4317
|
+
exports.ɵt.prototype.placeHistory;
|
|
4304
4318
|
}
|
|
4319
|
+
(function (PlaceRouter) {
|
|
4320
|
+
var UrlManipulator = /** @class */ (function () {
|
|
4321
|
+
function UrlManipulator(urlTree) {
|
|
4322
|
+
this.urlTree = urlTree;
|
|
4323
|
+
console.log({ segments: this.urlTree.root.children.primary.segments });
|
|
4324
|
+
}
|
|
4325
|
+
/**
|
|
4326
|
+
* @return {?}
|
|
4327
|
+
*/
|
|
4328
|
+
UrlManipulator.prototype.cloneUrlSegmentList = /**
|
|
4329
|
+
* @return {?}
|
|
4330
|
+
*/
|
|
4331
|
+
function () {
|
|
4332
|
+
return __spread(this.urlTree.root.children.primary.segments);
|
|
4333
|
+
};
|
|
4334
|
+
/**
|
|
4335
|
+
* @param {?} visit
|
|
4336
|
+
* @return {?}
|
|
4337
|
+
*/
|
|
4338
|
+
UrlManipulator.prototype.updateVisitSegments = /**
|
|
4339
|
+
* @param {?} visit
|
|
4340
|
+
* @return {?}
|
|
4341
|
+
*/
|
|
4342
|
+
function (visit) {
|
|
4343
|
+
// Ugly, but it works for now.
|
|
4344
|
+
/** @type {?} */
|
|
4345
|
+
var segments = this.cloneUrlSegmentList();
|
|
4346
|
+
/** @type {?} */
|
|
4347
|
+
var visitSegments = this.convertToUrlSegments(visit);
|
|
4348
|
+
/** @type {?} */
|
|
4349
|
+
var replaceAt = segments.findIndex((/**
|
|
4350
|
+
* @param {?} segment
|
|
4351
|
+
* @return {?}
|
|
4352
|
+
*/
|
|
4353
|
+
function (segment) { return segment.path === visitSegments[0].path; }));
|
|
4354
|
+
// do not use the return value, it's the items that were removed!
|
|
4355
|
+
segments.splice.apply(segments, __spread([replaceAt, visitSegments.length], visitSegments));
|
|
4356
|
+
return segments;
|
|
4357
|
+
};
|
|
4358
|
+
/**
|
|
4359
|
+
* Converts the visit into segments. Please not that these segments are not e
|
|
4360
|
+
* @param visit
|
|
4361
|
+
*/
|
|
4362
|
+
/**
|
|
4363
|
+
* Converts the visit into segments. Please not that these segments are not e
|
|
4364
|
+
* @param {?} visit
|
|
4365
|
+
* @return {?}
|
|
4366
|
+
*/
|
|
4367
|
+
UrlManipulator.prototype.convertToUrlSegments = /**
|
|
4368
|
+
* Converts the visit into segments. Please not that these segments are not e
|
|
4369
|
+
* @param {?} visit
|
|
4370
|
+
* @return {?}
|
|
4371
|
+
*/
|
|
4372
|
+
function (visit) {
|
|
4373
|
+
return visit.placeDefinition.hasRouteId() ?
|
|
4374
|
+
[
|
|
4375
|
+
// NOTE:
|
|
4376
|
+
// It's important to attach the params to the root path and not the id. If we attach them
|
|
4377
|
+
// to an empty id then the angular router won't match the pattern.
|
|
4378
|
+
new router.UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit)),
|
|
4379
|
+
new router.UrlSegment(visit.placeDefinition.getFormattedRouteId(visit), {})
|
|
4380
|
+
]
|
|
4381
|
+
:
|
|
4382
|
+
[
|
|
4383
|
+
new router.UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit))
|
|
4384
|
+
];
|
|
4385
|
+
};
|
|
4386
|
+
/**
|
|
4387
|
+
* @param {?} visit
|
|
4388
|
+
* @return {?}
|
|
4389
|
+
*/
|
|
4390
|
+
UrlManipulator.prototype.createRedirectCommandsFor = /**
|
|
4391
|
+
* @param {?} visit
|
|
4392
|
+
* @return {?}
|
|
4393
|
+
*/
|
|
4394
|
+
function (visit) {
|
|
4395
|
+
/** @type {?} */
|
|
4396
|
+
var segments = this.updateVisitSegments(visit);
|
|
4397
|
+
/** @type {?} */
|
|
4398
|
+
var commands = [];
|
|
4399
|
+
segments.forEach((/**
|
|
4400
|
+
* @param {?} s
|
|
4401
|
+
* @return {?}
|
|
4402
|
+
*/
|
|
4403
|
+
function (s) {
|
|
4404
|
+
commands.push(s.path);
|
|
4405
|
+
if (s.parameterMap.keys.length > 0) {
|
|
4406
|
+
commands.push(s.parameters);
|
|
4407
|
+
}
|
|
4408
|
+
}));
|
|
4409
|
+
return commands;
|
|
4410
|
+
};
|
|
4411
|
+
__decorate([
|
|
4412
|
+
pectin.Trace(),
|
|
4413
|
+
__metadata("design:type", Function),
|
|
4414
|
+
__metadata("design:paramtypes", [Visit]),
|
|
4415
|
+
__metadata("design:returntype", Array)
|
|
4416
|
+
], UrlManipulator.prototype, "createRedirectCommandsFor", null);
|
|
4417
|
+
return UrlManipulator;
|
|
4418
|
+
}());
|
|
4419
|
+
PlaceRouter.UrlManipulator = UrlManipulator;
|
|
4420
|
+
if (false) {
|
|
4421
|
+
/**
|
|
4422
|
+
* @type {?}
|
|
4423
|
+
* @private
|
|
4424
|
+
*/
|
|
4425
|
+
UrlManipulator.prototype.urlTree;
|
|
4426
|
+
}
|
|
4427
|
+
})(exports.ɵt || (exports.ɵt = {}));
|
|
4305
4428
|
|
|
4306
4429
|
/**
|
|
4307
4430
|
* @fileoverview added by tsickle
|
|
@@ -4688,7 +4811,7 @@
|
|
|
4688
4811
|
/** @nocollapse */
|
|
4689
4812
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4690
4813
|
{ type: router.Router },
|
|
4691
|
-
{ type:
|
|
4814
|
+
{ type: exports.ɵt },
|
|
4692
4815
|
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [AUP_PLACE_CONFIG,] }] },
|
|
4693
4816
|
{ type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
|
|
4694
4817
|
]; };
|
|
@@ -6052,7 +6175,7 @@
|
|
|
6052
6175
|
*/
|
|
6053
6176
|
function (activatedRoute, state) {
|
|
6054
6177
|
return __awaiter(this, void 0, void 0, function () {
|
|
6055
|
-
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit,
|
|
6178
|
+
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, commands;
|
|
6056
6179
|
return __generator(this, function (_a) {
|
|
6057
6180
|
switch (_a.label) {
|
|
6058
6181
|
case 0:
|
|
@@ -6069,9 +6192,8 @@
|
|
|
6069
6192
|
// Save the visit with any updated parameters. We need to save it so we remember any non route parameters
|
|
6070
6193
|
this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
|
|
6071
6194
|
if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
|
|
6072
|
-
routerStateUrlTree = this.urlSerializer.parse(state.url);
|
|
6073
6195
|
// Regenerate the url
|
|
6074
|
-
commands = this.
|
|
6196
|
+
commands = this.placeRouter.createUrlManipulator(state).createRedirectCommandsFor(sanitisedVisit);
|
|
6075
6197
|
console.log('##### Place Guard Redirect', commands);
|
|
6076
6198
|
return [2 /*return*/, this.router.createUrlTree(commands, {
|
|
6077
6199
|
replaceUrl: true,
|
|
@@ -6088,46 +6210,6 @@
|
|
|
6088
6210
|
});
|
|
6089
6211
|
});
|
|
6090
6212
|
};
|
|
6091
|
-
/**
|
|
6092
|
-
* @private
|
|
6093
|
-
* @param {?} sanitisedVisit
|
|
6094
|
-
* @param {?} path
|
|
6095
|
-
* @return {?}
|
|
6096
|
-
*/
|
|
6097
|
-
EnterPlaceGuard.prototype.createRedirectCommands = /**
|
|
6098
|
-
* @private
|
|
6099
|
-
* @param {?} sanitisedVisit
|
|
6100
|
-
* @param {?} path
|
|
6101
|
-
* @return {?}
|
|
6102
|
-
*/
|
|
6103
|
-
function (sanitisedVisit, path) {
|
|
6104
|
-
// Ugly, but it works for now.
|
|
6105
|
-
/** @type {?} */
|
|
6106
|
-
var newSegments = sanitisedVisit.getUrlSegments();
|
|
6107
|
-
/** @type {?} */
|
|
6108
|
-
var replaceAt = path.findIndex((/**
|
|
6109
|
-
* @param {?} segment
|
|
6110
|
-
* @return {?}
|
|
6111
|
-
*/
|
|
6112
|
-
function (segment) { return segment.path === newSegments[0].path; }));
|
|
6113
|
-
/** @type {?} */
|
|
6114
|
-
var newPath = __spread(path);
|
|
6115
|
-
newPath.splice.apply(newPath, __spread([replaceAt, newSegments.length], newSegments)); // do not use the return value, it's the items that were removed!
|
|
6116
|
-
// do not use the return value, it's the items that were removed!
|
|
6117
|
-
/** @type {?} */
|
|
6118
|
-
var commands = [];
|
|
6119
|
-
newPath.forEach((/**
|
|
6120
|
-
* @param {?} s
|
|
6121
|
-
* @return {?}
|
|
6122
|
-
*/
|
|
6123
|
-
function (s) {
|
|
6124
|
-
commands.push(s.path);
|
|
6125
|
-
if (s.parameterMap.keys.length > 0) {
|
|
6126
|
-
commands.push(s.parameters);
|
|
6127
|
-
}
|
|
6128
|
-
}));
|
|
6129
|
-
return { newPath: newPath, commands: commands };
|
|
6130
|
-
};
|
|
6131
6213
|
EnterPlaceGuard.decorators = [
|
|
6132
6214
|
{ type: core.Injectable, args: [{
|
|
6133
6215
|
providedIn: 'root'
|
|
@@ -6137,11 +6219,11 @@
|
|
|
6137
6219
|
EnterPlaceGuard.ctorParameters = function () { return [
|
|
6138
6220
|
{ type: router.Router },
|
|
6139
6221
|
{ type: router.UrlSerializer },
|
|
6140
|
-
{ type:
|
|
6222
|
+
{ type: exports.ɵt },
|
|
6141
6223
|
{ type: PlaceHistory },
|
|
6142
6224
|
{ type: core.Injector }
|
|
6143
6225
|
]; };
|
|
6144
|
-
/** @nocollapse */ EnterPlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function EnterPlaceGuard_Factory() { return new EnterPlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(
|
|
6226
|
+
/** @nocollapse */ EnterPlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function EnterPlaceGuard_Factory() { return new EnterPlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(exports.ɵt), core.ɵɵinject(PlaceHistory), core.ɵɵinject(core.INJECTOR)); }, token: EnterPlaceGuard, providedIn: "root" });
|
|
6145
6227
|
return EnterPlaceGuard;
|
|
6146
6228
|
}());
|
|
6147
6229
|
if (false) {
|
|
@@ -6511,11 +6593,11 @@
|
|
|
6511
6593
|
LeavePlaceGuard.ctorParameters = function () { return [
|
|
6512
6594
|
{ type: router.Router },
|
|
6513
6595
|
{ type: core.Injector },
|
|
6514
|
-
{ type:
|
|
6596
|
+
{ type: exports.ɵt },
|
|
6515
6597
|
{ type: InteractionContext },
|
|
6516
6598
|
{ type: common.Location }
|
|
6517
6599
|
]; };
|
|
6518
|
-
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(
|
|
6600
|
+
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(exports.ɵt), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
|
|
6519
6601
|
return LeavePlaceGuard;
|
|
6520
6602
|
}());
|
|
6521
6603
|
if (false) {
|
|
@@ -6578,7 +6660,7 @@
|
|
|
6578
6660
|
exports.PlaceHistory = PlaceHistory;
|
|
6579
6661
|
exports.PlaceModule = PlaceModule;
|
|
6580
6662
|
exports.PlaceOutletComponent = PlaceOutletComponent;
|
|
6581
|
-
exports.PlaceRouter =
|
|
6663
|
+
exports.PlaceRouter = exports.ɵt;
|
|
6582
6664
|
exports.Point = Point;
|
|
6583
6665
|
exports.ROUTE_PARAMETER_LIST_KEY = ROUTE_PARAMETER_LIST_KEY;
|
|
6584
6666
|
exports.ResizeAwareComponent = ResizeAwareComponent;
|
|
@@ -6620,7 +6702,6 @@
|
|
|
6620
6702
|
exports.ɵp = leftRightPlaceAnimation;
|
|
6621
6703
|
exports.ɵq = LEFT_RIGHT_PLACE_ANIMATION;
|
|
6622
6704
|
exports.ɵr = AUP_PLACE_CONFIG;
|
|
6623
|
-
exports.ɵt = PlaceRouter;
|
|
6624
6705
|
exports.ɵu = PlaceHistory;
|
|
6625
6706
|
exports.ɵv = TabbedPlaceNavigationComponent;
|
|
6626
6707
|
exports.ɵw = AbstractPlaceNavigationComponent;
|