@coolon/angular-ui-powerups 0.0.88 → 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.
Files changed (38) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +291 -201
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -2
  7. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +2 -2
  8. package/esm2015/lib/interaction/interaction-context.js +18 -2
  9. package/esm2015/lib/interaction/services/dialog-interaction.service.js +2 -2
  10. package/esm2015/lib/place/components/abstract-place-navigation.component.js +9 -2
  11. package/esm2015/lib/place/place-definition.js +16 -19
  12. package/esm2015/lib/place/place-router.js +122 -18
  13. package/esm2015/lib/place/place.module.js +6 -3
  14. package/esm2015/lib/place/route/guards/enter-place-guard.service.js +3 -38
  15. package/esm2015/lib/place/visit.js +4 -11
  16. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -2
  17. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +2 -2
  18. package/esm5/lib/interaction/interaction-context.js +29 -2
  19. package/esm5/lib/interaction/services/dialog-interaction.service.js +2 -2
  20. package/esm5/lib/place/components/abstract-place-navigation.component.js +9 -2
  21. package/esm5/lib/place/place-definition.js +17 -39
  22. package/esm5/lib/place/place-router.js +143 -16
  23. package/esm5/lib/place/place.module.js +6 -3
  24. package/esm5/lib/place/route/guards/enter-place-guard.service.js +3 -44
  25. package/esm5/lib/place/visit.js +4 -14
  26. package/fesm2015/coolon-angular-ui-powerups.js +240 -156
  27. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  28. package/fesm5/coolon-angular-ui-powerups.js +279 -188
  29. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  30. package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -1
  31. package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +1 -1
  32. package/lib/interaction/interaction-context.d.ts +2 -1
  33. package/lib/interaction/services/dialog-interaction.service.d.ts +1 -1
  34. package/lib/place/place-definition.d.ts +0 -4
  35. package/lib/place/place-router.d.ts +18 -2
  36. package/lib/place/route/guards/enter-place-guard.service.d.ts +0 -1
  37. package/lib/place/visit.d.ts +0 -2
  38. 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.confirm = function (confirm) { };
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.confirm = /**
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.confirm = /**
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.confirm = /**
2573
+ DialogInteractionService.prototype.confirmOrReject = /**
2547
2574
  * @param {?} confirm
2548
2575
  * @return {?}
2549
2576
  */
@@ -2661,78 +2688,6 @@
2661
2688
  return InteractionModule;
2662
2689
  }());
2663
2690
 
