@coolon/angular-ui-powerups 0.0.83 → 0.0.85

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.
@@ -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) {
@@ -4464,13 +4468,16 @@
4464
4468
  _this.placeChanged = new core.EventEmitter();
4465
4469
  _this._activePlace = new pectin.MutableValueModel();
4466
4470
  _this._activePlaceVisitModel = new pectin.DelegatingValueModel();
4467
- _this._inOutletUpdate = new pectin.Guard();
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
- _this.isOnInitialPlace = true;
4476
+ _this.initialPlaceIndex = null;
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);
4473
4479
  _this._activePlaceVisitModel.setDelegate(new pectin.MutableValueModel());
4480
+ _this._inOutletUpdate = valueOf.any(_this._inOutletDeactivation, _this._inOutletActivation).areTruthy();
4474
4481
  /** @type {?} */
4475
4482
  var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
4476
4483
  .pullValueModel((/**
@@ -4489,37 +4496,31 @@
4489
4496
  function (p) { return (/** @type {?} */ (p.constructor)); }));
4490
4497
  _this.placeAnimationOrder = chain(_this.customPlaceAnimationOrderModel)
4491
4498
  .otherwise(defaultPlaceAnimationOrder)
4492
- .indexOf(activatePlaceType)
4493
- .map((/**
4494
- * @param {?} order
4499
+ .reduce((/**
4500
+ * @param {?} placesInOrder
4495
4501
  * @return {?}
4496
4502
  */
4497
- function (order) {
4498
- // we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0
4499
- // if we're animating.
4500
- return _this.isOnInitialPlace ? 0 :
4501
- _this.animate ? Math.max(order, 0) : 0;
4502
- }));
4503
+ function (placesInOrder) {
4504
+ /** @type {?} */
4505
+ var placeIndex = 0;
4506
+ if (activatePlaceType.value) {
4507
+ placeIndex = placesInOrder.indexOf(activatePlaceType.value);
4508
+ if (___default.isNil(_this.initialPlaceIndex)) {
4509
+ _this.initialPlaceIndex = placeIndex;
4510
+ }
4511
+ }
4512
+ return ___default.isNil(_this.initialPlaceIndex) ? 0 : placeIndex - _this.initialPlaceIndex;
4513
+ }), { dependsOn: activatePlaceType });
4503
4514
  // Push incoming changes into the component
4504
- /** @type {?} */
4505
- var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4506
- /** @type {?} */
4507
- var inRouteVisitUpdate = new pectin.Guard();
4508
- when.valueOf(routeVisit).changes((/**
4509
- * @param {?} visit
4515
+ _this.routerVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4516
+ // Our router visit will change when our active is nullified during deactivation, which will push a null visit
4517
+ // the the deactivated component, which will nuke it's view before the animations have finished.
4518
+ // The visit will alway updated after the router session is finsised (when the new visits are registered) so
4519
+ // we can safely ignore it during outlet changes as these always happen before the router session ends.
4520
+ when.valueOf(_this.routerVisit).changes((/**
4510
4521
  * @return {?}
4511
4522
  */
4512
- function (visit) {
4513
- console.log("### Route visit changed");
4514
- if (visit) { // can be null while the place and index sync up
4515
- inRouteVisitUpdate.whileTrue((/**
4516
- * @return {?}
4517
- */
4518
- function () {
4519
- _this._activePlaceVisitModel.value = visit;
4520
- }));
4521
- }
4522
- }));
4523
+ function () { return _this.pushRouteChangesToVisit(); }), { unless: _this._inOutletUpdate });
4523
4524
  // Handle component based changes
