@coolon/angular-ui-powerups 2.0.0-alpha.13 → 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 (30) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +73 -84
  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/interaction/components/activity-container/activity-container.component.js +2 -7
  8. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  9. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  10. package/esm2015/lib/place/place-component.js +1 -1
  11. package/esm2015/lib/place/place-component.js.map +1 -1
  12. package/esm2015/lib/place/place-router.js +2 -8
  13. package/esm2015/lib/place/place-router.js.map +1 -1
  14. package/esm2015/lib/place/place-router.metadata.json +1 -1
  15. package/esm2015/lib/place/route/parameter-decorators.js +2 -3
  16. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  17. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  18. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -7
  19. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  20. package/esm5/lib/place/place-component.js +1 -1
  21. package/esm5/lib/place/place-component.js.map +1 -1
  22. package/esm5/lib/place/place-router.js +2 -8
  23. package/esm5/lib/place/place-router.js.map +1 -1
  24. package/esm5/lib/place/route/parameter-decorators.js +2 -3
  25. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  26. package/fesm2015/coolon-angular-ui-powerups.js +69 -80
  27. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  28. package/fesm5/coolon-angular-ui-powerups.js +74 -85
  29. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  30. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
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
+
5
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)
6
8
 
7
9
 
@@ -3223,6 +3223,7 @@
3223
3223
  ActivityContainerComponent.prototype.registerDisposable = function (disposable) {
3224
3224
  return this.garbage.registerDisposable(disposable);
3225
3225
  };
3226
+ // @Trace()
3226
3227
  ActivityContainerComponent.prototype.dispose = function () {
3227
3228
  // TODO: think about auto cancelling any outstanding activity on dispose.
3228
3229
  // See NavigationState.Navigating for a use-case.
@@ -3371,12 +3372,6 @@
3371
3372
  core.ViewChildren(ActivityOutletComponent),
3372
3373
  __metadata("design:type", core.QueryList)
3373
3374
  ], ActivityContainerComponent.prototype, "activityOutlets", void 0);
