@coolon/angular-ui-powerups 2.0.0-alpha.12 → 2.0.0-alpha.14

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 (40) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +84 -93
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/components/forms/abstract-list-input.component.js +11 -10
  8. package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
  9. package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
  10. package/esm2015/lib/components/forms/abstract-value-input.component.js +2 -1
  11. package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
  12. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -7
  13. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  14. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  15. package/esm2015/lib/place/place-component.js +1 -1
  16. package/esm2015/lib/place/place-component.js.map +1 -1
  17. package/esm2015/lib/place/place-router.js +2 -8
  18. package/esm2015/lib/place/place-router.js.map +1 -1
  19. package/esm2015/lib/place/place-router.metadata.json +1 -1
  20. package/esm2015/lib/place/route/parameter-decorators.js +2 -3
  21. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  22. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  23. package/esm5/lib/components/forms/abstract-list-input.component.js +11 -10
  24. package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
  25. package/esm5/lib/components/forms/abstract-value-input.component.js +2 -1
  26. package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
  27. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -7
  28. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  29. package/esm5/lib/place/place-component.js +1 -1
  30. package/esm5/lib/place/place-component.js.map +1 -1
  31. package/esm5/lib/place/place-router.js +2 -8
  32. package/esm5/lib/place/place-router.js.map +1 -1
  33. package/esm5/lib/place/route/parameter-decorators.js +2 -3
  34. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  35. package/fesm2015/coolon-angular-ui-powerups.js +80 -89
  36. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  37. package/fesm5/coolon-angular-ui-powerups.js +85 -94
  38. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  39. package/lib/components/forms/abstract-list-input.component.d.ts +1 -1
  40. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.0.0-alpha.14](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.13...v2.0.0-alpha.14) (2020-08-06)
6
+
7
+ ## [2.0.0-alpha.13](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.12...v2.0.0-alpha.13) (2020-07-31)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * added debug context to input component models ([ade30dc](https://bitbucket.org/coolon/angular-ui-powerups/commit/ade30dc8be0a7a9392c9220f86aca018ce165afd))
13
+
5
14
  ## [2.0.0-alpha.12](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2020-07-29)
6
15
 
7
16
 
@@ -888,27 +888,28 @@
888
888
  */
889
889
  // We have to register it as a disposable so it ditches any listeners when we're disposed.
890
890
  _this.inputModel = _this.registerDisposable(new pectin.Form.DelegatingListModel());
891
- _this.setValueIsInitialising = new pectin.Guard();
891
+ _this.setValueIsInProgress = new pectin.Guard();
892
892
  _this.valueChange = new core.EventEmitter();
893
893
  var when = pectin.Dsl.disposeWith(_this).when;
894
894
  when(_this.inputModel).changes(function (value) { return _this.valueChange.emit(value); }, {
895
895
  initialValue: 'ignore',
896
- unless: _this.setValueIsInitialising
896
+ unless: _this.setValueIsInProgress
897
897
  });
898
+ pectin.DebugContext.tag(_this.inputModel, _this.constructor.name + ".inputModel");
898
899
  return _this;
899
900
  }
900
901
  Object.defineProperty(AbstractListInputComponent.prototype, "value", {
901
902
  set: function (value) {
902
903
  var _this = this;
903
- if (!this.listHolder) {
904
- this.setValueIsInitialising.whileTrue(function () {
904
+ this.setValueIsInProgress.whileTrue(function () {
905
+ if (!_this.listHolder) {
905
906
  _this.listHolder = new pectin.MutableListModel(value);
906
907
  _this.listModel = _this.listHolder;
907
- });
908
- }
909
- else {
910
- this.listHolder.value = value;
911
- }
908
+ }
909
+ else {
910
+ _this.listHolder.value = value;
911
+ }
912
+ });
912
913
  },
913
914
  enumerable: true,
914
915
  configurable: true
@@ -956,6 +957,7 @@
956
957
  initialValue: 'ignore',
957
958
  unless: _this.setValueInProgress
958
959
  });
960
+ pectin.DebugContext.tag(_this.inputModel, _this.constructor.name + ".inputModel");
959
961
  return _this;
960
962
  }
