@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
|
@@ -5,7 +5,7 @@ import { MatInputModule, MatFormFieldModule, MatSelectModule, MatButtonModule, M
|
|
|
5
5
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
7
|
import { __extends, __decorate, __metadata, __awaiter, __generator, __assign, __spread } from 'tslib';
|
|
8
|
-
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel,
|
|
8
|
+
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, DelegatingListModel, Deferred, MutableStream, MutableValueModel, MutableListModel, Binding, Trace, Guard, StoreInValueModel, Command, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
9
9
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
10
|
import { RouterModule, NavigationStart, NavigationCancel, UrlSegment, NavigationEnd, NavigationError, Router, UrlSerializer } from '@angular/router';
|
|
11
11
|
import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
|
|
@@ -1100,7 +1100,10 @@ if (false) {
|
|
|
1100
1100
|
/**
|
|
1101
1101
|
* @abstract
|
|
1102
1102
|
*/
|
|
1103
|
-
var
|
|
1103
|
+
var /**
|
|
1104
|
+
* @abstract
|
|
1105
|
+
*/
|
|
1106
|
+
InteractionContext = /** @class */ (function (_super) {
|
|
1104
1107
|
__extends(InteractionContext, _super);
|
|
1105
1108
|
function InteractionContext() {
|
|
1106
1109
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1140,7 +1143,7 @@ var InteractionContext = /** @class */ (function (_super) {
|
|
|
1140
1143
|
* there is still another activity running.
|
|
1141
1144
|
* @return {?}
|
|
1142
1145
|
*/
|
|
1143
|
-
InteractionContext.prototype.
|
|
1146
|
+
InteractionContext.prototype.cancelActiveActivity = /**
|
|
1144
1147
|
* Cancels the current activity and returns true the context is no longer active, false if
|
|
1145
1148
|
* there is still another activity running.
|
|
1146
1149
|
* @return {?}
|
|
@@ -1153,7 +1156,7 @@ var InteractionContext = /** @class */ (function (_super) {
|
|
|
1153
1156
|
switch (_a.label) {
|
|
1154
1157
|
case 0:
|
|
1155
1158
|
when = Dsl.disposeWith(this).when;
|
|
1156
|
-
return [4 /*yield*/, this.
|
|
1159
|
+
return [4 /*yield*/, this.getActiveActivity()];
|
|
1157
1160
|
case 1:
|
|
1158
1161
|
activity = _a.sent();
|
|
1159
1162
|
return [2 /*return*/, new Promise((/**
|
|
@@ -1175,43 +1178,6 @@ var InteractionContext = /** @class */ (function (_super) {
|
|
|
1175
1178
|
});
|
|
1176
1179
|
});
|
|
1177
1180
|
};
|
|
1178
|
-
/**
|
|
1179
|
-
* @return {?}
|
|
1180
|
-
*/
|
|
1181
|
-
InteractionContext.prototype.abort = /**
|
|
1182
|
-
* @return {?}
|
|
1183
|
-
*/
|
|
1184
|
-
function () {
|
|
1185
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1186
|
-
var count;
|
|
1187
|
-
return __generator(this, function (_a) {
|
|
1188
|
-
switch (_a.label) {
|
|
1189
|
-
case 0:
|
|
1190
|
-
assert.isTruthy(this.isActive());
|
|
1191
|
-
count = 1;
|
|
1192
|
-
return [4 /*yield*/, this.cancelCurrentActivity()];
|
|
1193
|
-
case 1:
|
|
1194
|
-
_a.sent();
|
|
1195
|
-
console.log("aborted -> " + count++);
|
|
1196
|
-
_a.label = 2;
|
|
1197
|
-
case 2:
|
|
1198
|
-
if (!this.isActive()) return [3 /*break*/, 4];
|
|
1199
|
-
return [4 /*yield*/, this.cancelCurrentActivity()];
|
|
1200
|
-
case 3:
|
|
1201
|
-
_a.sent();
|
|
1202
|
-
console.log("aborted -> " + count++);
|
|
1203
|
-
return [3 /*break*/, 2];
|
|
1204
|
-
case 4: return [2 /*return*/];
|
|
1205
|
-
}
|
|
1206
|
-
});
|
|
1207
|
-
});
|
|
1208
|
-
};
|
|
1209
|
-
__decorate([
|
|
1210
|
-
Trace(),
|
|
1211
|
-
__metadata("design:type", Function),
|
|
1212
|
-
__metadata("design:paramtypes", []),
|
|
1213
|
-
__metadata("design:returntype", Promise)
|
|
1214
|
-
], InteractionContext.prototype, "abort", null);
|
|
1215
1181
|
return InteractionContext;
|
|
1216
1182
|
}(GarbageCollector));
|
|
1217
1183
|
if (false) {
|
|
@@ -1225,10 +1191,9 @@ if (false) {
|
|
|
1225
1191
|
* Returns the activity that is currently active.
|
|
1226
1192
|
* This model is only updated in the next tick after the view has been updated.
|
|
1227
1193
|
* @abstract
|
|
1228
|
-
* @protected
|
|
1229
1194
|
* @return {?}
|
|
1230
1195
|
*/
|
|
1231
|
-
InteractionContext.prototype.
|
|
1196
|
+
InteractionContext.prototype.getActiveActivity = function () { };
|
|
1232
1197
|
/**
|
|
1233
1198
|
* @abstract
|
|
1234
1199
|
* @template D, R, E
|
|
@@ -1489,7 +1454,7 @@ InteractionContextBase = /** @class */ (function (_super) {
|
|
|
1489
1454
|
* This model is only updated in the next tick after the view has been updated.
|
|
1490
1455
|
* @return {?}
|
|
1491
1456
|
*/
|
|
1492
|
-
InteractionContextBase.prototype.
|
|
1457
|
+
InteractionContextBase.prototype.getActiveActivity = /**
|
|
1493
1458
|
* Returns the activity that is currently active.
|
|
1494
1459
|
* This model is only updated in the next tick after the view has been updated.
|
|
1495
1460
|
* @return {?}
|
|
@@ -2292,10 +2257,33 @@ var InteractionService = /** @class */ (function () {
|
|
|
2292
2257
|
return this.modelInteractionActive.value;
|
|
2293
2258
|
};
|
|
2294
2259
|
/**
|
|
2260
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2261
|
+
* @param disposable
|
|
2262
|
+
*/
|
|
2263
|
+
/**
|
|
2264
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2295
2265
|
* @param {?} disposable
|
|
2296
2266
|
* @return {?}
|
|
2297
2267
|
*/
|
|
2298
2268
|
InteractionService.prototype.createModalInteractionContextFor = /**
|
|
2269
|
+
* @deprecated use #createModalInteractionContextDisposedWith instead.
|
|
2270
|
+
* @param {?} disposable
|
|
2271
|
+
* @return {?}
|
|
2272
|
+
*/
|
|
2273
|
+
function (disposable) {
|
|
2274
|
+
return this.createModalInteractionContextDisposedWith(disposable);
|
|
2275
|
+
};
|
|
2276
|
+
/**
|
|
2277
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2278
|
+
* @param disposable
|
|
2279
|
+
*/
|
|
2280
|
+
/**
|
|
2281
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2282
|
+
* @param {?} disposable
|
|
2283
|
+
* @return {?}
|
|
2284
|
+
*/
|
|
2285
|
+
InteractionService.prototype.createModalInteractionContextDisposedWith = /**
|
|
2286
|
+
* Creates a new model interaction context that will be disposed along with the component.
|
|
2299
2287
|
* @param {?} disposable
|
|
2300
2288
|
* @return {?}
|
|
2301
2289
|
*/
|
|
@@ -3717,14 +3705,14 @@ var PlaceComponentDeactivationHandler = /** @class */ (function () {
|
|
|
3717
3705
|
routeIds = this.placeRouter.getActiveInteractionIdsFromUrl(nextState.url);
|
|
3718
3706
|
currentIds = this.interactionService.activeInteractionContextIds.value;
|
|
3719
3707
|
if (!!isEqual(currentIds, routeIds)) return [3 /*break*/, 2];
|
|
3720
|
-
return [4 /*yield*/, this.interactionService.getActiveContext().
|
|
3708
|
+
return [4 /*yield*/, this.interactionService.getActiveContext().cancelActiveActivity()];
|
|
3721
3709
|
case 1:
|
|
3722
3710
|
_a.sent();
|
|
3723
3711
|
return [2 /*return*/, currentUrl.updateInteractionIds(this.interactionService.activeInteractionContextIds.value)];
|
|
3724
3712
|
case 2: return [3 /*break*/, 5];
|
|
3725
3713
|
case 3:
|
|
3726
3714
|
if (!(this.component.interactionContext && this.component.interactionContext.isActive())) return [3 /*break*/, 5];
|
|
3727
|
-
return [4 /*yield*/, this.component.interactionContext.
|
|
3715
|
+
return [4 /*yield*/, this.component.interactionContext.cancelActiveActivity()];
|
|
3728
3716
|
case 4:
|
|
3729
3717
|
_a.sent();
|
|
3730
3718
|
return [2 /*return*/, currentUrl
|
|
@@ -4247,7 +4235,7 @@ if (false) {
|
|
|
4247
4235
|
var when = Dsl.disposeWith(navigationInteraction).when;
|
|
4248
4236
|
// TODO: I need to make the exclusive interaction context disallow nested activities or
|
|
4249
4237
|
// that would mess things up entirely. Or, can I do a context.abortAll().then(..)
|
|
4250
|
-
navigationInteraction.
|
|
4238
|
+
navigationInteraction.cancelActiveActivity().then((/**
|
|
4251
4239
|
* @return {?}
|
|
4252
4240
|
*/
|
|
4253
4241
|
function () {
|