@coolon/angular-ui-powerups 0.0.34 → 0.0.36

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.
@@ -1019,13 +1019,248 @@
1019
1019
  * @fileoverview added by tsickle
1020
1020
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1021
1021
  */
1022
+ /** @type {?} */
1023
+ var ACTIVITY_DATA = new core.InjectionToken('InteractionActivityData');
1022
1024
  /**
1025
+ * @record
1023
1026
  * @template D, R, E
1024
1027
  */
1025
- var /**
1028
+ function Activity() { }
1029
+ if (false) {
1030
+ /** @type {?} */
1031
+ Activity.prototype.busy;
1032
+ /**
1033
+ * @param {?} callback
1034
+ * @return {?}
1035
+ */
1036
+ Activity.prototype.onDone = function (callback) { };
1037
+ /**
1038
+ * @param {?} callback
1039
+ * @return {?}
1040
+ */
1041
+ Activity.prototype.onCancel = function (callback) { };
1042
+ }
1043
+
1044
+ /**
1045
+ * @fileoverview added by tsickle
1046
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1047
+ */
1048
+ /**
1049
+ * @template D, R, E
1050
+ */
1051
+ exports.ɵr = /** @class */ (function () {
1052
+ function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
1053
+ this.componentFactoryResolver = componentFactoryResolver;
1054
+ this.viewContainerRef = viewContainerRef;
1055
+ this.injector = injector;
1056
+ }
1057
+ Object.defineProperty(ActivityOutletComponent.prototype, "activityContext", {
1058
+ set: /**
1059
+ * @param {?} activityContext
1060
+ * @return {?}
1061
+ */
1062
+ function (activityContext) {
1063
+ this.loadActivity(activityContext);
1064
+ },
1065
+ enumerable: true,
1066
+ configurable: true
1067
+ });
1068
+ ;
1069
+ /**
1070
+ * @return {?}
1071
+ */
1072
+ ActivityOutletComponent.prototype.ngOnInit = /**
1073
+ * @return {?}
1074
+ */
1075
+ function () {
1076
+ };
1077
+ /**
1078
+ * @param {?} activityContext
1079
+ * @return {?}
1080
+ */
1081
+ ActivityOutletComponent.prototype.loadActivity = /**
1082
+ * @param {?} activityContext
1083
+ * @return {?}
1084
+ */
1085
+ function (activityContext) {
1086
+ /** @type {?} */
1087
+ var injector = core.Injector.create({
1088
+ providers: [
1089
+ {
1090
+ provide: InteractionContext,
1091
+ useValue: this
1092
+ },
1093
+ { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
1094
+ ],
1095
+ parent: this.injector
1096
+ });
1097
+ /** @type {?} */
1098
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityContext.activityClass);
1099
+ this.viewContainerRef.clear();
1100
+ this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
1101
+ this.activityComponentRef.instance.onDone(activityContext.onDone);
1102
+ this.activityComponentRef.instance.onCancel(activityContext.onCancel);
1103
+ };
1104
+ /**
1105
+ * @param {?} alert
1106
+ * @return {?}
1107
+ */
1108
+ ActivityOutletComponent.prototype.alert = /**
1109
+ * @param {?} alert
1110
+ * @return {?}
1111
+ */
1112
+ function (alert) {
1113
+ return this.interactionContext.alert(alert);
1114
+ };
1115
+ /**
1116
+ * @param {?} confirm
1117
+ * @return {?}
1118
+ */
1119
+ ActivityOutletComponent.prototype.confirm = /**
1120
+ * @param {?} confirm
1121
+ * @return {?}
1122
+ */
1123
+ function (confirm) {
1124
+ return this.interactionContext.confirm(confirm);
1125
+ };
1126
+ /**
1127
+ * @template D1, R1, E1
1128
+ * @param {?} activityType
1129
+ * @param {?=} data
1130
+ * @return {?}
1131
+ */
1132
+ ActivityOutletComponent.prototype.startActivity = /**
1133
+ * @template D1, R1, E1
1134
+ * @param {?} activityType
1135
+ * @param {?=} data
1136
+ * @return {?}
1137
+ */
1138
+ function (activityType, data) {
1139
+ return this.interactionContext.startActivity(activityType, data);
1140
+ };
1141
+ /**
1142
+ * @return {?}
1143
+ */
1144
+ ActivityOutletComponent.prototype.notifyReady = /**
1145
+ * @return {?}
1146
+ */
1147
+ function () {
1148
+ if (this.activityComponentRef.instance['onActivityReady']) {
1149
+ this.activityComponentRef.instance['onActivityReady']();
1150
+ }
1151
+ };
1152
+ ActivityOutletComponent.decorators = [
1153
+ { type: core.Component, args: [{
1154
+ selector: 'angular-ui-powerups-activity-outlet',
1155
+ template: '',
1156
+ styles: [":host{display:block}"]
1157
+ }] }
1158
+ ];
1159
+ /** @nocollapse */
1160
+ ActivityOutletComponent.ctorParameters = function () { return [
1161
+ { type: core.ComponentFactoryResolver },
1162
+ { type: core.ViewContainerRef },
1163
+ { type: core.Injector }
1164
+ ]; };
1165
+ ActivityOutletComponent.propDecorators = {
1166
+ interactionContext: [{ type: core.Input }],
1167
+ activityContext: [{ type: core.Input }]
1168
+ };
1169
+ return ActivityOutletComponent;
1170
+ }());
1171
+ if (false) {
1172
+ /** @type {?} */
1173
+ exports.ɵr.prototype.interactionContext;
1174
+ /**
1175
+ * @type {?}
1176
+ * @private
1177
+ */
1178
+ exports.ɵr.prototype.activityComponentRef;
1179
+ /**
1180
+ * @type {?}
1181
+ * @private
1182
+ */
1183
+ exports.ɵr.prototype.componentFactoryResolver;
1184
+ /**
1185
+ * @type {?}
1186
+ * @private
1187
+ */
1188
+ exports.ɵr.prototype.viewContainerRef;
1189
+ /**
1190
+ * @type {?}
1191
+ * @private
1192
+ */
1193
+ exports.ɵr.prototype.injector;
1194
+ /* Skipping unhandled member: ;*/
1195
+ }
1196
+ (function (ActivityOutletComponent) {
1197
+ /**
1198
+ * @template D, R, E
1199
+ */
1200
+ var /**
1201
+ * @template D, R, E
1202
+ */
1203
+ OutletInteractionContext = /** @class */ (function () {
1204
+ function OutletInteractionContext(context) {
1205
+ this.context = context;
1206
+ }
1207
+ /**
1208
+ * @param {?} alert
1209
+ * @return {?}
1210
+ */
1211
+ OutletInteractionContext.prototype.alert = /**
1212
+ * @param {?} alert
1213
+ * @return {?}
1214
+ */
1215
+ function (alert) {
1216
+ return pectin.lang.notImplemented();
1217
+ };
1218
+ /**
1219
+ * @param {?} confirm
1220
+ * @return {?}
1221
+ */
1222
+ OutletInteractionContext.prototype.confirm = /**
1223
+ * @param {?} confirm
1224
+ * @return {?}
1225
+ */
1226
+ function (confirm) {
1227
+ return pectin.lang.notImplemented();
1228
+ };
1229
+ /**
1230
+ * @template D1, R1, E1
1231
+ * @param {?} activityType
1232
+ * @param {?=} data
1233
+ * @return {?}
1234
+ */
1235
+ OutletInteractionContext.prototype.startActivity = /**
1236
+ * @template D1, R1, E1
1237
+ * @param {?} activityType
1238
+ * @param {?=} data
1239
+ * @return {?}
1240
+ */
1241
+ function (activityType, data) {
1242
+ return pectin.lang.notImplemented();
1243
+ };
1244
+ return OutletInteractionContext;
1245
+ }());
1246
+ ActivityOutletComponent.OutletInteractionContext = OutletInteractionContext;
1247
+ if (false) {
1248
+ /**
1249
+ * @type {?}
1250
+ * @private
1251
+ */
1252
+ OutletInteractionContext.prototype.context;
1253
+ }
1254
+ })(exports.ɵr || (exports.ɵr = {}));
1255
+
1256
+ /**
1257
+ * @fileoverview added by tsickle
1258
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1259
+ */
1260
+ /**
1026
1261
  * @template D, R, E
1027
1262
  */
