@coolon/angular-ui-powerups 0.0.104 → 0.0.106
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 +34 -46
- 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/interaction-context-base.js +2 -2
- package/esm2015/lib/interaction/interaction-context.js +5 -28
- package/esm2015/lib/interaction/services/interaction.service.js +10 -1
- package/esm2015/lib/place/guards/navigation-state.js +2 -2
- package/esm2015/lib/place/guards/place-component-deactivation-handler.js +3 -3
- package/esm5/lib/interaction/interaction-context-base.js +2 -2
- package/esm5/lib/interaction/interaction-context.js +12 -44
- package/esm5/lib/interaction/services/interaction.service.js +24 -1
- package/esm5/lib/place/guards/navigation-state.js +2 -2
- package/esm5/lib/place/guards/place-component-deactivation-handler.js +3 -3
- package/fesm2015/coolon-angular-ui-powerups.js +17 -31
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +35 -47
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/interaction-context-base.d.ts +1 -1
- package/lib/interaction/interaction-context.d.ts +2 -3
- package/lib/interaction/services/interaction.service.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1283,7 +1283,10 @@
|
|
|
1283
1283
|
/**
|
|
1284
1284
|
* @abstract
|
|
1285
1285
|
*/
|
|
1286
|
-
var
|
|
1286
|
+
var /**
|
|
1287
|
+
* @abstract
|
|
1288
|
+
*/
|
|
1289
|
+
InteractionContext = /** @class */ (function (_super) {
|
|
1287
1290
|
__extends(InteractionContext, _super);
|
|
1288
1291
|
function InteractionContext() {
|
|
1289
1292
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1323,7 +1326,7 @@
|
|
|
1323
1326
|
* there is still another activity running.
|
|
1324
1327
|
* @return {?}
|
|
1325
1328
|
*/
|
|
1326
|
-
InteractionContext.prototype.
|
|
1329
|
+
InteractionContext.prototype.cancelActiveActivity = /**
|
|
1327
1330
|
* Cancels the current activity and returns true the context is no longer active, false if
|
|
1328
1331
|
* there is still another activity running.
|
|
1329
1332
|
* @return {?}
|
|
@@ -1336,7 +1339,7 @@
|
|
|
1336
1339
|
switch (_a.label) {
|
|
1337
1340
|
case 0:
|
|
1338
1341
|
when = pectin.Dsl.disposeWith(this).when;
|
|
1339
|
-
return [4 /*yield*/, this.
|
|
1342
|
+
return [4 /*yield*/, this.getActiveActivity()];
|
|
1340
1343
|
case 1:
|
|
1341
1344
|
activity = _a.sent();
|
|
1342
1345
|
return [2 /*return*/, new Promise((/**
|
|
@@ -1358,43 +1361,6 @@
|
|
|
1358
1361
|
});
|
|
1359
1362
|
});
|
|
1360
1363
|
};
|
|
1361
|
-
/**
|
|
1362
|
-
* @return {?}
|
|
1363
|
-
*/
|
|
1364
|
-
InteractionContext.prototype.abort = /**
|
|
1365
|
-
* @return {?}
|
|
1366
|
-
*/
|
|
1367
|
-
function () {
|
|
1368
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1369
|
-
var count;
|
|
1370
|
-
return __generator(this, function (_a) {
|
|
1371
|
-
switch (_a.label) {
|
|
1372
|
-
case 0:
|
|
1373
|
-
pectin.assert.isTruthy(this.isActive());
|
|
1374
|
-
count = 1;
|
|
1375
|
-
return [4 /*yield*/, this.cancelCurrentActivity()];
|
|
1376
|
-
case 1:
|
|
1377
|
-
_a.sent();
|
|
1378
|
-
console.log("aborted -> " + count++);
|
|
1379
|
-
_a.label = 2;
|
|
1380
|
-
case 2:
|
|
1381
|
-
if (!this.isActive()) return [3 /*break*/, 4];
|
|
1382
|
-
return [4 /*yield*/, this.cancelCurrentActivity()];
|
|
1383
|
-
case 3:
|
|
1384
|
-
_a.sent();
|
|
1385
|
-
console.log("aborted -> " + count++);
|
|
1386
|
-
return [3 /*break*/, 2];
|
|
1387
|
-
case 4: return [2 /*return*/];
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
});
|
|
1391
|
-
};
|
|
1392
|
-
__decorate([
|
|
1393
|
-
pectin.Trace(),
|
|
1394
|
-
__metadata("design:type", Function),
|
|
1395
|
-
__metadata("design:paramtypes", []),
|
|
1396
|
-
__metadata("design:returntype", Promise)
|
|
1397
|
-
], InteractionContext.prototype, "abort", null);
|
|
1398
1364
|
return InteractionContext;
|
|
1399
1365
|
}(pectin.GarbageCollector));
|
|
1400
1366
|
if (false) {
|
|
@@ -1408,10 +1374,9 @@
|
|
|
1408
1374
|
* Returns the activity that is currently active.
|
|
1409
1375
|
* This model is only updated in the next tick after the view has been updated.
|
|
1410
1376
|
* @abstract
|
|
1411
|
-
* @protected
|
|
1412
1377
|
* @return {?}
|
|
1413
1378
|
*/
|
|
1414
|
-
InteractionContext.prototype.
|
|
1379
|
+
InteractionContext.prototype.getActiveActivity = function () { };
|
|
1415
1380
|
/**
|
|
1416
1381
|
* @abstract
|
|
1417
1382
|
* @template D, R, E
|
|
@@ -1672,7 +1637,7 @@
|
|
|
1672
1637
|
* This model is only updated in the next tick after the view has been updated.
|
|
1673
1638
|
* @return {?}
|
|
1674
1639
|
*/
|
|
1675
|
-
InteractionContextBase.prototype.
|
|
1640
|
+
InteractionContextBase.prototype.getActiveActivity = /**
|
|
1676
1641
|
* Returns the activity that is currently active.
|
|
1677
1642
|
* This model is only updated in the next tick after the view has been updated.
|
|
1678
1643
|
* @return {?}
|
|
@@ -2475,10 +2440,33 @@
|
|
|
2475
2440
|
return this.modelInteractionActive.value;
|
|
2476
2441
|
};
|
|
2477
2442
|
/**
|
|
2443
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2444
|
+
* @param disposable
|
|
2445
|
+
*/
|
|
2446
|
+
/**
|
|
2447
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2478
2448
|
* @param {?} disposable
|
|
2479
2449
|
* @return {?}
|
|
2480
2450
|
*/
|
|
2481
2451
|
InteractionService.prototype.createModalInteractionContextFor = /**
|
|
2452
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2453
|
+
* @param {?} disposable
|
|
2454
|
+
* @return {?}
|
|
2455
|
+
*/
|
|
2456
|
+
function (disposable) {
|
|
2457
|
+
return this.createModalInteractionContextDisposedWith(disposable);
|
|
2458
|
+
};
|
|
2459
|
+
/**
|
|
2460
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2461
|
+
* @param disposable
|
|
2462
|
+
*/
|
|
2463
|
+
/**
|
|
2464
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2465
|
+
* @param {?} disposable
|
|
2466
|
+
* @return {?}
|
|
2467
|
+
*/
|
|
2468
|
+
InteractionService.prototype.createModalInteractionContextDisposedWith = /**
|
|
2469
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2482
2470
|
* @param {?} disposable
|
|
2483
2471
|
* @return {?}
|
|
2484
2472
|
*/
|
|
@@ -3900,14 +3888,14 @@
|
|
|
3900
3888
|
routeIds = this.placeRouter.getActiveInteractionIdsFromUrl(nextState.url);
|
|
3901
3889
|
currentIds = this.interactionService.activeInteractionContextIds.value;
|
|
3902
3890
|
if (!!___default.isEqual(currentIds, routeIds)) return [3 /*break*/, 2];
|
|
3903
|
-
return [4 /*yield*/, this.interactionService.getActiveContext().
|
|
3891
|
+
return [4 /*yield*/, this.interactionService.getActiveContext().cancelActiveActivity()];
|
|
3904
3892
|
case 1:
|
|
3905
3893
|
_a.sent();
|
|
3906
3894
|
return [2 /*return*/, currentUrl.updateInteractionIds(this.interactionService.activeInteractionContextIds.value)];
|
|
3907
3895
|
case 2: return [3 /*break*/, 5];
|
|
3908
3896
|
case 3:
|
|
3909
3897
|
if (!(this.component.interactionContext && this.component.interactionContext.isActive())) return [3 /*break*/, 5];
|
|
3910
|
-
return [4 /*yield*/, this.component.interactionContext.
|
|
3898
|
+
return [4 /*yield*/, this.component.interactionContext.cancelActiveActivity()];
|
|
3911
3899
|
case 4:
|
|
3912
3900
|
_a.sent();
|
|
3913
3901
|
return [2 /*return*/, currentUrl
|
|
@@ -4430,7 +4418,7 @@
|
|
|
4430
4418
|
var when = pectin.Dsl.disposeWith(navigationInteraction).when;
|
|
4431
4419
|
// TODO: I need to make the exclusive interaction context disallow nested activities or
|
|
4432
4420
|
// that would mess things up entirely. Or, can I do a context.abortAll().then(..)
|
|
4433
|
-
navigationInteraction.
|
|
4421
|
+
navigationInteraction.cancelActiveActivity().then((/**
|
|
4434
4422
|
* @return {?}
|
|
4435
4423
|
*/
|
|
4436
4424
|
function () {
|