961
963
  Object.defineProperty(AbstractValueInputComponent.prototype, "value", {
@@ -3221,6 +3223,7 @@
3221
3223
  ActivityContainerComponent.prototype.registerDisposable = function (disposable) {
3222
3224
  return this.garbage.registerDisposable(disposable);
3223
3225
  };
3226
+ // @Trace()
3224
3227
  ActivityContainerComponent.prototype.dispose = function () {
3225
3228
  // TODO: think about auto cancelling any outstanding activity on dispose.
3226
3229
  // See NavigationState.Navigating for a use-case.
@@ -3369,12 +3372,6 @@
3369
3372
  core.ViewChildren(ActivityOutletComponent),
3370
3373
  __metadata("design:type", core.QueryList)
3371
3374
  ], ActivityContainerComponent.prototype, "activityOutlets", void 0);
3372
- __decorate([
3373
- pectin.Trace(),
3374
- __metadata("design:type", Function),
3375
- __metadata("design:paramtypes", []),
3376
- __metadata("design:returntype", void 0)
3377
- ], ActivityContainerComponent.prototype, "dispose", null);
3378
3375
  ActivityContainerComponent = __decorate([
3379
3376
  core.Component({
3380
3377
  selector: 'aup-activity-container',
@@ -4458,7 +4455,7 @@
4458
4455
  pectin.assert.isNil(this.visitModel.value);
4459
4456
  var when = pectin.Dsl.disposeWith(this).when;
4460
4457
  this.visitModel.value = visit;
4461
- pectin.DebugContext.get(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4458
+ pectin.DebugContext.getOrCreate(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4462
4459
  this.placeDefinition.getVisitParameterDefs().forEach(function (parameterDef) { return _this.installBinding(parameterDef); });
4463
4460
  when.valueOf(this.visitModel).changes(function (current, previous) {
4464
4461
  notifyVisitChanged(current, previous);
@@ -5606,75 +5603,6 @@
5606
5603
  return UrlService;
5607
5604
  }());
5608
5605
 
5609
- var Visit = /** @class */ (function () {
5610
- function Visit(placeDefinition, visitParameters) {
5611
- if (visitParameters === void 0) { visitParameters = {}; }
5612
- this.placeDefinition = placeDefinition;
5613
- this.visitParameters = visitParameters;
5614
- }
5615
- // @Trace()
5616
- Visit.prototype.getRouteId = function () {
5617
- return this.placeDefinition.getRouteIdFrom(this);
5618
- };
5619
- // @Trace()
5620
- Visit.prototype.hasRouteId = function () {
5621
- return !___default.isNil(this.getRouteId());
5622
- };
5623
- /**
5624
- * Returns the value of the place parameter with the specified name. The parameter
5625
- * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
5626
- * same as the the ValueModel property name.
5627
- * @param parameterName the field name of the property model or the `as` option if specified.
5628
- */
5629
- Visit.prototype.getParameter = function (parameterName) {
5630
- return this.visitParameters[parameterName];
5631
- };
5632
- // @Trace()
5633
- Visit.prototype.hasParameter = function (parameterName) {
5634
- return Object.keys(this.visitParameters).includes(parameterName);
5635
- };
5636
- Visit.prototype.replace = function (parameter, value) {
5637
- var _a;
5638
- return new Visit(this.placeDefinition, __assign(__assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
5639
- };
5640
- Visit.prototype.mergeRouteParameters = function (routeParams) {
5641
- var _this = this;
5642
- // todo: whitelist parameters.
5643
- var routeParameterKeys = Object.keys(routeParams);
5644
- var params = {};
5645
- this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
5646
- if (def.isRouteId || def.isRouteParameter) {
5647
- if (routeParameterKeys.includes(def.name)) {
5648
- params[def.name] = routeParams[def.name];
5649
- }
5650
- }
5651
- else {
5652
- // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
5653
- // defaults and remember sanitisation process.
5654
- var value = _this.getParameter(def.name);
5655
- if (_this.hasParameter(def.name)) {
5656
- params[def.name] = value;
5657
- }
5658
- }
5659
- });
5660
- return new Visit(this.placeDefinition, params);
5661
- };
5662
- Visit.prototype.hasRoutingChangedFrom = function (other) {
5663
- var samePlace = other.placeDefinition === this.placeDefinition;
5664
- var sameRouteParameters = ___default.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
5665
- return !samePlace || !sameRouteParameters;
5666
- };
5667
- Visit.prototype.hasChangedFrom = function (other) {
5668
- var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
5669
- return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
5670
- };
5671
- Visit.prototype.toDebugString = function () {
5672
- var _this = this;
5673
- return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
5674
- };
5675
- return Visit;
5676
- }());
5677
-
5678
5606
  var PlaceRouter = /** @class */ (function (_super) {
5679
5607
  __extends(PlaceRouter, _super);
5680
5608
  function PlaceRouter(angularRouter, angularLocation, interactionService, urlService, placeHistory) {
@@ -5870,6 +5798,7 @@
5870
5798
  enumerable: true,
5871
5799
  configurable: true
5872
5800
  });
5801
+ // @Trace()
5873
5802
  PlaceRouter.prototype.pushVisitChangesToRoute = function (previous, next) {
5874
5803
  return __awaiter(this, void 0, void 0, function () {
5875
5804
  var _this = this;
@@ -5970,12 +5899,6 @@
5970
5899
  { type: exports.ɵbz }
5971
5900
  ]; };
5972
5901
  PlaceRouter.ɵprov = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(common.Location), core.ɵɵinject(exports.ɵbw), core.ɵɵinject(UrlService), core.ɵɵinject(exports.ɵbz)); }, token: PlaceRouter, providedIn: "root" });
5973
- __decorate([
5974
- pectin.Trace(),
5975
- __metadata("design:type", Function),
5976
- __metadata("design:paramtypes", [Visit, Visit]),
5977
- __metadata("design:returntype", Promise)
5978
- ], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
5979
5902
  PlaceRouter = __decorate([
5980
5903
  core.Injectable({
5981
5904
  providedIn: 'root'
@@ -5989,6 +5912,75 @@
5989
5912
  return PlaceRouter;
5990
5913
  }(pectin.GarbageCollector));
5991
5914
 
5915
+ var Visit = /** @class */ (function () {
5916
+ function Visit(placeDefinition, visitParameters) {
5917
+ if (visitParameters === void 0) { visitParameters = {}; }
5918
+ this.placeDefinition = placeDefinition;
5919
+ this.visitParameters = visitParameters;
5920
+ }
5921
+ // @Trace()
5922
+ Visit.prototype.getRouteId = function () {
5923
+ return this.placeDefinition.getRouteIdFrom(this);
5924
+ };
5925
+ // @Trace()
5926
+ Visit.prototype.hasRouteId = function () {
5927
+ return !___default.isNil(this.getRouteId());
5928
+ };
5929
+ /**
5930
+ * Returns the value of the place parameter with the specified name. The parameter
5931
+ * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
5932
+ * same as the the ValueModel property name.
5933
+ * @param parameterName the field name of the property model or the `as` option if specified.
5934
+ */
5935
+ Visit.prototype.getParameter = function (parameterName) {
5936
+ return this.visitParameters[parameterName];
5937
+ };
5938
+ // @Trace()
5939
+ Visit.prototype.hasParameter = function (parameterName) {
5940
+ return Object.keys(this.visitParameters).includes(parameterName);
5941
+ };
5942
+ Visit.prototype.replace = function (parameter, value) {
5943
+ var _a;
5944
+ return new Visit(this.placeDefinition, __assign(__assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
5945
+ };
5946
+ Visit.prototype.mergeRouteParameters = function (routeParams) {
5947
+ var _this = this;
5948
+ // todo: whitelist parameters.
5949
+ var routeParameterKeys = Object.keys(routeParams);
5950
+ var params = {};
5951
+ this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
5952
+ if (def.isRouteId || def.isRouteParameter) {
5953
+ if (routeParameterKeys.includes(def.name)) {
5954
+ params[def.name] = routeParams[def.name];
5955
+ }
5956
+ }
5957
+ else {
5958
+ // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
5959
+ // defaults and remember sanitisation process.
5960
+ var value = _this.getParameter(def.name);
5961
+ if (_this.hasParameter(def.name)) {
5962
+ params[def.name] = value;
5963
+ }
5964
+ }
5965
+ });
5966
+ return new Visit(this.placeDefinition, params);
5967
+ };
5968
+ Visit.prototype.hasRoutingChangedFrom = function (other) {
5969
+ var samePlace = other.placeDefinition === this.placeDefinition;
5970
+ var sameRouteParameters = ___default.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
5971
+ return !samePlace || !sameRouteParameters;
5972
+ };
5973
+ Visit.prototype.hasChangedFrom = function (other) {
5974
+ var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
5975
+ return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
5976
+ };
5977
+ Visit.prototype.toDebugString = function () {
5978
+ var _this = this;
5979
+ return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
5980
+ };
5981
+ return Visit;
5982
+ }());
5983
+
5992
5984
  var AUP_PLACE_CONFIG = new core.InjectionToken('AUP_PLACE_CONFIG');
5993
5985
 
5994
5986
  // Freezes the state of the components at the start of the animation.
@@ -7003,8 +6995,7 @@
7003
6995
  binding: null
7004
6996
  };
7005
6997
  var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
7006
- pectin.DebugContext.get(mechanics.backingModel).tag(tag);
7007
- pectin.Logger.get(mechanics.backingModel).tag(tag);
6998
+ pectin.DebugContext.getOrCreate(mechanics.backingModel).tag(tag);
7008
6999
  Object.defineProperty(prototype, propertyKey, {
7009
7000
  get: function () {
7010
7001
  return mechanics.backingModel;