2664
- /**
2665
- * @fileoverview added by tsickle
2666
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2667
- */
2668
- var BusyOverlayComponent = /** @class */ (function () {
2669
- function BusyOverlayComponent() {
2670
- }
2671
- /**
2672
- * @return {?}
2673
- */
2674
- BusyOverlayComponent.prototype.ngOnInit = /**
2675
- * @return {?}
2676
- */
2677
- function () {
2678
- };
2679
- BusyOverlayComponent.decorators = [
2680
- { type: core.Component, args: [{
2681
- selector: 'aup-busy-overlay',
2682
- template: "<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n",
2683
- styles: [":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]
2684
- }] }
2685
- ];
2686
- /** @nocollapse */
2687
- BusyOverlayComponent.ctorParameters = function () { return []; };
2688
- BusyOverlayComponent.propDecorators = {
2689
- busyModel: [{ type: core.Input }],
2690
- busy: [{ type: core.Input }]
2691
- };
2692
- __decorate([
2693
- pectin.UseDelegate(),
2694
- __metadata("design:type", pectin.ValueModel)
2695
- ], BusyOverlayComponent.prototype, "busyModel", void 0);
2696
- __decorate([
2697
- pectin.StoreInValueModel('busyModel'),
2698
- __metadata("design:type", Boolean)
2699
- ], BusyOverlayComponent.prototype, "busy", void 0);
2700
- return BusyOverlayComponent;
2701
- }());
2702
- if (false) {
2703
- /** @type {?} */
2704
- BusyOverlayComponent.prototype.busyModel;
2705
- /** @type {?} */
2706
- BusyOverlayComponent.prototype.busy;
2707
- }
2708
-
2709
- /**
2710
- * @fileoverview added by tsickle
2711
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2712
- */
2713
- var EmptyStateComponent = /** @class */ (function () {
2714
- function EmptyStateComponent() {
2715
- }
2716
- /**
2717
- * @return {?}
2718
- */
2719
- EmptyStateComponent.prototype.ngOnInit = /**
2720
- * @return {?}
2721
- */
2722
- function () {
2723
- };
2724
- EmptyStateComponent.decorators = [
2725
- { type: core.Component, args: [{
2726
- selector: 'aup-empty-state',
2727
- template: "\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ",
2728
- styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
2729
- }] }
2730
- ];
2731
- /** @nocollapse */
2732
- EmptyStateComponent.ctorParameters = function () { return []; };
2733
- return EmptyStateComponent;
2734
- }());
2735
-
2736
2691
  /**
2737
2692
  * @fileoverview added by tsickle
2738
2693
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -3168,49 +3123,25 @@
3168
3123
  return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;
3169
3124
  };
3170
3125
  /**
3171
- * Returns angular router commands that specify the route id and any route parameters. The result does
3172
- * not include any path information.
3173
- */
3174
- // getFormattedRouterCommands(visit: Visit): any[] {
3175
- // return this.hasRouteId() ?
3176
- // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
3177
- // [this.getFormattedRouteParameters(visit)];
3178
- // }
3179
- /**
3180
- * Returns angular router commands that specify the route id and any route parameters. The result does
3181
- * not include any path information.
3182
3126
  * @param {?} visit
3183
3127
  * @return {?}
3184
3128
  */
3185
- // getFormattedRouterCommands(visit: Visit): any[] {
3186
- // return this.hasRouteId() ?
3187
- // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
3188
- // [this.getFormattedRouteParameters(visit)];
3189
- // }
3190
3129
  PlaceDefinition.prototype.getFormattedRouteId = /**
3191
- * Returns angular router commands that specify the route id and any route parameters. The result does
3192
- * not include any path information.
3193
3130
  * @param {?} visit
3194
3131
  * @return {?}
3195
3132
  */
3196
- // getFormattedRouterCommands(visit: Visit): any[] {
3197
- // return this.hasRouteId() ?
3198
- // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
3199
- // [this.getFormattedRouteParameters(visit)];
3200
- // }
3201
3133
  function (visit) {
3202
- return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : null;
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()) : "";
3203
3138
  };
3204
- // @Trace()
3205
- // @Trace()
3206
3139
  /**
3207
3140
  * @param {?} visit
3208
3141
  * @param {?=} includeRouteId
3209
3142
  * @return {?}
3210
3143
  */
3211
- PlaceDefinition.prototype.getFormattedRouteParameters =
3212
- // @Trace()
3213
- /**
3144
+ PlaceDefinition.prototype.getFormattedRouteParameters = /**
3214
3145
  * @param {?} visit
3215
3146
  * @param {?=} includeRouteId
3216
3147
  * @return {?}
@@ -3306,15 +3237,17 @@
3306
3237
  }
3307
3238
  else {
3308
3239
  /** @type {?} */
3309
- var value = def.urlFormat.parse(params.get(def.name));
3310
- // because our id routes redirect if the id isn't pressent we always have a id
3311
- // parameter in our params. This will bugger our remember and defaultvalue sanitisation
3312
- // as it'll see that the id is present (event thought its null). The sanitisation can't
3313
- // check for null as that's a valid value for the id.
3314
- /** @type {?} */
3315
- var isEmptyRouteId = def.isRouteId && def.isEmptyValue(value);
3316
- if (!isEmptyRouteId) {
3317
- result[def.name] = value;
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);
3318
3251
  }
3319
3252
  }
3320
3253
  }
