@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
@@ -17,7 +17,7 @@ import { MatTableModule } from '@angular/material/table';
17
17
  import { MatTooltipModule } from '@angular/material/tooltip';
18
18
  import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
19
19
  import { fas } from '@fortawesome/free-solid-svg-icons';
20
- import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Trace, Binding, Functions } from '@coolon/pectin';
20
+ import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Binding, Functions } from '@coolon/pectin';
21
21
  import ___default, { isEqual, isNil } from 'lodash';
22
22
  import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
23
23
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
@@ -3052,6 +3052,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
3052
3052
  ActivityContainerComponent.prototype.registerDisposable = function (disposable) {
3053
3053
  return this.garbage.registerDisposable(disposable);
3054
3054
  };
3055
+ // @Trace()
3055
3056
  ActivityContainerComponent.prototype.dispose = function () {
3056
3057
  // TODO: think about auto cancelling any outstanding activity on dispose.
3057
3058
  // See NavigationState.Navigating for a use-case.
@@ -3200,12 +3201,6 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
3200
3201
  ViewChildren(ActivityOutletComponent),
3201
3202
  __metadata("design:type", QueryList)
3202
3203
  ], ActivityContainerComponent.prototype, "activityOutlets", void 0);
3203
- __decorate([
3204
- Trace(),
3205
- __metadata("design:type", Function),
3206
- __metadata("design:paramtypes", []),
3207
- __metadata("design:returntype", void 0)
3208
- ], ActivityContainerComponent.prototype, "dispose", null);
3209
3204
  ActivityContainerComponent = __decorate([
3210
3205
  Component({
3211
3206
  selector: 'aup-activity-container',
@@ -4289,7 +4284,7 @@ var PlaceComponent = /** @class */ (function (_super) {
4289
4284
  assert.isNil(this.visitModel.value);
4290
4285
  var when = Dsl.disposeWith(this).when;
4291
4286
  this.visitModel.value = visit;
4292
- DebugContext.get(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4287
+ DebugContext.getOrCreate(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
4293
4288
  this.placeDefinition.getVisitParameterDefs().forEach(function (parameterDef) { return _this.installBinding(parameterDef); });
4294
4289
  when.valueOf(this.visitModel).changes(function (current, previous) {
4295
4290
  notifyVisitChanged(current, previous);
@@ -5437,75 +5432,6 @@ var UrlService = /** @class */ (function () {
5437
5432
  return UrlService;
5438
5433
  }());
5439
5434
 
5440
- var Visit = /** @class */ (function () {
5441
- function Visit(placeDefinition, visitParameters) {
5442
- if (visitParameters === void 0) { visitParameters = {}; }
5443
- this.placeDefinition = placeDefinition;
5444
- this.visitParameters = visitParameters;
5445
- }
5446
- // @Trace()
5447
- Visit.prototype.getRouteId = function () {
5448
- return this.placeDefinition.getRouteIdFrom(this);
5449
- };
5450
- // @Trace()
5451
- Visit.prototype.hasRouteId = function () {
5452
- return !isNil(this.getRouteId());
5453
- };
5454
- /**
5455
- * Returns the value of the place parameter with the specified name. The parameter
5456
- * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
5457
- * same as the the ValueModel property name.
5458
- * @param parameterName the field name of the property model or the `as` option if specified.
5459
- */
5460
- Visit.prototype.getParameter = function (parameterName) {
5461
- return this.visitParameters[parameterName];
5462
- };
5463
- // @Trace()
5464
- Visit.prototype.hasParameter = function (parameterName) {
5465
- return Object.keys(this.visitParameters).includes(parameterName);
5466
- };
5467
- Visit.prototype.replace = function (parameter, value) {
5468
- var _a;
5469
- return new Visit(this.placeDefinition, __assign(__assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
5470
- };
5471
- Visit.prototype.mergeRouteParameters = function (routeParams) {
5472
- var _this = this;
5473
- // todo: whitelist parameters.
5474
- var routeParameterKeys = Object.keys(routeParams);
5475
- var params = {};
5476
- this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
5477
- if (def.isRouteId || def.isRouteParameter) {
5478
- if (routeParameterKeys.includes(def.name)) {
5479
- params[def.name] = routeParams[def.name];
5480
- }
5481
- }
5482
- else {
5483
- // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
5484
- // defaults and remember sanitisation process.
5485
- var value = _this.getParameter(def.name);
5486
- if (_this.hasParameter(def.name)) {
5487
- params[def.name] = value;
5488
- }
5489
- }
5490
- });
5491
- return new Visit(this.placeDefinition, params);
5492
- };
5493
- Visit.prototype.hasRoutingChangedFrom = function (other) {
5494
- var samePlace = other.placeDefinition === this.placeDefinition;
5495
- var sameRouteParameters = isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
5496
- return !samePlace || !sameRouteParameters;
5497
- };
5498
- Visit.prototype.hasChangedFrom = function (other) {
5499
- var sameNonRouteParameters = isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
5500
- return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
5501
- };
5502
- Visit.prototype.toDebugString = function () {
5503
- var _this = this;
5504
- return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
5505
- };
5506
- return Visit;
5507
- }());
5508
-
5509
5435
  var PlaceRouter = /** @class */ (function (_super) {
5510
5436
  __extends(PlaceRouter, _super);
5511
5437
  function PlaceRouter(angularRouter, angularLocation, interactionService, urlService, placeHistory) {
@@ -5701,6 +5627,7 @@ var PlaceRouter = /** @class */ (function (_super) {
5701
5627
  enumerable: true,
5702
5628
  configurable: true
5703
5629
  });
5630
+ // @Trace()
5704
5631
  PlaceRouter.prototype.pushVisitChangesToRoute = function (previous, next) {
5705
5632
  return __awaiter(this, void 0, void 0, function () {
5706
5633
  var _this = this;
@@ -5801,12 +5728,6 @@ var PlaceRouter = /** @class */ (function (_super) {
5801
5728
  { type: PlaceHistory }
5802
5729
  ]; };
5803
5730
  PlaceRouter.ɵprov = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router), ɵɵinject(Location), ɵɵinject(InteractionService), ɵɵinject(UrlService), ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
5804
- __decorate([
5805
- Trace(),
5806
- __metadata("design:type", Function),
5807
- __metadata("design:paramtypes", [Visit, Visit]),
5808
- __metadata("design:returntype", Promise)
5809
- ], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
5810
5731
  PlaceRouter = __decorate([
5811
5732
  Injectable({
5812
5733
  providedIn: 'root'
@@ -5820,6 +5741,75 @@ var PlaceRouter = /** @class */ (function (_super) {
5820
5741
  return PlaceRouter;
5821
5742
  }(GarbageCollector));
5822
5743
 
5744
+ var Visit = /** @class */ (function () {
5745
+ function Visit(placeDefinition, visitParameters) {
5746
+ if (visitParameters === void 0) { visitParameters = {}; }
5747
+ this.placeDefinition = placeDefinition;
5748
+ this.visitParameters = visitParameters;
5749
+ }
5750
+ // @Trace()
5751
+ Visit.prototype.getRouteId = function () {
5752
+ return this.placeDefinition.getRouteIdFrom(this);
5753
+ };
5754
+ // @Trace()
5755
+ Visit.prototype.hasRouteId = function () {
5756
+ return !isNil(this.getRouteId());
5757
+ };
5758
+ /**
5759
+ * Returns the value of the place parameter with the specified name. The parameter
5760
+ * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
5761
+ * same as the the ValueModel property name.
5762
+ * @param parameterName the field name of the property model or the `as` option if specified.
5763
+ */
5764
+ Visit.prototype.getParameter = function (parameterName) {
5765
+ return this.visitParameters[parameterName];
5766
+ };
5767
+ // @Trace()
5768
+ Visit.prototype.hasParameter = function (parameterName) {
5769
+ return Object.keys(this.visitParameters).includes(parameterName);
5770
+ };
5771
+ Visit.prototype.replace = function (parameter, value) {
5772
+ var _a;
5773
+ return new Visit(this.placeDefinition, __assign(__assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
5774
+ };
5775
+ Visit.prototype.mergeRouteParameters = function (routeParams) {
5776
+ var _this = this;
5777
+ // todo: whitelist parameters.
5778
+ var routeParameterKeys = Object.keys(routeParams);
5779
+ var params = {};
5780
+ this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
5781
+ if (def.isRouteId || def.isRouteParameter) {
5782
+ if (routeParameterKeys.includes(def.name)) {
5783
+ params[def.name] = routeParams[def.name];
5784
+ }
5785
+ }
5786
+ else {
5787
+ // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
5788
+ // defaults and remember sanitisation process.
5789
+ var value = _this.getParameter(def.name);
5790
+ if (_this.hasParameter(def.name)) {
5791
+ params[def.name] = value;
5792
+ }
5793
+ }
5794
+ });
5795
+ return new Visit(this.placeDefinition, params);
5796
+ };
5797
+ Visit.prototype.hasRoutingChangedFrom = function (other) {
5798
+ var samePlace = other.placeDefinition === this.placeDefinition;
5799
+ var sameRouteParameters = isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
5800
+ return !samePlace || !sameRouteParameters;
5801
+ };
5802
+ Visit.prototype.hasChangedFrom = function (other) {
5803
+ var sameNonRouteParameters = isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
5804
+ return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
5805
+ };
5806
+ Visit.prototype.toDebugString = function () {
5807
+ var _this = this;
5808
+ return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
5809
+ };
5810
+ return Visit;
5811
+ }());
5812
+
5823
5813
  var AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
5824
5814
 
5825
5815
  // Freezes the state of the components at the start of the animation.
@@ -6834,8 +6824,7 @@ function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmp
6834
6824
  binding: null
6835
6825
  };
6836
6826
  var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
6837
- DebugContext.get(mechanics.backingModel).tag(tag);
6838
- Logger.get(mechanics.backingModel).tag(tag);
6827
+ DebugContext.getOrCreate(mechanics.backingModel).tag(tag);
6839
6828
  Object.defineProperty(prototype, propertyKey, {
6840
6829
  get: function () {
6841
6830
  return mechanics.backingModel;