@coolon/angular-ui-powerups 0.0.79 → 0.0.81

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 (31) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +143 -51
  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.d.ts +20 -19
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +20 -19
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +61 -10
  10. package/esm2015/lib/place/index.js +2 -1
  11. package/esm2015/lib/place/place-component.js +13 -4
  12. package/esm2015/lib/place/place-config.js +16 -0
  13. package/esm2015/lib/place/place.module.js +7 -2
  14. package/esm2015/public_api.js +2 -2
  15. package/esm5/coolon-angular-ui-powerups.js +20 -19
  16. package/esm5/index.js +2 -2
  17. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +69 -18
  18. package/esm5/lib/place/index.js +2 -1
  19. package/esm5/lib/place/place-component.js +26 -4
  20. package/esm5/lib/place/place-config.js +16 -0
  21. package/esm5/lib/place/place.module.js +7 -2
  22. package/esm5/public_api.js +2 -2
  23. package/fesm2015/coolon-angular-ui-powerups.js +89 -12
  24. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  25. package/fesm5/coolon-angular-ui-powerups.js +110 -20
  26. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  27. package/lib/place/components/place-outlet/place-outlet.component.d.ts +6 -1
  28. package/lib/place/index.d.ts +1 -0
  29. package/lib/place/place-component.d.ts +8 -3
  30. package/lib/place/place-config.d.ts +5 -0
  31. 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';
@@ -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 {?}
@@ -3536,6 +3559,21 @@ if (false) {
3536
3559
  Visit.prototype.visitParameters;
3537
3560
  }
3538
3561
 
3562
+ /**
3563
+ * @fileoverview added by tsickle
3564
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3565
+ */
3566
+ /** @type {?} */
3567
+ var AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
3568
+ /**
3569
+ * @record
3570
+ */
3571
+ function PlaceConfig() { }
3572
+ if (false) {
3573
+ /** @type {?} */
3574
+ PlaceConfig.prototype.animationDuration;
3575
+ }
3576
+
3539
3577
  /**
3540
3578
  * @fileoverview added by tsickle
3541
3579
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4233,10 +4271,11 @@ if (false) {
4233
4271
  }
4234
4272
  var PlaceOutletComponent = /** @class */ (function (_super) {
4235
4273
  __extends(PlaceOutletComponent, _super);
4236
- function PlaceOutletComponent(router, placeRouter, parentOutlet) {
4274
+ function PlaceOutletComponent(router, placeRouter, placeConfig, parentOutlet) {
4237
4275
  var _this = _super.call(this) || this;
4238
4276
  _this.router = router;
4239
4277
  _this.placeRouter = placeRouter;
4278
+ _this.placeConfig = placeConfig;
4240
4279
  _this.animate = true;
4241
4280
  _this.placeChanged = new EventEmitter();
4242
4281
  _this._activePlace = new MutableValueModel();
@@ -4254,9 +4293,9 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4254
4293
  * @return {?}
4255
4294
  */
4256
4295
  function (o) { return o.activePlaceModel; }))
4257
- .pluck("placeDefinition")
4258
- .pluckList("children")
4259
- .pluck("component");
4296
+ .pluck('placeDefinition')
4297
+ .pluckList('children')
4298
+ .pluck('component');
4260
4299
  /** @type {?} */
4261
4300
  var activatePlaceType = chain(_this.activePlaceModel).map((/**
4262
4301
  * @param {?} p
@@ -4325,6 +4364,16 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4325
4364
  */
4326
4365
  function () {
4327
4366
  };
4367
+ Object.defineProperty(PlaceOutletComponent.prototype, "animationDuration", {
4368
+ get: /**
4369
+ * @return {?}
4370
+ */
4371
+ function () {
4372
+ return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';
4373
+ },
4374
+ enumerable: true,
4375
+ configurable: true
4376
+ });
4328
4377
  /**
4329
4378
  * @param {?} visit
4330
4379
  * @return {?}
@@ -4384,16 +4433,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4384
4433
  enumerable: true,
4385
4434
  configurable: true
4386
4435
  });
4387
- // @Trace()
4388
- // @Trace()
4389
4436
  /**
4390
4437
  * @param {?} routerOutlet
4391
4438
  * @param {?} place
4392
4439
  * @return {?}
4393
4440
  */
4394
- PlaceOutletComponent.prototype.onOutletActivated =
4395
- // @Trace()
4396
- /**
4441
+ PlaceOutletComponent.prototype.onOutletActivated = /**
4397
4442
  * @param {?} routerOutlet
4398
4443
  * @param {?} place
4399
4444
  * @return {?}
@@ -4419,16 +4464,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4419
4464
  this.animationDone();
4420
4465
  }
4421
4466
  };
4422
- // @Trace()
4423
- // @Trace()
4424
4467
  /**
4425
4468
  * @param {?} routerOutlet
4426
4469
  * @param {?} $event
4427
4470
  * @return {?}
4428
4471
  */
4429
- PlaceOutletComponent.prototype.onOutletDeactivated =
4430
- // @Trace()
4431
- /**
4472
+ PlaceOutletComponent.prototype.onOutletDeactivated = /**
4432
4473
  * @param {?} routerOutlet
4433
4474
  * @param {?} $event
4434
4475
  * @return {?}
@@ -4439,12 +4480,22 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4439
4480
  * @return {?}
4440
4481
  */
4441
4482
  function () {
4483
+ _this._previousPlace = _this._activePlace.value;
4442
4484
  _this.isOnInitialPlace = false;
4443
4485
  _this._activePlace.value = null;
4444
4486
  _this._activatedRouteModel.value = null;
4445
4487
  _this._placeDefinition.value = null;
4446
4488
  }));
4447
4489
  };
4490
+ /**
4491
+ * @return {?}
4492
+ */
4493
+ PlaceOutletComponent.prototype.animationStarted = /**
4494
+ * @return {?}
4495
+ */
4496
+ function () {
4497
+ console.log({ activePlace: this._activePlace.value });
4498
+ };
4448
4499
  /**
4449
4500
  * @return {?}
4450
4501
  */
@@ -4452,6 +4503,10 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4452
4503
  * @return {?}
4453
4504
  */
4454
4505
  function () {
4506
+ console.log({ activePlace: this._activePlace.value });
4507
+ if (this._previousPlace) {
4508
+ this._previousPlace.onPlaceDestroyed();
4509
+ }
4455
4510
  if (this._activePlace.value) {
4456
4511
  this._activePlace.value.onPlaceReady();
4457
4512
  }
@@ -4459,7 +4514,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4459
4514
  PlaceOutletComponent.decorators = [
4460
4515
  { type: Component, args: [{
4461
4516
  selector: 'aup-place-outlet',
4462
- template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"placeAnimationOrder.value\"\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",
4517
+ 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(routerOutlet, $event)\">\n </router-outlet>\n</div>\n\n",
4463
4518
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
4464
4519
  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}"]
4465
4520
  }] }
@@ -4468,6 +4523,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4468
4523
  PlaceOutletComponent.ctorParameters = function () { return [
4469
4524
  { type: Router },
4470
4525
  { type: PlaceRouter },
4526
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [AUP_PLACE_CONFIG,] }] },
4471
4527
  { type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] }