@@ -3684,8 +3617,10 @@
3684
3617
  else {
3685
3618
  // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
3686
3619
  // defaults and remember sanitisation process.
3620
+ /** @type {?} */
3621
+ var value = _this.getParameter(def.name);
3687
3622
  if (_this.hasParameter(def.name)) {
3688
- params[def.name] = _this.getParameter(def.name);
3623
+ params[def.name] = value;
3689
3624
  }
3690
3625
  }
3691
3626
  }));
@@ -3719,17 +3654,6 @@
3719
3654
  var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
3720
3655
  return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
3721
3656
  };
3722
- /**
3723
- * @return {?}
3724
- */
3725
- Visit.prototype.getUrlSegments = /**
3726
- * @return {?}
3727
- */
3728
- function () {
3729
- return this.placeDefinition.hasRouteId() ?
3730
- [new router.UrlSegment(this.placeDefinition.path, {}), new router.UrlSegment(this.placeDefinition.getFormattedRouteId(this), this.placeDefinition.getFormattedRouteParameters(this))] :
3731
- [new router.UrlSegment(this.placeDefinition.path, this.placeDefinition.getFormattedRouteParameters(this))];
3732
- };
3733
3657
  return Visit;
3734
3658
  }());
3735
3659
  if (false) {
@@ -4029,11 +3953,12 @@
4029
3953
  * @fileoverview added by tsickle
4030
3954
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4031
3955
  */
4032
- var PlaceRouter = /** @class */ (function (_super) {
3956
+ exports.ɵt = /** @class */ (function (_super) {
4033
3957
  __extends(PlaceRouter, _super);
4034
- function PlaceRouter(router$1, angularLocation, placeHistory) {
3958
+ function PlaceRouter(router$1, urlSerializer, angularLocation, placeHistory) {
4035
3959
  var _this = _super.call(this) || this;
4036
3960
  _this.router = router$1;
3961
+ _this.urlSerializer = urlSerializer;
4037
3962
  _this.angularLocation = angularLocation;
4038
3963
  _this.placeHistory = placeHistory;
4039
3964
  _this.firstRoute = true;
@@ -4184,19 +4109,19 @@
4184
4109
  * @return {?}
4185
4110
  */
4186
4111
  function (router) {
4187
- // we have to to use the definition for route id as our redirection always includes
4188
- // the id in the url segements (but leaves it blank when there's no id). I.e. in the
4189
- // no id case we're doing the following redirect [<placePath>, ""] -> ["..", <id>]
4190
4112
  /** @type {?} */
4191
- var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
4192
- /** @type {?} */
4193
- var commands = __spread([
4194
- relativePath
4195
- ], _this.createRouteParameters(next), _this.extractChildPath(activatedRoute.snapshot));
4196
- console.log('### Push Changes to route Redirect', { commands: commands, relativeTo: activatedRoute.snapshot.url });
4197
- return router.navigate(commands, {
4198
- relativeTo: activatedRoute
4199
- });
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);
4200
4125
  }))];
4201
4126
  }
4202
4127
  return [2 /*return*/];
@@ -4324,6 +4249,17 @@
4324
4249
  */
4325
4250
  function (child) { return child.url; })));