1028
- AbstractActivity = /** @class */ (function (_super) {
1263
+ var AbstractActivity = /** @class */ (function (_super) {
1029
1264
  __extends(AbstractActivity, _super);
1030
1265
  function AbstractActivity() {
1031
1266
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -1099,6 +1334,14 @@
1099
1334
  */
1100
1335
  function () { return _this.finalizeAndDispose(); }));
1101
1336
  };
1337
+ /**
1338
+ * @return {?}
1339
+ */
1340
+ AbstractActivity.prototype.onActivityReady = /**
1341
+ * @return {?}
1342
+ */
1343
+ function () {
1344
+ };
1102
1345
  /**
1103
1346
  * @private
1104
1347
  * @return {?}
@@ -1156,6 +1399,12 @@
1156
1399
  function () {
1157
1400
  return this._busyModel.value;
1158
1401
  };
1402
+ __decorate([
1403
+ pectin.Trace(),
1404
+ __metadata("design:type", Function),
1405
+ __metadata("design:paramtypes", []),
1406
+ __metadata("design:returntype", void 0)
1407
+ ], AbstractActivity.prototype, "onActivityReady", null);
1159
1408
  return AbstractActivity;
1160
1409
  }(DisposableComponent));
1161
1410
  if (false) {
@@ -1181,32 +1430,6 @@
1181
1430
  AbstractActivity.prototype._busyModel;
1182
1431
  }
1183
1432
 
1184
- /**
1185
- * @fileoverview added by tsickle
1186
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1187
- */
1188
- /** @type {?} */
1189
- var ACTIVITY_DATA = new core.InjectionToken('InteractionActivityData');
1190
- /**
1191
- * @record
1192
- * @template D, R, E
1193
- */
1194
- function Activity() { }
1195
- if (false) {
1196
- /** @type {?} */
1197
- Activity.prototype.busy;
1198
- /**
1199
- * @param {?} callback
1200
- * @return {?}
1201
- */
1202
- Activity.prototype.onDone = function (callback) { };
1203
- /**
1204
- * @param {?} callback
1205
- * @return {?}
1206
- */
1207
- Activity.prototype.onCancel = function (callback) { };
1208
- }
1209
-
1210
1433
  /**
1211
1434
  * @fileoverview added by tsickle
1212
1435
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1302,6 +1525,8 @@
1302
1525
  var _this = _super.call(this) || this;
1303
1526
  _this.activityTabs = new pectin.MutableListModel();
1304
1527
  _this.obsoleteTabs = [];
1528
+ 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;
1529
+ _this.lastActivityTab = chain(_this.activityTabs).last().otherwise(_this.initialActivity);
1305
1530
  return _this;
1306
1531
  }
1307
1532
  /**
@@ -1324,7 +1549,7 @@
1324
1549
  observe.valuesFrom(this.tabs.animationDone).subscribe((/**
1325
1550
  * @return {?}
1326
1551
  */
1327
- function () { return _this.cleanUpTabs(); }));
1552
+ function () { return _this.onAnimationFinished(); }));
1328
1553
  };
