@coolon/angular-ui-powerups 0.0.80 → 0.0.83

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 (24) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +86 -35
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
  7. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
  8. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
  9. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +52 -19
  10. package/esm2015/lib/place/place-component.js +13 -4
  11. package/esm2015/lib/place/place.module.js +5 -2
  12. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
  13. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
  14. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
  15. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +57 -29
  16. package/esm5/lib/place/place-component.js +26 -4
  17. package/esm5/lib/place/place.module.js +5 -2
  18. package/fesm2015/coolon-angular-ui-powerups.js +69 -26
  19. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  20. package/fesm5/coolon-angular-ui-powerups.js +87 -36
  21. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  22. package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -9
  23. package/lib/place/place-component.d.ts +8 -3
  24. package/package.json +1 -1
@@ -7,7 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
7
  import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __spread } from 'tslib';
8
8
  import { assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, DelegatingValueModel, MutableStream, MutableListModel, DelegatingListModel, StoreInValueModel, Binding, MutableValueModel, Trace, Guard as Guard$1, Command, OptionsHelper, ValueHolder } from '@coolon/pectin';
9
9
  import { PortalModule } from '@angular/cdk/portal';
10
- import { Router, RouterModule, UrlSegment, NavigationStart, NavigationEnd, NavigationError, ActivatedRouteSnapshot, RouterStateSnapshot, UrlSerializer } from '@angular/router';
10
+ import { Router, RouterModule, UrlSegment, NavigationStart, NavigationEnd, NavigationError, RouterOutlet, ActivatedRouteSnapshot, RouterStateSnapshot, UrlSerializer } from '@angular/router';
11
11
  import ___default, { last, isNil, isEqual } from 'lodash';
12
12
  import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
13
13
  import { MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialog as MatDialog$1 } from '@angular/material/dialog';
