@coolon/angular-ui-powerups 0.0.123 → 0.0.126

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.
@@ -5,7 +5,7 @@ import { MatInputModule, MatFormFieldModule, MatSelectModule, MatButtonModule, M
5
5
  import { MatTabsModule } from '@angular/material/tabs';
6
6
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
7
  import { __extends, __decorate, __metadata, __awaiter, __generator, __assign, __spread } from 'tslib';
8
- import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, DelegatingListModel, Deferred, MutableStream, MutableValueModel, MutableListModel, DebugContext, Binding, Trace, Guard, StoreInValueModel, Command, ValueHolder } from '@coolon/pectin';
8
+ import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, DelegatingListModel, Deferred, MutableStream, MutableValueModel, MutableListModel, DebugContext, Binding, Guard, StoreInValueModel, Command, ValueHolder } from '@coolon/pectin';
9
9
  import { PortalModule } from '@angular/cdk/portal';
10
10
  import { RouterModule, UrlSegment, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, Router, UrlSerializer } from '@angular/router';
11
11
  import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
@@ -3323,13 +3323,17 @@ var PlaceComponent = /** @class */ (function (_super) {
3323
3323
  _this.installBinding(parameterDef);
3324
3324
  }));
3325
3325
  };
3326
+ // @Trace()
3327
+ // @Trace()
3326
3328
  /**
3327
3329
  * @private
3328
3330
  * @template T, S
3329
3331
  * @param {?} parameterDef
3330
3332
  * @return {?}
3331
3333
  */
3332
- PlaceComponent.prototype.installBinding = /**
3334
+ PlaceComponent.prototype.installBinding =
3335
+ // @Trace()
3336
+ /**
3333
3337
  * @private
3334
3338
  * @template T, S
3335
3339
  * @param {?} parameterDef
@@ -3400,12 +3404,6 @@ var PlaceComponent = /** @class */ (function (_super) {
3400
3404
  */
3401
3405
  function () {
3402
3406
  };
3403
- __decorate([
3404
- Trace(),
3405
- __metadata("design:type", Function),
3406
- __metadata("design:paramtypes", [ParameterDefinition]),
3407
- __metadata("design:returntype", void 0)
3408
- ], PlaceComponent.prototype, "installBinding", null);
3409
3407
  __decorate([
3410
3408
  Memoize$1(),
3411
3409
  __metadata("design:type", PlaceDefinition),
@@ -8432,6 +8430,57 @@ if (false) {
8432
8430
  /** @type {?|undefined} */
8433
8431
  RouteListParameterOptions.prototype.storeInUrl;
8434
8432
  }
8433
+ /**
8434
+ * @template M
8435
+ * @param {?} prototype
8436
+ * @param {?} propertyKey
8437
+ * @param {?} backingModel
8438
+ * @param {?} tagPrefix
8439
+ * @param {?} isEmpty
8440
+ * @return {?}
8441
+ */
8442
+ function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
8443
+ /** @type {?} */
8444
+ var mechanics = {
8445
+ backingModel: backingModel,
8446
+ binding: (/** @type {?} */ (null))
8447
+ };
8448
+ /** @type {?} */
8449
+ var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8450
+ DebugContext.get(mechanics.backingModel).tag(tag);
8451
+ Logger.get(mechanics.backingModel).tag(tag);
8452
+ Object.defineProperty(prototype, propertyKey, {
8453
+ get: (/**
8454
+ * @return {?}
8455
+ */
8456
+ function () {
8457
+ return mechanics.backingModel;
8458
+ }),
8459
+ set: (/**
8460
+ * @param {?} userModel
8461
+ * @return {?}
8462
+ */
8463
+ function (userModel) {
8464
+ // This handles the scenario where we want to push an existing value model (such as a form model)
8465
+ // to and from the route.
8466
+ if (mechanics.binding) {
8467
+ mechanics.binding.dispose();
8468
+ }
8469
+ if (userModel) {
8470
+ mechanics.binding = new Binding(mechanics.backingModel, userModel);
8471
+ if (isEmpty(userModel)) {
8472
+ mechanics.binding.writeRight(); // push the visit into the user model;
8473
+ }
8474
+ else {
8475
+ if (!isEmpty(mechanics.backingModel)) {
8476
+ console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8477
+ }
8478
+ mechanics.binding.writeLeft(); // push the user model into the visit
8479
+ }
8480
+ }
8481
+ })
8482
+ });
8483
+ }
8435
8484
  /**
8436
8485
  * @template T
8437
8486
  * @param {?} type
@@ -8448,8 +8497,11 @@ function RouteId(type, options) {
8448
8497
  /** @type {?} */
8449
8498
  var param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
8450
8499
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8451
- UseDelegate({ tag: "@RouteId(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
8452
- // UseDelegate()(prototype, propertyKey);
8500
+ installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
8501
+ * @param {?} m
8502
+ * @return {?}
8503
+ */
8504
+ function (m) { return m.query().isNil(); }));
8453
8505
  });
8454
8506
  }