1329
1554
  /**
1330
1555
  * @template D, R, E
@@ -1399,12 +1624,13 @@
1399
1624
  * @private
1400
1625
  * @return {?}
1401
1626
  */
1402
- ActivityContainerComponent.prototype.cleanUpTabs = /**
1627
+ ActivityContainerComponent.prototype.onAnimationFinished = /**
1403
1628
  * @private
1404
1629
  * @return {?}
1405
1630
  */
1406
1631
  function () {
1407
1632
  var _this = this;
1633
+ // TODO: notify selected tab they are ready. activty.afterAnimationComplete
1408
1634
  this.activityTabs.value = this.activityTabs.value.filter((/**
1409
1635
  * @param {?} tab
1410
1636
  * @return {?}
@@ -1412,6 +1638,7 @@
1412
1638
  function (tab) {
1413
1639
  return !_this.obsoleteTabs.includes(tab);
1414
1640
  }));
1641
+ this.outlets.last.notifyReady();
1415
1642
  };
1416
1643
  ActivityContainerComponent.decorators = [
1417
1644
  { type: core.Component, args: [{
@@ -1425,7 +1652,8 @@
1425
1652
  ActivityContainerComponent.propDecorators = {
1426
1653
  parentInteractionContext: [{ type: core.Input }],
1427
1654
  initialActivity: [{ type: core.Input }],
1428
- tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }]
1655
+ tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }],
1656
+ outlets: [{ type: core.ViewChildren, args: [exports.ɵr,] }]
1429
1657
  };
1430
1658
  return ActivityContainerComponent;
1431
1659
  }(DisposableComponent));
@@ -1437,12 +1665,19 @@
1437
1665
  /** @type {?} */
1438
1666
  exports.ɵq.prototype.tabs;
1439
1667
  /** @type {?} */
1668
+ exports.ɵq.prototype.outlets;
1669
+ /** @type {?} */
1440
1670
  exports.ɵq.prototype.activityTabs;
1441
1671
  /**
1442
1672
  * @type {?}
1443
1673
  * @private
1444
1674
  */
1445
1675
  exports.ɵq.prototype.obsoleteTabs;
1676
+ /**
1677
+ * @type {?}
1678
+ * @private
1679
+ */
1680
+ exports.ɵq.prototype.lastActivityTab;
1446
1681
  }
1447
1682
  (function (ActivityContainerComponent) {
1448
1683
  /**
@@ -1463,207 +1698,6 @@
1463
1698
  }
1464
1699
  })(exports.ɵq || (exports.ɵq = {}));
1465
1700
 
1466
- /**
1467
- * @fileoverview added by tsickle
1468
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1469
- */
1470
- /**
1471
- * @template D, R, E
1472
- */
1473
- exports.ɵx = /** @class */ (function () {
1474
- function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
1475
- this.componentFactoryResolver = componentFactoryResolver;
1476
- this.viewContainerRef = viewContainerRef;
1477
- this.injector = injector;
1478
- }
1479
- Object.defineProperty(ActivityOutletComponent.prototype, "activityContext", {
1480
- set: /**
1481
- * @param {?} activityContext
1482
- * @return {?}
1483
- */
1484
- function (activityContext) {
1485
- this.loadActivity(activityContext);
1486
- },
1487
- enumerable: true,
1488
- configurable: true
1489
- });
1490
- ;
1491
- /**
1492
- * @return {?}
1493
- */
1494
- ActivityOutletComponent.prototype.ngOnInit = /**
1495
- * @return {?}
1496
- */
1497
- function () {
1498
- };
1499
- /**
1500
- * @param {?} activityContext
1501
- * @return {?}
1502
- */
1503
- ActivityOutletComponent.prototype.loadActivity = /**
1504
- * @param {?} activityContext
1505
- * @return {?}
1506
- */
1507
- function (activityContext) {
1508
- /** @type {?} */
1509
- var injector = core.Injector.create({
1510
- providers: [
1511
- {
1512
- provide: InteractionContext,
1513
- useValue: this
1514
- },
1515
- { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
1516
- ],
1517
- parent: this.injector
1518
- });
1519
- /** @type {?} */
1520
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityContext.activityClass);
1521
- this.viewContainerRef.clear();
1522
- this.activityComponent = this.viewContainerRef.createComponent(componentFactory, 0, injector);
1523
- this.activityComponent.instance.onDone(activityContext.onDone);
1524
- this.activityComponent.instance.onCancel(activityContext.onCancel);
1525
- };
1526
- /**
1527
- * @param {?} alert
1528
- * @return {?}
1529
- */
1530
- ActivityOutletComponent.prototype.alert = /**
1531
- * @param {?} alert
1532
- * @return {?}
1533
- */
1534
- function (alert) {
1535
- return this.interactionContext.alert(alert);
1536
- };
1537
- /**
1538
- * @param {?} confirm
1539
- * @return {?}
1540
- */
1541
- ActivityOutletComponent.prototype.confirm = /**
1542
- * @param {?} confirm
1543
- * @return {?}
1544
- */
1545
- function (confirm) {
1546
- return this.interactionContext.confirm(confirm);
1547
- };
1548
- /**
1549
- * @template D1, R1, E1
1550
- * @param {?} activityType
1551
- * @param {?=} data
1552
- * @return {?}
1553
- */
1554
- ActivityOutletComponent.prototype.startActivity = /**
1555
- * @template D1, R1, E1
1556
- * @param {?} activityType
1557
- * @param {?=} data
1558
- * @return {?}
1559
- */
1560
- function (activityType, data) {
1561
- return this.interactionContext.startActivity(activityType, data);
1562
- };
1563
- ActivityOutletComponent.decorators = [
1564
- { type: core.Component, args: [{
1565
- selector: 'angular-ui-powerups-activity-outlet',
1566
- template: '',
1567
- styles: [":host{display:block}"]
1568
- }] }
1569
- ];
1570
- /** @nocollapse */
1571
- ActivityOutletComponent.ctorParameters = function () { return [
1572
- { type: core.ComponentFactoryResolver },
1573
- { type: core.ViewContainerRef },
1574
- { type: core.Injector }
1575
- ]; };
1576
- ActivityOutletComponent.propDecorators = {
1577
- interactionContext: [{ type: core.Input }],
1578
- activityContext: [{ type: core.Input }]
1579
- };
1580
- return ActivityOutletComponent;
1581
- }());
1582
- if (false) {
1583
- /** @type {?} */
1584
- exports.ɵx.prototype.interactionContext;
1585
- /**
1586
- * @type {?}
1587
- * @private
1588
- */
1589
- exports.ɵx.prototype.activityComponent;
1590
- /**
1591
- * @type {?}
1592
- * @private
1593
- */
1594
- exports.ɵx.prototype.componentFactoryResolver;
1595
- /**
1596
- * @type {?}
1597
- * @private
1598
- */
1599
- exports.ɵx.prototype.viewContainerRef;
1600
- /**
1601
- * @type {?}
1602
- * @private
1603
- */
1604
- exports.ɵx.prototype.injector;
1605
- /* Skipping unhandled member: ;*/
1606
- }
1607
- (function (ActivityOutletComponent) {
1608
- /**
1609
- * @template D, R, E
1610
- */
1611
- var /**
1612
- * @template D, R, E
1613
- */
1614
- OutletInteractionContext = /** @class */ (function () {
1615
- function OutletInteractionContext(context) {
1616
- this.context = context;
1617
- }
1618
- /**
1619
- * @param {?} alert
1620
- * @return {?}
1621
- */
1622
- OutletInteractionContext.prototype.alert = /**
1623
- * @param {?} alert
1624
- * @return {?}
1625
- */
1626
- function (alert) {
1627
- return pectin.lang.notImplemented();
1628
- };
1629
- /**
1630
- * @param {?} confirm
1631
- * @return {?}
1632
- */
1633
- OutletInteractionContext.prototype.confirm = /**
1634
- * @param {?} confirm
1635
- * @return {?}
1636
- */
1637
- function (confirm) {
1638
- return pectin.lang.notImplemented();
1639
- };
1640
- /**
1641
- * @template D1, R1, E1
1642
- * @param {?} activityType
1643
- * @param {?=} data
1644
- * @return {?}
1645
- */
1646
- OutletInteractionContext.prototype.startActivity = /**
1647
- * @template D1, R1, E1
1648
- * @param {?} activityType
1649
- * @param {?=} data
1650
- * @return {?}
1651
- */
1652
- function (activityType, data) {
1653
- return pectin.lang.notImplemented();
1654
- };
1655
- return OutletInteractionContext;
1656
- }());
1657
- ActivityOutletComponent.OutletInteractionContext = OutletInteractionContext;
1658
- if (false) {
1659
- /**
1660
- * @type {?}
1661
- * @private
1662
- */
1663
- OutletInteractionContext.prototype.context;
1664
- }
1665
- })(exports.ɵx || (exports.ɵx = {}));
1666
-
1667
1701
  /**
1668
1702
  * @fileoverview added by tsickle
1669
1703
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1813,7 +1847,7 @@
1813
1847
  exports.ɵq,
1814
1848
  ConfirmationDialogComponent,
1815
1849
  AlertDialogComponent,
1816
- exports.ɵx
1850
+ exports.ɵr
1817
1851
  ],
1818
1852
  entryComponents: [
1819
1853
  exports.ɵq,
@@ -4026,7 +4060,7 @@
4026
4060
  exports.AbstractActivity = AbstractActivity;
4027
4061
  exports.AbstractInputComponent = AbstractInputComponent;
4028
4062
  exports.ActivityContainerComponent = exports.ɵq;
4029
- exports.ActivityOutletComponent = exports.ɵx;
4063
+ exports.ActivityOutletComponent = exports.ɵr;
4030
4064
  exports.AlertDialogComponent = AlertDialogComponent;
4031
4065
  exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
4032
4066
  exports.BusyOverlayComponent = BusyOverlayComponent;
@@ -4078,10 +4112,10 @@
4078
4112
  exports.ɵn = PlaceService;
4079
4113
  exports.ɵo = TabbedPlaceNavigationComponent;
4080
4114
  exports.ɵp = InteractionModule;
4081
- exports.ɵr = ConfirmationDialogComponent;
4082
- exports.ɵs = AbstractActivity;
4083
- exports.ɵt = ACTIVITY_DATA;
4084
- exports.ɵv = AlertDialogComponent;
4115
+ exports.ɵs = ConfirmationDialogComponent;
4116
+ exports.ɵt = AbstractActivity;
4117
+ exports.ɵu = ACTIVITY_DATA;
4118
+ exports.ɵw = AlertDialogComponent;
4085
4119
  exports.ɵy = DialogInteractionService;
4086
4120
  exports.ɵz = InteractionContext;
4087
4121