@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
@@ -1043,8 +1043,8 @@ class AlertDialogComponent extends AbstractActivity {
1043
1043
  AlertDialogComponent.decorators = [
1044
1044
  { type: Component, args: [{
1045
1045
  selector: 'aup-alert-dialog',
1046
- 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",
1047
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1046
+ 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",
1047
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1048
1048
  }] }
1049
1049
  ];
1050
1050
  /** @nocollapse */
@@ -1111,8 +1111,8 @@ class ConfirmThenDialogComponent extends AbstractActivity {
1111
1111
  ConfirmThenDialogComponent.decorators = [
1112
1112
  { type: Component, args: [{
1113
1113
  selector: 'aup-confirmation-dialog',
1114
- 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",
1115
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1114
+ 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",
1115
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1116
1116
  }] }
1117
1117
  ];
1118
1118
  /** @nocollapse */
@@ -1171,8 +1171,8 @@ class ConfirmationDialogComponent extends AbstractActivity {
1171
1171
  ConfirmationDialogComponent.decorators = [
1172
1172
  { type: Component, args: [{
1173
1173
  selector: 'aup-confirmation-dialog',
1174
- 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",
1175
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1174
+ 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",
1175
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1176
1176
  }] }
1177
1177
  ];
1178
1178
  /** @nocollapse */
@@ -3242,7 +3242,6 @@ class PlaceRouter extends GarbageCollector {
3242
3242
  [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
3243
3243
  [def.getFormattedRouteParameters(visit)];
3244
3244
  }
3245
- // @Trace()
3246
3245
  /**
3247
3246
  * @private
3248
3247
  * @param {?} event
@@ -3260,7 +3259,6 @@ class PlaceRouter extends GarbageCollector {
3260
3259
  }
3261
3260
  this.firstRoute = false;
3262
3261
  }
3263
- // @Trace()
3264
3262
  /**
3265
3263
  * @private
3266
3264
  * @return {?}
@@ -3312,6 +3310,18 @@ __decorate([
3312
3310
  __metadata("design:paramtypes", [Visit, Object]),
3313
3311
  __metadata("design:returntype", Promise)
3314
3312
  ], PlaceRouter.prototype, "navigate", null);
3313
+ __decorate([
3314
+ Trace(),
3315
+ __metadata("design:type", Function),
3316
+ __metadata("design:paramtypes", [NavigationStart]),
3317
+ __metadata("design:returntype", void 0)
3318
+ ], PlaceRouter.prototype, "onAngularRouterStarted", null);
3319
+ __decorate([
3320
+ Trace(),
3321
+ __metadata("design:type", Function),
3322
+ __metadata("design:paramtypes", []),
3323
+ __metadata("design:returntype", void 0)
3324
+ ], PlaceRouter.prototype, "onAngularRouterFinished", null);
3315
3325
  if (false) {
3316
3326
  /**
3317
3327
  * @type {?}
@@ -3435,13 +3445,17 @@ class PlaceOutletComponent extends DisposableComponent {
3435
3445
  this.animate = true;
3436
3446
  this.placeChanged = new EventEmitter();
3437
3447
  this._activePlace = new MutableValueModel();
3438
- this._placeVisit = new MutableValueModel();
3439
- this._inOutletUpdate = new Guard$1();
3448
+ this._activePlaceVisitModel = new DelegatingValueModel();
3449
+ this._inOutletActivation = new Guard$1();
3450
+ this._inOutletDeactivation = new Guard$1();
3451
+ this._inRouteVisitUpdate = new Guard$1();
3440
3452
  this._activatedRouteModel = new MutableValueModel();
3441
3453
  this._placeDefinition = new MutableValueModel();
3442
3454
  this.isOnInitialPlace = true;
3443
3455
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
3444
3456
  this.parentOutletModel = new MutableValueModel(parentOutlet);
3457
+ this._activePlaceVisitModel.setDelegate(new MutableValueModel());
3458
+ this._inOutletUpdate = valueOf.any(this._inOutletDeactivation, this._inOutletActivation).areTruthy();
3445
3459
  /** @type {?} */
3446
3460
  const defaultPlaceAnimationOrder = chain(this.parentOutletModel)
3447
3461
  .pullValueModel((/**
@@ -3472,26 +3486,17 @@ class PlaceOutletComponent extends DisposableComponent {
3472
3486
  this.animate ? Math.max(order, 0) : 0;
3473
3487
  }));
3474
3488
  // Push incoming changes into the component
3475
- /** @type {?} */
3476
- const routeVisit = chain(this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
3477
- /** @type {?} */
3478
- const inRouteVisitUpdate = new Guard$1();
3479
- when.valueOf(routeVisit).changes((/**
3480
- * @param {?} visit
3489
+ this.routerVisit = chain(this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
3490
+ // Our router visit will change when our active is nullified during deactivation, which will push a null visit
3491
+ // the the deactivated component, which will nuke it's view before the animations have finished.
3492
+ // The visit will alway updated after the router session is finsised (when the new visits are registered) so
3493
+ // we can safely ignore it during outlet changes as these always happen before the router session ends.
3494
+ when.valueOf(this.routerVisit).changes((/**
3481
3495
  * @return {?}
3482
3496
  */
3483
- (visit) => {
3484
- if (visit) { // can be null while the place and index sync up
3485
- inRouteVisitUpdate.whileTrue((/**
3486
- * @return {?}
3487
- */
3488
- () => {
3489
- this._placeVisit.value = visit;
3490
- }));
3491
- }
3492
- }));
3497
+ () => this.pushRouteChangesToVisit()), { unless: this._inOutletUpdate });
3493
3498
  // Handle component based changes
3494
- when.valueOf(this._placeVisit).changes((/**
3499
+ when.valueOf(this._activePlaceVisitModel).changes((/**
3495
3500
  * @param {?} next
3496
3501
  * @param {?} previous
3497
3502
  * @return {?}
@@ -3499,7 +3504,7 @@ class PlaceOutletComponent extends DisposableComponent {
3499
3504
  (next, previous) => {
3500
3505
  this.pushVisitChangesToRoute(next, previous);
3501
3506
  }), {
3502
- unless: inRouteVisitUpdate
3507
+ unless: this.placeRouter.navigationSessionActive
3503
3508
  });
3504
3509
  chain(this._activePlace)
3505
3510
  .postponeWhile(placeRouter.navigationSessionActive)
@@ -3538,6 +3543,27 @@ class PlaceOutletComponent extends DisposableComponent {
3538
3543
  get parentOutlet() {
3539
3544
  return this.parentOutletModel.value;
3540
3545
  }
3546
+ /**
3547
+ * @return {?}
3548
+ */
3549
+ pushRouteChangesToVisit() {
3550
+ /** @type {?} */
3551
+ const visit = this.routerVisit.value;
3552
+ console.log({
3553
+ visit,
3554
+ place: visit ? visit.placeDefinition.component : null,
3555
+ inOutletActivation: this._inOutletActivation.value,
3556
+ inRoutingSession: this.placeRouter.navigationSessionActive.value,
3557
+ });
3558
+ if (visit) { // can be null while the place and index sync up
3559
+ this._inRouteVisitUpdate.whileTrue((/**
3560
+ * @return {?}
3561
+ */
3562
+ () => {
3563
+ this._activePlaceVisitModel.value = visit;
3564
+ }));
3565
+ }
3566
+ }
3541
3567
  /**
3542
3568
  * @param {?} next
3543
3569
  * @param {?} previous
@@ -3566,7 +3592,7 @@ class PlaceOutletComponent extends DisposableComponent {
3566
3592
  * @return {?}
3567
3593
  */
3568
3594
  onOutletActivated(routerOutlet, place) {
3569
- this._inOutletUpdate.whileTrue((/**
3595
+ this._inOutletActivation.whileTrue((/**
3570
3596
  * @return {?}
3571
3597
  */
3572
3598
  () => {
@@ -3574,7 +3600,10 @@ class PlaceOutletComponent extends DisposableComponent {
3574
3600
  this._activePlace.value = place;
3575
3601
  this._activatedRouteModel.value = routerOutlet.activatedRoute;
3576
3602
  this._placeDefinition.value = place.placeDefinition;
3577
- place.initialiseBindings(this._placeVisit);
3603
+ /** @type {?} */
3604
+ const visitModel = new MutableValueModel();
3605
+ this._activePlaceVisitModel.setDelegate(visitModel);
3606
+ place.initialiseBindings(visitModel);
3578
3607
  }
3579
3608
  catch (error) {
3580
3609
  console.error(error);
@@ -3586,20 +3615,18 @@ class PlaceOutletComponent extends DisposableComponent {
3586
3615
  }
3587
3616
  }
3588
3617
  /**
3589
- * @param {?} routerOutlet
3590
- * @param {?} $event
3591
3618
  * @return {?}
3592
3619
  */
3593
- onOutletDeactivated(routerOutlet, $event) {
3594
- this._inOutletUpdate.whileTrue((/**
3620
+ onOutletDeactivated() {
3621
+ this._inOutletDeactivation.whileTrue((/**
3595
3622
  * @return {?}
3596
3623
  */
3597
3624
  () => {
3598
- this._previousPlace = this._activePlace.value;
3599
3625
  this.isOnInitialPlace = false;
3600
3626
  this._activePlace.value = null;
3601
3627
  this._activatedRouteModel.value = null;
3602
3628
  this._placeDefinition.value = null;
3629
+ this._activePlaceVisitModel.setDelegate(null);
3603
3630
  }));
3604
3631
  }
3605
3632
  /**
@@ -3612,10 +3639,6 @@ class PlaceOutletComponent extends DisposableComponent {
3612
3639
  * @return {?}
3613
3640
  */
3614
3641
  animationDone() {
3615
- console.log({ activePlace: this._activePlace.value });
3616
- if (this._previousPlace) {
3617
- this._previousPlace.onPlaceDestroyed();
3618
- }
3619
3642
  if (this._activePlace.value) {
3620
3643
  this._activePlace.value.onPlaceReady();
3621
3644
  }
@@ -3624,7 +3647,7 @@ class PlaceOutletComponent extends DisposableComponent {
3624
3647
  PlaceOutletComponent.decorators = [
3625
3648
  { type: Component, args: [{
3626
3649
  selector: 'aup-place-outlet',
3627
- 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",
3650
+ 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",
3628
3651
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
3629
3652
  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}"]
3630
3653
  }] }
@@ -3657,6 +3680,12 @@ __decorate([
3657
3680
  __metadata("design:paramtypes", [Visit]),
3658
3681
  __metadata("design:returntype", void 0)
3659
3682
  ], PlaceOutletComponent.prototype, "navigate", null);
3683
+ __decorate([
3684
+ Trace(),
3685
+ __metadata("design:type", Function),
3686
+ __metadata("design:paramtypes", []),
3687
+ __metadata("design:returntype", void 0)
3688
+ ], PlaceOutletComponent.prototype, "pushRouteChangesToVisit", null);
3660
3689
  __decorate([
3661
3690
  Trace(),
3662
3691
  __metadata("design:type", Function),
@@ -3666,7 +3695,7 @@ __decorate([
3666
3695
  __decorate([
3667
3696
  Trace(),
3668
3697
  __metadata("design:type", Function),
3669
- __metadata("design:paramtypes", [RouterOutlet, Object]),
3698
+ __metadata("design:paramtypes", []),
3670
3699
  __metadata("design:returntype", void 0)
3671
3700
  ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
3672
3701
  __decorate([
@@ -3701,12 +3730,27 @@ if (false) {
3701
3730
  * @type {?}
3702
3731
  * @private
3703
3732
  */
3704
- PlaceOutletComponent.prototype._placeVisit;
3733
+ PlaceOutletComponent.prototype._activePlaceVisitModel;
3734
+ /**
3735
+ * @type {?}
3736
+ * @private
3737
+ */
3738
+ PlaceOutletComponent.prototype._inOutletActivation;
3739
+ /**
3740
+ * @type {?}
3741
+ * @private
3742
+ */
3743
+ PlaceOutletComponent.prototype._inOutletDeactivation;
3705
3744
  /**
3706
3745
  * @type {?}
3707
3746
  * @private
3708
3747
  */
3709
3748
  PlaceOutletComponent.prototype._inOutletUpdate;
3749
+ /**
3750
+ * @type {?}
3751
+ * @private
3752
+ */
3753
+ PlaceOutletComponent.prototype._inRouteVisitUpdate;
3710
3754
  /**
3711
3755
  * @type {?}
3712
3756
  * @private
@@ -3733,7 +3777,7 @@ if (false) {
3733
3777
  * @type {?}
3734
3778
  * @private
3735
3779
  */
3736
- PlaceOutletComponent.prototype._previousPlace;
3780
+ PlaceOutletComponent.prototype.routerVisit;
3737
3781
  /**
3738
3782
  * @type {?}
3739
3783
  * @private
@@ -3922,7 +3966,6 @@ TabbedPlaceNavigationComponent.ctorParameters = () => [];
3922
3966
  * @fileoverview added by tsickle
3923
3967
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3924
3968
  */
3925
- const ɵ0 = { animationDuration: "2000ms" };
3926
3969
  class PlaceModule {
3927
3970
  }
3928
3971
  PlaceModule.decorators = [
@@ -3954,7 +3997,7 @@ PlaceModule.decorators = [
3954
3997
  ListPlaceNavComponent
3955
3998
  ],
3956
3999
  providers: [
3957
- { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
4000
+ // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "2000ms"}}
3958
4001
  ]
3959
4002
  },] }
3960
4003
  ];