@coolon/angular-ui-powerups 0.0.121 → 0.0.123

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 (27) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +117 -14
  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/esm2015/lib/place/components/place-outlet/place-outlet.component.js +8 -3
  6. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  7. package/esm2015/lib/place/place-component.js +19 -5
  8. package/esm2015/lib/place/place-component.js.map +1 -1
  9. package/esm2015/lib/place/place-component.metadata.json +1 -1
  10. package/esm2015/lib/place/place-definition.js +7 -1
  11. package/esm2015/lib/place/place-definition.js.map +1 -1
  12. package/esm2015/lib/place/route/parameter-decorators.js +83 -7
  13. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  14. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +8 -3
  15. package/esm5/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  16. package/esm5/lib/place/place-component.js +19 -5
  17. package/esm5/lib/place/place-component.js.map +1 -1
  18. package/esm5/lib/place/place-definition.js +11 -2
  19. package/esm5/lib/place/place-definition.js.map +1 -1
  20. package/esm5/lib/place/route/parameter-decorators.js +83 -7
  21. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  22. package/fesm2015/coolon-angular-ui-powerups.js +114 -14
  23. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  24. package/fesm5/coolon-angular-ui-powerups.js +118 -15
  25. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  26. package/lib/place/place-component.d.ts +1 -1
  27. package/package.json +2 -2
@@ -3293,12 +3293,16 @@
3293
3293
  // an empty string.
3294
3294
  return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : "";
3295
3295
  };
3296
+ // @Trace()
3297
+ // @Trace()
3296
3298
  /**
3297
3299
  * @param {?} visit
3298
3300
  * @param {?=} includeRouteId
3299
3301
  * @return {?}
3300
3302
  */
3301
- PlaceDefinition.prototype.getFormattedRouteParameters = /**
3303
+ PlaceDefinition.prototype.getFormattedRouteParameters =
3304
+ // @Trace()
3305
+ /**
3302
3306
  * @param {?} visit
3303
3307
  * @param {?=} includeRouteId
3304
3308
  * @return {?}
@@ -3384,8 +3388,13 @@
3384
3388
  // params will return null for non existent names
3385
3389
  if (params.has(def.name)) {
3386
3390
  if (def.isArray) {
3391
+ // const values = params.getAll(def.name); // TODO: EEEK getAll is returning ["1,2,3,4"] when we gave it ["1","2","3","4"].
3387
3392
  /** @type {?} */
