@coolon/angular-ui-powerups 0.0.122 → 0.0.125

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.
@@ -3494,21 +3494,10 @@
3494
3494
  * @return {?}
3495
3495
  */
3496
3496
  function (visit) {
3497
+ var _this = this;
3497
3498
  pectin.assert.isNil(this.visit);
3498
3499
  this.visit = visit;
3499
3500
  pectin.DebugContext.get(this.visit).tag(this.placeDefinition.component.name + ".visit");
3500
- // this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {
3501
- // this.installBinding(parameterDef);
3502
- // });
3503
- };
3504
- /**
3505
- * @return {?}
3506
- */
3507
- PlaceComponent.prototype.ngAfterViewInit = /**
3508
- * @return {?}
3509
- */
3510
- function () {
3511
- var _this = this;
3512
3501
  this.placeDefinition.getVisitParameterDefs().forEach((/**
3513
3502
  * @param {?} parameterDef
3514
3503
  * @return {?}
@@ -8626,6 +8615,57 @@
8626
8615
  /** @type {?|undefined} */
8627
8616
  RouteListParameterOptions.prototype.storeInUrl;
8628
8617
  }
8618
+ /**
8619
+ * @template M
8620
+ * @param {?} prototype
8621
+ * @param {?} propertyKey
8622
+ * @param {?} backingModel
8623
+ * @param {?} tagPrefix
8624
+ * @param {?} isEmpty
8625
+ * @return {?}
8626
+ */
8627
+ function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
8628
+ /** @type {?} */
8629
+ var mechanics = {
8630
+ backingModel: backingModel,
8631
+ binding: (/** @type {?} */ (null))
8632
+ };
8633
+ /** @type {?} */
8634
+ var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8635
+ pectin.DebugContext.get(mechanics.backingModel).tag(tag);
8636
+ pectin.Logger.get(mechanics.backingModel).tag(tag);
8637
+ Object.defineProperty(prototype, propertyKey, {
8638
+ get: (/**
8639
+ * @return {?}
8640
+ */
8641
+ function () {
8642
+ return mechanics.backingModel;
8643
+ }),
8644
+ set: (/**
8645
+ * @param {?} userModel
8646
+ * @return {?}
8647
+ */
8648
+ function (userModel) {
8649
+ // This handles the scenario where we want to push an existing value model (such as a form model)
8650
+ // to and from the route.
8651
+ if (mechanics.binding) {
8652
+ mechanics.binding.dispose();
8653
+ }
8654
+ if (userModel) {
8655
+ mechanics.binding = new pectin.Binding(mechanics.backingModel, userModel);
8656
+ if (isEmpty(userModel)) {
8657
+ mechanics.binding.writeRight(); // push the visit into the user model;
8658
+ }
8659
+ else {
8660
+ if (!isEmpty(mechanics.backingModel)) {
8661
+ console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8662
+ }
8663
+ mechanics.binding.writeLeft(); // push the user model into the visit
8664
+ }
8665
+ }
8666
+ })
8667
+ });
8668
+ }
8629
8669
  /**
8630
8670
  * @template T
8631
8671
  * @param {?} type
@@ -8642,8 +8682,11 @@
8642
8682
  /** @type {?} */
8643
8683
  var param = new exports.ParameterDefinition.RouteId(propertyKey.toString(), options, type);
8644
8684
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8645
- pectin.UseDelegate({ tag: "@RouteId(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8646
- // UseDelegate()(prototype, propertyKey);
8685
+ installMechanics(prototype, propertyKey, new pectin.MutableValueModel(), "@RouteId", (/**
8686
+ * @param {?} m
8687
+ * @return {?}
8688
+ */
8689
+ function (m) { return m.query().isNil(); }));
8647
8690
  });
8648
8691
  }
8649
8692
  /**
@@ -8661,10 +8704,13 @@
8661
8704
  */
8662
8705
  function (prototype, propertyKey) {
8663
8706
  /** @type {?} */
8664
- var param = new exports.ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
8707
+ var param = new exports.ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8665
8708
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8666
- pectin.UseDelegate({ tag: "@VisitParameter(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8667
- // UseDelegate()(prototype, propertyKey);
8709
+ installMechanics(prototype, propertyKey, new pectin.MutableValueModel(), "@VisitParameter", (/**
8710
+ * @param {?} m
8711
+ * @return {?}
8712
+ */
8713
+ function (m) { return m.query().isNil(); }));
8668
8714
  });
8669
8715
  }
8670
8716
  /**
@@ -8682,10 +8728,13 @@
8682
8728
  */
8683
8729
  function (prototype, propertyKey) {
8684
8730
  /** @type {?} */
8685
- var param = new exports.ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
8686
- pectin.UseDelegate({ tag: "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8687
- // UseDelegate()(prototype, propertyKey);
8731
+ var param = new exports.ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8688
8732
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8733
+ installMechanics(prototype, propertyKey, new pectin.MutableListModel(), "@VisitParameterList", (/**
8734
+ * @param {?} m
8735
+ * @return {?}
8736
+ */
8737
+ function (m) { return m.query().isEmpty(); }));
8689
8738
  });
8690
8739
  }
8691
8740