@coolon/angular-ui-powerups 0.0.63 → 0.0.66
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 +725 -561
- 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.d.ts +10 -10
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +10 -10
- package/esm2015/index.js +2 -2
- package/esm2015/lib/interaction/abstract-activity.js +5 -68
- package/esm2015/lib/interaction/activity.js +72 -11
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +213 -120
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +6 -7
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +19 -43
- package/esm2015/lib/interaction/index.js +2 -2
- package/esm2015/lib/interaction/interaction-context.js +11 -5
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +94 -65
- package/esm2015/lib/place/guards/leave-place.guard.js +95 -131
- package/esm2015/lib/place/place-router.js +87 -6
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +10 -10
- package/esm5/index.js +2 -2
- package/esm5/lib/interaction/abstract-activity.js +10 -96
- package/esm5/lib/interaction/activity.js +114 -11
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +285 -143
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +6 -7
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +19 -67
- package/esm5/lib/interaction/index.js +2 -2
- package/esm5/lib/interaction/interaction-context.js +18 -7
- package/esm5/lib/interaction/services/dialog-interaction.service.js +112 -64
- package/esm5/lib/place/guards/leave-place.guard.js +51 -137
- package/esm5/lib/place/place-router.js +96 -6
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +583 -439
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +698 -535
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/abstract-activity.d.ts +4 -13
- package/lib/interaction/activity.d.ts +14 -7
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +37 -25
- package/lib/interaction/components/activity-outlet/activity-outlet-context.d.ts +2 -5
- package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +1 -10
- package/lib/interaction/interaction-context.d.ts +6 -6
- package/lib/interaction/services/dialog-interaction.service.d.ts +4 -6
- package/lib/place/guards/leave-place.guard.d.ts +6 -7
- package/lib/place/place-router.d.ts +14 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/typescript-utilities', '@angular/material/dialog', '
|
|
4
|
-
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.typescriptUtilities, global.ng.material.dialog, global.
|
|
5
|
-
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, typescriptUtilities, dialog,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('uuid'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@angular/router'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', 'uuid', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@angular/router', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill'], factory) :
|
|
4
|
+
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.uuid, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.ng.router, global.src, global.fastMemoizeDecorator, null, global.ng.animations, global.ResizeObserver));
|
|
5
|
+
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, ___default, typescriptUtilities, dialog, uuid, icon, list, tooltip, router, src, fastMemoizeDecorator, reflectMetadata, animations$1, ResizeObserver) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ___default__default = 'default' in ___default ? ___default['default'] : ___default;
|
|
8
8
|
ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
|
|
@@ -991,15 +991,25 @@
|
|
|
991
991
|
function InteractionContext() {
|
|
992
992
|
return _super.call(this) || this;
|
|
993
993
|
}
|
|
994
|
+
Object.defineProperty(InteractionContext.prototype, "currentActivity", {
|
|
995
|
+
/**
|
|
996
|
+
* Returns the activity that is currently active.
|
|
997
|
+
* This model is only updated in the next tick after the view has been updated.
|
|
998
|
+
*/
|
|
999
|
+
get: /**
|
|
1000
|
+
* Returns the activity that is currently active.
|
|
1001
|
+
* This model is only updated in the next tick after the view has been updated.
|
|
1002
|
+
* @return {?}
|
|
1003
|
+
*/
|
|
1004
|
+
function () {
|
|
1005
|
+
return ___default.last(this.activityList.value);
|
|
1006
|
+
},
|
|
1007
|
+
enumerable: true,
|
|
1008
|
+
configurable: true
|
|
1009
|
+
});
|
|
994
1010
|
return InteractionContext;
|
|
995
1011
|
}(pectin.GarbageCollector));
|
|
996
1012
|
if (false) {
|
|
997
|
-
/**
|
|
998
|
-
* Returns the activity that is currently active.
|
|
999
|
-
* This model is only updated in the next tick after the view has been updated.
|
|
1000
|
-
* @type {?}
|
|
1001
|
-
*/
|
|
1002
|
-
InteractionContext.prototype.currentActivity;
|
|
1003
1013
|
/**
|
|
1004
1014
|
* Returns the current list of activities that are in progress.
|
|
1005
1015
|
* This model is only updated in the next tick after the view has been updated.
|
|
@@ -1051,29 +1061,124 @@
|
|
|
1051
1061
|
/** @type {?} */
|
|
1052
1062
|
var ACTIVITY_DATA = new core.InjectionToken('InteractionActivityData');
|
|
1053
1063
|
/**
|
|
1054
|
-
* @
|
|
1064
|
+
* @abstract
|
|
1055
1065
|
* @template D, R, E
|
|
1056
1066
|
*/
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1067
|
+
/**
|
|
1068
|
+
* @abstract
|
|
1069
|
+
* @template D, R, E
|
|
1070
|
+
*/
|
|
1071
|
+
exports.ɵba = /** @class */ (function (_super) {
|
|
1072
|
+
__extends(Activity, _super);
|
|
1073
|
+
function Activity() {
|
|
1074
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1075
|
+
_this._busyModel = new pectin.DelegatingValueModel().withDefault(false);
|
|
1076
|
+
return _this;
|
|
1077
|
+
}
|
|
1061
1078
|
/**
|
|
1062
1079
|
* @param {?} activityContext
|
|
1063
1080
|
* @return {?}
|
|
1064
1081
|
*/
|
|
1065
|
-
Activity.prototype.initialise =
|
|
1082
|
+
Activity.prototype.initialise = /**
|
|
1083
|
+
* @param {?} activityContext
|
|
1084
|
+
* @return {?}
|
|
1085
|
+
*/
|
|
1086
|
+
function (activityContext) {
|
|
1087
|
+
typescriptUtilities.assert.isNil(this._activityContext);
|
|
1088
|
+
this._activityContext = activityContext;
|
|
1089
|
+
};
|
|
1066
1090
|
/**
|
|
1067
|
-
* @param {
|
|
1091
|
+
* @param {?=} result
|
|
1092
|
+
* @return {?}
|
|
1093
|
+
*/
|
|
1094
|
+
Activity.prototype.done = /**
|
|
1095
|
+
* @param {?=} result
|
|
1096
|
+
* @return {?}
|
|
1097
|
+
*/
|
|
1098
|
+
function (result) {
|
|
1099
|
+
return this._activityContext.onDone(result);
|
|
1100
|
+
};
|
|
1101
|
+
/**
|
|
1102
|
+
* @param {?=} error
|
|
1103
|
+
* @return {?}
|
|
1104
|
+
*/
|
|
1105
|
+
Activity.prototype.cancel = /**
|
|
1106
|
+
* @param {?=} error
|
|
1068
1107
|
* @return {?}
|
|
1069
1108
|
*/
|
|
1070
|
-
|
|
1109
|
+
function (error) {
|
|
1110
|
+
this._activityContext.onCancel(error);
|
|
1111
|
+
};
|
|
1112
|
+
// @Trace()
|
|
1113
|
+
// @Trace()
|
|
1071
1114
|
/**
|
|
1072
|
-
* @param {?} e
|
|
1073
1115
|
* @return {?}
|
|
1074
1116
|
*/
|
|
1075
|
-
Activity.prototype.
|
|
1117
|
+
Activity.prototype.onActivityReady =
|
|
1118
|
+
// @Trace()
|
|
1119
|
+
/**
|
|
1120
|
+
* @return {?}
|
|
1121
|
+
*/
|
|
1122
|
+
function () {
|
|
1123
|
+
};
|
|
1124
|
+
Object.defineProperty(Activity.prototype, "busy", {
|
|
1125
|
+
get: /**
|
|
1126
|
+
* @return {?}
|
|
1127
|
+
*/
|
|
1128
|
+
function () {
|
|
1129
|
+
return this._busyModel.readonly;
|
|
1130
|
+
},
|
|
1131
|
+
enumerable: true,
|
|
1132
|
+
configurable: true
|
|
1133
|
+
});
|
|
1134
|
+
/**
|
|
1135
|
+
* @param {?} busyModel
|
|
1136
|
+
* @return {?}
|
|
1137
|
+
*/
|
|
1138
|
+
Activity.prototype.busyWhile = /**
|
|
1139
|
+
* @param {?} busyModel
|
|
1140
|
+
* @return {?}
|
|
1141
|
+
*/
|
|
1142
|
+
function (busyModel) {
|
|
1143
|
+
this._busyModel.setDelegate(busyModel);
|
|
1144
|
+
};
|
|
1145
|
+
/**
|
|
1146
|
+
* @return {?}
|
|
1147
|
+
*/
|
|
1148
|
+
Activity.prototype.isBusy = /**
|
|
1149
|
+
* @return {?}
|
|
1150
|
+
*/
|
|
1151
|
+
function () {
|
|
1152
|
+
return this._busyModel.value;
|
|
1153
|
+
};
|
|
1154
|
+
return Activity;
|
|
1155
|
+
}(pectin.GarbageCollector));
|
|
1156
|
+
if (false) {
|
|
1157
|
+
/**
|
|
1158
|
+
* @type {?}
|
|
1159
|
+
* @private
|
|
1160
|
+
*/
|
|
1161
|
+
exports.ɵba.prototype._busyModel;
|
|
1162
|
+
/**
|
|
1163
|
+
* @type {?}
|
|
1164
|
+
* @private
|
|
1165
|
+
*/
|
|
1166
|
+
exports.ɵba.prototype._activityContext;
|
|
1076
1167
|
}
|
|
1168
|
+
(function (Activity) {
|
|
1169
|
+
/**
|
|
1170
|
+
* @record
|
|
1171
|
+
* @template R, E
|
|
1172
|
+
*/
|
|
1173
|
+
function Callbacks() { }
|
|
1174
|
+
Activity.Callbacks = Callbacks;
|
|
1175
|
+
if (false) {
|
|
1176
|
+
/** @type {?} */
|
|
1177
|
+
Callbacks.prototype.onDone;
|
|
1178
|
+
/** @type {?} */
|
|
1179
|
+
Callbacks.prototype.onCancel;
|
|
1180
|
+
}
|
|
1181
|
+
})(exports.ɵba || (exports.ɵba = {}));
|
|
1077
1182
|
|
|
1078
1183
|
/**
|
|
1079
1184
|
* @fileoverview added by tsickle
|
|
@@ -1094,11 +1199,19 @@
|
|
|
1094
1199
|
this.injector = injector;
|
|
1095
1200
|
}
|
|
1096
1201
|
Object.defineProperty(ActivityOutletComponent.prototype, "activityContext", {
|
|
1202
|
+
get: /**
|
|
1203
|
+
* @return {?}
|
|
1204
|
+
*/
|
|
1205
|
+
function () {
|
|
1206
|
+
return this._activityContext;
|
|
1207
|
+
},
|
|
1097
1208
|
set: /**
|
|
1098
1209
|
* @param {?} activityContext
|
|
1099
1210
|
* @return {?}
|
|
1100
1211
|
*/
|
|
1101
1212
|
function (activityContext) {
|
|
1213
|
+
pectin.assert.isNil(this._activityContext);
|
|
1214
|
+
this._activityContext = activityContext;
|
|
1102
1215
|
this.loadActivity(activityContext);
|
|
1103
1216
|
},
|
|
1104
1217
|
enumerable: true,
|
|
@@ -1127,7 +1240,7 @@
|
|
|
1127
1240
|
providers: [
|
|
1128
1241
|
{
|
|
1129
1242
|
provide: InteractionContext,
|
|
1130
|
-
useValue: this
|
|
1243
|
+
useValue: this.interactionContext
|
|
1131
1244
|
},
|
|
1132
1245
|
{ provide: ACTIVITY_DATA, useValue: activityContext.activityData }
|
|
1133
1246
|
],
|
|
@@ -1138,6 +1251,9 @@
|
|
|
1138
1251
|
this.viewContainerRef.clear();
|
|
1139
1252
|
this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
|
|
1140
1253
|
this.activityComponentRef.instance.initialise(activityContext);
|
|
1254
|
+
if (this.activityContext.componentReady) {
|
|
1255
|
+
this.activityContext.componentReady(this.component);
|
|
1256
|
+
}
|
|
1141
1257
|
};
|
|
1142
1258
|
Object.defineProperty(ActivityOutletComponent.prototype, "component", {
|
|
1143
1259
|
get: /**
|
|
@@ -1149,71 +1265,6 @@
|
|
|
1149
1265
|
enumerable: true,
|
|
1150
1266
|
configurable: true
|
|
1151
1267
|
});
|
|
1152
|
-
/**
|
|
1153
|
-
* @param {?} alert
|
|
1154
|
-
* @return {?}
|
|
1155
|
-
*/
|
|
1156
|
-
ActivityOutletComponent.prototype.alert = /**
|
|
1157
|
-
* @param {?} alert
|
|
1158
|
-
* @return {?}
|
|
1159
|
-
*/
|
|
1160
|
-
function (alert) {
|
|
1161
|
-
return this.interactionContext.alert(alert);
|
|
1162
|
-
};
|
|
1163
|
-
/**
|
|
1164
|
-
* @param {?} confirm
|
|
1165
|
-
* @return {?}
|
|
1166
|
-
*/
|
|
1167
|
-
ActivityOutletComponent.prototype.confirm = /**
|
|
1168
|
-
* @param {?} confirm
|
|
1169
|
-
* @return {?}
|
|
1170
|
-
*/
|
|
1171
|
-
function (confirm) {
|
|
1172
|
-
return this.interactionContext.confirm(confirm);
|
|
1173
|
-
};
|
|
1174
|
-
/**
|
|
1175
|
-
* @template D1, R1, E1
|
|
1176
|
-
* @param {?} confirm
|
|
1177
|
-
* @param {?} activityType
|
|
1178
|
-
* @param {?=} data
|
|
1179
|
-
* @return {?}
|
|
1180
|
-
*/
|
|
1181
|
-
ActivityOutletComponent.prototype.confirmThen = /**
|
|
1182
|
-
* @template D1, R1, E1
|
|
1183
|
-
* @param {?} confirm
|
|
1184
|
-
* @param {?} activityType
|
|
1185
|
-
* @param {?=} data
|
|
1186
|
-
* @return {?}
|
|
1187
|
-
*/
|
|
1188
|
-
function (confirm, activityType, data) {
|
|
1189
|
-
return this.interactionContext.confirmThen(confirm, activityType, data);
|
|
1190
|
-
};
|
|
1191
|
-
/**
|
|
1192
|
-
* @template D1, R1, E1
|
|
1193
|
-
* @param {?} activityType
|
|
1194
|
-
* @param {?=} data
|
|
1195
|
-
* @return {?}
|
|
1196
|
-
*/
|
|
1197
|
-
ActivityOutletComponent.prototype.startActivity = /**
|
|
1198
|
-
* @template D1, R1, E1
|
|
1199
|
-
* @param {?} activityType
|
|
1200
|
-
* @param {?=} data
|
|
1201
|
-
* @return {?}
|
|
1202
|
-
*/
|
|
1203
|
-
function (activityType, data) {
|
|
1204
|
-
return this.interactionContext.startActivity(activityType, data);
|
|
1205
|
-
};
|
|
1206
|
-
/**
|
|
1207
|
-
* @return {?}
|
|
1208
|
-
*/
|
|
1209
|
-
ActivityOutletComponent.prototype.notifyReady = /**
|
|
1210
|
-
* @return {?}
|
|
1211
|
-
*/
|
|
1212
|
-
function () {
|
|
1213
|
-
if (this.activityComponentRef.instance['onActivityReady']) {
|
|
1214
|
-
this.activityComponentRef.instance['onActivityReady']();
|
|
1215
|
-
}
|
|
1216
|
-
};
|
|
1217
1268
|
ActivityOutletComponent.decorators = [
|
|
1218
1269
|
{ type: core.Component, args: [{
|
|
1219
1270
|
selector: 'angular-ui-powerups-activity-outlet',
|
|
@@ -1236,6 +1287,11 @@
|
|
|
1236
1287
|
if (false) {
|
|
1237
1288
|
/** @type {?} */
|
|
1238
1289
|
ActivityOutletComponent.prototype.interactionContext;
|
|
1290
|
+
/**
|
|
1291
|
+
* @type {?}
|
|
1292
|
+
* @private
|
|
1293
|
+
*/
|
|
1294
|
+
ActivityOutletComponent.prototype._activityContext;
|
|
1239
1295
|
/**
|
|
1240
1296
|
* @type {?}
|
|
1241
1297
|
* @private
|
|
@@ -1264,108 +1320,22 @@
|
|
|
1264
1320
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1265
1321
|
*/
|
|
1266
1322
|
/**
|
|
1323
|
+
* Deprecated. You can now extend the Activity class directly.
|
|
1324
|
+
* @abstract
|
|
1267
1325
|
* @template D, R, E
|
|
1268
1326
|
*/
|
|
1269
1327
|
var /**
|
|
1328
|
+
* Deprecated. You can now extend the Activity class directly.
|
|
1329
|
+
* @abstract
|
|
1270
1330
|
* @template D, R, E
|
|
1271
1331
|
*/
|
|
1272
1332
|
AbstractActivity = /** @class */ (function (_super) {
|
|
1273
1333
|
__extends(AbstractActivity, _super);
|
|
1274
1334
|
function AbstractActivity() {
|
|
1275
|
-
|
|
1276
|
-
_this._busyModel = new pectin.DelegatingValueModel().withDefault(false);
|
|
1277
|
-
return _this;
|
|
1335
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1278
1336
|
}
|
|
1279
|
-
/**
|
|
1280
|
-
* @param {?} activityContext
|
|
1281
|
-
* @return {?}
|
|
1282
|
-
*/
|
|
1283
|
-
AbstractActivity.prototype.initialise = /**
|
|
1284
|
-
* @param {?} activityContext
|
|
1285
|
-
* @return {?}
|
|
1286
|
-
*/
|
|
1287
|
-
function (activityContext) {
|
|
1288
|
-
typescriptUtilities.assert.isNil(this.activityContext);
|
|
1289
|
-
this.activityContext = activityContext;
|
|
1290
|
-
};
|
|
1291
|
-
/**
|
|
1292
|
-
* @param {?=} result
|
|
1293
|
-
* @return {?}
|
|
1294
|
-
*/
|
|
1295
|
-
AbstractActivity.prototype.done = /**
|
|
1296
|
-
* @param {?=} result
|
|
1297
|
-
* @return {?}
|
|
1298
|
-
*/
|
|
1299
|
-
function (result) {
|
|
1300
|
-
return this.activityContext.onDone(result);
|
|
1301
|
-
};
|
|
1302
|
-
/**
|
|
1303
|
-
* @param {?=} error
|
|
1304
|
-
* @return {?}
|
|
1305
|
-
*/
|
|
1306
|
-
AbstractActivity.prototype.cancel = /**
|
|
1307
|
-
* @param {?=} error
|
|
1308
|
-
* @return {?}
|
|
1309
|
-
*/
|
|
1310
|
-
function (error) {
|
|
1311
|
-
this.activityContext.onCancel(error);
|
|
1312
|
-
};
|
|
1313
|
-
// @Trace()
|
|
1314
|
-
// @Trace()
|
|
1315
|
-
/**
|
|
1316
|
-
* @return {?}
|
|
1317
|
-
*/
|
|
1318
|
-
AbstractActivity.prototype.onActivityReady =
|
|
1319
|
-
// @Trace()
|
|
1320
|
-
/**
|
|
1321
|
-
* @return {?}
|
|
1322
|
-
*/
|
|
1323
|
-
function () {
|
|
1324
|
-
};
|
|
1325
|
-
Object.defineProperty(AbstractActivity.prototype, "busy", {
|
|
1326
|
-
get: /**
|
|
1327
|
-
* @return {?}
|
|
1328
|
-
*/
|
|
1329
|
-
function () {
|
|
1330
|
-
return this._busyModel.readonly;
|
|
1331
|
-
},
|
|
1332
|
-
enumerable: true,
|
|
1333
|
-
configurable: true
|
|
1334
|
-
});
|
|
1335
|
-
/**
|
|
1336
|
-
* @param {?} busyModel
|
|
1337
|
-
* @return {?}
|
|
1338
|
-
*/
|
|
1339
|
-
AbstractActivity.prototype.busyWhile = /**
|
|
1340
|
-
* @param {?} busyModel
|
|
1341
|
-
* @return {?}
|
|
1342
|
-
*/
|
|
1343
|
-
function (busyModel) {
|
|
1344
|
-
this._busyModel.setDelegate(busyModel);
|
|
1345
|
-
};
|
|
1346
|
-
/**
|
|
1347
|
-
* @return {?}
|
|
1348
|
-
*/
|
|
1349
|
-
AbstractActivity.prototype.isBusy = /**
|
|
1350
|
-
* @return {?}
|
|
1351
|
-
*/
|
|
1352
|
-
function () {
|
|
1353
|
-
return this._busyModel.value;
|
|
1354
|
-
};
|
|
1355
1337
|
return AbstractActivity;
|
|
1356
|
-
}(
|
|
1357
|
-
if (false) {
|
|
1358
|
-
/**
|
|
1359
|
-
* @type {?}
|
|
1360
|
-
* @private
|
|
1361
|
-
*/
|
|
1362
|
-
AbstractActivity.prototype._busyModel;
|
|
1363
|
-
/**
|
|
1364
|
-
* @type {?}
|
|
1365
|
-
* @private
|
|
1366
|
-
*/
|
|
1367
|
-
AbstractActivity.prototype.activityContext;
|
|
1368
|
-
}
|
|
1338
|
+
}(exports.ɵba));
|
|
1369
1339
|
|
|
1370
1340
|
/**
|
|
1371
1341
|
* @fileoverview added by tsickle
|
|
@@ -1411,7 +1381,7 @@
|
|
|
1411
1381
|
/**
|
|
1412
1382
|
* @template D, R, E
|
|
1413
1383
|
*/
|
|
1414
|
-
exports.ɵ
|
|
1384
|
+
exports.ɵbc = /** @class */ (function (_super) {
|
|
1415
1385
|
__extends(ConfirmThenDialogComponent, _super);
|
|
1416
1386
|
function ConfirmThenDialogComponent(config, interactionContext) {
|
|
1417
1387
|
var _this = _super.call(this) || this;
|
|
@@ -1483,9 +1453,9 @@
|
|
|
1483
1453
|
}(AbstractActivity));
|
|
1484
1454
|
if (false) {
|
|
1485
1455
|
/** @type {?} */
|
|
1486
|
-
exports.ɵ
|
|
1456
|
+
exports.ɵbc.prototype.config;
|
|
1487
1457
|
/** @type {?} */
|
|
1488
|
-
exports.ɵ
|
|
1458
|
+
exports.ɵbc.prototype.interactionContext;
|
|
1489
1459
|
}
|
|
1490
1460
|
(function (ConfirmThenDialogComponent) {
|
|
1491
1461
|
/**
|
|
@@ -1502,7 +1472,7 @@
|
|
|
1502
1472
|
/** @type {?} */
|
|
1503
1473
|
Data.prototype.data;
|
|
1504
1474
|
}
|
|
1505
|
-
})(exports.ɵ
|
|
1475
|
+
})(exports.ɵbc || (exports.ɵbc = {}));
|
|
1506
1476
|
|
|
1507
1477
|
/**
|
|
1508
1478
|
* @fileoverview added by tsickle
|
|
@@ -1555,16 +1525,174 @@
|
|
|
1555
1525
|
* @fileoverview added by tsickle
|
|
1556
1526
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1557
1527
|
*/
|
|
1558
|
-
|
|
1528
|
+
/**
|
|
1529
|
+
* Note: this class is mutable and is stored in a list model. This is normally a big no no but
|
|
1530
|
+
* we're manually deriving other models from the list after view state changes. I.e. we not
|
|
1531
|
+
* using pectin chains on any of the mutable fields.
|
|
1532
|
+
* @template D, R, E
|
|
1533
|
+
*/
|
|
1534
|
+
var /**
|
|
1535
|
+
* Note: this class is mutable and is stored in a list model. This is normally a big no no but
|
|
1536
|
+
* we're manually deriving other models from the list after view state changes. I.e. we not
|
|
1537
|
+
* using pectin chains on any of the mutable fields.
|
|
1538
|
+
* @template D, R, E
|
|
1539
|
+
*/
|
|
1540
|
+
TabContext = /** @class */ (function () {
|
|
1541
|
+
function TabContext(activityData, activityClass, interactionContext, activityCallbacks) {
|
|
1542
|
+
this.activityData = activityData;
|
|
1543
|
+
this.activityClass = activityClass;
|
|
1544
|
+
this.interactionContext = interactionContext;
|
|
1545
|
+
this.activityCallbacks = activityCallbacks;
|
|
1546
|
+
this._complete = false;
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* @return {?}
|
|
1550
|
+
*/
|
|
1551
|
+
TabContext.prototype.isComponentRealised = /**
|
|
1552
|
+
* @return {?}
|
|
1553
|
+
*/
|
|
1554
|
+
function () {
|
|
1555
|
+
return !!this._component;
|
|
1556
|
+
};
|
|
1557
|
+
/**
|
|
1558
|
+
* @return {?}
|
|
1559
|
+
*/
|
|
1560
|
+
TabContext.prototype.isComplete = /**
|
|
1561
|
+
* @return {?}
|
|
1562
|
+
*/
|
|
1563
|
+
function () {
|
|
1564
|
+
return this._complete;
|
|
1565
|
+
};
|
|
1566
|
+
/**
|
|
1567
|
+
* @param {?} component
|
|
1568
|
+
* @return {?}
|
|
1569
|
+
*/
|
|
1570
|
+
TabContext.prototype.componentReady = /**
|
|
1571
|
+
* @param {?} component
|
|
1572
|
+
* @return {?}
|
|
1573
|
+
*/
|
|
1574
|
+
function (component) {
|
|
1575
|
+
pectin.assert.isNil(this._component);
|
|
1576
|
+
this._component = component;
|
|
1577
|
+
};
|
|
1578
|
+
Object.defineProperty(TabContext.prototype, "component", {
|
|
1579
|
+
get: /**
|
|
1580
|
+
* @return {?}
|
|
1581
|
+
*/
|
|
1582
|
+
function () {
|
|
1583
|
+
return this._component;
|
|
1584
|
+
},
|
|
1585
|
+
enumerable: true,
|
|
1586
|
+
configurable: true
|
|
1587
|
+
});
|
|
1588
|
+
// @Trace()
|
|
1589
|
+
// @Trace()
|
|
1590
|
+
/**
|
|
1591
|
+
* @param {?} result
|
|
1592
|
+
* @return {?}
|
|
1593
|
+
*/
|
|
1594
|
+
TabContext.prototype.onDone =
|
|
1595
|
+
// @Trace()
|
|
1596
|
+
/**
|
|
1597
|
+
* @param {?} result
|
|
1598
|
+
* @return {?}
|
|
1599
|
+
*/
|
|
1600
|
+
function (result) {
|
|
1601
|
+
this._complete = true;
|
|
1602
|
+
this.activityCallbacks.onDone(result);
|
|
1603
|
+
};
|
|
1604
|
+
// @Trace()
|
|
1605
|
+
// @Trace()
|
|
1606
|
+
/**
|
|
1607
|
+
* @param {?} error
|
|
1608
|
+
* @return {?}
|
|
1609
|
+
*/
|
|
1610
|
+
TabContext.prototype.onCancel =
|
|
1611
|
+
// @Trace()
|
|
1612
|
+
/**
|
|
1613
|
+
* @param {?} error
|
|
1614
|
+
* @return {?}
|
|
1615
|
+
*/
|
|
1616
|
+
function (error) {
|
|
1617
|
+
this._complete = true;
|
|
1618
|
+
this.activityCallbacks.onCancel(error);
|
|
1619
|
+
};
|
|
1620
|
+
return TabContext;
|
|
1621
|
+
}());
|
|
1622
|
+
if (false) {
|
|
1623
|
+
/**
|
|
1624
|
+
* @type {?}
|
|
1625
|
+
* @private
|
|
1626
|
+
*/
|
|
1627
|
+
TabContext.prototype._complete;
|
|
1628
|
+
/**
|
|
1629
|
+
* @type {?}
|
|
1630
|
+
* @private
|
|
1631
|
+
*/
|
|
1632
|
+
TabContext.prototype._component;
|
|
1633
|
+
/** @type {?} */
|
|
1634
|
+
TabContext.prototype.activityData;
|
|
1635
|
+
/** @type {?} */
|
|
1636
|
+
TabContext.prototype.activityClass;
|
|
1637
|
+
/** @type {?} */
|
|
1638
|
+
TabContext.prototype.interactionContext;
|
|
1639
|
+
/** @type {?} */
|
|
1640
|
+
TabContext.prototype.activityCallbacks;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* @template D, R, E
|
|
1644
|
+
*/
|
|
1645
|
+
var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
1559
1646
|
__extends(ActivityContainerComponent, _super);
|
|
1560
1647
|
function ActivityContainerComponent() {
|
|
1561
1648
|
var _this = _super.call(this) || this;
|
|
1562
|
-
_this.
|
|
1563
|
-
_this.
|
|
1649
|
+
_this.activityFinishedEvents = new pectin.MutableStream();
|
|
1650
|
+
_this.activityTabs = new pectin.MutableListModel();
|
|
1564
1651
|
_this.finished = false;
|
|
1565
1652
|
_this._activityList = new pectin.MutableListModel();
|
|
1653
|
+
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;
|
|
1654
|
+
chain(_this.activityFinishedEvents).throttle(50).subscribe((/**
|
|
1655
|
+
* @return {?}
|
|
1656
|
+
*/
|
|
1657
|
+
function () { return _this.onActivityFinished(); }));
|
|
1566
1658
|
return _this;
|
|
1567
1659
|
}
|
|
1660
|
+
Object.defineProperty(ActivityContainerComponent.prototype, "initialActivityOutletContext", {
|
|
1661
|
+
get: /**
|
|
1662
|
+
* @return {?}
|
|
1663
|
+
*/
|
|
1664
|
+
function () {
|
|
1665
|
+
return this.activityTabs.length > 0 ? this.activityTabs.value[0] : null;
|
|
1666
|
+
},
|
|
1667
|
+
set: /**
|
|
1668
|
+
* @param {?} initialContext
|
|
1669
|
+
* @return {?}
|
|
1670
|
+
*/
|
|
1671
|
+
function (initialContext) {
|
|
1672
|
+
var _this = this;
|
|
1673
|
+
pectin.assert.isNil(this.initialActivityOutletContext);
|
|
1674
|
+
this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
|
|
1675
|
+
onDone: (/**
|
|
1676
|
+
* @param {?} result
|
|
1677
|
+
* @return {?}
|
|
1678
|
+
*/
|
|
1679
|
+
function (result) {
|
|
1680
|
+
_this.finished = true;
|
|
1681
|
+
return initialContext.onDone(result);
|
|
1682
|
+
}),
|
|
1683
|
+
onCancel: (/**
|
|
1684
|
+
* @param {?} error
|
|
1685
|
+
* @return {?}
|
|
1686
|
+
*/
|
|
1687
|
+
function (error) {
|
|
1688
|
+
_this.finished = true;
|
|
1689
|
+
return initialContext.onCancel(error);
|
|
1690
|
+
})
|
|
1691
|
+
}));
|
|
1692
|
+
},
|
|
1693
|
+
enumerable: true,
|
|
1694
|
+
configurable: true
|
|
1695
|
+
});
|
|
1568
1696
|
/**
|
|
1569
1697
|
* @return {?}
|
|
1570
1698
|
*/
|
|
@@ -1600,94 +1728,28 @@
|
|
|
1600
1728
|
*/
|
|
1601
1729
|
function () {
|
|
1602
1730
|
var _this = this;
|
|
1603
|
-
var
|
|
1604
|
-
|
|
1605
|
-
* @param {?} c
|
|
1731
|
+
var _a = pectin.Dsl.disposeWith(this), chain = _a.chain, observe = _a.observe;
|
|
1732
|
+
observe.valuesFrom(this.outlets.changes).subscribe((/**
|
|
1606
1733
|
* @return {?}
|
|
1607
1734
|
*/
|
|
1608
|
-
function (
|
|
1609
|
-
observe.valuesFrom(this.outlets.changes).subscribe((/**
|
|
1610
|
-
* @param {?} change
|
|
1735
|
+
function () { return setTimeout((/**
|
|
1611
1736
|
* @return {?}
|
|
1612
1737
|
*/
|
|
1613
|
-
function (
|
|
1614
|
-
_this.safelyUpdateActivityList(change.map((/**
|
|
1615
|
-
* @param {?} c
|
|
1616
|
-
* @return {?}
|
|
1617
|
-
*/
|
|
1618
|
-
function (c) { return c.component; })));
|
|
1619
|
-
}));
|
|
1738
|
+
function () { return _this.updateActivityList(); })); }));
|
|
1620
1739
|
observe.valuesFrom(this.tabs.animationDone).subscribe((/**
|
|
1621
1740
|
* @return {?}
|
|
1622
1741
|
*/
|
|
1623
1742
|
function () { return _this.onAnimationFinished(); }));
|
|
1743
|
+
this.updateActivityList();
|
|
1624
1744
|
};
|
|
1625
1745
|
/**
|
|
1626
|
-
*
|
|
1627
|
-
* @param activities
|
|
1628
|
-
*/
|
|
1629
|
-
/**
|
|
1630
|
-
* Update in the next tick to avoid changing state in the current change detection cycle.
|
|
1631
|
-
* @private
|
|
1632
|
-
* @param {?} activities
|
|
1633
|
-
* @return {?}
|
|
1634
|
-
*/
|
|
1635
|
-
ActivityContainerComponent.prototype.safelyUpdateActivityList = /**
|
|
1636
|
-
* Update in the next tick to avoid changing state in the current change detection cycle.
|
|
1637
|
-
* @private
|
|
1638
|
-
* @param {?} activities
|
|
1639
|
-
* @return {?}
|
|
1640
|
-
*/
|
|
1641
|
-
function (activities) {
|
|
1642
|
-
var _this = this;
|
|
1643
|
-
setTimeout((/**
|
|
1644
|
-
* @return {?}
|
|
1645
|
-
*/
|
|
1646
|
-
function () { return _this._activityList.value = activities; }));
|
|
1647
|
-
};
|
|
1648
|
-
/**
|
|
1649
|
-
* @template D, R, E
|
|
1650
|
-
* @param {?} initialContext
|
|
1651
|
-
* @return {?}
|
|
1652
|
-
*/
|
|
1653
|
-
ActivityContainerComponent.prototype.initialise = /**
|
|
1654
|
-
* @template D, R, E
|
|
1655
|
-
* @param {?} initialContext
|
|
1656
|
-
* @return {?}
|
|
1657
|
-
*/
|
|
1658
|
-
function (initialContext) {
|
|
1659
|
-
/** @type {?} */
|
|
1660
|
-
var self = this;
|
|
1661
|
-
this.initialActivityOutletContext = {
|
|
1662
|
-
activityClass: initialContext.activityClass,
|
|
1663
|
-
activityData: initialContext.activityData,
|
|
1664
|
-
onDone: (/**
|
|
1665
|
-
* @param {?} result
|
|
1666
|
-
* @return {?}
|
|
1667
|
-
*/
|
|
1668
|
-
function (result) {
|
|
1669
|
-
self.finished = true;
|
|
1670
|
-
return initialContext.onDone(result);
|
|
1671
|
-
}),
|
|
1672
|
-
onCancel: (/**
|
|
1673
|
-
* @param {?} error
|
|
1674
|
-
* @return {?}
|
|
1675
|
-
*/
|
|
1676
|
-
function (error) {
|
|
1677
|
-
self.finished = true;
|
|
1678
|
-
return initialContext.onCancel(error);
|
|
1679
|
-
}),
|
|
1680
|
-
interactionContext: this
|
|
1681
|
-
};
|
|
1682
|
-
};
|
|
1683
|
-
/**
|
|
1684
|
-
* @template D, R, E
|
|
1746
|
+
* @template D1, R1, E1
|
|
1685
1747
|
* @param {?} activityType
|
|
1686
1748
|
* @param {?=} data
|
|
1687
1749
|
* @return {?}
|
|
1688
1750
|
*/
|
|
1689
1751
|
ActivityContainerComponent.prototype.startActivity = /**
|
|
1690
|
-
* @template
|
|
1752
|
+
* @template D1, R1, E1
|
|
1691
1753
|
* @param {?} activityType
|
|
1692
1754
|
* @param {?=} data
|
|
1693
1755
|
* @return {?}
|
|
@@ -1703,41 +1765,26 @@
|
|
|
1703
1765
|
*/
|
|
1704
1766
|
function (resolve, reject) {
|
|
1705
1767
|
/** @type {?} */
|
|
1706
|
-
var context = {
|
|
1707
|
-
interactionContext: self,
|
|
1708
|
-
activityClass: activityType,
|
|
1709
|
-
activityData: data,
|
|
1768
|
+
var context = new TabContext(data, activityType, self, {
|
|
1710
1769
|
onDone: (/**
|
|
1711
1770
|
* @param {?} result
|
|
1712
1771
|
* @return {?}
|
|
1713
1772
|
*/
|
|
1714
1773
|
function (result) {
|
|
1715
|
-
self.obsoleteTabs.push(context);
|
|
1716
|
-
// animating on the next tick gives chained done's a chance to
|
|
1717
|
-
// finished before we start an animations
|
|
1718
1774
|
resolve(result);
|
|
1719
|
-
|
|
1720
|
-
* @return {?}
|
|
1721
|
-
*/
|
|
1722
|
-
function () { return self.animateTabs(); }));
|
|
1775
|
+
self.activityFinishedEvents.publish({});
|
|
1723
1776
|
}),
|
|
1724
1777
|
onCancel: (/**
|
|
1725
1778
|
* @param {?} error
|
|
1726
1779
|
* @return {?}
|
|
1727
1780
|
*/
|
|
1728
1781
|
function (error) {
|
|
1729
|
-
self.obsoleteTabs.push(context);
|
|
1730
|
-
// finished before we start an animations
|
|
1731
1782
|
reject(error);
|
|
1732
|
-
|
|
1733
|
-
setTimeout((/**
|
|
1734
|
-
* @return {?}
|
|
1735
|
-
*/
|
|
1736
|
-
function () { return self.animateTabs(); }));
|
|
1783
|
+
self.activityFinishedEvents.publish({});
|
|
1737
1784
|
})
|
|
1738
|
-
};
|
|
1739
|
-
self.
|
|
1740
|
-
self.tabs.selectedIndex = _this.
|
|
1785
|
+
});
|
|
1786
|
+
self.activityTabs.push(context);
|
|
1787
|
+
self.tabs.selectedIndex = _this.activityTabs.length;
|
|
1741
1788
|
}));
|
|
1742
1789
|
};
|
|
1743
1790
|
/**
|
|
@@ -1763,63 +1810,151 @@
|
|
|
1763
1810
|
return this.startActivity(ConfirmationDialogComponent, confirm);
|
|
1764
1811
|
};
|
|
1765
1812
|
/**
|
|
1766
|
-
* @template
|
|
1767
|
-
* @param {?} confirm
|
|
1768
|
-
* @param {?} activityType
|
|
1769
|
-
* @param {?=} data
|
|
1813
|
+
* @template D1, R1, E1
|
|
1814
|
+
* @param {?} confirm
|
|
1815
|
+
* @param {?} activityType
|
|
1816
|
+
* @param {?=} data
|
|
1817
|
+
* @return {?}
|
|
1818
|
+
*/
|
|
1819
|
+
ActivityContainerComponent.prototype.confirmThen = /**
|
|
1820
|
+
* @template D1, R1, E1
|
|
1821
|
+
* @param {?} confirm
|
|
1822
|
+
* @param {?} activityType
|
|
1823
|
+
* @param {?=} data
|
|
1824
|
+
* @return {?}
|
|
1825
|
+
*/
|
|
1826
|
+
function (confirm, activityType, data) {
|
|
1827
|
+
return this.startActivity(exports.ɵbc, {
|
|
1828
|
+
confirm: confirm,
|
|
1829
|
+
activityType: activityType,
|
|
1830
|
+
data: data
|
|
1831
|
+
});
|
|
1832
|
+
};
|
|
1833
|
+
// @Trace()
|
|
1834
|
+
// @Trace()
|
|
1835
|
+
/**
|
|
1836
|
+
* @private
|
|
1837
|
+
* @return {?}
|
|
1838
|
+
*/
|
|
1839
|
+
ActivityContainerComponent.prototype.onActivityFinished =
|
|
1840
|
+
// @Trace()
|
|
1841
|
+
/**
|
|
1842
|
+
* @private
|
|
1843
|
+
* @return {?}
|
|
1844
|
+
*/
|
|
1845
|
+
function () {
|
|
1846
|
+
// don't do anything if job already queued up.
|
|
1847
|
+
if (!this.finished) {
|
|
1848
|
+
if (this.synchroniseSelectedTabIndex()) {
|
|
1849
|
+
this.cleanupStaleActivities();
|
|
1850
|
+
}
|
|
1851
|
+
this.updateActivityList();
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
// @Trace()
|
|
1855
|
+
// @Trace()
|
|
1856
|
+
/**
|
|
1857
|
+
* @private
|
|
1858
|
+
* @return {?}
|
|
1859
|
+
*/
|
|
1860
|
+
ActivityContainerComponent.prototype.cleanupStaleActivities =
|
|
1861
|
+
// @Trace()
|
|
1862
|
+
/**
|
|
1863
|
+
* @private
|
|
1864
|
+
* @return {?}
|
|
1865
|
+
*/
|
|
1866
|
+
function () {
|
|
1867
|
+
var _this = this;
|
|
1868
|
+
// clean up old tabs
|
|
1869
|
+
if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
|
|
1870
|
+
this.activityTabs.runInTransaction((/**
|
|
1871
|
+
* @param {?} draft
|
|
1872
|
+
* @return {?}
|
|
1873
|
+
*/
|
|
1874
|
+
function (draft) {
|
|
1875
|
+
draft.value = draft.value.slice(0, 1 + _this.tabs.selectedIndex);
|
|
1876
|
+
}));
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
/**
|
|
1880
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1881
|
+
*/
|
|
1882
|
+
// @Trace()
|
|
1883
|
+
/**
|
|
1884
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1885
|
+
* @private
|
|
1886
|
+
* @return {?}
|
|
1887
|
+
*/
|
|
1888
|
+
// @Trace()
|
|
1889
|
+
ActivityContainerComponent.prototype.synchroniseSelectedTabIndex = /**
|
|
1890
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1891
|
+
* @private
|
|
1892
|
+
* @return {?}
|
|
1893
|
+
*/
|
|
1894
|
+
// @Trace()
|
|
1895
|
+
function () {
|
|
1896
|
+
/** @type {?} */
|
|
1897
|
+
var previousIndex = this.tabs.selectedIndex;
|
|
1898
|
+
/** @type {?} */
|
|
1899
|
+
var newIndex = this.activityTabs.query().findIndex((/**
|
|
1900
|
+
* @param {?} t
|
|
1901
|
+
* @return {?}
|
|
1902
|
+
*/
|
|
1903
|
+
function (t) { return t.isComplete(); })) - 1;
|
|
1904
|
+
this.tabs.selectedIndex = newIndex;
|
|
1905
|
+
return previousIndex === newIndex;
|
|
1906
|
+
};
|
|
1907
|
+
// @Trace()
|
|
1908
|
+
// @Trace()
|
|
1909
|
+
/**
|
|
1910
|
+
* @private
|
|
1770
1911
|
* @return {?}
|
|
1771
1912
|
*/
|
|
1772
|
-
ActivityContainerComponent.prototype.
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
* @
|
|
1776
|
-
* @param {?=} data
|
|
1913
|
+
ActivityContainerComponent.prototype.onAnimationFinished =
|
|
1914
|
+
// @Trace()
|
|
1915
|
+
/**
|
|
1916
|
+
* @private
|
|
1777
1917
|
* @return {?}
|
|
1778
1918
|
*/
|
|
1779
|
-
function (
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
data: data
|
|
1784
|
-
});
|
|
1919
|
+
function () {
|
|
1920
|
+
this.getSelectedOutlet().component.onActivityReady();
|
|
1921
|
+
this.cleanupStaleActivities();
|
|
1922
|
+
this.updateActivityList();
|
|
1785
1923
|
};
|
|
1786
1924
|
/**
|
|
1787
1925
|
* @private
|
|
1788
1926
|
* @return {?}
|
|
1789
1927
|
*/
|
|
1790
|
-
ActivityContainerComponent.prototype.
|
|
1928
|
+
ActivityContainerComponent.prototype.updateActivityList = /**
|
|
1791
1929
|
* @private
|
|
1792
1930
|
* @return {?}
|
|
1793
1931
|
*/
|
|
1794
1932
|
function () {
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
* @param {?} tab
|
|
1933
|
+
this._activityList.value = this.activityTabs.value.filter((/**
|
|
1934
|
+
* @param {?} t
|
|
1798
1935
|
* @return {?}
|
|
1799
1936
|
*/
|
|
1800
|
-
function (
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1937
|
+
function (t) { return !t.isComplete() && t.isComponentRealised(); })).map((/**
|
|
1938
|
+
* @param {?} t
|
|
1939
|
+
* @return {?}
|
|
1940
|
+
*/
|
|
1941
|
+
function (t) { return t.component; }));
|
|
1805
1942
|
};
|
|
1806
1943
|
/**
|
|
1807
1944
|
* @private
|
|
1808
1945
|
* @return {?}
|
|
1809
1946
|
*/
|
|
1810
|
-
ActivityContainerComponent.prototype.
|
|
1947
|
+
ActivityContainerComponent.prototype.getSelectedOutlet = /**
|
|
1811
1948
|
* @private
|
|
1812
1949
|
* @return {?}
|
|
1813
1950
|
*/
|
|
1814
1951
|
function () {
|
|
1815
|
-
|
|
1816
|
-
this.tabs.selectedIndex = this.activityOutletTabs.length - this.obsoleteTabs.length;
|
|
1817
|
-
}
|
|
1952
|
+
return this.outlets.toArray()[this.tabs.selectedIndex];
|
|
1818
1953
|
};
|
|
1819
1954
|
ActivityContainerComponent.decorators = [
|
|
1820
1955
|
{ type: core.Component, args: [{
|
|
1821
1956
|
selector: 'angular-ui-powerups-activity-container',
|
|
1822
|
-
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab
|
|
1957
|
+
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\"\n [activityContext]=\"tab\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
|
|
1823
1958
|
styles: [":host{display:block}"]
|
|
1824
1959
|
}] }
|
|
1825
1960
|
];
|
|
@@ -1832,54 +1967,32 @@
|
|
|
1832
1967
|
outlets: [{ type: core.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
1833
1968
|
};
|
|
1834
1969
|
return ActivityContainerComponent;
|
|
1835
|
-
}(
|
|
1970
|
+
}(InteractionContext));
|
|
1836
1971
|
if (false) {
|
|
1837
|
-
/** @type {?} */
|
|
1838
|
-
exports.ɵu.prototype.parentInteractionContext;
|
|
1839
|
-
/** @type {?} */
|
|
1840
|
-
exports.ɵu.prototype.initialActivityOutletContext;
|
|
1841
|
-
/** @type {?} */
|
|
1842
|
-
exports.ɵu.prototype.currentActivity;
|
|
1843
|
-
/** @type {?} */
|
|
1844
|
-
exports.ɵu.prototype.tabs;
|
|
1845
|
-
/** @type {?} */
|
|
1846
|
-
exports.ɵu.prototype.outlets;
|
|
1847
|
-
/** @type {?} */
|
|
1848
|
-
exports.ɵu.prototype.activityOutletTabs;
|
|
1849
1972
|
/**
|
|
1850
1973
|
* @type {?}
|
|
1851
1974
|
* @private
|
|
1852
1975
|
*/
|
|
1853
|
-
|
|
1976
|
+
ActivityContainerComponent.prototype.activityFinishedEvents;
|
|
1977
|
+
/** @type {?} */
|
|
1978
|
+
ActivityContainerComponent.prototype.parentInteractionContext;
|
|
1979
|
+
/** @type {?} */
|
|
1980
|
+
ActivityContainerComponent.prototype.tabs;
|
|
1981
|
+
/** @type {?} */
|
|
1982
|
+
ActivityContainerComponent.prototype.outlets;
|
|
1983
|
+
/** @type {?} */
|
|
1984
|
+
ActivityContainerComponent.prototype.activityTabs;
|
|
1854
1985
|
/**
|
|
1855
1986
|
* @type {?}
|
|
1856
1987
|
* @private
|
|
1857
1988
|
*/
|
|
1858
|
-
|
|
1989
|
+
ActivityContainerComponent.prototype.finished;
|
|
1859
1990
|
/**
|
|
1860
1991
|
* @type {?}
|
|
1861
1992
|
* @private
|
|
1862
1993
|
*/
|
|
1863
|
-
|
|
1994
|
+
ActivityContainerComponent.prototype._activityList;
|
|
1864
1995
|
}
|
|
1865
|
-
(function (ActivityContainerComponent) {
|
|
1866
|
-
/**
|
|
1867
|
-
* @record
|
|
1868
|
-
* @template D, R, E
|
|
1869
|
-
*/
|
|
1870
|
-
function ActivityContext() { }
|
|
1871
|
-
ActivityContainerComponent.ActivityContext = ActivityContext;
|
|
1872
|
-
if (false) {
|
|
1873
|
-
/** @type {?} */
|
|
1874
|
-
ActivityContext.prototype.activityClass;
|
|
1875
|
-
/** @type {?} */
|
|
1876
|
-
ActivityContext.prototype.activityData;
|
|
1877
|
-
/** @type {?} */
|
|
1878
|
-
ActivityContext.prototype.onDone;
|
|
1879
|
-
/** @type {?} */
|
|
1880
|
-
ActivityContext.prototype.onCancel;
|
|
1881
|
-
}
|
|
1882
|
-
})(exports.ɵu || (exports.ɵu = {}));
|
|
1883
1996
|
|
|
1884
1997
|
/**
|
|
1885
1998
|
* @fileoverview added by tsickle
|
|
@@ -1887,19 +2000,68 @@
|
|
|
1887
2000
|
*/
|
|
1888
2001
|
/** @type {?} */
|
|
1889
2002
|
var DIALOG_INTERACTION_SERVICE_DEFAULTS = new core.InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
|
|
2003
|
+
var Guard = /** @class */ (function (_super) {
|
|
2004
|
+
__extends(Guard, _super);
|
|
2005
|
+
function Guard() {
|
|
2006
|
+
return _super.call(this, { initialValue: false }) || this;
|
|
2007
|
+
}
|
|
2008
|
+
Object.defineProperty(Guard.prototype, "value", {
|
|
2009
|
+
get: /**
|
|
2010
|
+
* @return {?}
|
|
2011
|
+
*/
|
|
2012
|
+
function () {
|
|
2013
|
+
return this.store.read();
|
|
2014
|
+
},
|
|
2015
|
+
enumerable: true,
|
|
2016
|
+
configurable: true
|
|
2017
|
+
});
|
|
2018
|
+
/**
|
|
2019
|
+
* @template R
|
|
2020
|
+
* @param {?} fun
|
|
2021
|
+
* @return {?}
|
|
2022
|
+
*/
|
|
2023
|
+
Guard.prototype.whileTrue = /**
|
|
2024
|
+
* @template R
|
|
2025
|
+
* @param {?} fun
|
|
2026
|
+
* @return {?}
|
|
2027
|
+
*/
|
|
2028
|
+
function (fun) {
|
|
2029
|
+
this.startTransaction().commit(true);
|
|
2030
|
+
try {
|
|
2031
|
+
return fun();
|
|
2032
|
+
}
|
|
2033
|
+
finally {
|
|
2034
|
+
this.startTransaction().commit(false);
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
/**
|
|
2038
|
+
* @template R
|
|
2039
|
+
* @param {?} fun
|
|
2040
|
+
* @param {?=} defaultValue
|
|
2041
|
+
* @return {?}
|
|
2042
|
+
*/
|
|
2043
|
+
Guard.prototype.runIfFalse = /**
|
|
2044
|
+
* @template R
|
|
2045
|
+
* @param {?} fun
|
|
2046
|
+
* @param {?=} defaultValue
|
|
2047
|
+
* @return {?}
|
|
2048
|
+
*/
|
|
2049
|
+
function (fun, defaultValue) {
|
|
2050
|
+
if (defaultValue === void 0) { defaultValue = null; }
|
|
2051
|
+
return !this.value ? fun() : defaultValue;
|
|
2052
|
+
};
|
|
2053
|
+
return Guard;
|
|
2054
|
+
}(pectin.ValueModel));
|
|
1890
2055
|
var DialogInteractionService = /** @class */ (function (_super) {
|
|
1891
2056
|
__extends(DialogInteractionService, _super);
|
|
1892
|
-
function DialogInteractionService(dialogService,
|
|
2057
|
+
function DialogInteractionService(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
|
|
1893
2058
|
var _this = _super.call(this) || this;
|
|
1894
2059
|
_this.dialogService = dialogService;
|
|
1895
|
-
_this.router = router;
|
|
1896
2060
|
_this.dialogServiceDefaults = dialogServiceDefaults;
|
|
1897
2061
|
_this.matDialogDefaultConfig = matDialogDefaultConfig;
|
|
1898
2062
|
_this._activityList = new pectin.DelegatingListModel();
|
|
1899
|
-
_this.
|
|
2063
|
+
_this.startingGuard = new Guard();
|
|
1900
2064
|
typescriptUtilities.assert.notNil(dialogService);
|
|
1901
|
-
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, observe = _a.observe;
|
|
1902
|
-
_this.currentActivity = chain(_this.activityList).last();
|
|
1903
2065
|
return _this;
|
|
1904
2066
|
}
|
|
1905
2067
|
/**
|
|
@@ -1909,7 +2071,7 @@
|
|
|
1909
2071
|
* @return {?}
|
|
1910
2072
|
*/
|
|
1911
2073
|
function () {
|
|
1912
|
-
return this.
|
|
2074
|
+
return !!this.currentActivityId;
|
|
1913
2075
|
};
|
|
1914
2076
|
/**
|
|
1915
2077
|
* @return {?}
|
|
@@ -1918,7 +2080,7 @@
|
|
|
1918
2080
|
* @return {?}
|
|
1919
2081
|
*/
|
|
1920
2082
|
function () {
|
|
1921
|
-
this.currentActivity.
|
|
2083
|
+
this.currentActivity.cancel(null);
|
|
1922
2084
|
};
|
|
1923
2085
|
Object.defineProperty(DialogInteractionService.prototype, "activityList", {
|
|
1924
2086
|
get: /**
|
|
@@ -1971,56 +2133,59 @@
|
|
|
1971
2133
|
*/
|
|
1972
2134
|
function (a) { return a.constructor.name; })).join(', '));
|
|
1973
2135
|
}
|
|
1974
|
-
this.
|
|
1975
|
-
/** @type {?} */
|
|
1976
|
-
var self = this;
|
|
1977
|
-
/** @type {?} */
|
|
1978
|
-
var config = __assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig, this.dialogServiceDefaults, {
|
|
1979
|
-
data: data,
|
|
1980
|
-
disableClose: disableClose,
|
|
1981
|
-
panelClass: 'dialog-interaction-service'
|
|
1982
|
-
});
|
|
1983
|
-
/** @type {?} */
|
|
1984
|
-
var matDialogRef = (/** @type {?} */ (this.dialogService.open(exports.ɵu, config)));
|
|
1985
|
-
return new Promise((/**
|
|
1986
|
-
* @param {?} resolve
|
|
1987
|
-
* @param {?} reject
|
|
2136
|
+
return this.startingGuard.whileTrue((/**
|
|
1988
2137
|
* @return {?}
|
|
1989
2138
|
*/
|
|
1990
|
-
function (
|
|
2139
|
+
function () {
|
|
2140
|
+
_this.currentActivityId = uuid.v1();
|
|
1991
2141
|
/** @type {?} */
|
|
1992
|
-
var
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
onDone: /**
|
|
1999
|
-
* @param {?} result
|
|
2000
|
-
* @return {?}
|
|
2001
|
-
*/
|
|
2002
|
-
function (result) {
|
|
2003
|
-
// TODO: should I be calling resolve after close?
|
|
2004
|
-
resolve(result);
|
|
2005
|
-
matDialogRef.close(result);
|
|
2006
|
-
},
|
|
2007
|
-
onCancel: /**
|
|
2008
|
-
* @param {?} error
|
|
2009
|
-
* @return {?}
|
|
2010
|
-
*/
|
|
2011
|
-
function (error) {
|
|
2012
|
-
// TODO: should I be calling reject after close?
|
|
2013
|
-
reject(error);
|
|
2014
|
-
matDialogRef.close(error);
|
|
2015
|
-
}
|
|
2142
|
+
var self = _this;
|
|
2143
|
+
/** @type {?} */
|
|
2144
|
+
var config = __assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, _this.matDialogDefaultConfig, _this.dialogServiceDefaults, {
|
|
2145
|
+
data: data,
|
|
2146
|
+
disableClose: disableClose,
|
|
2147
|
+
panelClass: 'dialog-interaction-service'
|
|
2016
2148
|
});
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2149
|
+
/** @type {?} */
|
|
2150
|
+
var matDialogRef = (/** @type {?} */ (_this.dialogService.open(ActivityContainerComponent, config)));
|
|
2151
|
+
return new Promise((/**
|
|
2152
|
+
* @param {?} resolve
|
|
2153
|
+
* @param {?} reject
|
|
2154
|
+
* @return {?}
|
|
2155
|
+
*/
|
|
2156
|
+
function (resolve, reject) {
|
|
2157
|
+
/** @type {?} */
|
|
2158
|
+
var activityContainer = matDialogRef.componentInstance;
|
|
2159
|
+
activityContainer.parentInteractionContext = _this;
|
|
2160
|
+
self.safelyUpdateActivityListDelegate(activityContainer.activityList);
|
|
2161
|
+
activityContainer.initialActivityOutletContext = {
|
|
2162
|
+
activityClass: activityType,
|
|
2163
|
+
activityData: data,
|
|
2164
|
+
onDone: /**
|
|
2165
|
+
* @param {?} result
|
|
2166
|
+
* @return {?}
|
|
2167
|
+
*/
|
|
2168
|
+
function (result) {
|
|
2169
|
+
resolve(result);
|
|
2170
|
+
matDialogRef.close(result);
|
|
2171
|
+
},
|
|
2172
|
+
onCancel: /**
|
|
2173
|
+
* @param {?} error
|
|
2174
|
+
* @return {?}
|
|
2175
|
+
*/
|
|
2176
|
+
function (error) {
|
|
2177
|
+
reject(error);
|
|
2178
|
+
matDialogRef.close(error);
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
matDialogRef.updateSize();
|
|
2182
|
+
})).finally((/**
|
|
2183
|
+
* @return {?}
|
|
2184
|
+
*/
|
|
2185
|
+
function () {
|
|
2186
|
+
_this.currentActivityId = null;
|
|
2187
|
+
self.safelyUpdateActivityListDelegate(null);
|
|
2188
|
+
}));
|
|
2024
2189
|
}));
|
|
2025
2190
|
};
|
|
2026
2191
|
/**
|
|
@@ -2081,7 +2246,7 @@
|
|
|
2081
2246
|
* @return {?}
|
|
2082
2247
|
*/
|
|
2083
2248
|
function (confirm, activityType, data) {
|
|
2084
|
-
return this._startActivity(exports.ɵ
|
|
2249
|
+
return this._startActivity(exports.ɵbc, {
|
|
2085
2250
|
confirm: confirm,
|
|
2086
2251
|
activityType: activityType,
|
|
2087
2252
|
data: data
|
|
@@ -2095,16 +2260,13 @@
|
|
|
2095
2260
|
/** @nocollapse */
|
|
2096
2261
|
DialogInteractionService.ctorParameters = function () { return [
|
|
2097
2262
|
{ type: material.MatDialog },
|
|
2098
|
-
{ type: router.Router },
|
|
2099
2263
|
{ type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
|
|
2100
2264
|
{ type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [dialog.MAT_DIALOG_DEFAULT_OPTIONS,] }] }
|
|
2101
2265
|
]; };
|
|
2102
|
-
/** @nocollapse */ DialogInteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(
|
|
2266
|
+
/** @nocollapse */ DialogInteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), core.ɵɵinject(dialog.MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionService, providedIn: "root" });
|
|
2103
2267
|
return DialogInteractionService;
|
|
2104
2268
|
}(InteractionContext));
|
|
2105
2269
|
if (false) {
|
|
2106
|
-
/** @type {?} */
|
|
2107
|
-
DialogInteractionService.prototype.currentActivity;
|
|
2108
2270
|
/**
|
|
2109
2271
|
* @type {?}
|
|
2110
2272
|
* @private
|
|
@@ -2114,17 +2276,17 @@
|
|
|
2114
2276
|
* @type {?}
|
|
2115
2277
|
* @private
|
|
2116
2278
|
*/
|
|
2117
|
-
DialogInteractionService.prototype.
|
|
2279
|
+
DialogInteractionService.prototype.startingGuard;
|
|
2118
2280
|
/**
|
|
2119
2281
|
* @type {?}
|
|
2120
2282
|
* @private
|
|
2121
2283
|
*/
|
|
2122
|
-
DialogInteractionService.prototype.
|
|
2284
|
+
DialogInteractionService.prototype.currentActivityId;
|
|
2123
2285
|
/**
|
|
2124
2286
|
* @type {?}
|
|
2125
2287
|
* @private
|
|
2126
2288
|
*/
|
|
2127
|
-
DialogInteractionService.prototype.
|
|
2289
|
+
DialogInteractionService.prototype.dialogService;
|
|
2128
2290
|
/** @type {?} */
|
|
2129
2291
|
DialogInteractionService.prototype.dialogServiceDefaults;
|
|
2130
2292
|
/** @type {?} */
|
|
@@ -2148,20 +2310,20 @@
|
|
|
2148
2310
|
portal.PortalModule
|
|
2149
2311
|
],
|
|
2150
2312
|
declarations: [
|
|
2151
|
-
|
|
2313
|
+
ActivityContainerComponent,
|
|
2152
2314
|
ConfirmationDialogComponent,
|
|
2153
|
-
exports.ɵ
|
|
2315
|
+
exports.ɵbc,
|
|
2154
2316
|
AlertDialogComponent,
|
|
2155
2317
|
ActivityOutletComponent
|
|
2156
2318
|
],
|
|
2157
2319
|
exports: [
|
|
2158
|
-
|
|
2320
|
+
ActivityContainerComponent,
|
|
2159
2321
|
ActivityOutletComponent,
|
|
2160
2322
|
],
|
|
2161
2323
|
entryComponents: [
|
|
2162
|
-
|
|
2324
|
+
ActivityContainerComponent,
|
|
2163
2325
|
ConfirmationDialogComponent,
|
|
2164
|
-
exports.ɵ
|
|
2326
|
+
exports.ɵbc,
|
|
2165
2327
|
AlertDialogComponent
|
|
2166
2328
|
],
|
|
2167
2329
|
providers: [
|
|
@@ -2714,10 +2876,92 @@
|
|
|
2714
2876
|
* @fileoverview added by tsickle
|
|
2715
2877
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2716
2878
|
*/
|
|
2879
|
+
var NavigationSession = /** @class */ (function () {
|
|
2880
|
+
function NavigationSession(isPopState, initialUrl) {
|
|
2881
|
+
this.isPopState = isPopState;
|
|
2882
|
+
this.initialUrl = initialUrl;
|
|
2883
|
+
this._alreadyAccepted = [];
|
|
2884
|
+
console.log('NavigationSession', { isPopState: isPopState, initialUrl: initialUrl });
|
|
2885
|
+
}
|
|
2886
|
+
/**
|
|
2887
|
+
* @param {?} placeComponent
|
|
2888
|
+
* @return {?}
|
|
2889
|
+
*/
|
|
2890
|
+
NavigationSession.prototype.alreadyAccepted = /**
|
|
2891
|
+
* @param {?} placeComponent
|
|
2892
|
+
* @return {?}
|
|
2893
|
+
*/
|
|
2894
|
+
function (placeComponent) {
|
|
2895
|
+
return this._alreadyAccepted.includes(placeComponent);
|
|
2896
|
+
};
|
|
2897
|
+
/**
|
|
2898
|
+
* @param {?} component
|
|
2899
|
+
* @return {?}
|
|
2900
|
+
*/
|
|
2901
|
+
NavigationSession.prototype.rememberAcceptanceOf = /**
|
|
2902
|
+
* @param {?} component
|
|
2903
|
+
* @return {?}
|
|
2904
|
+
*/
|
|
2905
|
+
function (component) {
|
|
2906
|
+
this._alreadyAccepted.push(component);
|
|
2907
|
+
};
|
|
2908
|
+
return NavigationSession;
|
|
2909
|
+
}());
|
|
2910
|
+
if (false) {
|
|
2911
|
+
/**
|
|
2912
|
+
* @type {?}
|
|
2913
|
+
* @private
|
|
2914
|
+
*/
|
|
2915
|
+
NavigationSession.prototype._alreadyAccepted;
|
|
2916
|
+
/** @type {?} */
|
|
2917
|
+
NavigationSession.prototype.isPopState;
|
|
2918
|
+
/** @type {?} */
|
|
2919
|
+
NavigationSession.prototype.initialUrl;
|
|
2920
|
+
}
|
|
2717
2921
|
var PlaceRouter = /** @class */ (function () {
|
|
2718
|
-
function PlaceRouter(router) {
|
|
2719
|
-
|
|
2922
|
+
function PlaceRouter(router$1, angularLocation) {
|
|
2923
|
+
var _this = this;
|
|
2924
|
+
this.router = router$1;
|
|
2925
|
+
this._navigationSession = new pectin.MutableValueModel();
|
|
2926
|
+
angularLocation.onUrlChange((/**
|
|
2927
|
+
* @param {?} url
|
|
2928
|
+
* @return {?}
|
|
2929
|
+
*/
|
|
2930
|
+
function (url) {
|
|
2931
|
+
console.log("### " + url);
|
|
2932
|
+
}));
|
|
2933
|
+
this.router.events.subscribe((/**
|
|
2934
|
+
* @param {?} event
|
|
2935
|
+
* @return {?}
|
|
2936
|
+
*/
|
|
2937
|
+
function (event) {
|
|
2938
|
+
// console.log(`${event.constructor.name}`, location.pathname, angularLocation.getState());
|
|
2939
|
+
// NavigationStart -> .... -> NavigationCancel === redirect (so don't ask again)
|
|
2940
|
+
// NavigationStart -> .... -> NavigationEnd === navigated (so ask next time)
|
|
2941
|
+
// NavigationStart -> .... -> NavigationError === canceled (guard cancelled so ask next time)
|
|
2942
|
+
if (event instanceof router.NavigationStart && !_this.navigationSession) {
|
|
2943
|
+
_this._navigationSession.value = new NavigationSession(event.navigationTrigger === 'popstate', _this.router.routerState.snapshot.url);
|
|
2944
|
+
}
|
|
2945
|
+
if (event instanceof router.NavigationEnd) {
|
|
2946
|
+
console.log('navigation ended');
|
|
2947
|
+
_this._navigationSession.value = null;
|
|
2948
|
+
}
|
|
2949
|
+
if (event instanceof router.NavigationError) {
|
|
2950
|
+
console.log('navigation errored');
|
|
2951
|
+
_this._navigationSession.value = null;
|
|
2952
|
+
}
|
|
2953
|
+
}));
|
|
2720
2954
|
}
|
|
2955
|
+
Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
|
|
2956
|
+
get: /**
|
|
2957
|
+
* @return {?}
|
|
2958
|
+
*/
|
|
2959
|
+
function () {
|
|
2960
|
+
return this._navigationSession.value;
|
|
2961
|
+
},
|
|
2962
|
+
enumerable: true,
|
|
2963
|
+
configurable: true
|
|
2964
|
+
});
|
|
2721
2965
|
/**
|
|
2722
2966
|
* @param {?} activatedRoute
|
|
2723
2967
|
* @param {?} previous
|
|
@@ -2760,7 +3004,6 @@
|
|
|
2760
3004
|
var commands = (weHaveARouteId) ?
|
|
2761
3005
|
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
2762
3006
|
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
2763
|
-
console.log("redirect path", commands);
|
|
2764
3007
|
return this.router.createUrlTree(commands);
|
|
2765
3008
|
};
|
|
2766
3009
|
/**
|
|
@@ -2804,12 +3047,18 @@
|
|
|
2804
3047
|
];
|
|
2805
3048
|
/** @nocollapse */
|
|
2806
3049
|
PlaceRouter.ctorParameters = function () { return [
|
|
2807
|
-
{ type: router.Router }
|
|
3050
|
+
{ type: router.Router },
|
|
3051
|
+
{ type: common.Location }
|
|
2808
3052
|
]; };
|
|
2809
|
-
/** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
3053
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(common.Location)); }, token: PlaceRouter, providedIn: "root" });
|
|
2810
3054
|
return PlaceRouter;
|
|
2811
3055
|
}());
|
|
2812
3056
|
if (false) {
|
|
3057
|
+
/**
|
|
3058
|
+
* @type {?}
|
|
3059
|
+
* @private
|
|
3060
|
+
*/
|
|
3061
|
+
PlaceRouter.prototype._navigationSession;
|
|
2813
3062
|
/**
|
|
2814
3063
|
* @type {?}
|
|
2815
3064
|
* @private
|
|
@@ -4593,16 +4842,15 @@
|
|
|
4593
4842
|
*/
|
|
4594
4843
|
function ActivityOutletContext() { }
|
|
4595
4844
|
if (false) {
|
|
4596
|
-
/** @type {?} */
|
|
4597
|
-
ActivityOutletContext.prototype.interactionContext;
|
|
4598
4845
|
/** @type {?} */
|
|
4599
4846
|
ActivityOutletContext.prototype.activityClass;
|
|
4600
4847
|
/** @type {?} */
|
|
4601
4848
|
ActivityOutletContext.prototype.activityData;
|
|
4602
|
-
/**
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4849
|
+
/**
|
|
4850
|
+
* @param {?} component
|
|
4851
|
+
* @return {?}
|
|
4852
|
+
*/
|
|
4853
|
+
ActivityOutletContext.prototype.componentReady = function (component) { };
|
|
4606
4854
|
}
|
|
4607
4855
|
|
|
4608
4856
|
/**
|
|
@@ -4765,33 +5013,12 @@
|
|
|
4765
5013
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4766
5014
|
*/
|
|
4767
5015
|
var LeavePlaceGuard = /** @class */ (function () {
|
|
4768
|
-
function LeavePlaceGuard(router
|
|
4769
|
-
this.router = router
|
|
5016
|
+
function LeavePlaceGuard(router, injector, placeRouter, interactionContext, angularLocation) {
|
|
5017
|
+
this.router = router;
|
|
4770
5018
|
this.injector = injector;
|
|
5019
|
+
this.placeRouter = placeRouter;
|
|
4771
5020
|
this.interactionContext = interactionContext;
|
|
4772
|
-
this.
|
|
4773
|
-
// TODO: should probably replace this with a RouteTracker thingy.
|
|
4774
|
-
this._alreadyAccepted = [];
|
|
4775
|
-
console.log('***** Created new guard ******');
|
|
4776
|
-
/** @type {?} */
|
|
4777
|
-
var self = this;
|
|
4778
|
-
this.router.events.subscribe((/**
|
|
4779
|
-
* @param {?} event
|
|
4780
|
-
* @return {?}
|
|
4781
|
-
*/
|
|
4782
|
-
function (event) {
|
|
4783
|
-
// NavigationStart -> .... -> NavigationCancel === redirect (so don't ask again)
|
|
4784
|
-
// NavigationStart -> .... -> NavigationEnd === navigated (so ask next time)
|
|
4785
|
-
// NavigationStart -> .... -> NavigationError === canceled (guard cancelled so ask next time)
|
|
4786
|
-
if (event instanceof router.NavigationEnd) {
|
|
4787
|
-
console.log('navigation ended');
|
|
4788
|
-
self._alreadyAccepted = [];
|
|
4789
|
-
}
|
|
4790
|
-
if (event instanceof router.NavigationError) {
|
|
4791
|
-
console.log('navigation errored');
|
|
4792
|
-
self._alreadyAccepted = [];
|
|
4793
|
-
}
|
|
4794
|
-
}));
|
|
5021
|
+
this.angularLocation = angularLocation;
|
|
4795
5022
|
}
|
|
4796
5023
|
/**
|
|
4797
5024
|
* @param {?} component
|
|
@@ -4808,105 +5035,45 @@
|
|
|
4808
5035
|
* @return {?}
|
|
4809
5036
|
*/
|
|
4810
5037
|
function (component, currentRoute, currentState, nextState) {
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: undefined, dl: Array(0), …}
|
|
4837
|
-
// parameter-snapshot.ts:20 {name: "idModel", mine: -1, theirs: null}
|
|
4838
|
-
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
4839
|
-
// canDeactivate {
|
|
4840
|
-
// staticPath: "/hero-stats",
|
|
4841
|
-
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
4842
|
-
// nextStateUrl: "/route-parameters/-1"
|
|
4843
|
-
// }
|
|
4844
|
-
// canDeactivate {
|
|
4845
|
-
// staticPath: "/route-parameters",
|
|
4846
|
-
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
4847
|
-
// nextStateUrl: "/route-parameters/-1"
|
|
4848
|
-
// }
|
|
4849
|
-
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: "A", dl: Array(3), …}
|
|
4850
|
-
// parameter-snapshot.ts:20 {name: "dv", mine: "A", theirs: undefined}
|
|
4851
|
-
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
4852
|
-
// canDeactivate {
|
|
4853
|
-
// staticPath: "/hero-stats",
|
|
4854
|
-
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
4855
|
-
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c"
|
|
4856
|
-
// }
|
|
4857
|
-
// HACK: this will break with child routes...
|
|
4858
|
-
if (this.alreadyAccepted(component)) {
|
|
4859
|
-
return true;
|
|
4860
|
-
}
|
|
4861
|
-
else {
|
|
4862
|
-
if (!nextState.url.startsWith(placeDefinitionPath)) {
|
|
4863
|
-
/** @type {?} */
|
|
4864
|
-
var self_1 = this;
|
|
4865
|
-
return Promise.resolve(component.canDeactivate())
|
|
4866
|
-
.then((/**
|
|
4867
|
-
* @param {?} canLeave
|
|
4868
|
-
* @return {?}
|
|
4869
|
-
*/
|
|
4870
|
-
function (canLeave) {
|
|
4871
|
-
if (!canLeave) {
|
|
4872
|
-
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
4873
|
-
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
4874
|
-
_this.location.go(currentState.url);
|
|
4875
|
-
return false;
|
|
4876
|
-
}
|
|
4877
|
-
else {
|
|
4878
|
-
if (_this.interactionContext.isActive()) {
|
|
4879
|
-
_this.interactionContext.currentActivity.value.cancel(null);
|
|
4880
|
-
return false;
|
|
5038
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5039
|
+
var placeDefinitionPath, self_1, canLeave;
|
|
5040
|
+
return __generator(this, function (_a) {
|
|
5041
|
+
switch (_a.label) {
|
|
5042
|
+
case 0:
|
|
5043
|
+
placeDefinitionPath = "/" + component.placeDefinition.path;
|
|
5044
|
+
if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
|
|
5045
|
+
return [2 /*return*/, true];
|
|
5046
|
+
case 1:
|
|
5047
|
+
if (!!nextState.url.startsWith(placeDefinitionPath)) return [3 /*break*/, 3];
|
|
5048
|
+
self_1 = this;
|
|
5049
|
+
return [4 /*yield*/, component.canDeactivate()];
|
|
5050
|
+
case 2:
|
|
5051
|
+
canLeave = _a.sent();
|
|
5052
|
+
// component is happy to leave but we need to check if it's left an interaction
|
|
5053
|
+
// open. If so we close and stay where we are.
|
|
5054
|
+
if (canLeave && this.interactionContext.isActive()) {
|
|
5055
|
+
canLeave = false;
|
|
5056
|
+
console.log("cancelling", { activity: this.interactionContext.currentActivity });
|
|
5057
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
5058
|
+
}
|
|
5059
|
+
// If we're still leaving then remember it since angular will call this method multiple
|
|
5060
|
+
// times if any route parameters are changed along the way.
|
|
5061
|
+
if (canLeave) {
|
|
5062
|
+
self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
|
|
4881
5063
|
}
|
|
4882
5064
|
else {
|
|
4883
|
-
|
|
5065
|
+
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
5066
|
+
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
5067
|
+
if (this.placeRouter.navigationSession.isPopState) {
|
|
5068
|
+
console.log('cancelled during popstate');
|
|
5069
|
+
this.angularLocation.go(this.placeRouter.navigationSession.initialUrl);
|
|
5070
|
+
}
|
|
4884
5071
|
}
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
function (canDeactivate) {
|
|
4891
|
-
if (canDeactivate) {
|
|
4892
|
-
self_1._alreadyAccepted.push(component);
|
|
4893
|
-
}
|
|
4894
|
-
return canDeactivate;
|
|
4895
|
-
}));
|
|
4896
|
-
}
|
|
4897
|
-
return true;
|
|
4898
|
-
}
|
|
4899
|
-
};
|
|
4900
|
-
/**
|
|
4901
|
-
* @param {?} placeComponent
|
|
4902
|
-
* @return {?}
|
|
4903
|
-
*/
|
|
4904
|
-
LeavePlaceGuard.prototype.alreadyAccepted = /**
|
|
4905
|
-
* @param {?} placeComponent
|
|
4906
|
-
* @return {?}
|
|
4907
|
-
*/
|
|
4908
|
-
function (placeComponent) {
|
|
4909
|
-
return this._alreadyAccepted.includes(placeComponent);
|
|
5072
|
+
return [2 /*return*/, canLeave];
|
|
5073
|
+
case 3: return [2 /*return*/, true];
|
|
5074
|
+
}
|
|
5075
|
+
});
|
|
5076
|
+
});
|
|
4910
5077
|
};
|
|
4911
5078
|
LeavePlaceGuard.decorators = [
|
|
4912
5079
|
{ type: core.Injectable, args: [{
|
|
@@ -4917,16 +5084,11 @@
|
|
|
4917
5084
|
LeavePlaceGuard.ctorParameters = function () { return [
|
|
4918
5085
|
{ type: router.Router },
|
|
4919
5086
|
{ type: core.Injector },
|
|
5087
|
+
{ type: PlaceRouter },
|
|
4920
5088
|
{ type: InteractionContext },
|
|
4921
5089
|
{ type: common.Location }
|
|
4922
5090
|
]; };
|
|
4923
|
-
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
|
|
4924
|
-
__decorate([
|
|
4925
|
-
pectin.Trace(),
|
|
4926
|
-
__metadata("design:type", Function),
|
|
4927
|
-
__metadata("design:paramtypes", [exports.PlaceComponent]),
|
|
4928
|
-
__metadata("design:returntype", Boolean)
|
|
4929
|
-
], LeavePlaceGuard.prototype, "alreadyAccepted", null);
|
|
5091
|
+
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(PlaceRouter), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
|
|
4930
5092
|
return LeavePlaceGuard;
|
|
4931
5093
|
}());
|
|
4932
5094
|
if (false) {
|
|
@@ -4934,21 +5096,21 @@
|
|
|
4934
5096
|
* @type {?}
|
|
4935
5097
|
* @private
|
|
4936
5098
|
*/
|
|
4937
|
-
LeavePlaceGuard.prototype.
|
|
5099
|
+
LeavePlaceGuard.prototype.router;
|
|
4938
5100
|
/**
|
|
4939
5101
|
* @type {?}
|
|
4940
5102
|
* @private
|
|
4941
5103
|
*/
|
|
4942
|
-
LeavePlaceGuard.prototype.
|
|
5104
|
+
LeavePlaceGuard.prototype.injector;
|
|
4943
5105
|
/**
|
|
4944
5106
|
* @type {?}
|
|
4945
5107
|
* @private
|
|
4946
5108
|
*/
|
|
4947
|
-
LeavePlaceGuard.prototype.
|
|
5109
|
+
LeavePlaceGuard.prototype.placeRouter;
|
|
4948
5110
|
/** @type {?} */
|
|
4949
5111
|
LeavePlaceGuard.prototype.interactionContext;
|
|
4950
5112
|
/** @type {?} */
|
|
4951
|
-
LeavePlaceGuard.prototype.
|
|
5113
|
+
LeavePlaceGuard.prototype.angularLocation;
|
|
4952
5114
|
}
|
|
4953
5115
|
|
|
4954
5116
|
/**
|
|
@@ -5241,14 +5403,15 @@
|
|
|
5241
5403
|
exports.AbstractActivity = AbstractActivity;
|
|
5242
5404
|
exports.AbstractInputComponent = AbstractInputComponent;
|
|
5243
5405
|
exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
|
|
5244
|
-
exports.
|
|
5406
|
+
exports.Activity = exports.ɵba;
|
|
5407
|
+
exports.ActivityContainerComponent = ActivityContainerComponent;
|
|
5245
5408
|
exports.ActivityOutletComponent = ActivityOutletComponent;
|
|
5246
5409
|
exports.AlertDialogComponent = AlertDialogComponent;
|
|
5247
5410
|
exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
|
|
5248
5411
|
exports.BusyOverlayComponent = BusyOverlayComponent;
|
|
5249
5412
|
exports.CloseInteractionGuard = CloseInteractionGuard;
|
|
5250
5413
|
exports.CommandDirective = CommandDirective;
|
|
5251
|
-
exports.ConfirmThenDialogComponent = exports.ɵ
|
|
5414
|
+
exports.ConfirmThenDialogComponent = exports.ɵbc;
|
|
5252
5415
|
exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
|
|
5253
5416
|
exports.DEFINITION_META_DATA_KEY = DEFINITION_META_DATA_KEY;
|
|
5254
5417
|
exports.DIALOG_INTERACTION_SERVICE_DEFAULTS = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
@@ -5284,10 +5447,9 @@
|
|
|
5284
5447
|
exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
|
|
5285
5448
|
exports.ɵa = CommandDirective;
|
|
5286
5449
|
exports.ɵb = FocusBindingDirective;
|
|
5287
|
-
exports.ɵ
|
|
5288
|
-
exports.ɵ
|
|
5289
|
-
exports.ɵ
|
|
5290
|
-
exports.ɵbf = DialogInteractionService;
|
|
5450
|
+
exports.ɵbd = AlertDialogComponent;
|
|
5451
|
+
exports.ɵbf = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
5452
|
+
exports.ɵbg = DialogInteractionService;
|
|
5291
5453
|
exports.ɵc = DisposableComponent;
|
|
5292
5454
|
exports.ɵd = NumberInputComponent;
|
|
5293
5455
|
exports.ɵe = AbstractInputComponent;
|
|
@@ -5306,10 +5468,12 @@
|
|
|
5306
5468
|
exports.ɵr = AbstractPlaceNavigationComponent;
|
|
5307
5469
|
exports.ɵs = ListPlaceNavComponent;
|
|
5308
5470
|
exports.ɵt = InteractionModule;
|
|
5309
|
-
exports.ɵ
|
|
5310
|
-
exports.ɵ
|
|
5311
|
-
exports.ɵ
|
|
5312
|
-
exports.ɵ
|
|
5471
|
+
exports.ɵu = ActivityContainerComponent;
|
|
5472
|
+
exports.ɵv = InteractionContext;
|
|
5473
|
+
exports.ɵw = ActivityOutletComponent;
|
|
5474
|
+
exports.ɵx = ConfirmationDialogComponent;
|
|
5475
|
+
exports.ɵy = AbstractActivity;
|
|
5476
|
+
exports.ɵz = ACTIVITY_DATA;
|
|
5313
5477
|
|
|
5314
5478
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5315
5479
|
|