3374
- __decorate([
3375
- pectin.Trace(),
3376
- __metadata("design:type", Function),
3377
- __metadata("design:paramtypes", []),
3378
- __metadata("design:returntype", void 0)
3379
- ], ActivityContainerComponent.prototype, "dispose", null);
3380
3375
  ActivityContainerComponent = __decorate([
3381
3376
  core.Component({
3382
3377
  selector: 'aup-activity-container',
@@ -4460,7 +4455,7 @@
4460
4455
  pectin.assert.isNil(this.visitModel.value);
4461
4456
  var when = pectin.Dsl.disposeWith(this).when;
4462
4457
  this.visitModel.value = visit;
4463
- pectin.DebugContext.get(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4458
+ pectin.DebugContext.getOrCreate(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4464
4459
  this.placeDefinition.getVisitParameterDefs().forEach(function (parameterDef) { return _this.installBinding(parameterDef); });
4465
4460
  when.valueOf(this.visitModel).changes(function (current, previous) {
4466
4461
  notifyVisitChanged(current, previous);
@@ -5608,75 +5603,6 @@
5608
5603
  return UrlService;
5609
5604
  }());
5610
5605
 
5611
- var Visit = /** @class */ (function () {
5612
- function Visit(placeDefinition, visitParameters) {
5613
- if (visitParameters === void 0) { visitParameters = {}; }
5614
- this.placeDefinition = placeDefinition;
5615
- this.visitParameters = visitParameters;
5616
- }
5617
- // @Trace()
5618
- Visit.prototype.getRouteId = function () {
5619
- return this.placeDefinition.getRouteIdFrom(this);
5620
- };
5621
- // @Trace()
5622
- Visit.prototype.hasRouteId = function () {
5623
- return !___default.isNil(this.getRouteId());
5624
- };
5625
- /**
5626
- * Returns the value of the place parameter with the specified name. The parameter
5627
- * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
5628
- * same as the the ValueModel property name.
5629
- * @param parameterName the field name of the property model or the `as` option if specified.
5630
- */
5631
- Visit.prototype.getParameter = function (parameterName) {
5632
- return this.visitParameters[parameterName];
5633
- };
5634
- // @Trace()
5635
- Visit.prototype.hasParameter = function (parameterName) {
5636
- return Object.keys(this.visitParameters).includes(parameterName);
5637
- };
5638
- Visit.prototype.replace = function (parameter, value) {
5639
- var _a;
5640
- return new Visit(this.placeDefinition, __assign(__assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
5641
- };
5642
- Visit.prototype.mergeRouteParameters = function (routeParams) {
5643
- var _this = this;
5644
- // todo: whitelist parameters.
5645
- var routeParameterKeys = Object.keys(routeParams);
5646
- var params = {};
5647
- this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
5648
- if (def.isRouteId || def.isRouteParameter) {
5649
- if (routeParameterKeys.includes(def.name)) {
5650
- params[def.name] = routeParams[def.name];
5651
- }
5652
- }
5653
- else {
5654
- // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
5655
- // defaults and remember sanitisation process.
5656
- var value = _this.getParameter(def.name);
5657
- if (_this.hasParameter(def.name)) {
5658
- params[def.name] = value;
5659
- }
5660
- }
5661
- });
5662
- return new Visit(this.placeDefinition, params);
5663
- };
5664
- Visit.prototype.hasRoutingChangedFrom = function (other) {
5665
- var samePlace = other.placeDefinition === this.placeDefinition;
5666
- var sameRouteParameters = ___default.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
5667
- return !samePlace || !sameRouteParameters;
5668
- };
5669
- Visit.prototype.hasChangedFrom = function (other) {
5670
- var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
5671
- return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
5672
- };
5673
- Visit.prototype.toDebugString = function () {
5674
- var _this = this;
5675
- return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
5676
- };
5677
- return Visit;
5678
- }());
5679
-
5680
5606
  var PlaceRouter = /** @class */ (function (_super) {
5681
5607
  __extends(PlaceRouter, _super);
5682
5608
  function PlaceRouter(angularRouter, angularLocation, interactionService, urlService, placeHistory) {
@@ -5872,6 +5798,7 @@
5872
5798
  enumerable: true,
5873
5799
  configurable: true
5874
5800
  });
5801
+ // @Trace()
5875
5802
  PlaceRouter.prototype.pushVisitChangesToRoute = function (previous, next) {
5876
5803
  return __awaiter(this, void 0, void 0, function () {
5877
5804
  var _this = this;
@@ -5972,12 +5899,6 @@
5972
5899
  { type: exports.ɵbz }
5973
5900
  ]; };
5974
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" });
5975
- __decorate([
5976
- pectin.Trace(),
5977
- __metadata("design:type", Function),
5978
- __metadata("design:paramtypes", [Visit, Visit]),
5979
- __metadata("design:returntype", Promise)
5980
- ], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
5981
5902
  PlaceRouter = __decorate([
5982
5903
  core.Injectable({
5983
5904
  providedIn: 'root'
@@ -5991,6 +5912,75 @@
5991
5912
  return PlaceRouter;
5992
5913
  }(pectin.GarbageCollector));
5993
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
+
5994
5984
  var AUP_PLACE_CONFIG = new core.InjectionToken('AUP_PLACE_CONFIG');
5995
5985
 
5996
5986
  // Freezes the state of the components at the start of the animation.
@@ -7005,8 +6995,7 @@
7005
6995
  binding: null
7006
6996
  };
7007
6997
  var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
7008
- pectin.DebugContext.get(mechanics.backingModel).tag(tag);
7009
- pectin.Logger.get(mechanics.backingModel).tag(tag);
6998
+ pectin.DebugContext.getOrCreate(mechanics.backingModel).tag(tag);
7010
6999
  Object.defineProperty(prototype, propertyKey, {
7011
7000
  get: function () {
7012
7001
  return mechanics.backingModel;