4326
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
+ };
4327
4263
  PlaceRouter.decorators = [
4328
4264
  { type: core.Injectable, args: [{
4329
4265
  providedIn: 'root'
@@ -4332,10 +4268,11 @@
4332
4268
  /** @nocollapse */
4333
4269
  PlaceRouter.ctorParameters = function () { return [
4334
4270
  { type: router.Router },
4271
+ { type: router.UrlSerializer },
4335
4272
  { type: common.Location },
4336
4273
  { type: PlaceHistory }
4337
4274
  ]; };
4338
- /** @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" });
4339
4276
  __decorate([
4340
4277
  pectin.Trace(),
4341
4278
  __metadata("design:type", Function),
@@ -4349,31 +4286,145 @@
4349
4286
  * @type {?}
4350
4287
  * @private
4351
4288
  */
4352
- PlaceRouter.prototype.firstRoute;
4289
+ exports.ɵt.prototype.firstRoute;
4353
4290
  /**
4354
4291
  * @type {?}
4355
4292
  * @private
4356
4293
  */
4357
- PlaceRouter.prototype._navigationSessionModel;
4294
+ exports.ɵt.prototype._navigationSessionModel;
4358
4295
  /**
4359
4296
  * @type {?}
4360
4297
  * @private
4361
4298
  */
4362
- PlaceRouter.prototype._activeVisits;
4299
+ exports.ɵt.prototype._activeVisits;
4363
4300
  /** @type {?} */
4364
- PlaceRouter.prototype.navigationSessionActive;
4301
+ exports.ɵt.prototype.navigationSessionActive;
4365
4302
  /** @type {?} */
4366
- PlaceRouter.prototype.activeVisitIndex;
4303
+ exports.ɵt.prototype.activeVisitIndex;
4367
4304
  /**
4368
4305
  * @type {?}
4369
4306
  * @private
4370
4307
  */
4371
- PlaceRouter.prototype.router;
4308
+ exports.ɵt.prototype.router;
4309
+ /**
4310
+ * @type {?}
4311
+ * @private
4312
+ */
4313
+ exports.ɵt.prototype.urlSerializer;
4372
4314
  /** @type {?} */
4373
- PlaceRouter.prototype.angularLocation;
4315
+ exports.ɵt.prototype.angularLocation;
4374
4316
  /** @type {?} */
4375
- PlaceRouter.prototype.placeHistory;
4317
+ exports.ɵt.prototype.placeHistory;
4376
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 = {}));
4377
4428
 
4378
4429
  /**
4379
4430
  * @fileoverview added by tsickle
@@ -4760,7 +4811,7 @@
4760
4811
  /** @nocollapse */
4761
4812
  PlaceOutletComponent.ctorParameters = function () { return [
4762
4813
  { type: router.Router },
4763
- { type: PlaceRouter },
4814
+ { type: exports.ɵt },
4764
4815
  { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [AUP_PLACE_CONFIG,] }] },
4765
4816
  { type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
4766
4817
  ]; };
@@ -4936,6 +4987,13 @@
4936
4987
  */
4937
4988
  function () {
4938
4989
  };
4990
+ AbstractPlaceNavigationComponent.decorators = [
4991
+ { type: core.Component, args: [{
4992
+ template: ''
4993
+ }] }
4994
+ ];
4995
+ /** @nocollapse */
4996
+ AbstractPlaceNavigationComponent.ctorParameters = function () { return []; };
4939
4997
  AbstractPlaceNavigationComponent.propDecorators = {
4940
4998
  places: [{ type: core.Input }],
4941
4999
  placesModel: [{ type: core.Input }],
@@ -4983,6 +5041,78 @@
4983
5041
  AbstractPlaceNavigationComponent.prototype.activePlaceDefinition;
4984
5042
  }
4985
5043
 
5044
+ /**
5045
+ * @fileoverview added by tsickle
5046
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5047
+ */
5048
+ var BusyOverlayComponent = /** @class */ (function () {
5049
+ function BusyOverlayComponent() {
5050
+ }
5051
+ /**
5052
+ * @return {?}
5053
+ */
5054
+ BusyOverlayComponent.prototype.ngOnInit = /**
5055
+ * @return {?}
5056
+ */
5057
+ function () {
5058
+ };
5059
+ BusyOverlayComponent.decorators = [
5060
+ { type: core.Component, args: [{
5061
+ selector: 'aup-busy-overlay',
5062
+ template: "<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n",
5063
+ styles: [":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]
5064
+ }] }
5065
+ ];
5066
+ /** @nocollapse */
5067
+ BusyOverlayComponent.ctorParameters = function () { return []; };
5068
+ BusyOverlayComponent.propDecorators = {
5069
+ busyModel: [{ type: core.Input }],
5070
+ busy: [{ type: core.Input }]
5071
+ };
5072
+ __decorate([
5073
+ pectin.UseDelegate(),
5074
+ __metadata("design:type", pectin.ValueModel)
5075
+ ], BusyOverlayComponent.prototype, "busyModel", void 0);
5076
+ __decorate([
5077
+ pectin.StoreInValueModel('busyModel'),
5078
+ __metadata("design:type", Boolean)
5079
+ ], BusyOverlayComponent.prototype, "busy", void 0);
5080
+ return BusyOverlayComponent;
5081
+ }());
5082
+ if (false) {
5083
+ /** @type {?} */
5084
+ BusyOverlayComponent.prototype.busyModel;
5085
+ /** @type {?} */
5086
+ BusyOverlayComponent.prototype.busy;
5087
+ }
5088
+
5089
+ /**
5090
+ * @fileoverview added by tsickle
5091
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5092
+ */
5093
+ var EmptyStateComponent = /** @class */ (function () {
5094
+ function EmptyStateComponent() {
5095
+ }
5096
+ /**
5097
+ * @return {?}
5098
+ */
5099
+ EmptyStateComponent.prototype.ngOnInit = /**
5100
+ * @return {?}
5101
+ */
5102
+ function () {
5103
+ };
5104
+ EmptyStateComponent.decorators = [
5105
+ { type: core.Component, args: [{
5106
+ selector: 'aup-empty-state',
5107
+ template: "\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ",
5108
+ styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
5109
+ }] }
5110
+ ];
5111
+ /** @nocollapse */
5112
+ EmptyStateComponent.ctorParameters = function () { return []; };
5113
+ return EmptyStateComponent;
5114
+ }());
5115
+
4986
5116
  /**
4987
5117
  * @fileoverview added by tsickle
4988
5118
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -5086,7 +5216,8 @@
5086
5216
  BusyOverlayComponent,
5087
5217
  PlaceOutletComponent,
5088
5218
  TabbedPlaceNavigationComponent,
5089
- ListPlaceNavComponent
5219
+ ListPlaceNavComponent,
5220
+ AbstractPlaceNavigationComponent
5090
5221
  ],
5091
5222
  entryComponents: [BusyOverlayComponent],
5092
5223
  exports: [
@@ -5094,7 +5225,8 @@
5094
5225
  PlaceOutletComponent,
5095
5226
  EmptyStateComponent,
5096
5227
  TabbedPlaceNavigationComponent,
5097
- ListPlaceNavComponent
5228
+ ListPlaceNavComponent,
5229
+ AbstractPlaceNavigationComponent
5098
5230
  ],
5099
5231
  providers: [
5100
5232
  // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "2000ms"}}
@@ -6043,7 +6175,7 @@
6043
6175
  */
6044
6176
  function (activatedRoute, state) {
6045
6177
  return __awaiter(this, void 0, void 0, function () {
6046
- var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, routerStateUrlTree, commands;
6178
+ var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, commands;
6047
6179
  return __generator(this, function (_a) {
6048
6180
  switch (_a.label) {
6049
6181
  case 0:
@@ -6060,9 +6192,8 @@
6060
6192
  // Save the visit with any updated parameters. We need to save it so we remember any non route parameters
6061
6193
  this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
6062
6194
  if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
6063
- routerStateUrlTree = this.urlSerializer.parse(state.url);
6064
6195
  // Regenerate the url
6065
- commands = this.createRedirectCommands(sanitisedVisit, __spread(routerStateUrlTree.root.children.primary.segments)).commands;
6196
+ commands = this.placeRouter.createUrlManipulator(state).createRedirectCommandsFor(sanitisedVisit);
6066
6197
  console.log('##### Place Guard Redirect', commands);
6067
6198
  return [2 /*return*/, this.router.createUrlTree(commands, {
6068
6199
  replaceUrl: true,
@@ -6079,46 +6210,6 @@
6079
6210
  });
6080
6211
  });
6081
6212
  };
6082
- /**
6083
- * @private
6084
- * @param {?} sanitisedVisit
6085
- * @param {?} path
6086
- * @return {?}
6087
- */
6088
- EnterPlaceGuard.prototype.createRedirectCommands = /**
6089
- * @private
6090
- * @param {?} sanitisedVisit
6091
- * @param {?} path
6092
- * @return {?}
6093
- */
6094
- function (sanitisedVisit, path) {
6095
- // Ugly, but it works for now.
6096
- /** @type {?} */
6097
- var newSegments = sanitisedVisit.getUrlSegments();
6098
- /** @type {?} */
6099
- var replaceAt = path.findIndex((/**
6100
- * @param {?} segment
6101
- * @return {?}
6102
- */
6103
- function (segment) { return segment.path === newSegments[0].path; }));
6104
- /** @type {?} */
6105
- var newPath = __spread(path);
6106
- newPath.splice.apply(newPath, __spread([replaceAt, newSegments.length], newSegments)); // do not use the return value, it's the items that were removed!
6107
- // do not use the return value, it's the items that were removed!
6108
- /** @type {?} */
6109
- var commands = [];
6110
- newPath.forEach((/**
6111
- * @param {?} s
6112
- * @return {?}
6113
- */
6114
- function (s) {
6115
- commands.push(s.path);
6116
- if (s.parameterMap.keys.length > 0) {
6117
- commands.push(s.parameters);
6118
- }
6119
- }));
6120
- return { newPath: newPath, commands: commands };
6121
- };
6122
6213
  EnterPlaceGuard.decorators = [
6123
6214
  { type: core.Injectable, args: [{
6124
6215
  providedIn: 'root'
@@ -6128,11 +6219,11 @@
6128
6219
  EnterPlaceGuard.ctorParameters = function () { return [
6129
6220
  { type: router.Router },
6130
6221
  { type: router.UrlSerializer },
6131
- { type: PlaceRouter },
6222
+ { type: exports.ɵt },
6132
6223
  { type: PlaceHistory },
6133
6224
  { type: core.Injector }
6134
6225
  ]; };
6135
- /** @nocollapse */ EnterPlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function EnterPlaceGuard_Factory() { return new EnterPlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(PlaceRouter), core.ɵɵinject(PlaceHistory), core.ɵɵinject(core.INJECTOR)); }, token: EnterPlaceGuard, providedIn: "root" });
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" });
6136
6227
  return EnterPlaceGuard;
6137
6228
  }());
6138
6229
  if (false) {
@@ -6502,11 +6593,11 @@
6502
6593
  LeavePlaceGuard.ctorParameters = function () { return [
6503
6594
  { type: router.Router },
6504
6595
  { type: core.Injector },
6505
- { type: PlaceRouter },
6596
+ { type: exports.ɵt },
6506
6597
  { type: InteractionContext },
6507
6598
  { type: common.Location }
6508
6599
  ]; };
6509
- /** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(PlaceRouter), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
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" });
6510
6601
  return LeavePlaceGuard;
6511
6602
  }());
6512
6603
  if (false) {
@@ -6569,7 +6660,7 @@
6569
6660
  exports.PlaceHistory = PlaceHistory;
6570
6661
  exports.PlaceModule = PlaceModule;
6571
6662
  exports.PlaceOutletComponent = PlaceOutletComponent;
6572
- exports.PlaceRouter = PlaceRouter;
6663
+ exports.PlaceRouter = exports.ɵt;
6573
6664
  exports.Point = Point;
6574
6665
  exports.ROUTE_PARAMETER_LIST_KEY = ROUTE_PARAMETER_LIST_KEY;
6575
6666
  exports.ResizeAwareComponent = ResizeAwareComponent;
@@ -6611,7 +6702,6 @@
6611
6702
  exports.ɵp = leftRightPlaceAnimation;
6612
6703
  exports.ɵq = LEFT_RIGHT_PLACE_ANIMATION;
6613
6704
  exports.ɵr = AUP_PLACE_CONFIG;
6614
- exports.ɵt = PlaceRouter;
6615
6705
  exports.ɵu = PlaceHistory;
6616
6706
  exports.ɵv = TabbedPlaceNavigationComponent;
6617
6707
  exports.ɵw = AbstractPlaceNavigationComponent;