@coolon/angular-ui-powerups 0.0.85 → 0.0.87
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 +16 -8
- 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/route/guards/leave-place.guard.js +12 -3
- package/esm5/lib/interaction/services/dialog-interaction.service.js +7 -8
- package/esm5/lib/place/route/guards/leave-place.guard.js +12 -3
- package/fesm2015/coolon-angular-ui-powerups.js +16 -8
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +16 -8
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/services/dialog-interaction.service.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
|
|
@@ -6258,10 +6257,19 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
6258
6257
|
self_1 = this;
|
|
6259
6258
|
canLeave = true;
|
|
6260
6259
|
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
|
|
6260
|
+
// we check the dialog interaction first, so that components that don't need to check if they're in an
|
|
6262
6261
|
// interaction during the canDeactivate cycle.
|
|
6263
6262
|
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6264
|
-
if (
|
|
6263
|
+
if (this.interactionContext.isActive()) {
|
|
6264
|
+
console.log('cancelling', { activity: this.interactionContext.currentActivity });
|
|
6265
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
6266
|
+
canLeave = false;
|
|
6267
|
+
}
|
|
6268
|
+
else {
|
|
6269
|
+
canLeave = true;
|
|
6270
|
+
}
|
|
6271
|
+
// now check if the component has an active interaction context
|
|
6272
|
+
if (canLeave && component.interactionContext && component.interactionContext.isActive()) {
|
|
6265
6273
|
canLeave = false;
|
|
6266
6274
|
console.log('cancelling', { activity: component.interactionContext.currentActivity });
|
|
6267
6275
|
component.interactionContext.currentActivity.cancel(null);
|