@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
@@ -1447,8 +1447,8 @@
1447
1447
  AlertDialogComponent.decorators = [
1448
1448
  { type: core.Component, args: [{
1449
1449
  selector: 'aup-alert-dialog',
1450
- 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",
1451
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1450
+ 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",
1451
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1452
1452
  }] }
1453
1453
  ];
1454
1454
  /** @nocollapse */
@@ -1528,8 +1528,8 @@
1528
1528
  ConfirmThenDialogComponent.decorators = [
1529
1529
  { type: core.Component, args: [{
1530
1530
  selector: 'aup-confirmation-dialog',
1531
- 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",
1532
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1531
+ 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",
1532
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1533
1533
  }] }
1534
1534
  ];
1535
1535
  /** @nocollapse */
@@ -1594,8 +1594,8 @@
1594
1594
  ConfirmationDialogComponent.decorators = [
1595
1595
  { type: core.Component, args: [{
1596
1596
  selector: 'aup-confirmation-dialog',
1597
- 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",
1598
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1597
+ 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",
1598
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1599
1599
  }] }
1600
1600
  ];
1601
1601
  /** @nocollapse */
@@ -4254,16 +4254,12 @@
4254
4254
  [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
4255
4255
  [def.getFormattedRouteParameters(visit)];
4256
4256
  };
4257
- // @Trace()
4258
- // @Trace()
4259
4257
  /**
4260
4258
  * @private
4261
4259
  * @param {?} event
4262
4260
  * @return {?}
4263
4261
  */
4264
- PlaceRouter.prototype.onAngularRouterStarted =
4265
- // @Trace()
4266
- /**
4262
+ PlaceRouter.prototype.onAngularRouterStarted = /**
4267
4263
  * @private
4268
4264
  * @param {?} event
4269
4265
  * @return {?}
@@ -4280,15 +4276,11 @@
4280
4276
  }
4281
4277
  this.firstRoute = false;
4282
4278
  };
4283
- // @Trace()
4284
- // @Trace()
4285
4279
  /**
4286
4280
  * @private
4287
4281
  * @return {?}
4288
4282
  */
4289
- PlaceRouter.prototype.onAngularRouterFinished =
4290
- // @Trace()
4291
- /**
4283
+ PlaceRouter.prototype.onAngularRouterFinished = /**
4292
4284
  * @private
4293
4285
  * @return {?}
4294
4286
  */
@@ -4343,6 +4335,18 @@
4343
4335
  __metadata("design:paramtypes", [Visit, Object]),
4344
4336
  __metadata("design:returntype", Promise)
4345
4337
  ], PlaceRouter.prototype, "navigate", null);
4338
+ __decorate([
4339
+ pectin.Trace(),
4340
+ __metadata("design:type", Function),
4341
+ __metadata("design:paramtypes", [router.NavigationStart]),
4342
+ __metadata("design:returntype", void 0)
4343
+ ], PlaceRouter.prototype, "onAngularRouterStarted", null);
4344
+ __decorate([
4345
+ pectin.Trace(),
4346
+ __metadata("design:type", Function),
4347
+ __metadata("design:paramtypes", []),
4348
+ __metadata("design:returntype", void 0)
4349
+ ], PlaceRouter.prototype, "onAngularRouterFinished", null);
4346
4350
  return PlaceRouter;
4347
4351
  }(pectin.GarbageCollector));
