@coolon/angular-ui-powerups 0.0.63 → 0.0.65
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 +722 -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 +71 -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 +110 -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 +582 -439
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +695 -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 +13 -6
- 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,121 @@
|
|
|
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 () {
|
|
1072
|
+
function Activity() {
|
|
1073
|
+
this._busyModel = new pectin.DelegatingValueModel().withDefault(false);
|
|
1074
|
+
}
|
|
1061
1075
|
/**
|
|
1062
1076
|
* @param {?} activityContext
|
|
1063
1077
|
* @return {?}
|
|
1064
1078
|
*/
|
|
1065
|
-
Activity.prototype.initialise =
|
|
1079
|
+
Activity.prototype.initialise = /**
|
|
1080
|
+
* @param {?} activityContext
|
|
1081
|
+
* @return {?}
|
|
1082
|
+
*/
|
|
1083
|
+
function (activityContext) {
|
|
1084
|
+
typescriptUtilities.assert.isNil(this._activityContext);
|
|
1085
|
+
this._activityContext = activityContext;
|
|
1086
|
+
};
|
|
1066
1087
|
/**
|
|
1067
|
-
* @param {
|
|
1088
|
+
* @param {?=} result
|
|
1068
1089
|
* @return {?}
|
|
1069
1090
|
*/
|
|
1070
|
-
Activity.prototype.done =
|
|
1091
|
+
Activity.prototype.done = /**
|
|
1092
|
+
* @param {?=} result
|
|
1093
|
+
* @return {?}
|
|
1094
|
+
*/
|
|
1095
|
+
function (result) {
|
|
1096
|
+
return this._activityContext.onDone(result);
|
|
1097
|
+
};
|
|
1071
1098
|
/**
|
|
1072
|
-
* @param {
|
|
1099
|
+
* @param {?=} error
|
|
1073
1100
|
* @return {?}
|
|
1074
1101
|
*/
|
|
1075
|
-
Activity.prototype.cancel =
|
|
1102
|
+
Activity.prototype.cancel = /**
|
|
1103
|
+
* @param {?=} error
|
|
1104
|
+
* @return {?}
|
|
1105
|
+
*/
|
|
1106
|
+
function (error) {
|
|
1107
|
+
this._activityContext.onCancel(error);
|
|
1108
|
+
};
|
|
1109
|
+
// @Trace()
|
|
1110
|
+
// @Trace()
|
|
1111
|
+
/**
|
|
1112
|
+
* @return {?}
|
|
1113
|
+
*/
|
|
1114
|
+
Activity.prototype.onActivityReady =
|
|
1115
|
+
// @Trace()
|
|
1116
|
+
/**
|
|
1117
|
+
* @return {?}
|
|
1118
|
+
*/
|
|
1119
|
+
function () {
|
|
1120
|
+
};
|
|
1121
|
+
Object.defineProperty(Activity.prototype, "busy", {
|
|
1122
|
+
get: /**
|
|
1123
|
+
* @return {?}
|
|
1124
|
+
*/
|
|
1125
|
+
function () {
|
|
1126
|
+
return this._busyModel.readonly;
|
|
1127
|
+
},
|
|
1128
|
+
enumerable: true,
|
|
1129
|
+
configurable: true
|
|
1130
|
+
});
|
|
1131
|
+
/**
|
|
1132
|
+
* @param {?} busyModel
|
|
1133
|
+
* @return {?}
|
|
1134
|
+
*/
|
|
1135
|
+
Activity.prototype.busyWhile = /**
|
|
1136
|
+
* @param {?} busyModel
|
|
1137
|
+
* @return {?}
|
|
1138
|
+
*/
|
|
1139
|
+
function (busyModel) {
|
|
1140
|
+
this._busyModel.setDelegate(busyModel);
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* @return {?}
|
|
1144
|
+
*/
|
|
1145
|
+
Activity.prototype.isBusy = /**
|
|
1146
|
+
* @return {?}
|
|
1147
|
+
*/
|
|
1148
|
+
function () {
|
|
1149
|
+
return this._busyModel.value;
|
|
1150
|
+
};
|
|
1151
|
+
return Activity;
|
|
1152
|
+
}());
|
|
1153
|
+
if (false) {
|
|
1154
|
+
/**
|
|
1155
|
+
* @type {?}
|
|
1156
|
+
* @private
|
|
1157
|
+
*/
|
|
1158
|
+
exports.ɵba.prototype._busyModel;
|
|
1159
|
+
/**
|
|
1160
|
+
* @type {?}
|
|
1161
|
+
* @private
|
|
1162
|
+
*/
|
|
1163
|
+
exports.ɵba.prototype._activityContext;
|
|
1076
1164
|
}
|
|
1165
|
+
(function (Activity) {
|
|
1166
|
+
/**
|
|
1167
|
+
* @record
|
|
1168
|
+
* @template R, E
|
|
1169
|
+
*/
|
|
1170
|
+
function Callbacks() { }
|
|
1171
|
+
Activity.Callbacks = Callbacks;
|
|
1172
|
+
if (false) {
|
|
1173
|
+
/** @type {?} */
|
|
1174
|
+
Callbacks.prototype.onDone;
|
|
1175
|
+
/** @type {?} */
|
|
1176
|
+
Callbacks.prototype.onCancel;
|
|
1177
|
+
}
|
|
1178
|
+
})(exports.ɵba || (exports.ɵba = {}));
|
|
1077
1179
|
|
|
1078
1180
|
/**
|
|
1079
1181
|
* @fileoverview added by tsickle
|
|
@@ -1094,11 +1196,19 @@
|
|
|
1094
1196
|
this.injector = injector;
|
|
1095
1197
|
}
|
|
1096
1198
|
Object.defineProperty(ActivityOutletComponent.prototype, "activityContext", {
|
|
1199
|
+
get: /**
|
|
1200
|
+
* @return {?}
|
|
1201
|
+
*/
|
|
1202
|
+
function () {
|
|
1203
|
+
return this._activityContext;
|
|
1204
|
+
},
|
|
1097
1205
|
set: /**
|
|
1098
1206
|
* @param {?} activityContext
|
|
1099
1207
|
* @return {?}
|
|
1100
1208
|
*/
|
|
1101
1209
|
function (activityContext) {
|
|
1210
|
+
pectin.assert.isNil(this._activityContext);
|
|
1211
|
+
this._activityContext = activityContext;
|
|
1102
1212
|
this.loadActivity(activityContext);
|
|
1103
1213
|
},
|
|
1104
1214
|
enumerable: true,
|
|
@@ -1127,7 +1237,7 @@
|
|
|
1127
1237
|
providers: [
|
|
1128
1238
|
{
|
|
1129
1239
|
provide: InteractionContext,
|
|
1130
|
-
useValue: this
|
|
1240
|
+
useValue: this.interactionContext
|
|
1131
1241
|
},
|
|
1132
1242
|
{ provide: ACTIVITY_DATA, useValue: activityContext.activityData }
|
|
1133
1243
|
],
|
|
@@ -1138,6 +1248,9 @@
|
|
|
1138
1248
|
this.viewContainerRef.clear();
|
|
1139
1249
|
this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
|
|
1140
1250
|
this.activityComponentRef.instance.initialise(activityContext);
|
|
1251
|
+
if (this.activityContext.componentReady) {
|
|
1252
|
+
this.activityContext.componentReady(this.component);
|
|
1253
|
+
}
|
|
1141
1254
|
};
|
|
1142
1255
|
Object.defineProperty(ActivityOutletComponent.prototype, "component", {
|
|
1143
1256
|
get: /**
|
|
@@ -1149,71 +1262,6 @@
|
|
|
1149
1262
|
enumerable: true,
|
|
1150
1263
|
configurable: true
|
|
1151
1264
|
});
|
|
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
1265
|
ActivityOutletComponent.decorators = [
|
|
1218
1266
|
{ type: core.Component, args: [{
|
|
1219
1267
|
selector: 'angular-ui-powerups-activity-outlet',
|
|
@@ -1236,6 +1284,11 @@
|
|
|
1236
1284
|
if (false) {
|
|
1237
1285
|
/** @type {?} */
|
|
1238
1286
|
ActivityOutletComponent.prototype.interactionContext;
|
|
1287
|
+
/**
|
|
1288
|
+
* @type {?}
|
|
1289
|
+
* @private
|
|
1290
|
+
*/
|
|
1291
|
+
ActivityOutletComponent.prototype._activityContext;
|
|
1239
1292
|
/**
|
|
1240
1293
|
* @type {?}
|
|
1241
1294
|
* @private
|
|
@@ -1264,108 +1317,22 @@
|
|
|
1264
1317
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1265
1318
|
*/
|
|
1266
1319
|
/**
|
|
1320
|
+
* Deprecated. You can now extend the Activity class directly.
|
|
1321
|
+
* @abstract
|
|
1267
1322
|
* @template D, R, E
|
|
1268
1323
|
*/
|
|
1269
1324
|
var /**
|
|
1325
|
+
* Deprecated. You can now extend the Activity class directly.
|
|
1326
|
+
* @abstract
|
|
1270
1327
|
* @template D, R, E
|
|
1271
1328
|
*/
|
|
1272
1329
|
AbstractActivity = /** @class */ (function (_super) {
|
|
1273
1330
|
__extends(AbstractActivity, _super);
|
|
1274
1331
|
function AbstractActivity() {
|
|
1275
|
-
|
|
1276
|
-
_this._busyModel = new pectin.DelegatingValueModel().withDefault(false);
|
|
1277
|
-
return _this;
|
|
1332
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1278
1333
|
}
|
|
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
1334
|
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
|
-
}
|
|
1335
|
+
}(exports.ɵba));
|
|
1369
1336
|
|
|
1370
1337
|
/**
|
|
1371
1338
|
* @fileoverview added by tsickle
|
|
@@ -1411,7 +1378,7 @@
|
|
|
1411
1378
|
/**
|
|
1412
1379
|
* @template D, R, E
|
|
1413
1380
|
*/
|
|
1414
|
-
exports.ɵ
|
|
1381
|
+
exports.ɵbc = /** @class */ (function (_super) {
|
|
1415
1382
|
__extends(ConfirmThenDialogComponent, _super);
|
|
1416
1383
|
function ConfirmThenDialogComponent(config, interactionContext) {
|
|
1417
1384
|
var _this = _super.call(this) || this;
|
|
@@ -1483,9 +1450,9 @@
|
|
|
1483
1450
|
}(AbstractActivity));
|
|
1484
1451
|
if (false) {
|
|
1485
1452
|
/** @type {?} */
|
|
1486
|
-
exports.ɵ
|
|
1453
|
+
exports.ɵbc.prototype.config;
|
|
1487
1454
|
/** @type {?} */
|
|
1488
|
-
exports.ɵ
|
|
1455
|
+
exports.ɵbc.prototype.interactionContext;
|
|
1489
1456
|
}
|
|
1490
1457
|
(function (ConfirmThenDialogComponent) {
|
|
1491
1458
|
/**
|
|
@@ -1502,7 +1469,7 @@
|
|
|
1502
1469
|
/** @type {?} */
|
|
1503
1470
|
Data.prototype.data;
|
|
1504
1471
|
}
|
|
1505
|
-
})(exports.ɵ
|
|
1472
|
+
})(exports.ɵbc || (exports.ɵbc = {}));
|
|
1506
1473
|
|
|
1507
1474
|
/**
|
|
1508
1475
|
* @fileoverview added by tsickle
|
|
@@ -1555,16 +1522,174 @@
|
|
|
1555
1522
|
* @fileoverview added by tsickle
|
|
1556
1523
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1557
1524
|
*/
|
|
1558
|
-
|
|
1525
|
+
/**
|
|
1526
|
+
* Note: this class is mutable and is stored in a list model. This is normally a big no no but
|
|
1527
|
+
* we're manually deriving other models from the list after view state changes. I.e. we not
|
|
1528
|
+
* using pectin chains on any of the mutable fields.
|
|
1529
|
+
* @template D, R, E
|
|
1530
|
+
*/
|
|
1531
|
+
var /**
|
|
1532
|
+
* Note: this class is mutable and is stored in a list model. This is normally a big no no but
|
|
1533
|
+
* we're manually deriving other models from the list after view state changes. I.e. we not
|
|
1534
|
+
* using pectin chains on any of the mutable fields.
|
|
1535
|
+
* @template D, R, E
|
|
1536
|
+
*/
|
|
1537
|
+
TabContext = /** @class */ (function () {
|
|
1538
|
+
function TabContext(activityData, activityClass, interactionContext, activityCallbacks) {
|
|
1539
|
+
this.activityData = activityData;
|
|
1540
|
+
this.activityClass = activityClass;
|
|
1541
|
+
this.interactionContext = interactionContext;
|
|
1542
|
+
this.activityCallbacks = activityCallbacks;
|
|
1543
|
+
this._complete = false;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @return {?}
|
|
1547
|
+
*/
|
|
1548
|
+
TabContext.prototype.isComponentRealised = /**
|
|
1549
|
+
* @return {?}
|
|
1550
|
+
*/
|
|
1551
|
+
function () {
|
|
1552
|
+
return !!this._component;
|
|
1553
|
+
};
|
|
1554
|
+
/**
|
|
1555
|
+
* @return {?}
|
|
1556
|
+
*/
|
|
1557
|
+
TabContext.prototype.isComplete = /**
|
|
1558
|
+
* @return {?}
|
|
1559
|
+
*/
|
|
1560
|
+
function () {
|
|
1561
|
+
return this._complete;
|
|
1562
|
+
};
|
|
1563
|
+
/**
|
|
1564
|
+
* @param {?} component
|
|
1565
|
+
* @return {?}
|
|
1566
|
+
*/
|
|
1567
|
+
TabContext.prototype.componentReady = /**
|
|
1568
|
+
* @param {?} component
|
|
1569
|
+
* @return {?}
|
|
1570
|
+
*/
|
|
1571
|
+
function (component) {
|
|
1572
|
+
pectin.assert.isNil(this._component);
|
|
1573
|
+
this._component = component;
|
|
1574
|
+
};
|
|
1575
|
+
Object.defineProperty(TabContext.prototype, "component", {
|
|
1576
|
+
get: /**
|
|
1577
|
+
* @return {?}
|
|
1578
|
+
*/
|
|
1579
|
+
function () {
|
|
1580
|
+
return this._component;
|
|
1581
|
+
},
|
|
1582
|
+
enumerable: true,
|
|
1583
|
+
configurable: true
|
|
1584
|
+
});
|
|
1585
|
+
// @Trace()
|
|
1586
|
+
// @Trace()
|
|
1587
|
+
/**
|
|
1588
|
+
* @param {?} result
|
|
1589
|
+
* @return {?}
|
|
1590
|
+
*/
|
|
1591
|
+
TabContext.prototype.onDone =
|
|
1592
|
+
// @Trace()
|
|
1593
|
+
/**
|
|
1594
|
+
* @param {?} result
|
|
1595
|
+
* @return {?}
|
|
1596
|
+
*/
|
|
1597
|
+
function (result) {
|
|
1598
|
+
this._complete = true;
|
|
1599
|
+
this.activityCallbacks.onDone(result);
|
|
1600
|
+
};
|
|
1601
|
+
// @Trace()
|
|
1602
|
+
// @Trace()
|
|
1603
|
+
/**
|
|
1604
|
+
* @param {?} error
|
|
1605
|
+
* @return {?}
|
|
1606
|
+
*/
|
|
1607
|
+
TabContext.prototype.onCancel =
|
|
1608
|
+
// @Trace()
|
|
1609
|
+
/**
|
|
1610
|
+
* @param {?} error
|
|
1611
|
+
* @return {?}
|
|
1612
|
+
*/
|
|
1613
|
+
function (error) {
|
|
1614
|
+
this._complete = true;
|
|
1615
|
+
this.activityCallbacks.onCancel(error);
|
|
1616
|
+
};
|
|
1617
|
+
return TabContext;
|
|
1618
|
+
}());
|
|
1619
|
+
if (false) {
|
|
1620
|
+
/**
|
|
1621
|
+
* @type {?}
|
|
1622
|
+
* @private
|
|
1623
|
+
*/
|
|
1624
|
+
TabContext.prototype._complete;
|
|
1625
|
+
/**
|
|
1626
|
+
* @type {?}
|
|
1627
|
+
* @private
|
|
1628
|
+
*/
|
|
1629
|
+
TabContext.prototype._component;
|
|
1630
|
+
/** @type {?} */
|
|
1631
|
+
TabContext.prototype.activityData;
|
|
1632
|
+
/** @type {?} */
|
|
1633
|
+
TabContext.prototype.activityClass;
|
|
1634
|
+
/** @type {?} */
|
|
1635
|
+
TabContext.prototype.interactionContext;
|
|
1636
|
+
/** @type {?} */
|
|
1637
|
+
TabContext.prototype.activityCallbacks;
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* @template D, R, E
|
|
1641
|
+
*/
|
|
1642
|
+
var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
1559
1643
|
__extends(ActivityContainerComponent, _super);
|
|
1560
1644
|
function ActivityContainerComponent() {
|
|
1561
1645
|
var _this = _super.call(this) || this;
|
|
1562
|
-
_this.
|
|
1563
|
-
_this.
|
|
1646
|
+
_this.activityFinishedEvents = new pectin.MutableStream();
|
|
1647
|
+
_this.activityTabs = new pectin.MutableListModel();
|
|
1564
1648
|
_this.finished = false;
|
|
1565
1649
|
_this._activityList = new pectin.MutableListModel();
|
|
1650
|
+
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;
|
|
1651
|
+
chain(_this.activityFinishedEvents).throttle(50).subscribe((/**
|
|
1652
|
+
* @return {?}
|
|
1653
|
+
*/
|
|
1654
|
+
function () { return _this.onActivityFinished(); }));
|
|
1566
1655
|
return _this;
|
|
1567
1656
|
}
|
|
1657
|
+
Object.defineProperty(ActivityContainerComponent.prototype, "initialActivityOutletContext", {
|
|
1658
|
+
get: /**
|
|
1659
|
+
* @return {?}
|
|
1660
|
+
*/
|
|
1661
|
+
function () {
|
|
1662
|
+
return this.activityTabs.length > 0 ? this.activityTabs.value[0] : null;
|
|
1663
|
+
},
|
|
1664
|
+
set: /**
|
|
1665
|
+
* @param {?} initialContext
|
|
1666
|
+
* @return {?}
|
|
1667
|
+
*/
|
|
1668
|
+
function (initialContext) {
|
|
1669
|
+
var _this = this;
|
|
1670
|
+
pectin.assert.isNil(this.initialActivityOutletContext);
|
|
1671
|
+
this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
|
|
1672
|
+
onDone: (/**
|
|
1673
|
+
* @param {?} result
|
|
1674
|
+
* @return {?}
|
|
1675
|
+
*/
|
|
1676
|
+
function (result) {
|
|
1677
|
+
_this.finished = true;
|
|
1678
|
+
return initialContext.onDone(result);
|
|
1679
|
+
}),
|
|
1680
|
+
onCancel: (/**
|
|
1681
|
+
* @param {?} error
|
|
1682
|
+
* @return {?}
|
|
1683
|
+
*/
|
|
1684
|
+
function (error) {
|
|
1685
|
+
_this.finished = true;
|
|
1686
|
+
return initialContext.onCancel(error);
|
|
1687
|
+
})
|
|
1688
|
+
}));
|
|
1689
|
+
},
|
|
1690
|
+
enumerable: true,
|
|
1691
|
+
configurable: true
|
|
1692
|
+
});
|
|
1568
1693
|
/**
|
|
1569
1694
|
* @return {?}
|
|
1570
1695
|
*/
|
|
@@ -1600,94 +1725,28 @@
|
|
|
1600
1725
|
*/
|
|
1601
1726
|
function () {
|
|
1602
1727
|
var _this = this;
|
|
1603
|
-
var
|
|
1604
|
-
|
|
1605
|
-
* @param {?} c
|
|
1728
|
+
var _a = pectin.Dsl.disposeWith(this), chain = _a.chain, observe = _a.observe;
|
|
1729
|
+
observe.valuesFrom(this.outlets.changes).subscribe((/**
|
|
1606
1730
|
* @return {?}
|
|
1607
1731
|
*/
|
|
1608
|
-
function (
|
|
1609
|
-
observe.valuesFrom(this.outlets.changes).subscribe((/**
|
|
1610
|
-
* @param {?} change
|
|
1732
|
+
function () { return setTimeout((/**
|
|
1611
1733
|
* @return {?}
|
|
1612
1734
|
*/
|
|
1613
|
-
function (
|
|
1614
|
-
_this.safelyUpdateActivityList(change.map((/**
|
|
1615
|
-
* @param {?} c
|
|
1616
|
-
* @return {?}
|
|
1617
|
-
*/
|
|
1618
|
-
function (c) { return c.component; })));
|
|
1619
|
-
}));
|
|
1735
|
+
function () { return _this.updateActivityList(); })); }));
|
|
1620
1736
|
observe.valuesFrom(this.tabs.animationDone).subscribe((/**
|
|
1621
1737
|
* @return {?}
|
|
1622
1738
|
*/
|
|
1623
1739
|
function () { return _this.onAnimationFinished(); }));
|
|
1740
|
+
this.updateActivityList();
|
|
1624
1741
|
};
|
|
1625
1742
|
/**
|
|
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
|
|
1743
|
+
* @template D1, R1, E1
|
|
1685
1744
|
* @param {?} activityType
|
|
1686
1745
|
* @param {?=} data
|
|
1687
1746
|
* @return {?}
|
|
1688
1747
|
*/
|
|
1689
1748
|
ActivityContainerComponent.prototype.startActivity = /**
|
|
1690
|
-
* @template
|
|
1749
|
+
* @template D1, R1, E1
|
|
1691
1750
|
* @param {?} activityType
|
|
1692
1751
|
* @param {?=} data
|
|
1693
1752
|
* @return {?}
|
|
@@ -1703,41 +1762,26 @@
|
|
|
1703
1762
|
*/
|
|
1704
1763
|
function (resolve, reject) {
|
|
1705
1764
|
/** @type {?} */
|
|
1706
|
-
var context = {
|
|
1707
|
-
interactionContext: self,
|
|
1708
|
-
activityClass: activityType,
|
|
1709
|
-
activityData: data,
|
|
1765
|
+
var context = new TabContext(data, activityType, self, {
|
|
1710
1766
|
onDone: (/**
|
|
1711
1767
|
* @param {?} result
|
|
1712
1768
|
* @return {?}
|
|
1713
1769
|
*/
|
|
1714
1770
|
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
1771
|
resolve(result);
|
|
1719
|
-
|
|
1720
|
-
* @return {?}
|
|
1721
|
-
*/
|
|
1722
|
-
function () { return self.animateTabs(); }));
|
|
1772
|
+
self.activityFinishedEvents.publish({});
|
|
1723
1773
|
}),
|
|
1724
1774
|
onCancel: (/**
|
|
1725
1775
|
* @param {?} error
|
|
1726
1776
|
* @return {?}
|
|
1727
1777
|
*/
|
|
1728
1778
|
function (error) {
|
|
1729
|
-
self.obsoleteTabs.push(context);
|
|
1730
|
-
// finished before we start an animations
|
|
1731
1779
|
reject(error);
|
|
1732
|
-
|
|
1733
|
-
setTimeout((/**
|
|
1734
|
-
* @return {?}
|
|
1735
|
-
*/
|
|
1736
|
-
function () { return self.animateTabs(); }));
|
|
1780
|
+
self.activityFinishedEvents.publish({});
|
|
1737
1781
|
})
|
|
1738
|
-
};
|
|
1739
|
-
self.
|
|
1740
|
-
self.tabs.selectedIndex = _this.
|
|
1782
|
+
});
|
|
1783
|
+
self.activityTabs.push(context);
|
|
1784
|
+
self.tabs.selectedIndex = _this.activityTabs.length;
|
|
1741
1785
|
}));
|
|
1742
1786
|
};
|
|
1743
1787
|
/**
|
|
@@ -1763,63 +1807,151 @@
|
|
|
1763
1807
|
return this.startActivity(ConfirmationDialogComponent, confirm);
|
|
1764
1808
|
};
|
|
1765
1809
|
/**
|
|
1766
|
-
* @template
|
|
1767
|
-
* @param {?} confirm
|
|
1768
|
-
* @param {?} activityType
|
|
1769
|
-
* @param {?=} data
|
|
1810
|
+
* @template D1, R1, E1
|
|
1811
|
+
* @param {?} confirm
|
|
1812
|
+
* @param {?} activityType
|
|
1813
|
+
* @param {?=} data
|
|
1814
|
+
* @return {?}
|
|
1815
|
+
*/
|
|
1816
|
+
ActivityContainerComponent.prototype.confirmThen = /**
|
|
1817
|
+
* @template D1, R1, E1
|
|
1818
|
+
* @param {?} confirm
|
|
1819
|
+
* @param {?} activityType
|
|
1820
|
+
* @param {?=} data
|
|
1821
|
+
* @return {?}
|
|
1822
|
+
*/
|
|
1823
|
+
function (confirm, activityType, data) {
|
|
1824
|
+
return this.startActivity(exports.ɵbc, {
|
|
1825
|
+
confirm: confirm,
|
|
1826
|
+
activityType: activityType,
|
|
1827
|
+
data: data
|
|
1828
|
+
});
|
|
1829
|
+
};
|
|
1830
|
+
// @Trace()
|
|
1831
|
+
// @Trace()
|
|
1832
|
+
/**
|
|
1833
|
+
* @private
|
|
1834
|
+
* @return {?}
|
|
1835
|
+
*/
|
|
1836
|
+
ActivityContainerComponent.prototype.onActivityFinished =
|
|
1837
|
+
// @Trace()
|
|
1838
|
+
/**
|
|
1839
|
+
* @private
|
|
1840
|
+
* @return {?}
|
|
1841
|
+
*/
|
|
1842
|
+
function () {
|
|
1843
|
+
// don't do anything if job already queued up.
|
|
1844
|
+
if (!this.finished) {
|
|
1845
|
+
if (this.synchroniseSelectedTabIndex()) {
|
|
1846
|
+
this.cleanupStaleActivities();
|
|
1847
|
+
}
|
|
1848
|
+
this.updateActivityList();
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
// @Trace()
|
|
1852
|
+
// @Trace()
|
|
1853
|
+
/**
|
|
1854
|
+
* @private
|
|
1855
|
+
* @return {?}
|
|
1856
|
+
*/
|
|
1857
|
+
ActivityContainerComponent.prototype.cleanupStaleActivities =
|
|
1858
|
+
// @Trace()
|
|
1859
|
+
/**
|
|
1860
|
+
* @private
|
|
1861
|
+
* @return {?}
|
|
1862
|
+
*/
|
|
1863
|
+
function () {
|
|
1864
|
+
var _this = this;
|
|
1865
|
+
// clean up old tabs
|
|
1866
|
+
if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
|
|
1867
|
+
this.activityTabs.runInTransaction((/**
|
|
1868
|
+
* @param {?} draft
|
|
1869
|
+
* @return {?}
|
|
1870
|
+
*/
|
|
1871
|
+
function (draft) {
|
|
1872
|
+
draft.value = draft.value.slice(0, 1 + _this.tabs.selectedIndex);
|
|
1873
|
+
}));
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
/**
|
|
1877
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1878
|
+
*/
|
|
1879
|
+
// @Trace()
|
|
1880
|
+
/**
|
|
1881
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1882
|
+
* @private
|
|
1883
|
+
* @return {?}
|
|
1884
|
+
*/
|
|
1885
|
+
// @Trace()
|
|
1886
|
+
ActivityContainerComponent.prototype.synchroniseSelectedTabIndex = /**
|
|
1887
|
+
* Synchronises the selected tab index. Returns true if there was no change to the selected index.
|
|
1888
|
+
* @private
|
|
1889
|
+
* @return {?}
|
|
1890
|
+
*/
|
|
1891
|
+
// @Trace()
|
|
1892
|
+
function () {
|
|
1893
|
+
/** @type {?} */
|
|
1894
|
+
var previousIndex = this.tabs.selectedIndex;
|
|
1895
|
+
/** @type {?} */
|
|
1896
|
+
var newIndex = this.activityTabs.query().findIndex((/**
|
|
1897
|
+
* @param {?} t
|
|
1898
|
+
* @return {?}
|
|
1899
|
+
*/
|
|
1900
|
+
function (t) { return t.isComplete(); })) - 1;
|
|
1901
|
+
this.tabs.selectedIndex = newIndex;
|
|
1902
|
+
return previousIndex === newIndex;
|
|
1903
|
+
};
|
|
1904
|
+
// @Trace()
|
|
1905
|
+
// @Trace()
|
|
1906
|
+
/**
|
|
1907
|
+
* @private
|
|
1770
1908
|
* @return {?}
|
|
1771
1909
|
*/
|
|
1772
|
-
ActivityContainerComponent.prototype.
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
* @
|
|
1776
|
-
* @param {?=} data
|
|
1910
|
+
ActivityContainerComponent.prototype.onAnimationFinished =
|
|
1911
|
+
// @Trace()
|
|
1912
|
+
/**
|
|
1913
|
+
* @private
|
|
1777
1914
|
* @return {?}
|
|
1778
1915
|
*/
|
|
1779
|
-
function (
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
data: data
|
|
1784
|
-
});
|
|
1916
|
+
function () {
|
|
1917
|
+
this.getSelectedOutlet().component.onActivityReady();
|
|
1918
|
+
this.cleanupStaleActivities();
|
|
1919
|
+
this.updateActivityList();
|
|
1785
1920
|
};
|
|
1786
1921
|
/**
|
|
1787
1922
|
* @private
|
|
1788
1923
|
* @return {?}
|
|
1789
1924
|
*/
|
|
1790
|
-
ActivityContainerComponent.prototype.
|
|
1925
|
+
ActivityContainerComponent.prototype.updateActivityList = /**
|
|
1791
1926
|
* @private
|
|
1792
1927
|
* @return {?}
|
|
1793
1928
|
*/
|
|
1794
1929
|
function () {
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
* @param {?} tab
|
|
1930
|
+
this._activityList.value = this.activityTabs.value.filter((/**
|
|
1931
|
+
* @param {?} t
|
|
1798
1932
|
* @return {?}
|
|
1799
1933
|
*/
|
|
1800
|
-
function (
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1934
|
+
function (t) { return !t.isComplete() && t.isComponentRealised(); })).map((/**
|
|
1935
|
+
* @param {?} t
|
|
1936
|
+
* @return {?}
|
|
1937
|
+
*/
|
|
1938
|
+
function (t) { return t.component; }));
|
|
1805
1939
|
};
|
|
1806
1940
|
/**
|
|
1807
1941
|
* @private
|
|
1808
1942
|
* @return {?}
|
|
1809
1943
|
*/
|
|
1810
|
-
ActivityContainerComponent.prototype.
|
|
1944
|
+
ActivityContainerComponent.prototype.getSelectedOutlet = /**
|
|
1811
1945
|
* @private
|
|
1812
1946
|
* @return {?}
|
|
1813
1947
|
*/
|
|
1814
1948
|
function () {
|
|
1815
|
-
|
|
1816
|
-
this.tabs.selectedIndex = this.activityOutletTabs.length - this.obsoleteTabs.length;
|
|
1817
|
-
}
|
|
1949
|
+
return this.outlets.toArray()[this.tabs.selectedIndex];
|
|
1818
1950
|
};
|
|
1819
1951
|
ActivityContainerComponent.decorators = [
|
|
1820
1952
|
{ type: core.Component, args: [{
|
|
1821
1953
|
selector: 'angular-ui-powerups-activity-container',
|
|
1822
|
-
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab
|
|
1954
|
+
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
1955
|
styles: [":host{display:block}"]
|
|
1824
1956
|
}] }
|
|
1825
1957
|
];
|
|
@@ -1832,54 +1964,32 @@
|
|
|
1832
1964
|
outlets: [{ type: core.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
1833
1965
|
};
|
|
1834
1966
|
return ActivityContainerComponent;
|
|
1835
|
-
}(
|
|
1967
|
+
}(InteractionContext));
|
|
1836
1968
|
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
1969
|
/**
|
|
1850
1970
|
* @type {?}
|
|
1851
1971
|
* @private
|
|
1852
1972
|
*/
|
|
1853
|
-
|
|
1973
|
+
ActivityContainerComponent.prototype.activityFinishedEvents;
|
|
1974
|
+
/** @type {?} */
|
|
1975
|
+
ActivityContainerComponent.prototype.parentInteractionContext;
|
|
1976
|
+
/** @type {?} */
|
|
1977
|
+
ActivityContainerComponent.prototype.tabs;
|
|
1978
|
+
/** @type {?} */
|
|
1979
|
+
ActivityContainerComponent.prototype.outlets;
|
|
1980
|
+
/** @type {?} */
|
|
1981
|
+
ActivityContainerComponent.prototype.activityTabs;
|
|
1854
1982
|
/**
|
|
1855
1983
|
* @type {?}
|
|
1856
1984
|
* @private
|
|
1857
1985
|
*/
|
|
1858
|
-
|
|
1986
|
+
ActivityContainerComponent.prototype.finished;
|
|
1859
1987
|
/**
|
|
1860
1988
|
* @type {?}
|
|
1861
1989
|
* @private
|
|
1862
1990
|
*/
|
|
1863
|
-
|
|
1991
|
+
ActivityContainerComponent.prototype._activityList;
|
|
1864
1992
|
}
|
|
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
1993
|
|
|
1884
1994
|
/**
|
|
1885
1995
|
* @fileoverview added by tsickle
|
|
@@ -1887,19 +1997,68 @@
|
|
|
1887
1997
|
*/
|
|
1888
1998
|
/** @type {?} */
|
|
1889
1999
|
var DIALOG_INTERACTION_SERVICE_DEFAULTS = new core.InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
|
|
2000
|
+
var Guard = /** @class */ (function (_super) {
|
|
2001
|
+
__extends(Guard, _super);
|
|
2002
|
+
function Guard() {
|
|
2003
|
+
return _super.call(this, { initialValue: false }) || this;
|
|
2004
|
+
}
|
|
2005
|
+
Object.defineProperty(Guard.prototype, "value", {
|
|
2006
|
+
get: /**
|
|
2007
|
+
* @return {?}
|
|
2008
|
+
*/
|
|
2009
|
+
function () {
|
|
2010
|
+
return this.store.read();
|
|
2011
|
+
},
|
|
2012
|
+
enumerable: true,
|
|
2013
|
+
configurable: true
|
|
2014
|
+
});
|
|
2015
|
+
/**
|
|
2016
|
+
* @template R
|
|
2017
|
+
* @param {?} fun
|
|
2018
|
+
* @return {?}
|
|
2019
|
+
*/
|
|
2020
|
+
Guard.prototype.whileTrue = /**
|
|
2021
|
+
* @template R
|
|
2022
|
+
* @param {?} fun
|
|
2023
|
+
* @return {?}
|
|
2024
|
+
*/
|
|
2025
|
+
function (fun) {
|
|
2026
|
+
this.startTransaction().commit(true);
|
|
2027
|
+
try {
|
|
2028
|
+
return fun();
|
|
2029
|
+
}
|
|
2030
|
+
finally {
|
|
2031
|
+
this.startTransaction().commit(false);
|
|
2032
|
+
}
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* @template R
|
|
2036
|
+
* @param {?} fun
|
|
2037
|
+
* @param {?=} defaultValue
|
|
2038
|
+
* @return {?}
|
|
2039
|
+
*/
|
|
2040
|
+
Guard.prototype.runIfFalse = /**
|
|
2041
|
+
* @template R
|
|
2042
|
+
* @param {?} fun
|
|
2043
|
+
* @param {?=} defaultValue
|
|
2044
|
+
* @return {?}
|
|
2045
|
+
*/
|
|
2046
|
+
function (fun, defaultValue) {
|
|
2047
|
+
if (defaultValue === void 0) { defaultValue = null; }
|
|
2048
|
+
return !this.value ? fun() : defaultValue;
|
|
2049
|
+
};
|
|
2050
|
+
return Guard;
|
|
2051
|
+
}(pectin.ValueModel));
|
|
1890
2052
|
var DialogInteractionService = /** @class */ (function (_super) {
|
|
1891
2053
|
__extends(DialogInteractionService, _super);
|
|
1892
|
-
function DialogInteractionService(dialogService,
|
|
2054
|
+
function DialogInteractionService(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
|
|
1893
2055
|
var _this = _super.call(this) || this;
|
|
1894
2056
|
_this.dialogService = dialogService;
|
|
1895
|
-
_this.router = router;
|
|
1896
2057
|
_this.dialogServiceDefaults = dialogServiceDefaults;
|
|
1897
2058
|
_this.matDialogDefaultConfig = matDialogDefaultConfig;
|
|
1898
2059
|
_this._activityList = new pectin.DelegatingListModel();
|
|
1899
|
-
_this.
|
|
2060
|
+
_this.startingGuard = new Guard();
|
|
1900
2061
|
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
2062
|
return _this;
|
|
1904
2063
|
}
|
|
1905
2064
|
/**
|
|
@@ -1909,7 +2068,7 @@
|
|
|
1909
2068
|
* @return {?}
|
|
1910
2069
|
*/
|
|
1911
2070
|
function () {
|
|
1912
|
-
return this.
|
|
2071
|
+
return !!this.currentActivityId;
|
|
1913
2072
|
};
|
|
1914
2073
|
/**
|
|
1915
2074
|
* @return {?}
|
|
@@ -1918,7 +2077,7 @@
|
|
|
1918
2077
|
* @return {?}
|
|
1919
2078
|
*/
|
|
1920
2079
|
function () {
|
|
1921
|
-
this.currentActivity.
|
|
2080
|
+
this.currentActivity.cancel(null);
|
|
1922
2081
|
};
|
|
1923
2082
|
Object.defineProperty(DialogInteractionService.prototype, "activityList", {
|
|
1924
2083
|
get: /**
|
|
@@ -1971,56 +2130,59 @@
|
|
|
1971
2130
|
*/
|
|
1972
2131
|
function (a) { return a.constructor.name; })).join(', '));
|
|
1973
2132
|
}
|
|
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
|
|
2133
|
+
return this.startingGuard.whileTrue((/**
|
|
1988
2134
|
* @return {?}
|
|
1989
2135
|
*/
|
|
1990
|
-
function (
|
|
2136
|
+
function () {
|
|
2137
|
+
_this.currentActivityId = uuid.v1();
|
|
1991
2138
|
/** @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
|
-
}
|
|
2139
|
+
var self = _this;
|
|
2140
|
+
/** @type {?} */
|
|
2141
|
+
var config = __assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, _this.matDialogDefaultConfig, _this.dialogServiceDefaults, {
|
|
2142
|
+
data: data,
|
|
2143
|
+
disableClose: disableClose,
|
|
2144
|
+
panelClass: 'dialog-interaction-service'
|
|
2016
2145
|
});
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2146
|
+
/** @type {?} */
|
|
2147
|
+
var matDialogRef = (/** @type {?} */ (_this.dialogService.open(ActivityContainerComponent, config)));
|
|
2148
|
+
return new Promise((/**
|
|
2149
|
+
* @param {?} resolve
|
|
2150
|
+
* @param {?} reject
|
|
2151
|
+
* @return {?}
|
|
2152
|
+
*/
|
|
2153
|
+
function (resolve, reject) {
|
|
2154
|
+
/** @type {?} */
|
|
2155
|
+
var activityContainer = matDialogRef.componentInstance;
|
|
2156
|
+
activityContainer.parentInteractionContext = _this;
|
|
2157
|
+
self.safelyUpdateActivityListDelegate(activityContainer.activityList);
|
|
2158
|
+
activityContainer.initialActivityOutletContext = {
|
|
2159
|
+
activityClass: activityType,
|
|
2160
|
+
activityData: data,
|
|
2161
|
+
onDone: /**
|
|
2162
|
+
* @param {?} result
|
|
2163
|
+
* @return {?}
|
|
2164
|
+
*/
|
|
2165
|
+
function (result) {
|
|
2166
|
+
resolve(result);
|
|
2167
|
+
matDialogRef.close(result);
|
|
2168
|
+
},
|
|
2169
|
+
onCancel: /**
|
|
2170
|
+
* @param {?} error
|
|
2171
|
+
* @return {?}
|
|
2172
|
+
*/
|
|
2173
|
+
function (error) {
|
|
2174
|
+
reject(error);
|
|
2175
|
+
matDialogRef.close(error);
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
matDialogRef.updateSize();
|
|
2179
|
+
})).finally((/**
|
|
2180
|
+
* @return {?}
|
|
2181
|
+
*/
|
|
2182
|
+
function () {
|
|
2183
|
+
_this.currentActivityId = null;
|
|
2184
|
+
self.safelyUpdateActivityListDelegate(null);
|
|
2185
|
+
}));
|
|
2024
2186
|
}));
|
|
2025
2187
|
};
|
|
2026
2188
|
/**
|
|
@@ -2081,7 +2243,7 @@
|
|
|
2081
2243
|
* @return {?}
|
|
2082
2244
|
*/
|
|
2083
2245
|
function (confirm, activityType, data) {
|
|
2084
|
-
return this._startActivity(exports.ɵ
|
|
2246
|
+
return this._startActivity(exports.ɵbc, {
|
|
2085
2247
|
confirm: confirm,
|
|
2086
2248
|
activityType: activityType,
|
|
2087
2249
|
data: data
|
|
@@ -2095,16 +2257,13 @@
|
|
|
2095
2257
|
/** @nocollapse */
|
|
2096
2258
|
DialogInteractionService.ctorParameters = function () { return [
|
|
2097
2259
|
{ type: material.MatDialog },
|
|
2098
|
-
{ type: router.Router },
|
|
2099
2260
|
{ type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
|
|
2100
2261
|
{ type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [dialog.MAT_DIALOG_DEFAULT_OPTIONS,] }] }
|
|
2101
2262
|
]; };
|
|
2102
|
-
/** @nocollapse */ DialogInteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(
|
|
2263
|
+
/** @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
2264
|
return DialogInteractionService;
|
|
2104
2265
|
}(InteractionContext));
|
|
2105
2266
|
if (false) {
|
|
2106
|
-
/** @type {?} */
|
|
2107
|
-
DialogInteractionService.prototype.currentActivity;
|
|
2108
2267
|
/**
|
|
2109
2268
|
* @type {?}
|
|
2110
2269
|
* @private
|
|
@@ -2114,17 +2273,17 @@
|
|
|
2114
2273
|
* @type {?}
|
|
2115
2274
|
* @private
|
|
2116
2275
|
*/
|
|
2117
|
-
DialogInteractionService.prototype.
|
|
2276
|
+
DialogInteractionService.prototype.startingGuard;
|
|
2118
2277
|
/**
|
|
2119
2278
|
* @type {?}
|
|
2120
2279
|
* @private
|
|
2121
2280
|
*/
|
|
2122
|
-
DialogInteractionService.prototype.
|
|
2281
|
+
DialogInteractionService.prototype.currentActivityId;
|
|
2123
2282
|
/**
|
|
2124
2283
|
* @type {?}
|
|
2125
2284
|
* @private
|
|
2126
2285
|
*/
|
|
2127
|
-
DialogInteractionService.prototype.
|
|
2286
|
+
DialogInteractionService.prototype.dialogService;
|
|
2128
2287
|
/** @type {?} */
|
|
2129
2288
|
DialogInteractionService.prototype.dialogServiceDefaults;
|
|
2130
2289
|
/** @type {?} */
|
|
@@ -2148,20 +2307,20 @@
|
|
|
2148
2307
|
portal.PortalModule
|
|
2149
2308
|
],
|
|
2150
2309
|
declarations: [
|
|
2151
|
-
|
|
2310
|
+
ActivityContainerComponent,
|
|
2152
2311
|
ConfirmationDialogComponent,
|
|
2153
|
-
exports.ɵ
|
|
2312
|
+
exports.ɵbc,
|
|
2154
2313
|
AlertDialogComponent,
|
|
2155
2314
|
ActivityOutletComponent
|
|
2156
2315
|
],
|
|
2157
2316
|
exports: [
|
|
2158
|
-
|
|
2317
|
+
ActivityContainerComponent,
|
|
2159
2318
|
ActivityOutletComponent,
|
|
2160
2319
|
],
|
|
2161
2320
|
entryComponents: [
|
|
2162
|
-
|
|
2321
|
+
ActivityContainerComponent,
|
|
2163
2322
|
ConfirmationDialogComponent,
|
|
2164
|
-
exports.ɵ
|
|
2323
|
+
exports.ɵbc,
|
|
2165
2324
|
AlertDialogComponent
|
|
2166
2325
|
],
|
|
2167
2326
|
providers: [
|
|
@@ -2714,10 +2873,92 @@
|
|
|
2714
2873
|
* @fileoverview added by tsickle
|
|
2715
2874
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2716
2875
|
*/
|
|
2876
|
+
var NavigationSession = /** @class */ (function () {
|
|
2877
|
+
function NavigationSession(isPopState, initialUrl) {
|
|
2878
|
+
this.isPopState = isPopState;
|
|
2879
|
+
this.initialUrl = initialUrl;
|
|
2880
|
+
this._alreadyAccepted = [];
|
|
2881
|
+
console.log('NavigationSession', { isPopState: isPopState, initialUrl: initialUrl });
|
|
2882
|
+
}
|
|
2883
|
+
/**
|
|
2884
|
+
* @param {?} placeComponent
|
|
2885
|
+
* @return {?}
|
|
2886
|
+
*/
|
|
2887
|
+
NavigationSession.prototype.alreadyAccepted = /**
|
|
2888
|
+
* @param {?} placeComponent
|
|
2889
|
+
* @return {?}
|
|
2890
|
+
*/
|
|
2891
|
+
function (placeComponent) {
|
|
2892
|
+
return this._alreadyAccepted.includes(placeComponent);
|
|
2893
|
+
};
|
|
2894
|
+
/**
|
|
2895
|
+
* @param {?} component
|
|
2896
|
+
* @return {?}
|
|
2897
|
+
*/
|
|
2898
|
+
NavigationSession.prototype.rememberAcceptanceOf = /**
|
|
2899
|
+
* @param {?} component
|
|
2900
|
+
* @return {?}
|
|
2901
|
+
*/
|
|
2902
|
+
function (component) {
|
|
2903
|
+
this._alreadyAccepted.push(component);
|
|
2904
|
+
};
|
|
2905
|
+
return NavigationSession;
|
|
2906
|
+
}());
|
|
2907
|
+
if (false) {
|
|
2908
|
+
/**
|
|
2909
|
+
* @type {?}
|
|
2910
|
+
* @private
|
|
2911
|
+
*/
|
|
2912
|
+
NavigationSession.prototype._alreadyAccepted;
|
|
2913
|
+
/** @type {?} */
|
|
2914
|
+
NavigationSession.prototype.isPopState;
|
|
2915
|
+
/** @type {?} */
|
|
2916
|
+
NavigationSession.prototype.initialUrl;
|
|
2917
|
+
}
|
|
2717
2918
|
var PlaceRouter = /** @class */ (function () {
|
|
2718
|
-
function PlaceRouter(router) {
|
|
2719
|
-
|
|
2919
|
+
function PlaceRouter(router$1, angularLocation) {
|
|
2920
|
+
var _this = this;
|
|
2921
|
+
this.router = router$1;
|
|
2922
|
+
this._navigationSession = new pectin.MutableValueModel();
|
|
2923
|
+
angularLocation.onUrlChange((/**
|
|
2924
|
+
* @param {?} url
|
|
2925
|
+
* @return {?}
|
|
2926
|
+
*/
|
|
2927
|
+
function (url) {
|
|
2928
|
+
console.log("### " + url);
|
|
2929
|
+
}));
|
|
2930
|
+
this.router.events.subscribe((/**
|
|
2931
|
+
* @param {?} event
|
|
2932
|
+
* @return {?}
|
|
2933
|
+
*/
|
|
2934
|
+
function (event) {
|
|
2935
|
+
// console.log(`${event.constructor.name}`, location.pathname, angularLocation.getState());
|
|
2936
|
+
// NavigationStart -> .... -> NavigationCancel === redirect (so don't ask again)
|
|
2937
|
+
// NavigationStart -> .... -> NavigationEnd === navigated (so ask next time)
|
|
2938
|
+
// NavigationStart -> .... -> NavigationError === canceled (guard cancelled so ask next time)
|
|
2939
|
+
if (event instanceof router.NavigationStart && !_this.navigationSession) {
|
|
2940
|
+
_this._navigationSession.value = new NavigationSession(event.navigationTrigger === 'popstate', _this.router.routerState.snapshot.url);
|
|
2941
|
+
}
|
|
2942
|
+
if (event instanceof router.NavigationEnd) {
|
|
2943
|
+
console.log('navigation ended');
|
|
2944
|
+
_this._navigationSession.value = null;
|
|
2945
|
+
}
|
|
2946
|
+
if (event instanceof router.NavigationError) {
|
|
2947
|
+
console.log('navigation errored');
|
|
2948
|
+
_this._navigationSession.value = null;
|
|
2949
|
+
}
|
|
2950
|
+
}));
|
|
2720
2951
|
}
|
|
2952
|
+
Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
|
|
2953
|
+
get: /**
|
|
2954
|
+
* @return {?}
|
|
2955
|
+
*/
|
|
2956
|
+
function () {
|
|
2957
|
+
return this._navigationSession.value;
|
|
2958
|
+
},
|
|
2959
|
+
enumerable: true,
|
|
2960
|
+
configurable: true
|
|
2961
|
+
});
|
|
2721
2962
|
/**
|
|
2722
2963
|
* @param {?} activatedRoute
|
|
2723
2964
|
* @param {?} previous
|
|
@@ -2760,7 +3001,6 @@
|
|
|
2760
3001
|
var commands = (weHaveARouteId) ?
|
|
2761
3002
|
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
2762
3003
|
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
2763
|
-
console.log("redirect path", commands);
|
|
2764
3004
|
return this.router.createUrlTree(commands);
|
|
2765
3005
|
};
|
|
2766
3006
|
/**
|
|
@@ -2804,12 +3044,18 @@
|
|
|
2804
3044
|
];
|
|
2805
3045
|
/** @nocollapse */
|
|
2806
3046
|
PlaceRouter.ctorParameters = function () { return [
|
|
2807
|
-
{ type: router.Router }
|
|
3047
|
+
{ type: router.Router },
|
|
3048
|
+
{ type: common.Location }
|
|
2808
3049
|
]; };
|
|
2809
|
-
/** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
3050
|
+
/** @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
3051
|
return PlaceRouter;
|
|
2811
3052
|
}());
|
|
2812
3053
|
if (false) {
|
|
3054
|
+
/**
|
|
3055
|
+
* @type {?}
|
|
3056
|
+
* @private
|
|
3057
|
+
*/
|
|
3058
|
+
PlaceRouter.prototype._navigationSession;
|
|
2813
3059
|
/**
|
|
2814
3060
|
* @type {?}
|
|
2815
3061
|
* @private
|
|
@@ -4593,16 +4839,15 @@
|
|
|
4593
4839
|
*/
|
|
4594
4840
|
function ActivityOutletContext() { }
|
|
4595
4841
|
if (false) {
|
|
4596
|
-
/** @type {?} */
|
|
4597
|
-
ActivityOutletContext.prototype.interactionContext;
|
|
4598
4842
|
/** @type {?} */
|
|
4599
4843
|
ActivityOutletContext.prototype.activityClass;
|
|
4600
4844
|
/** @type {?} */
|
|
4601
4845
|
ActivityOutletContext.prototype.activityData;
|
|
4602
|
-
/**
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4846
|
+
/**
|
|
4847
|
+
* @param {?} component
|
|
4848
|
+
* @return {?}
|
|
4849
|
+
*/
|
|
4850
|
+
ActivityOutletContext.prototype.componentReady = function (component) { };
|
|
4606
4851
|
}
|
|
4607
4852
|
|
|
4608
4853
|
/**
|
|
@@ -4765,33 +5010,12 @@
|
|
|
4765
5010
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4766
5011
|
*/
|
|
4767
5012
|
var LeavePlaceGuard = /** @class */ (function () {
|
|
4768
|
-
function LeavePlaceGuard(router
|
|
4769
|
-
this.router = router
|
|
5013
|
+
function LeavePlaceGuard(router, injector, placeRouter, interactionContext, angularLocation) {
|
|
5014
|
+
this.router = router;
|
|
4770
5015
|
this.injector = injector;
|
|
5016
|
+
this.placeRouter = placeRouter;
|
|
4771
5017
|
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
|
-
}));
|
|
5018
|
+
this.angularLocation = angularLocation;
|
|
4795
5019
|
}
|
|
4796
5020
|
/**
|
|
4797
5021
|
* @param {?} component
|
|
@@ -4808,105 +5032,45 @@
|
|
|
4808
5032
|
* @return {?}
|
|
4809
5033
|
*/
|
|
4810
5034
|
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;
|
|
5035
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5036
|
+
var placeDefinitionPath, self_1, canLeave;
|
|
5037
|
+
return __generator(this, function (_a) {
|
|
5038
|
+
switch (_a.label) {
|
|
5039
|
+
case 0:
|
|
5040
|
+
placeDefinitionPath = "/" + component.placeDefinition.path;
|
|
5041
|
+
if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
|
|
5042
|
+
return [2 /*return*/, true];
|
|
5043
|
+
case 1:
|
|
5044
|
+
if (!!nextState.url.startsWith(placeDefinitionPath)) return [3 /*break*/, 3];
|
|
5045
|
+
self_1 = this;
|
|
5046
|
+
return [4 /*yield*/, component.canDeactivate()];
|
|
5047
|
+
case 2:
|
|
5048
|
+
canLeave = _a.sent();
|
|
5049
|
+
// component is happy to leave but we need to check if it's left an interaction
|
|
5050
|
+
// open. If so we close and stay where we are.
|
|
5051
|
+
if (canLeave && this.interactionContext.isActive()) {
|
|
5052
|
+
canLeave = false;
|
|
5053
|
+
console.log("cancelling", { activity: this.interactionContext.currentActivity });
|
|
5054
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
5055
|
+
}
|
|
5056
|
+
// If we're still leaving then remember it since angular will call this method multiple
|
|
5057
|
+
// times if any route parameters are changed along the way.
|
|
5058
|
+
if (canLeave) {
|
|
5059
|
+
self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
|
|
4881
5060
|
}
|
|
4882
5061
|
else {
|
|
4883
|
-
|
|
5062
|
+
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
5063
|
+
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
5064
|
+
if (this.placeRouter.navigationSession.isPopState) {
|
|
5065
|
+
console.log('cancelled during popstate');
|
|
5066
|
+
this.angularLocation.go(this.placeRouter.navigationSession.initialUrl);
|
|
5067
|
+
}
|
|
4884
5068
|
}
|
|
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);
|
|
5069
|
+
return [2 /*return*/, canLeave];
|
|
5070
|
+
case 3: return [2 /*return*/, true];
|
|
5071
|
+
}
|
|
5072
|
+
});
|
|
5073
|
+
});
|
|
4910
5074
|
};
|
|
4911
5075
|
LeavePlaceGuard.decorators = [
|
|
4912
5076
|
{ type: core.Injectable, args: [{
|
|
@@ -4917,16 +5081,11 @@
|
|
|
4917
5081
|
LeavePlaceGuard.ctorParameters = function () { return [
|
|
4918
5082
|
{ type: router.Router },
|
|
4919
5083
|
{ type: core.Injector },
|
|
5084
|
+
{ type: PlaceRouter },
|
|
4920
5085
|
{ type: InteractionContext },
|
|
4921
5086
|
{ type: common.Location }
|
|
4922
5087
|
]; };
|
|
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);
|
|
5088
|
+
/** @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
5089
|
return LeavePlaceGuard;
|
|
4931
5090
|
}());
|
|
4932
5091
|
if (false) {
|
|
@@ -4934,21 +5093,21 @@
|
|
|
4934
5093
|
* @type {?}
|
|
4935
5094
|
* @private
|
|
4936
5095
|
*/
|
|
4937
|
-
LeavePlaceGuard.prototype.
|
|
5096
|
+
LeavePlaceGuard.prototype.router;
|
|
4938
5097
|
/**
|
|
4939
5098
|
* @type {?}
|
|
4940
5099
|
* @private
|
|
4941
5100
|
*/
|
|
4942
|
-
LeavePlaceGuard.prototype.
|
|
5101
|
+
LeavePlaceGuard.prototype.injector;
|
|
4943
5102
|
/**
|
|
4944
5103
|
* @type {?}
|
|
4945
5104
|
* @private
|
|
4946
5105
|
*/
|
|
4947
|
-
LeavePlaceGuard.prototype.
|
|
5106
|
+
LeavePlaceGuard.prototype.placeRouter;
|
|
4948
5107
|
/** @type {?} */
|
|
4949
5108
|
LeavePlaceGuard.prototype.interactionContext;
|
|
4950
5109
|
/** @type {?} */
|
|
4951
|
-
LeavePlaceGuard.prototype.
|
|
5110
|
+
LeavePlaceGuard.prototype.angularLocation;
|
|
4952
5111
|
}
|
|
4953
5112
|
|
|
4954
5113
|
/**
|
|
@@ -5241,14 +5400,15 @@
|
|
|
5241
5400
|
exports.AbstractActivity = AbstractActivity;
|
|
5242
5401
|
exports.AbstractInputComponent = AbstractInputComponent;
|
|
5243
5402
|
exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
|
|
5244
|
-
exports.
|
|
5403
|
+
exports.Activity = exports.ɵba;
|
|
5404
|
+
exports.ActivityContainerComponent = ActivityContainerComponent;
|
|
5245
5405
|
exports.ActivityOutletComponent = ActivityOutletComponent;
|
|
5246
5406
|
exports.AlertDialogComponent = AlertDialogComponent;
|
|
5247
5407
|
exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
|
|
5248
5408
|
exports.BusyOverlayComponent = BusyOverlayComponent;
|
|
5249
5409
|
exports.CloseInteractionGuard = CloseInteractionGuard;
|
|
5250
5410
|
exports.CommandDirective = CommandDirective;
|
|
5251
|
-
exports.ConfirmThenDialogComponent = exports.ɵ
|
|
5411
|
+
exports.ConfirmThenDialogComponent = exports.ɵbc;
|
|
5252
5412
|
exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
|
|
5253
5413
|
exports.DEFINITION_META_DATA_KEY = DEFINITION_META_DATA_KEY;
|
|
5254
5414
|
exports.DIALOG_INTERACTION_SERVICE_DEFAULTS = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
@@ -5284,10 +5444,9 @@
|
|
|
5284
5444
|
exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
|
|
5285
5445
|
exports.ɵa = CommandDirective;
|
|
5286
5446
|
exports.ɵb = FocusBindingDirective;
|
|
5287
|
-
exports.ɵ
|
|
5288
|
-
exports.ɵ
|
|
5289
|
-
exports.ɵ
|
|
5290
|
-
exports.ɵbf = DialogInteractionService;
|
|
5447
|
+
exports.ɵbd = AlertDialogComponent;
|
|
5448
|
+
exports.ɵbf = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
5449
|
+
exports.ɵbg = DialogInteractionService;
|
|
5291
5450
|
exports.ɵc = DisposableComponent;
|
|
5292
5451
|
exports.ɵd = NumberInputComponent;
|
|
5293
5452
|
exports.ɵe = AbstractInputComponent;
|
|
@@ -5306,10 +5465,12 @@
|
|
|
5306
5465
|
exports.ɵr = AbstractPlaceNavigationComponent;
|
|
5307
5466
|
exports.ɵs = ListPlaceNavComponent;
|
|
5308
5467
|
exports.ɵt = InteractionModule;
|
|
5309
|
-
exports.ɵ
|
|
5310
|
-
exports.ɵ
|
|
5311
|
-
exports.ɵ
|
|
5312
|
-
exports.ɵ
|
|
5468
|
+
exports.ɵu = ActivityContainerComponent;
|
|
5469
|
+
exports.ɵv = InteractionContext;
|
|
5470
|
+
exports.ɵw = ActivityOutletComponent;
|
|
5471
|
+
exports.ɵx = ConfirmationDialogComponent;
|
|
5472
|
+
exports.ɵy = AbstractActivity;
|
|
5473
|
+
exports.ɵz = ACTIVITY_DATA;
|
|
5313
5474
|
|
|
5314
5475
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5315
5476
|
|