4472
4528
  ]; };
4473
4529
  PlaceOutletComponent.propDecorators = {
@@ -4482,7 +4538,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4482
4538
  __metadata("design:type", ListModel)
4483
4539
  ], PlaceOutletComponent.prototype, "customPlaceAnimationOrderModel", void 0);
4484
4540
  __decorate([
4485
- StoreInListModel("customPlaceAnimationOrderModel"),
4541
+ StoreInListModel('customPlaceAnimationOrderModel'),
4486
4542
  __metadata("design:type", Array)
4487
4543
  ], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
4488
4544
  __decorate([
@@ -4491,6 +4547,30 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4491
4547
  __metadata("design:paramtypes", [Visit]),
4492
4548
  __metadata("design:returntype", void 0)
4493
4549
  ], PlaceOutletComponent.prototype, "navigate", null);
4550
+ __decorate([
4551
+ Trace(),
4552
+ __metadata("design:type", Function),
4553
+ __metadata("design:paramtypes", [RouterOutlet, PlaceComponent]),
4554
+ __metadata("design:returntype", void 0)
4555
+ ], PlaceOutletComponent.prototype, "onOutletActivated", null);
4556
+ __decorate([
4557
+ Trace(),
4558
+ __metadata("design:type", Function),
4559
+ __metadata("design:paramtypes", [RouterOutlet, Object]),
4560
+ __metadata("design:returntype", void 0)
4561
+ ], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
4562
+ __decorate([
4563
+ Trace(),
4564
+ __metadata("design:type", Function),
4565
+ __metadata("design:paramtypes", []),
4566
+ __metadata("design:returntype", void 0)
4567
+ ], PlaceOutletComponent.prototype, "animationStarted", null);
4568
+ __decorate([
4569
+ Trace(),
4570
+ __metadata("design:type", Function),
4571
+ __metadata("design:paramtypes", []),
4572
+ __metadata("design:returntype", void 0)
4573
+ ], PlaceOutletComponent.prototype, "animationDone", null);
4494
4574
  return PlaceOutletComponent;
4495
4575
  }(DisposableComponent));