8455
8507
  /**
@@ -8469,46 +8521,11 @@ function VisitParameter(options) {
8469
8521
  /** @type {?} */
8470
8522
  var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8471
8523
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8472
- /** @type {?} */
8473
- var mechanics = {
8474
- backingModel: new MutableValueModel(),
8475
- binding: (/** @type {?} */ (null))
8476
- };
8477
- /** @type {?} */
8478
- var tag = "@VisitParameter(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8479
- DebugContext.get(mechanics.backingModel).tag(tag);
8480
- Logger.get(mechanics.backingModel).tag(tag);
8481
- Object.defineProperty(prototype, propertyKey, {
8482
- get: (/**
8483
- * @return {?}
8484
- */
8485
- function () {
8486
- return mechanics.backingModel;
8487
- }),
8488
- set: (/**
8489
- * @param {?} userModel
8490
- * @return {?}
8491
- */
8492
- function (userModel) {
8493
- // This handles the scenario where we want to push an existing value model (such as a form model)
8494
- // to and from the route.
8495
- if (mechanics.binding) {
8496
- mechanics.binding.dispose();
8497
- }
8498
- if (userModel) {
8499
- mechanics.binding = new Binding(mechanics.backingModel, userModel);
8500
- if (userModel.query().isNil()) {
8501
- mechanics.binding.writeRight(); // push the visit into the user model;
8502
- }
8503
- else {
8504
- if (!mechanics.backingModel.query().isNil()) {
8505
- console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8506
- }
8507
- mechanics.binding.writeLeft(); // push the user model into the visit
8508
- }
8509
- }
8510
- })
8511
- });
8524
+ installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
8525
+ * @param {?} m
8526
+ * @return {?}
8527
+ */
8528
+ function (m) { return m.query().isNil(); }));
8512
8529
  });
8513
8530
  }
8514
8531
  /**
@@ -8528,46 +8545,11 @@ function VisitParameterList(options) {
8528
8545
  /** @type {?} */
8529
8546
  var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
8530
8547
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
8531
- /** @type {?} */
8532
- var mechanics = {
8533
- backingModel: new MutableListModel(),
8534
- binding: (/** @type {?} */ (null))
8535
- };
8536
- /** @type {?} */
8537
- var tag = "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
8538
- DebugContext.get(mechanics.backingModel).tag(tag);
8539
- Logger.get(mechanics.backingModel).tag(tag);
8540
- Object.defineProperty(prototype, propertyKey, {
8541
- get: (/**
8542
- * @return {?}
8543
- */
8544
- function () {
8545
- return mechanics.backingModel;
8546
- }),
8547
- set: (/**
8548
- * @param {?} userModel
8549
- * @return {?}
8550
- */
8551
- function (userModel) {
8552
- // This handles the scenario where we want to push an existing value model (such as a form model)
8553
- // to and from the route.
8554
- if (mechanics.binding) {
8555
- mechanics.binding.dispose();
8556
- }
8557
- if (userModel) {
8558
- mechanics.binding = new Binding(mechanics.backingModel, userModel);
8559
- if (userModel.query().isEmpty()) {
8560
- mechanics.binding.writeRight(); // push the visit into the user model;
8561
- }
8562
- else {
8563
- if (!mechanics.backingModel.query().isEmpty()) {
8564
- console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
8565
- }
8566
- mechanics.binding.writeLeft(); // push the user model into the visit
8567
- }
8568
- }
8569
- })
8570
- });
8548
+ installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
8549
+ * @param {?} m
8550
+ * @return {?}
8551
+ */
8552
+ function (m) { return m.query().isEmpty(); }));
8571
8553
  });
8572
8554
  }
8573
8555