@@ -1263,8 +1263,8 @@ var AlertDialogComponent = /** @class */ (function (_super) {
1263
1263
  AlertDialogComponent.decorators = [
1264
1264
  { type: Component, args: [{
1265
1265
  selector: 'aup-alert-dialog',
1266
- template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</p>\n",
1267
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1266
+ template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</div>\n",
1267
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1268
1268
  }] }
1269
1269
  ];
1270
1270
  /** @nocollapse */
@@ -1344,8 +1344,8 @@ var ConfirmThenDialogComponent = /** @class */ (function (_super) {
1344
1344
  ConfirmThenDialogComponent.decorators = [
1345
1345
  { type: Component, args: [{
1346
1346
  selector: 'aup-confirmation-dialog',
1347
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1348
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1347
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1348
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1349
1349
  }] }
1350
1350
  ];
1351
1351
  /** @nocollapse */
@@ -1410,8 +1410,8 @@ var ConfirmationDialogComponent = /** @class */ (function (_super) {
1410
1410
  ConfirmationDialogComponent.decorators = [
1411
1411
  { type: Component, args: [{
1412
1412
  selector: 'aup-confirmation-dialog',
1413
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1414
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1413
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1414
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{justify-content:flex-end}"]
1415
1415
  }] }
1416
1416
  ];
1417
1417
  /** @nocollapse */
@@ -3302,13 +3302,36 @@ var PlaceComponent = /** @class */ (function (_super) {
3302
3302
  */
3303
3303
  function () {
3304
3304
  };
3305
+ /**
3306
+ * Called by the place outlet after all animations have finished. We need this instead of ngOnDestroy
3307
+ * to avoid the fact that the angular router calls it before the animations have run causing the component
3308
+ * to loose any pectin bindings.
3309
+ */
3310
+ // @Trace()
3311
+ /**
3312
+ * Called by the place outlet after all animations have finished. We need this instead of ngOnDestroy
3313
+ * to avoid the fact that the angular router calls it before the animations have run causing the component
3314
+ * to loose any pectin bindings.
3315
+ * @return {?}
3316
+ */
3317
+ // @Trace()
3318
+ PlaceComponent.prototype.onPlaceDestroyed = /**
3319
+ * Called by the place outlet after all animations have finished. We need this instead of ngOnDestroy
3320
+ * to avoid the fact that the angular router calls it before the animations have run causing the component
3321
+ * to loose any pectin bindings.
3322
+ * @return {?}
3323
+ */
3324
+ // @Trace()
3325
+ function () {
3326
+ this.dispose();
3327
+ };
3305
3328
  __decorate([
3306
3329
  Memoize$1(),
3307
3330
  __metadata("design:type", PlaceDefinition),
3308
3331
  __metadata("design:paramtypes", [])
3309
3332
  ], PlaceComponent.prototype, "placeDefinition", null);
3310
3333
  return PlaceComponent;
3311
- }(DisposableComponent));
3334
+ }(GarbageCollector));
3312
3335
  if (false) {
3313
3336
  /**
3314
3337
  * @type {?}
@@ -4256,13 +4279,14 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4256
4279
  _this.animate = true;
4257
4280
  _this.placeChanged = new EventEmitter();
4258
4281
  _this._activePlace = new MutableValueModel();
4259
- _this._placeVisit = new MutableValueModel();
4282
+ _this._activePlaceVisitModel = new DelegatingValueModel();
4260
4283
  _this._inOutletUpdate = new Guard$1();
4261
4284
  _this._activatedRouteModel = new MutableValueModel();
4262
4285
  _this._placeDefinition = new MutableValueModel();
4263
4286
  _this.isOnInitialPlace = true;
4264
4287
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
4265
4288
  _this.parentOutletModel = new MutableValueModel(parentOutlet);
4289
+ _this._activePlaceVisitModel.setDelegate(new MutableValueModel());
4266
4290
  /** @type {?} */
4267
4291
  var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
4268
4292
  .pullValueModel((/**
@@ -4270,9 +4294,9 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4270
4294
  * @return {?}
4271
4295
  */
4272
4296
  function (o) { return o.activePlaceModel; }))
4273
- .pluck("placeDefinition")
4274
- .pluckList("children")
4275
- .pluck("component");
4297
+ .pluck('placeDefinition')
4298
+ .pluckList('children')
4299
+ .pluck('component');
4276
4300
  /** @type {?} */
4277
4301
  var activatePlaceType = chain(_this.activePlaceModel).map((/**
4278
4302
  * @param {?} p
@@ -4302,17 +4326,18 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4302
4326
  * @return {?}
4303
4327
  */
4304
4328
  function (visit) {
4329
+ console.log("### Route visit changed");
4305
4330
  if (visit) { // can be null while the place and index sync up
4306
4331
  inRouteVisitUpdate.whileTrue((/**
4307
4332
  * @return {?}
4308
4333
  */
4309
4334
  function () {
4310
- _this._placeVisit.value = visit;
4335
+ _this._activePlaceVisitModel.value = visit;
4311
4336
  }));
4312
4337
  }
4313
4338
  }));
4314
4339
  // Handle component based changes
4315
- when.valueOf(_this._placeVisit).changes((/**
4340
+ when.valueOf(_this._activePlaceVisitModel).changes((/**
4316
4341
  * @param {?} next
4317
4342
  * @param {?} previous
4318
4343
  * @return {?}
@@ -4320,7 +4345,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4320
4345
  function (next, previous) {
4321
4346
  _this.pushVisitChangesToRoute(next, previous);
4322
4347
  }), {
4323
- unless: inRouteVisitUpdate
4348
+ unless: valueOf.any(_this._inOutletUpdate, inRouteVisitUpdate).areTruthy()
4324
4349
  });
4325
4350
  chain(_this._activePlace)
4326
4351
  .postponeWhile(placeRouter.navigationSessionActive)
@@ -4346,7 +4371,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4346
4371
  * @return {?}
4347
4372
  */
4348
4373
  function () {
4349
- return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : "500ms";
4374
+ return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';
4350
4375
  },
4351
4376
  enumerable: true,
4352
4377
  configurable: true
@@ -4410,16 +4435,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4410
4435
  enumerable: true,
4411
4436
  configurable: true
4412
4437
  });
4413
- // @Trace()
4414
- // @Trace()
4415
4438
  /**
4416
4439
  * @param {?} routerOutlet
4417
4440
  * @param {?} place
4418
4441
  * @return {?}
4419
4442
  */
4420
- PlaceOutletComponent.prototype.onOutletActivated =
4421
- // @Trace()
4422
- /**
4443
+ PlaceOutletComponent.prototype.onOutletActivated = /**
4423
4444
  * @param {?} routerOutlet
4424
4445
  * @param {?} place
4425
4446
  * @return {?}
@@ -4434,7 +4455,10 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4434
4455
  _this._activePlace.value = place;
4435
4456
  _this._activatedRouteModel.value = routerOutlet.activatedRoute;
4436
4457
  _this._placeDefinition.value = place.placeDefinition;
4437
- place.initialiseBindings(_this._placeVisit);
4458
+ /** @type {?} */
4459
+ var visitModel = new MutableValueModel();
4460
+ _this._activePlaceVisitModel.setDelegate(visitModel);
4461
+ place.initialiseBindings(visitModel);
4438
4462
  }
4439
4463
  catch (error) {
4440
4464
  console.error(error);
@@ -4445,32 +4469,34 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4445
4469
  this.animationDone();
4446
4470
  }
4447
4471
  };
4448
- // @Trace()
4449
- // @Trace()
4450
4472
  /**
4451
- * @param {?} routerOutlet
4452
- * @param {?} $event
4453
4473
  * @return {?}
4454
4474
  */
4455
- PlaceOutletComponent.prototype.onOutletDeactivated =
4456
- // @Trace()
4457
- /**
4458
- * @param {?} routerOutlet
4459
- * @param {?} $event
4475
+ PlaceOutletComponent.prototype.onOutletDeactivated = /**
4460
4476
  * @return {?}
4461
4477
  */
4462
- function (routerOutlet, $event) {
4478
+ function () {
4463
4479
  var _this = this;
4464
4480
  this._inOutletUpdate.whileTrue((/**
4465
4481
  * @return {?}
4466
4482
  */
4467
4483
  function () {
4484
+ _this._activePlaceVisitModel.setDelegate(null);
4468
4485
  _this.isOnInitialPlace = false;
4469
4486
  _this._activePlace.value = null;
4470
4487
  _this._activatedRouteModel.value = null;
4471
4488
  _this._placeDefinition.value = null;
4472
4489
  }));
4473
4490
  };
4491
+ /**
4492
+ * @return {?}
4493
+ */
4494
+ PlaceOutletComponent.prototype.animationStarted = /**
4495
+ * @return {?}
4496
+ */
4497
+ function () {
4498
+ console.log({ activePlace: this._activePlace.value });
4499
+ };
4474
4500
  /**
4475
4501
  * @return {?}
4476
4502
  */
@@ -4485,7 +4511,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4485
4511
  PlaceOutletComponent.decorators = [
4486
4512
  { type: Component, args: [{
4487
4513
  selector: 'aup-place-outlet',
4488
- template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"{value: placeAnimationOrder.value, params:{duration: animationDuration}}\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated(routerOutlet, $event)\">\n </router-outlet>\n</div>\n\n",
4514
+ template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"{value: placeAnimationOrder.value, params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n</div>\n\n",
4489
4515
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
4490
4516
  styles: [":host{display:flex;flex-direction:column;min-height:0;overflow-x:hidden}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
4491
4517
  }] }
@@ -4509,7 +4535,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4509
4535
  __metadata("design:type", ListModel)
4510
4536
  ], PlaceOutletComponent.prototype, "customPlaceAnimationOrderModel", void 0);
4511
4537
  __decorate([
4512
- StoreInListModel("customPlaceAnimationOrderModel"),
4538
+ StoreInListModel('customPlaceAnimationOrderModel'),
4513
4539
  __metadata("design:type", Array)
4514
4540
  ], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
4515
4541
  __decorate([
@@ -4518,6 +4544,30 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4518
4544
  __metadata("design:paramtypes", [Visit]),
4519
4545
  __metadata("design:returntype", void 0)
4520
4546
  ], PlaceOutletComponent.prototype, "navigate", null);
4547
+ __decorate([
4548
+ Trace(),
4549
+ __metadata("design:type", Function),
4550
+ __metadata("design:paramtypes", [RouterOutlet, PlaceComponent]),
4551
+ __metadata("design:returntype", void 0)
4552
+ ], PlaceOutletComponent.prototype, "onOutletActivated", null);
4553
+ __decorate([
4554
+ Trace(),
4555
+ __metadata("design:type", Function),
4556
+ __metadata("design:paramtypes", []),
4557
+ __metadata("design:returntype", void 0)
4558
+ ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
4559
+ __decorate([
4560
+ Trace(),
4561
+ __metadata("design:type", Function),
4562
+ __metadata("design:paramtypes", []),
4563
+ __metadata("design:returntype", void 0)
4564
+ ], PlaceOutletComponent.prototype, "animationStarted", null);
4565
+ __decorate([
4566
+ Trace(),
4567
+ __metadata("design:type", Function),
4568
+ __metadata("design:paramtypes", []),
4569
+ __metadata("design:returntype", void 0)
4570
+ ], PlaceOutletComponent.prototype, "animationDone", null);
4521
4571
  return PlaceOutletComponent;
4522
4572
  }(DisposableComponent));
4523
4573
  if (false) {
@@ -4540,7 +4590,7 @@ if (false) {
4540
4590
  * @type {?}
4541
4591
  * @private
4542
4592
  */
4543
- PlaceOutletComponent.prototype._placeVisit;
4593
+ PlaceOutletComponent.prototype._activePlaceVisitModel;
4544
4594
  /**
4545
4595
  * @type {?}
4546
4596
  * @private
@@ -4784,6 +4834,7 @@ var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
4784
4834
  * @fileoverview added by tsickle
4785
4835
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4786
4836
  */
4837
+ var ɵ0 = { animationDuration: "2000ms" };
4787
4838
  var PlaceModule = /** @class */ (function () {
4788
4839
  function PlaceModule() {
4789
4840
  }
@@ -4816,7 +4867,7 @@ var PlaceModule = /** @class */ (function () {
4816
4867
  ListPlaceNavComponent
4817
4868
  ],
4818
4869
  providers: [
4819
- // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: "100ms"}}
4870
+ { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
4820
4871
  ]
4821
4872
  },] }
4822
4873
  ];