@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
|
@@ -2364,6 +2364,8 @@
|
|
|
2364
2364
|
_this._activityList = new pectin.DelegatingListModel();
|
|
2365
2365
|
_this.startingGuard = new Guard();
|
|
2366
2366
|
typescriptUtilities.assert.notNil(dialogService);
|
|
2367
|
+
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2368
|
+
_this.active = chain(_this._activityList).isNotEmpty();
|
|
2367
2369
|
return _this;
|
|
2368
2370
|
}
|
|
2369
2371
|
/**
|
|
@@ -2373,7 +2375,7 @@
|
|
|
2373
2375
|
* @return {?}
|
|
2374
2376
|
*/
|
|
2375
2377
|
function () {
|
|
2376
|
-
return this.
|
|
2378
|
+
return this.active.value;
|
|
2377
2379
|
};
|
|
2378
2380
|
/**
|
|
2379
2381
|
* @return {?}
|
|
@@ -2596,11 +2598,8 @@
|
|
|
2596
2598
|
* @private
|
|
2597
2599
|
*/
|
|
2598
2600
|
DialogInteractionService.prototype.startingGuard;
|
|
2599
|
-
/**
|
|
2600
|
-
|
|
2601
|
-
* @private
|
|
2602
|
-
*/
|
|
2603
|
-
DialogInteractionService.prototype.currentActivityId;
|
|
2601
|
+
/** @type {?} */
|
|
2602
|
+
DialogInteractionService.prototype.active;
|
|
2604
2603
|
/**
|
|
2605
2604
|
* @type {?}
|
|
2606
2605
|
* @private
|
|
@@ -4254,12 +4253,16 @@
|
|
|
4254
4253
|
[def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
|
|
4255
4254
|
[def.getFormattedRouteParameters(visit)];
|
|
4256
4255
|
};
|
|
4256
|
+
// @Trace()
|
|
4257
|
+
// @Trace()
|
|
4257
4258
|
/**
|
|
4258
4259
|
* @private
|
|
4259
4260
|
* @param {?} event
|
|
4260
4261
|
* @return {?}
|
|
4261
4262
|
*/
|
|
4262
|
-
PlaceRouter.prototype.onAngularRouterStarted =
|
|
4263
|
+
PlaceRouter.prototype.onAngularRouterStarted =
|
|
4264
|
+
// @Trace()
|
|
4265
|
+
/**
|
|
4263
4266
|
* @private
|
|
4264
4267
|
* @param {?} event
|
|
4265
4268
|
* @return {?}
|
|
@@ -4276,11 +4279,15 @@
|
|
|
4276
4279
|
}
|
|
4277
4280
|
this.firstRoute = false;
|
|
4278
4281
|
};
|
|
4282
|
+
// @Trace()
|
|
4283
|
+
// @Trace()
|
|
4279
4284
|
/**
|
|
4280
4285
|
* @private
|
|
4281
4286
|
* @return {?}
|
|
4282
4287
|
*/
|
|
4283
|
-
PlaceRouter.prototype.onAngularRouterFinished =
|
|
4288
|
+
PlaceRouter.prototype.onAngularRouterFinished =
|
|
4289
|
+
// @Trace()
|
|
4290
|
+
/**
|
|
4284
4291
|
* @private
|
|
4285
4292
|
* @return {?}
|
|
4286
4293
|
*/
|
|
@@ -4335,18 +4342,6 @@
|
|
|
4335
4342
|
__metadata("design:paramtypes", [Visit, Object]),
|
|
4336
4343
|
__metadata("design:returntype", Promise)
|
|
4337
4344
|
], PlaceRouter.prototype, "navigate", null);
|
|
4338
|
-
__decorate([
|
|
4339
|
-
pectin.Trace(),
|
|
4340
|
-
__metadata("design:type", Function),
|
|
4341
|
-
__metadata("design:paramtypes", [router.NavigationStart]),
|
|
4342
|
-
__metadata("design:returntype", void 0)
|
|
4343
|
-
], PlaceRouter.prototype, "onAngularRouterStarted", null);
|
|
4344
|
-
__decorate([
|
|
4345
|
-
pectin.Trace(),
|
|
4346
|
-
__metadata("design:type", Function),
|
|
4347
|
-
__metadata("design:paramtypes", []),
|
|
4348
|
-
__metadata("design:returntype", void 0)
|
|
4349
|
-
], PlaceRouter.prototype, "onAngularRouterFinished", null);
|
|
4350
4345
|
return PlaceRouter;
|
|
4351
4346
|
}(pectin.GarbageCollector));
|
|
4352
4347
|
if (false) {
|
|
@@ -4616,12 +4611,12 @@
|
|
|
4616
4611
|
var _this = this;
|
|
4617
4612
|
/** @type {?} */
|
|
4618
4613
|
var visit = this.routerVisit.value;
|
|
4619
|
-
console.log({
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
});
|
|
4614
|
+
// console.log({
|
|
4615
|
+
// visit,
|
|
4616
|
+
// place: visit ? visit.placeDefinition.component : null,
|
|
4617
|
+
// inOutletActivation: this._inOutletActivation.value,
|
|
4618
|
+
// inRoutingSession: this.placeRouter.navigationSessionActive.value
|
|
4619
|
+
// });
|
|
4625
4620
|
if (visit) { // can be null while the place and index sync up
|
|
4626
4621
|
this._inRouteVisitUpdate.whileTrue((/**
|
|
4627
4622
|
* @return {?}
|
|
@@ -4737,7 +4732,7 @@
|
|
|
4737
4732
|
* @return {?}
|
|
4738
4733
|
*/
|
|
4739
4734
|
function () {
|
|
4740
|
-
console.log({ activePlace: this._activePlace.value });
|
|
4735
|
+
// console.log({ activePlace: this._activePlace.value });
|
|
4741
4736
|
};
|
|
4742
4737
|
// @Trace()
|
|
4743
4738
|
// @Trace()
|
|
@@ -6329,11 +6324,11 @@
|
|
|
6329
6324
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6330
6325
|
*/
|
|
6331
6326
|
var LeavePlaceGuard = /** @class */ (function () {
|
|
6332
|
-
function LeavePlaceGuard(router, injector, placeRouter,
|
|
6327
|
+
function LeavePlaceGuard(router, injector, placeRouter, dialogInteractionContext, angularLocation) {
|
|
6333
6328
|
this.router = router;
|
|
6334
6329
|
this.injector = injector;
|
|
6335
6330
|
this.placeRouter = placeRouter;
|
|
6336
|
-
this.
|
|
6331
|
+
this.dialogInteractionContext = dialogInteractionContext;
|
|
6337
6332
|
this.angularLocation = angularLocation;
|
|
6338
6333
|
}
|
|
6339
6334
|
// @Trace()
|
|
@@ -6442,13 +6437,25 @@
|
|
|
6442
6437
|
self_1 = this;
|
|
6443
6438
|
canLeave = true;
|
|
6444
6439
|
if (!this.isLeavingTheCurrentPlace(nextState, component.placeDefinition)) return [3 /*break*/, 4];
|
|
6445
|
-
// we check the interaction first, so that components that don't need to check if they're in an
|
|
6440
|
+
// we check the dialog interaction first, so that components that don't need to check if they're in an
|
|
6446
6441
|
// interaction during the canDeactivate cycle.
|
|
6447
6442
|
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6448
|
-
if (
|
|
6443
|
+
if (this.dialogInteractionContext.isActive()) {
|
|
6444
|
+
console.log('cancelling', { activity: this.dialogInteractionContext.currentActivity });
|
|
6445
|
+
this.dialogInteractionContext.currentActivity.cancel(null);
|
|
6449
6446
|
canLeave = false;
|
|
6450
|
-
|
|
6451
|
-
|
|
6447
|
+
}
|
|
6448
|
+
else {
|
|
6449
|
+
canLeave = true;
|
|
6450
|
+
}
|
|
6451
|
+
if (canLeave) {
|
|
6452
|
+
// now check if the component has an active interaction. This will handle
|
|
6453
|
+
// an inplace interaction contexts
|
|
6454
|
+
if (component.interactionContext && component.interactionContext.isActive()) {
|
|
6455
|
+
canLeave = false;
|
|
6456
|
+
console.log('cancelling', { activity: component.interactionContext.currentActivity });
|
|
6457
|
+
component.interactionContext.currentActivity.cancel(null);
|
|
6458
|
+
}
|
|
6452
6459
|
}
|
|
6453
6460
|
if (!canLeave) return [3 /*break*/, 3];
|
|
6454
6461
|
return [4 /*yield*/, component.canDeactivate()];
|
|
@@ -6458,9 +6465,9 @@
|
|
|
6458
6465
|
_a.label = 3;
|
|
6459
6466
|
case 3: return [3 /*break*/, 5];
|
|
6460
6467
|
case 4:
|
|
6461
|
-
if (this.
|
|
6462
|
-
console.log('cancelling', { activity: this.
|
|
6463
|
-
this.
|
|
6468
|
+
if (this.dialogInteractionContext.isActive()) {
|
|
6469
|
+
console.log('cancelling', { activity: this.dialogInteractionContext.currentActivity });
|
|
6470
|
+
this.dialogInteractionContext.currentActivity.cancel(null);
|
|
6464
6471
|
canLeave = false;
|
|
6465
6472
|
}
|
|
6466
6473
|
else {
|
|
@@ -6519,7 +6526,7 @@
|
|
|
6519
6526
|
*/
|
|
6520
6527
|
LeavePlaceGuard.prototype.placeRouter;
|
|
6521
6528
|
/** @type {?} */
|
|
6522
|
-
LeavePlaceGuard.prototype.
|
|
6529
|
+
LeavePlaceGuard.prototype.dialogInteractionContext;
|
|
6523
6530
|
/** @type {?} */
|
|
6524
6531
|
LeavePlaceGuard.prototype.angularLocation;
|
|
6525
6532
|
}
|