4524
4525
  when.valueOf(_this._activePlaceVisitModel).changes((/**
4525
4526
  * @param {?} next
@@ -4529,7 +4530,7 @@
4529
4530
  function (next, previous) {
4530
4531
  _this.pushVisitChangesToRoute(next, previous);
4531
4532
  }), {
4532
- unless: valueOf.any(_this._inOutletUpdate, inRouteVisitUpdate).areTruthy()
4533
+ unless: _this.placeRouter.navigationSessionActive
4533
4534
  });
4534
4535
  chain(_this._activePlace)
4535
4536
  .postponeWhile(placeRouter.navigationSessionActive)
@@ -4550,6 +4551,19 @@
4550
4551
  */
4551
4552
  function () {
4552
4553
  };
4554
+ // @Trace()
4555
+ // @Trace()
4556
+ /**
4557
+ * @return {?}
4558
+ */
4559
+ PlaceOutletComponent.prototype.getAnimationOrder =
4560
+ // @Trace()
4561
+ /**
4562
+ * @return {?}
4563
+ */
4564
+ function () {
4565
+ return this.placeAnimationOrder.value;
4566
+ };
4553
4567
  Object.defineProperty(PlaceOutletComponent.prototype, "animationDuration", {
4554
4568
  get: /**
4555
4569
  * @return {?}
@@ -4560,16 +4574,20 @@
4560
4574
  enumerable: true,
4561
4575
  configurable: true
4562
4576
  });
4577
+ // @Trace()
4578
+ // @Trace()
4563
4579
  /**
4564
4580
  * @param {?} visit
4565
4581
  * @return {?}
4566
4582
  */
4567
- PlaceOutletComponent.prototype.navigate = /**
4583
+ PlaceOutletComponent.prototype.navigate =
4584
+ // @Trace()
4585
+ /**
4568
4586
  * @param {?} visit
4569
4587
  * @return {?}
4570
4588
  */
4571
4589
  function (visit) {
4572
- console.log({ activatedRoute: this._activatedRouteModel.value });
4590
+ // console.log({ activatedRoute: this._activatedRouteModel.value });
4573
4591
  this.placeRouter.navigate(visit, {
4574
4592
  relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null
4575
4593
  });
@@ -4584,6 +4602,35 @@
4584
4602
  enumerable: true,
4585
4603
  configurable: true
4586
4604
  });
4605
+ // @Trace()
4606
+ // @Trace()
4607
+ /**
4608
+ * @return {?}
4609
+ */
4610
+ PlaceOutletComponent.prototype.pushRouteChangesToVisit =
4611
+ // @Trace()
4612
+ /**
4613
+ * @return {?}
4614
+ */
4615
+ function () {
4616
+ var _this = this;
4617
+ /** @type {?} */
4618
+ var visit = this.routerVisit.value;
4619
+ console.log({
4620
+ visit: visit,
4621
+ place: visit ? visit.placeDefinition.component : null,
4622
+ inOutletActivation: this._inOutletActivation.value,
4623
+ inRoutingSession: this.placeRouter.navigationSessionActive.value
4624
+ });
4625
+ if (visit) { // can be null while the place and index sync up
4626
+ this._inRouteVisitUpdate.whileTrue((/**
4627
+ * @return {?}
4628
+ */
4629
+ function () {
4630
+ _this._activePlaceVisitModel.value = visit;
4631
+ }));
4632
+ }
4633
+ };
4587
4634
  /**
4588
4635
  * @param {?} next
4589
4636
  * @param {?} previous
@@ -4619,19 +4666,23 @@
4619
4666
  enumerable: true,
4620
4667
  configurable: true
4621
4668
  });
4669
+ // @Trace()
4670
+ // @Trace()
4622
4671
  /**
4623
4672
  * @param {?} routerOutlet
4624
4673
  * @param {?} place
4625
4674
  * @return {?}
4626
4675
  */
4627
- PlaceOutletComponent.prototype.onOutletActivated = /**
4676
+ PlaceOutletComponent.prototype.onOutletActivated =
4677
+ // @Trace()
4678
+ /**
4628
4679
  * @param {?} routerOutlet
4629
4680
  * @param {?} place
4630
4681
  * @return {?}
4631
4682
  */
4632
4683
  function (routerOutlet, place) {
4633
4684
  var _this = this;
4634
- this._inOutletUpdate.whileTrue((/**
4685
+ this._inOutletActivation.whileTrue((/**
4635
4686
  * @return {?}
4636
4687
  */
4637
4688
  function () {
@@ -4653,38 +4704,49 @@
4653
4704
  this.animationDone();
4654
4705
  }
4655
4706
  };
4707
+ // @Trace()
4708
+ // @Trace()
4656
4709
  /**
4657
4710
  * @return {?}
4658
4711
  */
4659
- PlaceOutletComponent.prototype.onOutletDeactivated = /**
4712
+ PlaceOutletComponent.prototype.onOutletDeactivated =
4713
+ // @Trace()
4714
+ /**
4660
4715
  * @return {?}
4661
4716
  */
4662
4717
  function () {
4663
4718
  var _this = this;
4664
- this._inOutletUpdate.whileTrue((/**
4719
+ this._inOutletDeactivation.whileTrue((/**
4665
4720
  * @return {?}
4666
4721
  */
4667
4722
  function () {
4668
- _this._activePlaceVisitModel.setDelegate(null);
4669
- _this.isOnInitialPlace = false;
4670
4723
  _this._activePlace.value = null;
4671
4724
  _this._activatedRouteModel.value = null;
4672
4725
  _this._placeDefinition.value = null;
4726
+ _this._activePlaceVisitModel.setDelegate(null);
4673
4727
  }));
4674
4728
  };
4729
+ // @Trace()
4730
+ // @Trace()
4675
4731
  /**
4676
4732
  * @return {?}
4677
4733
  */
4678
- PlaceOutletComponent.prototype.animationStarted = /**
4734
+ PlaceOutletComponent.prototype.animationStarted =
4735
+ // @Trace()
4736
+ /**
4679
4737
  * @return {?}
4680
4738
  */
4681
4739
  function () {
4682
4740
  console.log({ activePlace: this._activePlace.value });
4683
4741
  };
4742
+ // @Trace()
4743
+ // @Trace()
4684
4744
  /**
4685
4745
  * @return {?}
4686
4746
  */
4687
- PlaceOutletComponent.prototype.animationDone = /**
4747
+ PlaceOutletComponent.prototype.animationDone =
4748
+ // @Trace()
4749
+ /**
4688
4750
  * @return {?}
4689
4751
  */
4690
4752
  function () {
@@ -4695,7 +4757,7 @@
4695
4757
  PlaceOutletComponent.decorators = [
4696
4758
  { type: core.Component, args: [{
4697
4759
  selector: 'aup-place-outlet',
4698
- 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",
4760
+ template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"{value: getAnimationOrder(), 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",
4699
4761
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
4700
4762
  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}"]
4701
4763
  }] }
@@ -4722,36 +4784,6 @@
4722
4784
  pectin.StoreInListModel('customPlaceAnimationOrderModel'),
4723
4785
  __metadata("design:type", Array)
4724
4786
  ], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
4725
- __decorate([
4726
- pectin.Trace(),
4727
- __metadata("design:type", Function),
4728
- __metadata("design:paramtypes", [Visit]),
4729
- __metadata("design:returntype", void 0)
4730
- ], PlaceOutletComponent.prototype, "navigate", null);
4731
- __decorate([
4732
- pectin.Trace(),
4733
- __metadata("design:type", Function),
4734
- __metadata("design:paramtypes", [router.RouterOutlet, exports.PlaceComponent]),
4735
- __metadata("design:returntype", void 0)
4736
- ], PlaceOutletComponent.prototype, "onOutletActivated", null);
4737
- __decorate([
4738
- pectin.Trace(),
4739
- __metadata("design:type", Function),
4740
- __metadata("design:paramtypes", []),
4741
- __metadata("design:returntype", void 0)
4742
- ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
4743
- __decorate([
4744
- pectin.Trace(),
4745
- __metadata("design:type", Function),
4746
- __metadata("design:paramtypes", []),
4747
- __metadata("design:returntype", void 0)
4748
- ], PlaceOutletComponent.prototype, "animationStarted", null);
4749
- __decorate([
4750
- pectin.Trace(),
4751
- __metadata("design:type", Function),
4752
- __metadata("design:paramtypes", []),
4753
- __metadata("design:returntype", void 0)
4754
- ], PlaceOutletComponent.prototype, "animationDone", null);
4755
4787
  return PlaceOutletComponent;
4756
4788
  }(DisposableComponent));
4757
4789
  if (false) {
@@ -4775,11 +4807,26 @@
4775
4807
  * @private
4776
4808
  */
4777
4809
  PlaceOutletComponent.prototype._activePlaceVisitModel;
4810
+ /**
4811
+ * @type {?}
4812
+ * @private
4813
+ */
4814
+ PlaceOutletComponent.prototype._inOutletActivation;
4815
+ /**
4816
+ * @type {?}
4817
+ * @private
4818
+ */
4819
+ PlaceOutletComponent.prototype._inOutletDeactivation;
4778
4820
  /**
4779
4821
  * @type {?}
4780
4822
  * @private
4781
4823
  */
4782
4824
  PlaceOutletComponent.prototype._inOutletUpdate;
4825
+ /**
4826
+ * @type {?}
4827
+ * @private
4828
+ */
4829
+ PlaceOutletComponent.prototype._inRouteVisitUpdate;
4783
4830
  /**
4784
4831
  * @type {?}
4785
4832
  * @private
@@ -4801,7 +4848,12 @@
4801
4848
  * @type {?}
4802
4849
  * @private
4803
4850
  */
4804
- PlaceOutletComponent.prototype.isOnInitialPlace;
4851
+ PlaceOutletComponent.prototype.initialPlaceIndex;
4852
+ /**
4853
+ * @type {?}
4854
+ * @private
4855
+ */
4856
+ PlaceOutletComponent.prototype.routerVisit;
4805
4857
  /**
4806
4858
  * @type {?}
4807
4859
  * @private
@@ -5018,7 +5070,6 @@
5018
5070
  * @fileoverview added by tsickle
5019
5071
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5020
5072
  */
5021
- var ɵ0 = { animationDuration: "2000ms" };
5022
5073
  var PlaceModule = /** @class */ (function () {
5023
5074
  function PlaceModule() {
5024
5075
  }
@@ -5051,7 +5102,7 @@
5051
5102
  ListPlaceNavComponent
5052
5103
  ],
5053
5104
  providers: [
5054
- { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
5105
+ // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "2000ms"}}
5055
5106
  ]
5056
5107
  },] }
5057
5108
  ];