@coolon/angular-ui-powerups 0.0.81 → 0.0.84

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.
Files changed (23) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +94 -55
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
  7. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
  8. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
  9. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +71 -37
  10. package/esm2015/lib/place/place-router.js +13 -3
  11. package/esm2015/lib/place/place.module.js +2 -5
  12. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
  13. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
  14. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
  15. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +75 -39
  16. package/esm5/lib/place/place-router.js +15 -11
  17. package/esm5/lib/place/place.module.js +2 -5
  18. package/fesm2015/coolon-angular-ui-powerups.js +88 -45
  19. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  20. package/fesm5/coolon-angular-ui-powerups.js +94 -55
  21. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  22. package/lib/place/components/place-outlet/place-outlet.component.d.ts +7 -10
  23. package/package.json +1 -1
@@ -1263,8 +1263,8 @@ var AlertDialogComponent = /** @class */ (function (_super) {
1263
1263
  AlertDialogComponent.decorators = [
1264
1264
  { type: Component, args: [{
1265
1265
  selector: 'aup-alert-dialog',
1266
- template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</p>\n",
1267
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1266
+ template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</div>\n",
1267
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1268
1268
  }] }
1269
1269
  ];
1270
1270
  /** @nocollapse */
@@ -1344,8 +1344,8 @@ var ConfirmThenDialogComponent = /** @class */ (function (_super) {
1344
1344
  ConfirmThenDialogComponent.decorators = [
1345
1345
  { type: Component, args: [{
1346
1346
  selector: 'aup-confirmation-dialog',
1347
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1348
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1347
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1348
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1349
1349
  }] }
1350
1350
  ];
1351
1351
  /** @nocollapse */
@@ -1410,8 +1410,8 @@ var ConfirmationDialogComponent = /** @class */ (function (_super) {
1410
1410
  ConfirmationDialogComponent.decorators = [
1411
1411
  { type: Component, args: [{
1412
1412
  selector: 'aup-confirmation-dialog',
1413
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1414
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1413
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1414
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1415
1415
  }] }
1416
1416
  ];
1417
1417
  /** @nocollapse */
@@ -4070,16 +4070,12 @@ var PlaceRouter = /** @class */ (function (_super) {
4070
4070
  [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
4071
4071
  [def.getFormattedRouteParameters(visit)];
4072
4072
  };
4073
- // @Trace()
4074
- // @Trace()
4075
4073
  /**
4076
4074
  * @private
4077
4075
  * @param {?} event
4078
4076
  * @return {?}
4079
4077
  */
4080
- PlaceRouter.prototype.onAngularRouterStarted =
4081
- // @Trace()
4082
- /**
4078
+ PlaceRouter.prototype.onAngularRouterStarted = /**
4083
4079
  * @private
4084
4080
  * @param {?} event
4085
4081
  * @return {?}
@@ -4096,15 +4092,11 @@ var PlaceRouter = /** @class */ (function (_super) {
4096
4092
  }
4097
4093
  this.firstRoute = false;
4098
4094
  };
4099
- // @Trace()
4100
- // @Trace()
4101
4095
  /**
4102
4096
  * @private
4103
4097
  * @return {?}
4104
4098
  */
4105
- PlaceRouter.prototype.onAngularRouterFinished =
4106
- // @Trace()
4107
- /**
4099
+ PlaceRouter.prototype.onAngularRouterFinished = /**
4108
4100
  * @private
4109
4101
  * @return {?}
4110
4102
  */
@@ -4159,6 +4151,18 @@ var PlaceRouter = /** @class */ (function (_super) {
4159
4151
  __metadata("design:paramtypes", [Visit, Object]),
4160
4152
  __metadata("design:returntype", Promise)
4161
4153
  ], PlaceRouter.prototype, "navigate", null);
4154
+ __decorate([
4155
+ Trace(),
4156
+ __metadata("design:type", Function),
4157
+ __metadata("design:paramtypes", [NavigationStart]),
4158
+ __metadata("design:returntype", void 0)
4159
+ ], PlaceRouter.prototype, "onAngularRouterStarted", null);
4160
+ __decorate([
4161
+ Trace(),
4162
+ __metadata("design:type", Function),
4163
+ __metadata("design:paramtypes", []),
4164
+ __metadata("design:returntype", void 0)
4165
+ ], PlaceRouter.prototype, "onAngularRouterFinished", null);
4162
4166
  return PlaceRouter;
4163
4167
  }(GarbageCollector));
4164
4168
  if (false) {
@@ -4279,13 +4283,17 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4279
4283
  _this.animate = true;
4280
4284
  _this.placeChanged = new EventEmitter();
4281
4285
  _this._activePlace = new MutableValueModel();
4282
- _this._placeVisit = new MutableValueModel();
4283
- _this._inOutletUpdate = new Guard$1();
4286
+ _this._activePlaceVisitModel = new DelegatingValueModel();
4287
+ _this._inOutletActivation = new Guard$1();
4288
+ _this._inOutletDeactivation = new Guard$1();
4289
+ _this._inRouteVisitUpdate = new Guard$1();
4284
4290
  _this._activatedRouteModel = new MutableValueModel();
4285
4291
  _this._placeDefinition = new MutableValueModel();
4286
4292
  _this.isOnInitialPlace = true;
4287
4293
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
4288
4294
  _this.parentOutletModel = new MutableValueModel(parentOutlet);
4295
+ _this._activePlaceVisitModel.setDelegate(new MutableValueModel());
4296
+ _this._inOutletUpdate = valueOf.any(_this._inOutletDeactivation, _this._inOutletActivation).areTruthy();
4289
4297
  /** @type {?} */
4290
4298
  var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
4291
4299
  .pullValueModel((/**
@@ -4316,26 +4324,17 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4316
4324
  _this.animate ? Math.max(order, 0) : 0;
4317
4325
  }));
4318
4326
  // Push incoming changes into the component
4319
- /** @type {?} */
4320
- var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4321
- /** @type {?} */
4322
- var inRouteVisitUpdate = new Guard$1();
4323
- when.valueOf(routeVisit).changes((/**
4324
- * @param {?} visit
4327
+ _this.routerVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4328
+ // Our router visit will change when our active is nullified during deactivation, which will push a null visit
4329
+ // the the deactivated component, which will nuke it's view before the animations have finished.
4330
+ // The visit will alway updated after the router session is finsised (when the new visits are registered) so
4331
+ // we can safely ignore it during outlet changes as these always happen before the router session ends.
4332
+ when.valueOf(_this.routerVisit).changes((/**
4325
4333
  * @return {?}
4326
4334
  */
4327
- function (visit) {
4328
- if (visit) { // can be null while the place and index sync up
4329
- inRouteVisitUpdate.whileTrue((/**
4330
- * @return {?}
4331
- */
4332
- function () {
4333
- _this._placeVisit.value = visit;
4334
- }));
4335
- }
4336
- }));
4335
+ function () { return _this.pushRouteChangesToVisit(); }), { unless: _this._inOutletUpdate });
4337
4336
  // Handle component based changes
4338
- when.valueOf(_this._placeVisit).changes((/**
4337
+ when.valueOf(_this._activePlaceVisitModel).changes((/**
4339
4338
  * @param {?} next
4340
4339
  * @param {?} previous
4341
4340
  * @return {?}
@@ -4343,7 +4342,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4343
4342
  function (next, previous) {
4344
4343
  _this.pushVisitChangesToRoute(next, previous);
4345
4344
  }), {
4346
- unless: inRouteVisitUpdate
4345
+ unless: _this.placeRouter.navigationSessionActive
4347
4346
  });
4348
4347
  chain(_this._activePlace)
4349
4348
  .postponeWhile(placeRouter.navigationSessionActive)
@@ -4398,6 +4397,31 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4398
4397
  enumerable: true,
4399
4398
  configurable: true
4400
4399
  });
4400
+ /**
4401
+ * @return {?}
4402
+ */
4403
+ PlaceOutletComponent.prototype.pushRouteChangesToVisit = /**
4404
+ * @return {?}
4405
+ */
4406
+ function () {
4407
+ var _this = this;
4408
+ /** @type {?} */
4409
+ var visit = this.routerVisit.value;
4410
+ console.log({
4411
+ visit: visit,
4412
+ place: visit ? visit.placeDefinition.component : null,
4413
+ inOutletActivation: this._inOutletActivation.value,
4414
+ inRoutingSession: this.placeRouter.navigationSessionActive.value,
4415
+ });
4416
+ if (visit) { // can be null while the place and index sync up
4417
+ this._inRouteVisitUpdate.whileTrue((/**
4418
+ * @return {?}
4419
+ */
4420
+ function () {
4421
+ _this._activePlaceVisitModel.value = visit;
4422
+ }));
4423
+ }
4424
+ };
4401
4425
  /**
4402
4426
  * @param {?} next
4403
4427
  * @param {?} previous
@@ -4445,7 +4469,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4445
4469
  */
4446
4470
  function (routerOutlet, place) {
4447
4471
  var _this = this;
4448
- this._inOutletUpdate.whileTrue((/**
4472
+ this._inOutletActivation.whileTrue((/**
4449
4473
  * @return {?}
4450
4474
  */
4451
4475
  function () {
@@ -4453,7 +4477,10 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4453
4477
  _this._activePlace.value = place;
4454
4478
  _this._activatedRouteModel.value = routerOutlet.activatedRoute;
4455
4479
  _this._placeDefinition.value = place.placeDefinition;
4456
- place.initialiseBindings(_this._placeVisit);
4480
+ /** @type {?} */
4481
+ var visitModel = new MutableValueModel();
4482
+ _this._activePlaceVisitModel.setDelegate(visitModel);
4483
+ place.initialiseBindings(visitModel);
4457
4484
  }
4458
4485
  catch (error) {
4459
4486
  console.error(error);
@@ -4465,26 +4492,22 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4465
4492
  }
4466
4493
  };
4467
4494
  /**
4468
- * @param {?} routerOutlet
4469
- * @param {?} $event
4470
4495
  * @return {?}
4471
4496
  */
4472
4497
  PlaceOutletComponent.prototype.onOutletDeactivated = /**
4473
- * @param {?} routerOutlet
4474
- * @param {?} $event
4475
4498
  * @return {?}
4476
4499
  */
4477
- function (routerOutlet, $event) {
4500
+ function () {
4478
4501
  var _this = this;
4479
- this._inOutletUpdate.whileTrue((/**
4502
+ this._inOutletDeactivation.whileTrue((/**
4480
4503
  * @return {?}
4481
4504
  */
4482
4505
  function () {
4483
- _this._previousPlace = _this._activePlace.value;
4484
4506
  _this.isOnInitialPlace = false;
4485
4507
  _this._activePlace.value = null;
4486
4508
  _this._activatedRouteModel.value = null;
4487
4509
  _this._placeDefinition.value = null;
4510
+ _this._activePlaceVisitModel.setDelegate(null);
4488
4511
  }));
4489
4512
  };
4490
4513
  /**
@@ -4503,10 +4526,6 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4503
4526
  * @return {?}
4504
4527
  */
4505
4528
  function () {
4506
- console.log({ activePlace: this._activePlace.value });
4507
- if (this._previousPlace) {
4508
- this._previousPlace.onPlaceDestroyed();
4509
- }
4510
4529
  if (this._activePlace.value) {
4511
4530
  this._activePlace.value.onPlaceReady();
4512
4531
  }
@@ -4514,7 +4533,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4514
4533
  PlaceOutletComponent.decorators = [
4515
4534
  { type: Component, args: [{
4516
4535
  selector: 'aup-place-outlet',
4517
- template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"{value: placeAnimationOrder.value, params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated(routerOutlet, $event)\">\n </router-outlet>\n</div>\n\n",
4536
+ template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"{value: placeAnimationOrder.value, params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n</div>\n\n",
4518
4537
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
4519
4538
  styles: [":host{display:flex;flex-direction:column;min-height:0;overflow-x:hidden}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
4520
4539
  }] }
@@ -4547,6 +4566,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4547
4566
  __metadata("design:paramtypes", [Visit]),
4548
4567
  __metadata("design:returntype", void 0)
4549
4568
  ], PlaceOutletComponent.prototype, "navigate", null);
4569
+ __decorate([
4570
+ Trace(),
4571
+ __metadata("design:type", Function),
4572
+ __metadata("design:paramtypes", []),
4573
+ __metadata("design:returntype", void 0)
4574
+ ], PlaceOutletComponent.prototype, "pushRouteChangesToVisit", null);
4550
4575
  __decorate([
4551
4576
  Trace(),
4552
4577
  __metadata("design:type", Function),
@@ -4556,7 +4581,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4556
4581
  __decorate([
4557
4582
  Trace(),
4558
4583
  __metadata("design:type", Function),
4559
- __metadata("design:paramtypes", [RouterOutlet, Object]),
4584
+ __metadata("design:paramtypes", []),
4560
4585
  __metadata("design:returntype", void 0)
4561
4586
  ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
4562
4587
  __decorate([
@@ -4593,12 +4618,27 @@ if (false) {
4593
4618
  * @type {?}
4594
4619
  * @private
4595
4620
  */
4596
- PlaceOutletComponent.prototype._placeVisit;
4621
+ PlaceOutletComponent.prototype._activePlaceVisitModel;
4622
+ /**
4623
+ * @type {?}
4624
+ * @private
4625
+ */
4626
+ PlaceOutletComponent.prototype._inOutletActivation;
4627
+ /**
4628
+ * @type {?}
4629
+ * @private
4630
+ */
4631
+ PlaceOutletComponent.prototype._inOutletDeactivation;
4597
4632
  /**
4598
4633
  * @type {?}
4599
4634
  * @private
4600
4635
  */
4601
4636
  PlaceOutletComponent.prototype._inOutletUpdate;
4637
+ /**
4638
+ * @type {?}
4639
+ * @private
4640
+ */
4641
+ PlaceOutletComponent.prototype._inRouteVisitUpdate;
4602
4642
  /**
4603
4643
  * @type {?}
4604
4644
  * @private
@@ -4625,7 +4665,7 @@ if (false) {
4625
4665
  * @type {?}
4626
4666
  * @private
4627
4667
  */
4628
- PlaceOutletComponent.prototype._previousPlace;
4668
+ PlaceOutletComponent.prototype.routerVisit;
4629
4669
  /**
4630
4670
  * @type {?}
4631
4671
  * @private
@@ -4842,7 +4882,6 @@ var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
4842
4882
  * @fileoverview added by tsickle
4843
4883
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4844
4884
  */
4845
- var ɵ0 = { animationDuration: "2000ms" };
4846
4885
  var PlaceModule = /** @class */ (function () {
4847
4886
  function PlaceModule() {
4848
4887
  }
@@ -4875,7 +4914,7 @@ var PlaceModule = /** @class */ (function () {
4875
4914
  ListPlaceNavComponent
4876
4915
  ],
4877
4916
  providers: [
4878
- { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
4917
+ // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "2000ms"}}
4879
4918
  ]
4880
4919
  },] }
4881
4920
  ];