@coolon/angular-ui-powerups 0.0.86 → 0.0.88
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 +44 -37
- 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/services/dialog-interaction.service.js +7 -8
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +8 -8
- package/esm2015/lib/place/place-router.js +3 -13
- package/esm2015/lib/place/route/guards/leave-place.guard.js +24 -12
- package/esm5/lib/interaction/services/dialog-interaction.service.js +7 -8
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +8 -8
- package/esm5/lib/place/place-router.js +11 -15
- package/esm5/lib/place/route/guards/leave-place.guard.js +23 -11
- package/fesm2015/coolon-angular-ui-powerups.js +37 -36
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +44 -37
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/services/dialog-interaction.service.d.ts +2 -2
- package/lib/place/route/guards/leave-place.guard.d.ts +2 -2
- package/package.json +1 -1
|
@@ -2180,6 +2180,8 @@ var DialogInteractionService = /** @class */ (function (_super) {
|
|
|
2180
2180
|
_this._activityList = new DelegatingListModel();
|
|
2181
2181
|
_this.startingGuard = new Guard();
|
|
2182
2182
|
assert$1.notNil(dialogService);
|
|
2183
|
+
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2184
|
+
_this.active = chain(_this._activityList).isNotEmpty();
|
|
2183
2185
|
return _this;
|
|
2184
2186
|
}
|
|
2185
2187
|
/**
|
|
@@ -2189,7 +2191,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
|
|
|
2189
2191
|
* @return {?}
|
|
2190
2192
|
*/
|
|
2191
2193
|
function () {
|
|
2192
|
-
return this.
|
|
2194
|
+
return this.active.value;
|
|
2193
2195
|
};
|
|
2194
2196
|
/**
|
|
2195
2197
|
* @return {?}
|
|
@@ -2412,11 +2414,8 @@ if (false) {
|
|
|
2412
2414
|
* @private
|
|
2413
2415
|
*/
|
|
2414
2416
|
DialogInteractionService.prototype.startingGuard;
|
|
2415
|
-
/**
|
|
2416
|
-
|
|
2417
|
-
* @private
|
|
2418
|
-
*/
|
|
2419
|
-
DialogInteractionService.prototype.currentActivityId;
|
|
2417
|
+
/** @type {?} */
|
|
2418
|
+
DialogInteractionService.prototype.active;
|
|
2420
2419
|
/**
|
|
2421
2420
|
* @type {?}
|
|
2422
2421
|
* @private
|
|
@@ -4070,12 +4069,16 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
4070
4069
|
[def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
|
|
4071
4070
|
[def.getFormattedRouteParameters(visit)];
|
|
4072
4071
|
};
|
|
4072
|
+
// @Trace()
|
|
4073
|
+
// @Trace()
|
|
4073
4074
|
/**
|
|
4074
4075
|
* @private
|
|
4075
4076
|
* @param {?} event
|
|
4076
4077
|
* @return {?}
|
|
4077
4078
|
*/
|
|
4078
|
-
PlaceRouter.prototype.onAngularRouterStarted =
|
|
4079
|
+
PlaceRouter.prototype.onAngularRouterStarted =
|
|
4080
|
+
// @Trace()
|
|
4081
|
+
/**
|
|
4079
4082
|
* @private
|
|
4080
4083
|
* @param {?} event
|
|
4081
4084
|
* @return {?}
|
|
@@ -4092,11 +4095,15 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
4092
4095
|
}
|
|
4093
4096
|
this.firstRoute = false;
|
|
4094
4097
|
};
|
|
4098
|
+
// @Trace()
|
|
4099
|
+
// @Trace()
|
|
4095
4100
|
/**
|
|
4096
4101
|
* @private
|
|
4097
4102
|
* @return {?}
|
|
4098
4103
|
*/
|
|
4099
|
-
PlaceRouter.prototype.onAngularRouterFinished =
|
|
4104
|
+
PlaceRouter.prototype.onAngularRouterFinished =
|
|
4105
|
+
// @Trace()
|
|
4106
|
+
/**
|
|
4100
4107
|
* @private
|
|
4101
4108
|
* @return {?}
|
|
4102
4109
|
*/
|
|
@@ -4151,18 +4158,6 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
4151
4158
|
__metadata("design:paramtypes", [Visit, Object]),
|
|
4152
4159
|
__metadata("design:returntype", Promise)
|
|
4153
4160
|
], PlaceRouter.prototype, "navigate", null);
|
|
4154
|
-
__decorate([
|
|
4155
|
-
Trace(),
|
|
4156
|
-
__metadata("design:type", Function),
|
|
4157
|
-
__metadata("design:paramtypes", [NavigationStart]),
|
|
4158
|
-
__metadata("design:returntype", void 0)
|
|
4159
|
-
], PlaceRouter.prototype, "onAngularRouterStarted", null);
|
|
4160
|
-
__decorate([
|
|
4161
|
-
Trace(),
|
|
4162
|
-
__metadata("design:type", Function),
|
|
4163
|
-
__metadata("design:paramtypes", []),
|
|
4164
|
-
__metadata("design:returntype", void 0)
|
|
4165
|
-
], PlaceRouter.prototype, "onAngularRouterFinished", null);
|
|
4166
4161
|
return PlaceRouter;
|
|
4167
4162
|
}(GarbageCollector));
|
|
4168
4163
|
if (false) {
|
|
@@ -4432,12 +4427,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4432
4427
|
var _this = this;
|
|
4433
4428
|
/** @type {?} */
|
|
4434
4429
|
var visit = this.routerVisit.value;
|
|
4435
|
-
console.log({
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
});
|
|
4430
|
+
// console.log({
|
|
4431
|
+
// visit,
|
|
4432
|
+
// place: visit ? visit.placeDefinition.component : null,
|
|
4433
|
+
// inOutletActivation: this._inOutletActivation.value,
|
|
4434
|
+
// inRoutingSession: this.placeRouter.navigationSessionActive.value
|
|
4435
|
+
// });
|
|
4441
4436
|
if (visit) { // can be null while the place and index sync up
|
|
4442
4437
|
this._inRouteVisitUpdate.whileTrue((/**
|
|
4443
4438
|
* @return {?}
|
|
@@ -4553,7 +4548,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4553
4548
|
* @return {?}
|
|
4554
4549
|
*/
|
|
4555
4550
|
function () {
|
|
4556
|
-
console.log({ activePlace: this._activePlace.value });
|
|
4551
|
+
// console.log({ activePlace: this._activePlace.value });
|
|
4557
4552
|
};
|
|
4558
4553
|
// @Trace()
|
|
4559
4554
|
// @Trace()
|
|
@@ -6145,11 +6140,11 @@ if (false) {
|
|
|
6145
6140
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6146
6141
|
*/
|
|
6147
6142
|
var LeavePlaceGuard = /** @class */ (function () {
|
|
6148
|
-
function LeavePlaceGuard(router, injector, placeRouter,
|
|
6143
|
+
function LeavePlaceGuard(router, injector, placeRouter, dialogInteractionContext, angularLocation) {
|
|
6149
6144
|
this.router = router;
|
|
6150
6145
|
this.injector = injector;
|
|
6151
6146
|
this.placeRouter = placeRouter;
|
|
6152
|
-
this.
|
|
6147
|
+
this.dialogInteractionContext = dialogInteractionContext;
|
|
6153
6148
|
this.angularLocation = angularLocation;
|
|
6154
6149
|
}
|
|
6155
6150
|
// @Trace()
|
|
@@ -6258,13 +6253,25 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
6258
6253
|
self_1 = this;
|
|
6259
6254
|
canLeave = true;
|
|
6260
6255
|
if (!this.isLeavingTheCurrentPlace(nextState, component.placeDefinition)) return [3 /*break*/, 4];
|
|
6261
|
-
// we check the interaction first, so that components that don't need to check if they're in an
|
|
6256
|
+
// we check the dialog interaction first, so that components that don't need to check if they're in an
|
|
6262
6257
|
// interaction during the canDeactivate cycle.
|
|
6263
6258
|
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6264
|
-
if (
|
|
6259
|
+
if (this.dialogInteractionContext.isActive()) {
|
|
6260
|
+
console.log('cancelling', { activity: this.dialogInteractionContext.currentActivity });
|
|
6261
|
+
this.dialogInteractionContext.currentActivity.cancel(null);
|
|
6265
6262
|
canLeave = false;
|
|
6266
|
-
|
|
6267
|
-
|
|
6263
|
+
}
|
|
6264
|
+
else {
|
|
6265
|
+
canLeave = true;
|
|
6266
|
+
}
|
|
6267
|
+
if (canLeave) {
|
|
6268
|
+
// now check if the component has an active interaction. This will handle
|
|
6269
|
+
// an inplace interaction contexts
|
|
6270
|
+
if (component.interactionContext && component.interactionContext.isActive()) {
|
|
6271
|
+
canLeave = false;
|
|
6272
|
+
console.log('cancelling', { activity: component.interactionContext.currentActivity });
|
|
6273
|
+
component.interactionContext.currentActivity.cancel(null);
|
|
6274
|
+
}
|
|
6268
6275
|
}
|
|
6269
6276
|
if (!canLeave) return [3 /*break*/, 3];
|
|
6270
6277
|
return [4 /*yield*/, component.canDeactivate()];
|
|
@@ -6274,9 +6281,9 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
6274
6281
|
_a.label = 3;
|
|
6275
6282
|
case 3: return [3 /*break*/, 5];
|
|
6276
6283
|
case 4:
|
|
6277
|
-
if (this.
|
|
6278
|
-
console.log('cancelling', { activity: this.
|
|
6279
|
-
this.
|
|
6284
|
+
if (this.dialogInteractionContext.isActive()) {
|
|
6285
|
+
console.log('cancelling', { activity: this.dialogInteractionContext.currentActivity });
|
|
6286
|
+
this.dialogInteractionContext.currentActivity.cancel(null);
|
|
6280
6287
|
canLeave = false;
|
|
6281
6288
|
}
|
|
6282
6289
|
else {
|
|
@@ -6335,7 +6342,7 @@ if (false) {
|
|
|
6335
6342
|
*/
|
|
6336
6343
|
LeavePlaceGuard.prototype.placeRouter;
|
|
6337
6344
|
/** @type {?} */
|
|
6338
|
-
LeavePlaceGuard.prototype.
|
|
6345
|
+
LeavePlaceGuard.prototype.dialogInteractionContext;
|
|
6339
6346
|
/** @type {?} */
|
|
6340
6347
|
LeavePlaceGuard.prototype.angularLocation;
|
|
6341
6348
|
}
|