4348
4352
  if (false) {
@@ -4463,13 +4467,17 @@
4463
4467
  _this.animate = true;
4464
4468
  _this.placeChanged = new core.EventEmitter();
4465
4469
  _this._activePlace = new pectin.MutableValueModel();
4466
- _this._placeVisit = new pectin.MutableValueModel();
4467
- _this._inOutletUpdate = new pectin.Guard();
4470
+ _this._activePlaceVisitModel = new pectin.DelegatingValueModel();
4471
+ _this._inOutletActivation = new pectin.Guard();
4472
+ _this._inOutletDeactivation = new pectin.Guard();
4473
+ _this._inRouteVisitUpdate = new pectin.Guard();
4468
4474
  _this._activatedRouteModel = new pectin.MutableValueModel();
4469
4475
  _this._placeDefinition = new pectin.MutableValueModel();
4470
4476
  _this.isOnInitialPlace = true;
4471
4477
  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;
4472
4478
  _this.parentOutletModel = new pectin.MutableValueModel(parentOutlet);
4479
+ _this._activePlaceVisitModel.setDelegate(new pectin.MutableValueModel());
4480
+ _this._inOutletUpdate = valueOf.any(_this._inOutletDeactivation, _this._inOutletActivation).areTruthy();
4473
4481
  /** @type {?} */
4474
4482
  var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
4475
4483
  .pullValueModel((/**
@@ -4500,26 +4508,17 @@
4500
4508
  _this.animate ? Math.max(order, 0) : 0;
4501
4509
  }));
4502
4510
  // Push incoming changes into the component
4503
- /** @type {?} */
4504
- var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4505
- /** @type {?} */
4506
- var inRouteVisitUpdate = new pectin.Guard();
4507
- when.valueOf(routeVisit).changes((/**
4508
- * @param {?} visit
4511
+ _this.routerVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4512
+ // Our router visit will change when our active is nullified during deactivation, which will push a null visit
4513
+ // the the deactivated component, which will nuke it's view before the animations have finished.
4514
+ // The visit will alway updated after the router session is finsised (when the new visits are registered) so
4515
+ // we can safely ignore it during outlet changes as these always happen before the router session ends.
4516
+ when.valueOf(_this.routerVisit).changes((/**
4509
4517
  * @return {?}
4510
4518
  */
4511
- function (visit) {
4512
- if (visit) { // can be null while the place and index sync up
4513
- inRouteVisitUpdate.whileTrue((/**
4514
- * @return {?}
4515
- */
4516
- function () {
4517
- _this._placeVisit.value = visit;
4518
- }));
4519
- }
4520
- }));
4519
+ function () { return _this.pushRouteChangesToVisit(); }), { unless: _this._inOutletUpdate });
4521
4520
  // Handle component based changes
4522
- when.valueOf(_this._placeVisit).changes((/**
4521
+ when.valueOf(_this._activePlaceVisitModel).changes((/**
4523
4522
  * @param {?} next
4524
4523
  * @param {?} previous
4525
4524
  * @return {?}
@@ -4527,7 +4526,7 @@
4527
4526
  function (next, previous) {
4528
4527
  _this.pushVisitChangesToRoute(next, previous);
4529
4528
  }), {
4530
- unless: inRouteVisitUpdate
4529
+ unless: _this.placeRouter.navigationSessionActive
4531
4530
  });
4532
4531
  chain(_this._activePlace)
4533
4532
  .postponeWhile(placeRouter.navigationSessionActive)
@@ -4582,6 +4581,31 @@
4582
4581
  enumerable: true,
4583
4582
  configurable: true
4584
4583
  });
4584
+ /**
4585
+ * @return {?}
4586
+ */
4587
+ PlaceOutletComponent.prototype.pushRouteChangesToVisit = /**
4588
+ * @return {?}
4589
+ */
4590
+ function () {
4591
+ var _this = this;
4592
+ /** @type {?} */
4593
+ var visit = this.routerVisit.value;
4594
+ console.log({
4595
+ visit: visit,
4596
+ place: visit ? visit.placeDefinition.component : null,
4597
+ inOutletActivation: this._inOutletActivation.value,
4598
+ inRoutingSession: this.placeRouter.navigationSessionActive.value,
4599
+ });
4600
+ if (visit) { // can be null while the place and index sync up
4601
+ this._inRouteVisitUpdate.whileTrue((/**
4602
+ * @return {?}
4603
+ */
4604
+ function () {
4605
+ _this._activePlaceVisitModel.value = visit;
4606
+ }));
4607
+ }
4608
+ };
4585
4609
  /**
4586
4610
  * @param {?} next
4587
4611
  * @param {?} previous
@@ -4629,7 +4653,7 @@
4629
4653
  */
4630
4654
  function (routerOutlet, place) {
4631
4655
  var _this = this;
4632
- this._inOutletUpdate.whileTrue((/**
4656
+ this._inOutletActivation.whileTrue((/**
4633
4657
  * @return {?}
4634
4658
  */
4635
4659
  function () {
@@ -4637,7 +4661,10 @@
4637
4661
  _this._activePlace.value = place;
4638
4662
  _this._activatedRouteModel.value = routerOutlet.activatedRoute;
4639
4663
  _this._placeDefinition.value = place.placeDefinition;
4640
- place.initialiseBindings(_this._placeVisit);
4664
+ /** @type {?} */
4665
+ var visitModel = new pectin.MutableValueModel();
4666
+ _this._activePlaceVisitModel.setDelegate(visitModel);
4667
+ place.initialiseBindings(visitModel);
4641
4668
  }
4642
4669
  catch (error) {
4643
4670
  console.error(error);
@@ -4649,26 +4676,22 @@
4649
4676
  }
4650
4677
  };
4651
4678
  /**
4652
- * @param {?} routerOutlet
4653
- * @param {?} $event
4654
4679
  * @return {?}
4655
4680
  */
4656
4681
  PlaceOutletComponent.prototype.onOutletDeactivated = /**
4657
- * @param {?} routerOutlet
4658
- * @param {?} $event
4659
4682
  * @return {?}
4660
4683
  */
4661
- function (routerOutlet, $event) {
4684
+ function () {
4662
4685
  var _this = this;
4663
- this._inOutletUpdate.whileTrue((/**
4686
+ this._inOutletDeactivation.whileTrue((/**
4664
4687
  * @return {?}
4665
4688
  */
4666
4689
  function () {
4667
- _this._previousPlace = _this._activePlace.value;
4668
4690
  _this.isOnInitialPlace = false;
4669
4691
  _this._activePlace.value = null;
4670
4692
  _this._activatedRouteModel.value = null;
4671
4693
  _this._placeDefinition.value = null;
4694
+ _this._activePlaceVisitModel.setDelegate(null);
4672
4695
  }));
4673
4696
  };
4674
4697
  /**
@@ -4687,10 +4710,6 @@
4687
4710
  * @return {?}
4688
4711
  */
4689
4712
  function () {
4690
- console.log({ activePlace: this._activePlace.value });
4691
- if (this._previousPlace) {
4692
- this._previousPlace.onPlaceDestroyed();
4693
- }
4694
4713
  if (this._activePlace.value) {
4695
4714
  this._activePlace.value.onPlaceReady();
4696
4715
  }
@@ -4698,7 +4717,7 @@
4698
4717
  PlaceOutletComponent.decorators = [
4699
4718
  { type: core.Component, args: [{
4700
4719
  selector: 'aup-place-outlet',
4701
- 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",
4720
+ 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",
4702
4721
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
4703
4722
  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}"]
4704
4723
  }] }
@@ -4731,6 +4750,12 @@
4731
4750
  __metadata("design:paramtypes", [Visit]),
4732
4751
  __metadata("design:returntype", void 0)
4733
4752
  ], PlaceOutletComponent.prototype, "navigate", null);
4753
+ __decorate([
4754
+ pectin.Trace(),
4755
+ __metadata("design:type", Function),
4756
+ __metadata("design:paramtypes", []),
4757
+ __metadata("design:returntype", void 0)
4758
+ ], PlaceOutletComponent.prototype, "pushRouteChangesToVisit", null);
4734
4759
  __decorate([
4735
4760
  pectin.Trace(),
4736
4761
  __metadata("design:type", Function),
@@ -4740,7 +4765,7 @@
4740
4765
  __decorate([
4741
4766
  pectin.Trace(),
4742
4767
  __metadata("design:type", Function),
4743
- __metadata("design:paramtypes", [router.RouterOutlet, Object]),
4768
+ __metadata("design:paramtypes", []),
4744
4769
  __metadata("design:returntype", void 0)
4745
4770
  ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
4746
4771
  __decorate([
@@ -4777,12 +4802,27 @@
4777
4802
  * @type {?}
4778
4803
  * @private
4779
4804
  */
4780
- PlaceOutletComponent.prototype._placeVisit;
4805
+ PlaceOutletComponent.prototype._activePlaceVisitModel;
4806
+ /**
4807
+ * @type {?}
4808
+ * @private
4809
+ */
4810
+ PlaceOutletComponent.prototype._inOutletActivation;
4811
+ /**
4812
+ * @type {?}
4813
+ * @private
4814
+ */
4815
+ PlaceOutletComponent.prototype._inOutletDeactivation;
4781
4816
  /**
4782
4817
  * @type {?}
4783
4818
  * @private
4784
4819
  */
4785
4820
  PlaceOutletComponent.prototype._inOutletUpdate;
4821
+ /**
4822
+ * @type {?}
4823
+ * @private
4824
+ */
4825
+ PlaceOutletComponent.prototype._inRouteVisitUpdate;
4786
4826
  /**
4787
4827
  * @type {?}
4788
4828
  * @private
@@ -4809,7 +4849,7 @@
4809
4849
  * @type {?}
4810
4850
  * @private
4811
4851
  */
4812
- PlaceOutletComponent.prototype._previousPlace;
4852
+ PlaceOutletComponent.prototype.routerVisit;
4813
4853
  /**
4814
4854
  * @type {?}
4815
4855
  * @private
@@ -5026,7 +5066,6 @@
5026
5066
  * @fileoverview added by tsickle
5027
5067
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5028
5068
  */
5029
- var ɵ0 = { animationDuration: "2000ms" };
5030
5069
  var PlaceModule = /** @class */ (function () {
5031
5070
  function PlaceModule() {
5032
5071
  }
@@ -5059,7 +5098,7 @@
5059
5098
  ListPlaceNavComponent
5060
5099
  ],
5061
5100
  providers: [
5062
- { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
5101
+ // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "2000ms"}}
5063
5102
  ]
5064
5103
  },] }
5065
5104
  ];