@coolon/angular-ui-powerups 0.0.123 → 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.
@@ -6823,6 +6823,57 @@ if (false) {
6823
6823
  /** @type {?|undefined} */
6824
6824
  RouteListParameterOptions.prototype.storeInUrl;
6825
6825
  }
6826
+ /**
6827
+ * @template M
6828
+ * @param {?} prototype
6829
+ * @param {?} propertyKey
6830
+ * @param {?} backingModel
6831
+ * @param {?} tagPrefix
6832
+ * @param {?} isEmpty
6833
+ * @return {?}
6834
+ */
6835
+ function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
6836
+ /** @type {?} */
6837
+ const mechanics = {
6838
+ backingModel: backingModel,
6839
+ binding: (/** @type {?} */ (null))
6840
+ };
6841
+ /** @type {?} */
6842
+ const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;
6843
+ DebugContext.get(mechanics.backingModel).tag(tag);
6844
+ Logger.get(mechanics.backingModel).tag(tag);
6845
+ Object.defineProperty(prototype, propertyKey, {
6846
+ get: (/**
6847
+ * @return {?}
6848
+ */
6849
+ function () {
6850
+ return mechanics.backingModel;
6851
+ }),
6852
+ set: (/**
6853
+ * @param {?} userModel
6854
+ * @return {?}
6855
+ */
6856
+ function (userModel) {
6857
+ // This handles the scenario where we want to push an existing value model (such as a form model)
6858
+ // to and from the route.
6859
+ if (mechanics.binding) {
6860
+ mechanics.binding.dispose();
6861
+ }
6862
+ if (userModel) {
6863
+ mechanics.binding = new Binding(mechanics.backingModel, userModel);
6864
+ if (isEmpty(userModel)) {
6865
+ mechanics.binding.writeRight(); // push the visit into the user model;
6866
+ }
6867
+ else {
6868
+ if (!isEmpty(mechanics.backingModel)) {
6869
+ console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
6870
+ }
6871
+ mechanics.binding.writeLeft(); // push the user model into the visit
6872
+ }
6873
+ }
6874
+ })
6875
+ });
6876
+ }
6826
6877
  /**
6827
6878
  * @template T
6828
6879
  * @param {?} type
@@ -6839,8 +6890,11 @@ function RouteId(type, options) {
6839
6890
  /** @type {?} */
6840
6891
  const param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
6841
6892
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
6842
- UseDelegate({ tag: `@RouteId(${prototype.constructor.name}.${propertyKey.toString()})` })(prototype, propertyKey);
6843
- // UseDelegate()(prototype, propertyKey);
6893
+ installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
6894
+ * @param {?} m
6895
+ * @return {?}
6896
+ */
6897
+ m => m.query().isNil()));
6844
6898
  });
6845
6899
  }
6846
6900
  /**
@@ -6860,46 +6914,11 @@ function VisitParameter(options) {
6860
6914
  /** @type {?} */
6861
6915
  const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
6862
6916
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
6863
- /** @type {?} */
6864
- const mechanics = {
6865
- backingModel: new MutableValueModel(),
6866
- binding: (/** @type {?} */ (null))
6867
- };
6868
- /** @type {?} */
6869
- const tag = `@VisitParameter(${prototype.constructor.name}.${propertyKey.toString()})`;
6870
- DebugContext.get(mechanics.backingModel).tag(tag);
6871
- Logger.get(mechanics.backingModel).tag(tag);
6872
- Object.defineProperty(prototype, propertyKey, {
6873
- get: (/**
6874
- * @return {?}
6875
- */
6876
- function () {
6877
- return mechanics.backingModel;
6878
- }),
6879
- set: (/**
6880
- * @param {?} userModel
6881
- * @return {?}
6882
- */
6883
- function (userModel) {
6884
- // This handles the scenario where we want to push an existing value model (such as a form model)
6885
- // to and from the route.
6886
- if (mechanics.binding) {
6887
- mechanics.binding.dispose();
6888
- }
6889
- if (userModel) {
6890
- mechanics.binding = new Binding(mechanics.backingModel, userModel);
6891
- if (userModel.query().isNil()) {
6892
- mechanics.binding.writeRight(); // push the visit into the user model;
6893
- }
6894
- else {
6895
- if (!mechanics.backingModel.query().isNil()) {
6896
- console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
6897
- }
6898
- mechanics.binding.writeLeft(); // push the user model into the visit
6899
- }
6900
- }
6901
- })
6902
- });
6917
+ installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
6918
+ * @param {?} m
6919
+ * @return {?}
6920
+ */
6921
+ m => m.query().isNil()));
6903
6922
  });
6904
6923
  }
6905
6924
  /**
@@ -6919,46 +6938,11 @@ function VisitParameterList(options) {
6919
6938
  /** @type {?} */
6920
6939
  const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
6921
6940
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
6922
- /** @type {?} */
6923
- const mechanics = {
6924
- backingModel: new MutableListModel(),
6925
- binding: (/** @type {?} */ (null))
6926
- };
6927
- /** @type {?} */
6928
- const tag = `@VisitParameterList(${prototype.constructor.name}.${propertyKey.toString()})`;
6929
- DebugContext.get(mechanics.backingModel).tag(tag);
6930
- Logger.get(mechanics.backingModel).tag(tag);
6931
- Object.defineProperty(prototype, propertyKey, {
6932
- get: (/**
6933
- * @return {?}
6934
- */
6935
- function () {
6936
- return mechanics.backingModel;
6937
- }),
6938
- set: (/**
6939
- * @param {?} userModel
6940
- * @return {?}
6941
- */
6942
- function (userModel) {
6943
- // This handles the scenario where we want to push an existing value model (such as a form model)
6944
- // to and from the route.
6945
- if (mechanics.binding) {
6946
- mechanics.binding.dispose();
6947
- }
6948
- if (userModel) {
6949
- mechanics.binding = new Binding(mechanics.backingModel, userModel);
6950
- if (userModel.query().isEmpty()) {
6951
- mechanics.binding.writeRight(); // push the visit into the user model;
6952
- }
6953
- else {
6954
- if (!mechanics.backingModel.query().isEmpty()) {
6955
- console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
6956
- }
6957
- mechanics.binding.writeLeft(); // push the user model into the visit
6958
- }
6959
- }
6960
- })
6961
- });
6941
+ installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
6942
+ * @param {?} m
6943
+ * @return {?}
6944
+ */
6945
+ m => m.query().isEmpty()));
6962
6946
  });
6963
6947
  }
6964
6948