3388
- var values = params.getAll(def.name);
3393
+ var values = params.get(def.name).split(',').map((/**
3394
+ * @param {?} s
3395
+ * @return {?}
3396
+ */
3397
+ function (s) { return s.trim(); }));
3389
3398
  result[def.name] = values.map((/**
3390
3399
  * @param {?} v
3391
3400
  * @return {?}
@@ -3480,7 +3489,7 @@
3480
3489
  * @param {?} visit
3481
3490
  * @return {?}
3482
3491
  */
3483
- PlaceComponent.prototype.initialiseBindings = /**
3492
+ PlaceComponent.prototype.initialiseVisit = /**
3484
3493
  * @param {?} visit
3485
3494
  * @return {?}
3486
3495
  */
@@ -3512,8 +3521,9 @@
3512
3521
  function (parameterDef) {
3513
3522
  /** @type {?} */
3514
3523
  var model = (/** @type {?} */ (this[parameterDef.propertyName]));
3515
- // this.txo.observe(parameterDef.propertyName, model);
3516
- this.registerDisposable(new pectin.Binding(this.visit, model, {
3524
+ pectin.DebugContext.tag(model, this.placeDefinition.component.name + "." + parameterDef.propertyName);
3525
+ /** @type {?} */
3526
+ var binding = this.registerDisposable(new pectin.Binding(this.visit, model, {
3517
3527
  toRight: /**
3518
3528
  * @param {?} visit
3519
3529
  * @return {?}
@@ -3521,7 +3531,7 @@
3521
3531
  function (visit) {
3522
3532
  /** @type {?} */
3523
3533
  var value = visit.getParameter(parameterDef.name);
3524
- // console.log('push to component', {name:parameterDef.name, value, visit});
3534
+ console.log('push to component', { name: parameterDef.name, value: value, visit: visit });
3525
3535
  return value;
3526
3536
  },
3527
3537
  toLeft: /**
@@ -3534,6 +3544,12 @@
3534
3544
  return currentVisit.replace(parameterDef, value);
3535
3545
  }
3536
3546
  }));
3547
+ setTimeout((/**
3548
+ * @return {?}
3549
+ */
3550
+ function () {
3551
+ binding.writeRight();
3552
+ }));
3537
3553
  };
3538
3554
  Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
3539
3555
  get: /**
@@ -3567,6 +3583,12 @@
3567
3583
  */
3568
3584
  function () {
3569
3585
  };
3586
+ __decorate([
3587
+ pectin.Trace(),
3588
+ __metadata("design:type", Function),
3589
+ __metadata("design:paramtypes", [exports.ParameterDefinition]),
3590
+ __metadata("design:returntype", void 0)
3591
+ ], PlaceComponent.prototype, "installBinding", null);
3570
3592
  __decorate([
3571
3593
  fastMemoizeDecorator.Memoize(),
3572
3594
  __metadata("design:type", exports.PlaceDefinition),
@@ -6435,7 +6457,11 @@
6435
6457
  _this.initialPlaceIndex = null;
6436
6458
  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;
6437
6459
  _this.parentOutletModel = new pectin.MutableValueModel(parentOutlet);
6438
- _this._activePlaceVisitModel.setDelegate(new pectin.MutableValueModel());
6460
+ /** @type {?} */
6461
+ var mutableValueModel = new pectin.MutableValueModel();
6462
+ pectin.DebugContext.tag(mutableValueModel, "PlaceOutletComponent -> mutableValueModel");
6463
+ _this._activePlaceVisitModel.setDelegate(mutableValueModel);
6464
+ pectin.DebugContext.tag(_this._activePlaceVisitModel, "PlaceOutletComponent._activePlaceVisitModel");
6439
6465
  _this._inOutletUpdate = valueOf.any(_this._inOutletDeactivation, _this._inOutletActivation).areTruthy();
6440
6466
  /** @type {?} */
6441
6467
  var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
@@ -6649,8 +6675,9 @@
6649
6675
  _this._placeDefinition.value = place.placeDefinition;
6650
6676
  /** @type {?} */
6651
6677
  var visitModel = new pectin.MutableValueModel();
6678
+ pectin.DebugContext.tag(visitModel, "PlaceOutletCompeont.visitModel");
6652
6679
  _this._activePlaceVisitModel.setDelegate(visitModel);
6653
- place.initialiseBindings(visitModel);
6680
+ place.initialiseVisit(visitModel);
6654
6681
  }
6655
6682
  catch (error) {
6656
6683
  console.error(error);
@@ -8623,10 +8650,48 @@
8623
8650
  */
8624
8651
  function (prototype, propertyKey) {
8625
8652
  /** @type {?} */
8626
- var param = new exports.ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
8653
+ var param = new exports.ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8627
8654
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8628
- pectin.UseDelegate({ tag: "@VisitParameter(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8629
- // UseDelegate()(prototype, propertyKey);
8655
+ /** @type {?} */
8656
+ var mechanics = {
8657
+ backingModel: new pectin.MutableValueModel(),
8658
+ binding: (/** @type {?} */ (null))
8659
+ };
8660
+ /** @type {?} */
8661
+ var tag = "@VisitParameter(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8662
+ pectin.DebugContext.get(mechanics.backingModel).tag(tag);
8663
+ pectin.Logger.get(mechanics.backingModel).tag(tag);
8664
+ Object.defineProperty(prototype, propertyKey, {
8665
+ get: (/**
8666
+ * @return {?}
8667
+ */
8668
+ function () {
8669
+ return mechanics.backingModel;
8670
+ }),
8671
+ set: (/**
8672
+ * @param {?} userModel
8673
+ * @return {?}
8674
+ */
8675
+ function (userModel) {
8676
+ // This handles the scenario where we want to push an existing value model (such as a form model)
8677
+ // to and from the route.
8678
+ if (mechanics.binding) {
8679
+ mechanics.binding.dispose();
8680
+ }
8681
+ if (userModel) {
8682
+ mechanics.binding = new pectin.Binding(mechanics.backingModel, userModel);
8683
+ if (userModel.query().isNil()) {
8684
+ mechanics.binding.writeRight(); // push the visit into the user model;
8685
+ }
8686
+ else {
8687
+ if (!mechanics.backingModel.query().isNil()) {
8688
+ console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8689
+ }
8690
+ mechanics.binding.writeLeft(); // push the user model into the visit
8691
+ }
8692
+ }
8693
+ })
8694
+ });
8630
8695
  });
8631
8696
  }
8632
8697
  /**
@@ -8644,10 +8709,48 @@
8644
8709
  */
8645
8710
  function (prototype, propertyKey) {
8646
8711
  /** @type {?} */
8647
- var param = new exports.ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
8648
- pectin.UseDelegate({ tag: "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8649
- // UseDelegate()(prototype, propertyKey);
8712
+ var param = new exports.ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8650
8713
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8714
+ /** @type {?} */
8715
+ var mechanics = {
8716
+ backingModel: new pectin.MutableListModel(),
8717
+ binding: (/** @type {?} */ (null))
8718
+ };
8719
+ /** @type {?} */
8720
+ var tag = "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8721
+ pectin.DebugContext.get(mechanics.backingModel).tag(tag);
8722
+ pectin.Logger.get(mechanics.backingModel).tag(tag);
8723
+ Object.defineProperty(prototype, propertyKey, {
8724
+ get: (/**
8725
+ * @return {?}
8726
+ */
8727
+ function () {
8728
+ return mechanics.backingModel;
8729
+ }),
8730
+ set: (/**
8731
+ * @param {?} userModel
8732
+ * @return {?}
8733
+ */
8734
+ function (userModel) {
8735
+ // This handles the scenario where we want to push an existing value model (such as a form model)
8736
+ // to and from the route.
8737
+ if (mechanics.binding) {
8738
+ mechanics.binding.dispose();
8739
+ }
8740
+ if (userModel) {
8741
+ mechanics.binding = new pectin.Binding(mechanics.backingModel, userModel);
8742
+ if (userModel.query().isEmpty()) {
8743
+ mechanics.binding.writeRight(); // push the visit into the user model;
8744
+ }
8745
+ else {
8746
+ if (!mechanics.backingModel.query().isEmpty()) {
8747
+ console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8748
+ }
8749
+ mechanics.binding.writeLeft(); // push the user model into the visit
8750
+ }
8751
+ }
8752
+ })
8753
+ });
8651
8754
  });
8652
8755
  }
8653
8756