4496
4576
  if (false) {
@@ -4541,6 +4621,11 @@ if (false) {
4541
4621
  * @private
4542
4622
  */
4543
4623
  PlaceOutletComponent.prototype.isOnInitialPlace;
4624
+ /**
4625
+ * @type {?}
4626
+ * @private
4627
+ */
4628
+ PlaceOutletComponent.prototype._previousPlace;
4544
4629
  /**
4545
4630
  * @type {?}
4546
4631
  * @private
@@ -4551,6 +4636,8 @@ if (false) {
4551
4636
  * @private
4552
4637
  */
4553
4638
  PlaceOutletComponent.prototype.placeRouter;
4639
+ /** @type {?} */
4640
+ PlaceOutletComponent.prototype.placeConfig;
4554
4641
  }
4555
4642
 
4556
4643
  /**
@@ -4755,6 +4842,7 @@ var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
4755
4842
  * @fileoverview added by tsickle
4756
4843
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4757
4844
  */
4845
+ var ɵ0 = { animationDuration: "2000ms" };
4758
4846
  var PlaceModule = /** @class */ (function () {
4759
4847
  function PlaceModule() {
4760
4848
  }
@@ -4786,7 +4874,9 @@ var PlaceModule = /** @class */ (function () {
4786
4874
  TabbedPlaceNavigationComponent,
4787
4875
  ListPlaceNavComponent
4788
4876
  ],
4789
- providers: []
4877
+ providers: [
4878
+ { provide: AUP_PLACE_CONFIG, useValue: ɵ0 }
4879
+ ]
4790
4880
  },] }
4791
4881
  ];
4792
4882
  return PlaceModule;
@@ -6227,5 +6317,5 @@ if (false) {
6227
6317
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6228
6318
  */
6229
6319
 
6230
- export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EnterPlaceGuard, FocusBindingDirective, Formatter, InplaceInteractionContextComponent, InteractionContext, InteractionGuard, InteractionModule, InteractionOutletComponent, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NavigationSession, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, leftRightPlaceAnimation, slideDownAndUpAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, ConfirmationDialogComponent as ɵba, AbstractActivity as ɵbb, ACTIVITY_DATA as ɵbc, Activity as ɵbd, ConfirmThenDialogComponent as ɵbf, AlertDialogComponent as ɵbg, InteractionOutletComponent as ɵbi, InplaceInteractionContextComponent as ɵbj, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbk, DialogInteractionService as ɵbl, FocusBindingDirective as ɵc, DisposableComponent as ɵd, ComponentsModule as ɵe, NumberInputComponent as ɵf, AbstractInputComponent as ɵg, StringInputComponent as ɵh, PasswordInputComponent as ɵi, SelectInputComponent as ɵj, NoopComponent as ɵk, PlaceModule as ɵl, EmptyStateComponent as ɵm, BusyOverlayComponent as ɵn, PlaceOutletComponent as ɵo, leftRightPlaceAnimation as ɵp, LEFT_RIGHT_PLACE_ANIMATION as ɵq, PlaceRouter as ɵr, PlaceHistory as ɵs, TabbedPlaceNavigationComponent as ɵt, AbstractPlaceNavigationComponent as ɵu, ListPlaceNavComponent as ɵv, InteractionModule as ɵw, ActivityContainerComponent as ɵx, InteractionContext as ɵy, ActivityOutletComponent as ɵz };
6320
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EnterPlaceGuard, FocusBindingDirective, Formatter, InplaceInteractionContextComponent, InteractionContext, InteractionGuard, InteractionModule, InteractionOutletComponent, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NavigationSession, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, leftRightPlaceAnimation, slideDownAndUpAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, InteractionContext as ɵba, ActivityOutletComponent as ɵbb, ConfirmationDialogComponent as ɵbc, AbstractActivity as ɵbd, ACTIVITY_DATA as ɵbe, Activity as ɵbf, ConfirmThenDialogComponent as ɵbh, AlertDialogComponent as ɵbi, InteractionOutletComponent as ɵbk, InplaceInteractionContextComponent as ɵbl, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbm, DialogInteractionService as ɵbn, FocusBindingDirective as ɵc, DisposableComponent as ɵd, ComponentsModule as ɵe, NumberInputComponent as ɵf, AbstractInputComponent as ɵg, StringInputComponent as ɵh, PasswordInputComponent as ɵi, SelectInputComponent as ɵj, NoopComponent as ɵk, PlaceModule as ɵl, EmptyStateComponent as ɵm, BusyOverlayComponent as ɵn, PlaceOutletComponent as ɵo, leftRightPlaceAnimation as ɵp, LEFT_RIGHT_PLACE_ANIMATION as ɵq, AUP_PLACE_CONFIG as ɵr, PlaceRouter as ɵt, PlaceHistory as ɵu, TabbedPlaceNavigationComponent as ɵv, AbstractPlaceNavigationComponent as ɵw, ListPlaceNavComponent as ɵx, InteractionModule as ɵy, ActivityContainerComponent as ɵz };
6231
6321
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map