@coolon/angular-ui-powerups 0.0.42 → 0.0.44

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 (132) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +1173 -1188
  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 +16 -15
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +16 -15
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/components/disposable-component.js +1 -1
  10. package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
  11. package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
  12. package/esm2015/lib/components/forms/string-input/string-input.component.js +1 -1
  13. package/esm2015/lib/components/resize-aware.component.js +1 -1
  14. package/esm2015/lib/components/types/bounds.class.js +1 -1
  15. package/esm2015/lib/components/types/dimension.class.js +1 -1
  16. package/esm2015/lib/components/types/point.class.js +1 -1
  17. package/esm2015/lib/directives/command.directive.js +1 -1
  18. package/esm2015/lib/directives/focus-binding.directive.js +2 -2
  19. package/esm2015/lib/interaction/alert.js +1 -1
  20. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +12 -12
  21. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +6 -1
  22. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
  23. package/esm2015/lib/interaction/confirm.js +1 -1
  24. package/esm2015/lib/interaction/interaction.module.js +3 -2
  25. package/esm2015/lib/interaction/result.js +1 -1
  26. package/esm2015/lib/interaction/services/dialog-interaction.service.js +2 -2
  27. package/esm2015/lib/place/components/abstract-place-navigation.component.js +3 -2
  28. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +132 -86
  29. package/esm2015/lib/place/components/place-outlet/route-animations.js +2 -2
  30. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
  31. package/esm2015/lib/place/guards/leave-place.guard.js +12 -10
  32. package/esm2015/lib/place/guards/place-route.guard.js +40 -33
  33. package/esm2015/lib/place/index.js +5 -5
  34. package/esm2015/lib/place/nav-item.js +1 -1
  35. package/esm2015/lib/place/place-component.js +38 -168
  36. package/esm2015/lib/place/place-definition.js +79 -0
  37. package/esm2015/lib/place/place-history.js +54 -0
  38. package/esm2015/lib/place/place-router.js +83 -0
  39. package/esm2015/lib/place/place.decorator.js +30 -3
  40. package/esm2015/lib/place/place.module.js +2 -5
  41. package/esm2015/lib/place/route/default-parameter-sanitiser.js +10 -22
  42. package/esm2015/lib/place/route/json-types.js +1 -1
  43. package/esm2015/lib/place/route/parameter-decorators.js +7 -60
  44. package/esm2015/lib/place/route/parameter-definition.class.js +103 -8
  45. package/esm2015/lib/place/route/parameter-sanitiser.js +1 -15
  46. package/esm2015/lib/place/route/parameter-snapshot.js +13 -55
  47. package/esm2015/lib/place/route/parameter-type.js +2 -2
  48. package/esm2015/lib/place/route/route-parameter-sanitiser.js +6 -20
  49. package/esm2015/lib/place/visit.js +1 -1
  50. package/esm2015/public_api.js +2 -2
  51. package/esm5/coolon-angular-ui-powerups.js +16 -15
  52. package/esm5/index.js +2 -2
  53. package/esm5/lib/components/disposable-component.js +1 -1
  54. package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
  55. package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
  56. package/esm5/lib/components/forms/string-input/string-input.component.js +1 -1
  57. package/esm5/lib/components/resize-aware.component.js +1 -1
  58. package/esm5/lib/components/types/bounds.class.js +1 -1
  59. package/esm5/lib/components/types/dimension.class.js +1 -1
  60. package/esm5/lib/components/types/point.class.js +1 -1
  61. package/esm5/lib/directives/command.directive.js +1 -1
  62. package/esm5/lib/directives/focus-binding.directive.js +2 -2
  63. package/esm5/lib/interaction/alert.js +1 -1
  64. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +12 -12
  65. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +6 -1
  66. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
  67. package/esm5/lib/interaction/confirm.js +1 -1
  68. package/esm5/lib/interaction/interaction.module.js +3 -2
  69. package/esm5/lib/interaction/result.js +1 -1
  70. package/esm5/lib/interaction/services/dialog-interaction.service.js +2 -2
  71. package/esm5/lib/place/components/abstract-place-navigation.component.js +3 -2
  72. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +150 -115
  73. package/esm5/lib/place/components/place-outlet/route-animations.js +2 -2
  74. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
  75. package/esm5/lib/place/guards/leave-place.guard.js +12 -10
  76. package/esm5/lib/place/guards/place-route.guard.js +40 -32
  77. package/esm5/lib/place/index.js +5 -5
  78. package/esm5/lib/place/nav-item.js +1 -1
  79. package/esm5/lib/place/place-component.js +52 -198
  80. package/esm5/lib/place/place-definition.js +88 -0
  81. package/esm5/lib/place/place-history.js +57 -0
  82. package/esm5/lib/place/place-router.js +101 -0
  83. package/esm5/lib/place/place.decorator.js +30 -3
  84. package/esm5/lib/place/place.module.js +2 -5
  85. package/esm5/lib/place/route/default-parameter-sanitiser.js +8 -20
  86. package/esm5/lib/place/route/json-types.js +1 -1
  87. package/esm5/lib/place/route/parameter-decorators.js +7 -60
  88. package/esm5/lib/place/route/parameter-definition.class.js +131 -8
  89. package/esm5/lib/place/route/parameter-sanitiser.js +1 -15
  90. package/esm5/lib/place/route/parameter-snapshot.js +25 -63
  91. package/esm5/lib/place/route/parameter-type.js +2 -2
  92. package/esm5/lib/place/route/route-parameter-sanitiser.js +6 -19
  93. package/esm5/lib/place/visit.js +1 -1
  94. package/esm5/public_api.js +2 -2
  95. package/fesm2015/coolon-angular-ui-powerups.js +955 -969
  96. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  97. package/fesm5/coolon-angular-ui-powerups.js +1158 -1177
  98. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  99. package/index.d.ts +1 -1
  100. package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -2
  101. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +7 -0
  102. package/lib/place/components/abstract-place-navigation.component.d.ts +3 -2
  103. package/lib/place/components/place-outlet/place-outlet.component.d.ts +31 -19
  104. package/lib/place/guards/place-route.guard.d.ts +7 -6
  105. package/lib/place/index.d.ts +3 -3
  106. package/lib/place/place-component.d.ts +13 -41
  107. package/lib/place/place-definition.d.ts +20 -0
  108. package/lib/place/place-history.d.ts +10 -0
  109. package/lib/place/place-router.d.ts +9 -0
  110. package/lib/place/place.decorator.d.ts +13 -1
  111. package/lib/place/route/default-parameter-sanitiser.d.ts +3 -5
  112. package/lib/place/route/parameter-decorators.d.ts +0 -4
  113. package/lib/place/route/parameter-definition.class.d.ts +29 -6
  114. package/lib/place/route/parameter-sanitiser.d.ts +0 -6
  115. package/lib/place/route/parameter-snapshot.d.ts +7 -7
  116. package/lib/place/route/route-parameter-sanitiser.d.ts +1 -3
  117. package/lib/place/visit.d.ts +2 -2
  118. package/package.json +1 -1
  119. package/schematics/place-routes/index.js.map +1 -1
  120. package/schematics/place-routes/place-def.js +1 -1
  121. package/schematics/place-routes/place-def.js.map +1 -1
  122. package/schematics/place-routes/templates/place-destinations.ts.template +21 -0
  123. package/schematics/place-routes/templates/{places.ts.template → place-routes.ts.template} +1 -13
  124. package/esm2015/lib/place/place-component-like.js +0 -17
  125. package/esm2015/lib/place/place-updates-service.js +0 -16
  126. package/esm2015/lib/place/place.service.js +0 -102
  127. package/esm5/lib/place/place-component-like.js +0 -17
  128. package/esm5/lib/place/place-updates-service.js +0 -16
  129. package/esm5/lib/place/place.service.js +0 -136
  130. package/lib/place/place-component-like.d.ts +0 -5
  131. package/lib/place/place-updates-service.d.ts +0 -10
  132. package/lib/place/place.service.d.ts +0 -22
@@ -1,9 +1,10 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/pectin/lib/promise/deferred.class'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@angular/router'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('lodash'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill')) :
3
- typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/pectin/lib/promise/deferred.class', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@angular/router', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'lodash', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill'], factory) :
4
- (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.deferred_class, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.ng.router, global.src, global.fastMemoizeDecorator, global.lodash, null, global.ng.animations, global.ResizeObserver));
5
- }(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, deferred_class, typescriptUtilities, dialog, icon, list, tooltip, router, src, fastMemoizeDecorator, lodash, reflectMetadata, animations$1, ResizeObserver) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/pectin/lib/promise/deferred.class'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@angular/router'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('lodash'), require('@angular/animations'), require('resize-observer-polyfill')) :
3
+ typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/pectin/lib/promise/deferred.class', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@angular/router', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', 'lodash', '@angular/animations', 'resize-observer-polyfill'], factory) :
4
+ (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.deferred_class, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.ng.router, global.src, global.fastMemoizeDecorator, null, global.___default, global.ng.animations, global.ResizeObserver));
5
+ }(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, deferred_class, typescriptUtilities, dialog, icon, list, tooltip, router, src, fastMemoizeDecorator, reflectMetadata, ___default, animations$1, ResizeObserver) { 'use strict';
6
6
 
7
+ var ___default__default = 'default' in ___default ? ___default['default'] : ___default;
7
8
  ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
8
9
 
9
10
  /*! *****************************************************************************
@@ -816,7 +817,7 @@
816
817
  }));
817
818
  }
818
819
  else {
819
- pectin.Logger.get(this).warn("pectinFocusBinding was nil");
820
+ pectin.Logger.get(this).warn('pectinFocusBinding was nil');
820
821
  }
821
822
  };
822
823
  /**
@@ -1046,9 +1047,14 @@
1046
1047
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1047
1048
  */
1048
1049
  /**
1050
+ * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an
1051
+ * external service.
1052
+ *
1053
+ * It might be nice to have wrapper component that allows more declarative use, i.e.
1054
+ * <activity-view [activityClass]="...", [activityData]="..." (done)=".." (cancel)="..."></activity-view>
1049
1055
  * @template D, R, E
1050
1056
  */
1051
- exports.ɵu = /** @class */ (function () {
1057
+ exports.ɵv = /** @class */ (function () {
1052
1058
  function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
1053
1059
  this.componentFactoryResolver = componentFactoryResolver;
1054
1060
  this.viewContainerRef = viewContainerRef;
@@ -1170,27 +1176,27 @@
1170
1176
  }());
1171
1177
  if (false) {
1172
1178
  /** @type {?} */
1173
- exports.ɵu.prototype.interactionContext;
1179
+ exports.ɵv.prototype.interactionContext;
1174
1180
  /**
1175
1181
  * @type {?}
1176
1182
  * @private
1177
1183
  */
1178
- exports.ɵu.prototype.activityComponentRef;
1184
+ exports.ɵv.prototype.activityComponentRef;
1179
1185
  /**
1180
1186
  * @type {?}
1181
1187
  * @private
1182
1188
  */
1183
- exports.ɵu.prototype.componentFactoryResolver;
1189
+ exports.ɵv.prototype.componentFactoryResolver;
1184
1190
  /**
1185
1191
  * @type {?}
1186
1192
  * @private
1187
1193
  */
1188
- exports.ɵu.prototype.viewContainerRef;
1194
+ exports.ɵv.prototype.viewContainerRef;
1189
1195
  /**
1190
1196
  * @type {?}
1191
1197
  * @private
1192
1198
  */
1193
- exports.ɵu.prototype.injector;
1199
+ exports.ɵv.prototype.injector;
1194
1200
  /* Skipping unhandled member: ;*/
1195
1201
  }
1196
1202
  (function (ActivityOutletComponent) {
@@ -1251,7 +1257,7 @@
1251
1257
  */
1252
1258
  OutletInteractionContext.prototype.context;
1253
1259
  }
1254
- })(exports.ɵu || (exports.ɵu = {}));
1260
+ })(exports.ɵv || (exports.ɵv = {}));
1255
1261
 
1256
1262
  /**
1257
1263
  * @fileoverview added by tsickle
@@ -1499,7 +1505,7 @@
1499
1505
  ConfirmationDialogComponent.decorators = [
1500
1506
  { type: core.Component, args: [{
1501
1507
  selector: 'angular-ui-powerups-confirmation-dialog',
1502
- 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()\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\" (click)=\"done(true)\">{{confirm.ok()}}</button>\n</p>\n\n",
1508
+ 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()\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done(true)\">{{confirm.ok()}}</button>\n</p>\n\n",
1503
1509
  styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1504
1510
  }] }
1505
1511
  ];
@@ -1518,14 +1524,14 @@
1518
1524
  * @fileoverview added by tsickle
1519
1525
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1520
1526
  */
1521
- exports.ɵt = /** @class */ (function (_super) {
1527
+ exports.ɵu = /** @class */ (function (_super) {
1522
1528
  __extends(ActivityContainerComponent, _super);
1523
1529
  function ActivityContainerComponent() {
1524
1530
  var _this = _super.call(this) || this;
1525
- _this.activityTabs = new pectin.MutableListModel();
1531
+ _this.activityOutletTabs = new pectin.MutableListModel();
1526
1532
  _this.obsoleteTabs = [];
1527
1533
  var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
1528
- _this.lastActivityTab = chain(_this.activityTabs).last().otherwise(_this.initialActivity);
1534
+ _this.lastActivityTab = chain(_this.activityOutletTabs).last().otherwise(_this.initialActivityOutlet);
1529
1535
  return _this;
1530
1536
  }
1531
1537
  /**
@@ -1561,7 +1567,7 @@
1561
1567
  * @return {?}
1562
1568
  */
1563
1569
  function (options) {
1564
- this.initialActivity = __assign({}, options, { interactionContext: this });
1570
+ this.initialActivityOutlet = __assign({}, options, { interactionContext: this });
1565
1571
  };
1566
1572
  /**
1567
1573
  * @template D, R, E
@@ -1587,14 +1593,14 @@
1587
1593
  onDone: deferred.resolve,
1588
1594
  onCancel: deferred.reject
1589
1595
  };
1590
- this.activityTabs.push(context);
1591
- this.tabs.selectedIndex = this.activityTabs.length;
1596
+ this.activityOutletTabs.push(context);
1597
+ this.tabs.selectedIndex = this.activityOutletTabs.length;
1592
1598
  return deferred.promise.finally((/**
1593
1599
  * @return {?}
1594
1600
  */
1595
1601
  function () {
1596
1602
  _this.obsoleteTabs.push(context);
1597
- _this.tabs.selectedIndex = _this.activityTabs.length - 1;
1603
+ _this.tabs.selectedIndex = _this.activityOutletTabs.length - 1;
1598
1604
  }));
1599
1605
  };
1600
1606
  /**
@@ -1629,7 +1635,7 @@
1629
1635
  */
1630
1636
  function () {
1631
1637
  var _this = this;
1632
- this.activityTabs.value = this.activityTabs.value.filter((/**
1638
+ this.activityOutletTabs.value = this.activityOutletTabs.value.filter((/**
1633
1639
  * @param {?} tab
1634
1640
  * @return {?}
1635
1641
  */
@@ -1641,7 +1647,7 @@
1641
1647
  ActivityContainerComponent.decorators = [
1642
1648
  { type: core.Component, args: [{
1643
1649
  selector: 'angular-ui-powerups-activity-container',
1644
- template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\" [activityContext]=\"initialActivity\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\" [activityContext]=\"tab\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1650
+ template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\"\n [activityContext]=\"initialActivityOutlet\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n <mat-tab *ngFor=\"let tab of activityOutletTabs.value\">\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\"\n [activityContext]=\"tab\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1645
1651
  styles: [":host{display:block}"]
1646
1652
  }] }
1647
1653
  ];
@@ -1649,33 +1655,33 @@
1649
1655
  ActivityContainerComponent.ctorParameters = function () { return []; };
1650
1656
  ActivityContainerComponent.propDecorators = {
1651
1657
  parentInteractionContext: [{ type: core.Input }],
1652
- initialActivity: [{ type: core.Input }],
1658
+ initialActivityOutlet: [{ type: core.Input }],
1653
1659
  tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }],
1654
- outlets: [{ type: core.ViewChildren, args: [exports.ɵu,] }]
1660
+ outlets: [{ type: core.ViewChildren, args: [exports.ɵv,] }]
1655
1661
  };
1656
1662
  return ActivityContainerComponent;
1657
1663
  }(DisposableComponent));
1658
1664
  if (false) {
1659
1665
  /** @type {?} */
1660
- exports.ɵt.prototype.parentInteractionContext;
1666
+ exports.ɵu.prototype.parentInteractionContext;
1661
1667
  /** @type {?} */
1662
- exports.ɵt.prototype.initialActivity;
1668
+ exports.ɵu.prototype.initialActivityOutlet;
1663
1669
  /** @type {?} */
1664
- exports.ɵt.prototype.tabs;
1670
+ exports.ɵu.prototype.tabs;
1665
1671
  /** @type {?} */
1666
- exports.ɵt.prototype.outlets;
1672
+ exports.ɵu.prototype.outlets;
1667
1673
  /** @type {?} */
1668
- exports.ɵt.prototype.activityTabs;
1674
+ exports.ɵu.prototype.activityOutletTabs;
1669
1675
  /**
1670
1676
  * @type {?}
1671
1677
  * @private
1672
1678
  */
1673
- exports.ɵt.prototype.obsoleteTabs;
1679
+ exports.ɵu.prototype.obsoleteTabs;
1674
1680
  /**
1675
1681
  * @type {?}
1676
1682
  * @private
1677
1683
  */
1678
- exports.ɵt.prototype.lastActivityTab;
1684
+ exports.ɵu.prototype.lastActivityTab;
1679
1685
  }
1680
1686
  (function (ActivityContainerComponent) {
1681
1687
  /**
@@ -1694,7 +1700,7 @@
1694
1700
  /** @type {?} */
1695
1701
  ActivityContext.prototype.onCancel;
1696
1702
  }
1697
- })(exports.ɵt || (exports.ɵt = {}));
1703
+ })(exports.ɵu || (exports.ɵu = {}));
1698
1704
 
1699
1705
  /**
1700
1706
  * @fileoverview added by tsickle
@@ -1750,7 +1756,7 @@
1750
1756
  autoFocus: false
1751
1757
  };
1752
1758
  /** @type {?} */
1753
- var matDialogRef = (/** @type {?} */ (this.dialogService.open(exports.ɵt, config)));
1759
+ var matDialogRef = (/** @type {?} */ (this.dialogService.open(exports.ɵu, config)));
1754
1760
  return new Promise((/**
1755
1761
  * @param {?} resolve
1756
1762
  * @param {?} reject
@@ -1842,16 +1848,17 @@
1842
1848
  portal.PortalModule
1843
1849
  ],
1844
1850
  declarations: [
1845
- exports.ɵt,
1851
+ exports.ɵu,
1846
1852
  ConfirmationDialogComponent,
1847
1853
  AlertDialogComponent,
1848
- exports.ɵu
1854
+ exports.ɵv
1849
1855
  ],
1850
1856
  exports: [
1851
- exports.ɵt,
1857
+ exports.ɵu,
1858
+ exports.ɵv
1852
1859
  ],
1853
1860
  entryComponents: [
1854
- exports.ɵt,
1861
+ exports.ɵu,
1855
1862
  ConfirmationDialogComponent,
1856
1863
  AlertDialogComponent
1857
1864
  ],
@@ -1939,1040 +1946,1100 @@
1939
1946
  * @fileoverview added by tsickle
1940
1947
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1941
1948
  */
1942
- // TODO: there are really two types of snapshot, ones with id's and ones without.
1943
- // Id snapshot are repesented by 2 url segments
1944
- // ID => [{'/basePath', params}, {'id', params}]
1945
- // NO ID => [{'/basePath', params}]
1946
- exports.ParameterSnapshot = /** @class */ (function () {
1947
- function ParameterSnapshot(placeDefinition, resolved) {
1948
- this.placeDefinition = placeDefinition;
1949
- this.resolved = resolved;
1949
+ var PlaceDefinition = /** @class */ (function () {
1950
+ function PlaceDefinition(component, path, authenticate, order, data, routeParameters, children) {
1951
+ this.component = component;
1952
+ this.path = path;
1953
+ this.authenticate = authenticate;
1954
+ this.order = order;
1955
+ this.data = data;
1956
+ this.routeParameters = routeParameters;
1957
+ this.children = children;
1950
1958
  }
1951
1959
  /**
1952
- * @param {?} other
1953
1960
  * @return {?}
1954
1961
  */
1955
- ParameterSnapshot.prototype.hasChanged = /**
1956
- * @param {?} other
1962
+ PlaceDefinition.prototype.getRouteParameters = /**
1957
1963
  * @return {?}
1958
1964
  */
1959
- function (other) {
1960
- /** @type {?} */
1961
- var changed = this.resolved.find((/**
1962
- * @param {?} r
1963
- * @return {?}
1964
- */
1965
- function (r) {
1966
- return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
1967
- }));
1968
- if (changed) {
1969
- console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
1970
- }
1971
- return !!changed;
1965
+ function () {
1966
+ return this.routeParameters;
1972
1967
  };
1973
1968
  /**
1974
- * @param {?} other
1969
+ * @template T
1970
+ * @param {?} key
1971
+ * @param {?=} defaultValue
1975
1972
  * @return {?}
1976
1973
  */
1977
- ParameterSnapshot.prototype.asUrlSegment = /**
1978
- * @param {?} other
1974
+ PlaceDefinition.prototype.getData = /**
1975
+ * @template T
1976
+ * @param {?} key
1977
+ * @param {?=} defaultValue
1979
1978
  * @return {?}
1980
1979
  */
1981
- function (other) {
1982
- pectin.assert.isTruthy(this.hasChanged(other));
1983
- /** @type {?} */
1984
- var routeParts = [];
1985
- /** @type {?} */
1986
- var gainedId = this.getFormattedRouteId() && !other.getFormattedRouteId();
1987
- /** @type {?} */
1988
- var sameId = this.getFormattedRouteId() === other.getFormattedRouteId();
1989
- /** @type {?} */
1990
- var lostId = (!this.getFormattedRouteId() && other.getFormattedRouteId());
1991
- /** @type {?} */
1992
- var changedId = (this.getFormattedRouteId() !== other.getFormattedRouteId());
1993
- if (lostId || changedId) {
1994
- routeParts.push('..');
1995
- if (changedId) {
1996
- routeParts.push(this.getFormattedRouteId());
1997
- }
1980
+ function (key, defaultValue) {
1981
+ return this.data ?
1982
+ ___default__default.isNil(this.data[key]) ? defaultValue : this.data[key] :
1983
+ defaultValue;
1984
+ };
1985
+ /**
1986
+ * @template T
1987
+ * @param {?} keys
1988
+ * @param {?=} defaultValue
1989
+ * @return {?}
1990
+ */
1991
+ PlaceDefinition.prototype.searchData = /**
1992
+ * @template T
1993
+ * @param {?} keys
1994
+ * @param {?=} defaultValue
1995
+ * @return {?}
1996
+ */
1997
+ function (keys, defaultValue) {
1998
+ var _this = this;
1999
+ if (this.data) {
2000
+ /** @type {?} */
2001
+ var found = keys.find((/**
2002
+ * @param {?} key
2003
+ * @return {?}
2004
+ */
2005
+ function (key) { return !___default__default.isNil(_this.data[key]); }));
2006
+ return found ? this.data[found] : defaultValue;
1998
2007
  }
1999
2008
  else {
2000
- routeParts.push('.');
2009
+ return defaultValue;
2001
2010
  }
2002
- routeParts.push(this.getFormattedParameters());
2003
- return routeParts;
2004
2011
  };
2012
+ return PlaceDefinition;
2013
+ }());
2014
+ if (false) {
2015
+ /** @type {?} */
2016
+ PlaceDefinition.prototype.component;
2017
+ /** @type {?} */
2018
+ PlaceDefinition.prototype.path;
2019
+ /** @type {?} */
2020
+ PlaceDefinition.prototype.authenticate;
2021
+ /** @type {?} */
2022
+ PlaceDefinition.prototype.order;
2023
+ /** @type {?} */
2024
+ PlaceDefinition.prototype.data;
2025
+ /** @type {?} */
2026
+ PlaceDefinition.prototype.routeParameters;
2027
+ /** @type {?} */
2028
+ PlaceDefinition.prototype.children;
2029
+ }
2030
+
2031
+ /**
2032
+ * @fileoverview added by tsickle
2033
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2034
+ */
2035
+ // RAKE: making this Symbol(...) broke things.
2036
+ /** @type {?} */
2037
+ var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
2038
+ // this one seems ok.
2039
+ /** @type {?} */
2040
+ var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2041
+ exports.PlaceComponent = /** @class */ (function (_super) {
2042
+ __extends(PlaceComponent, _super);
2043
+ function PlaceComponent() {
2044
+ return _super.call(this) || this;
2045
+ }
2005
2046
  /**
2006
- * @template T, S
2007
- * @param {?} parameterDef
2047
+ * @param {?} resolvedParameters
2008
2048
  * @return {?}
2009
2049
  */
2010
- ParameterSnapshot.prototype.getResolvedParameter = /**
2011
- * @template T, S
2012
- * @param {?} parameterDef
2050
+ PlaceComponent.prototype.initialiseBindings = /**
2051
+ * @param {?} resolvedParameters
2013
2052
  * @return {?}
2014
2053
  */
2015
- function (parameterDef) {
2016
- return this.resolved.find((/**
2017
- * @param {?} r
2054
+ function (resolvedParameters) {
2055
+ var _this = this;
2056
+ pectin.assert.isNil(this.resolvedParameters);
2057
+ this.resolvedParameters = resolvedParameters;
2058
+ this.placeDefinition.getRouteParameters().forEach((/**
2059
+ * @param {?} parameterDef
2018
2060
  * @return {?}
2019
2061
  */
2020
- function (r) { return r.parameterDef === parameterDef; }));
2062
+ function (parameterDef) {
2063
+ _this.installBinding(parameterDef);
2064
+ }));
2021
2065
  };
2022
2066
  /**
2067
+ * @private
2023
2068
  * @template T, S
2024
2069
  * @param {?} parameterDef
2025
2070
  * @return {?}
2026
2071
  */
2027
- ParameterSnapshot.prototype.getResolvedParameterValue = /**
2072
+ PlaceComponent.prototype.installBinding = /**
2073
+ * @private
2028
2074
  * @template T, S
2029
2075
  * @param {?} parameterDef
2030
2076
  * @return {?}
2031
2077
  */
2032
2078
  function (parameterDef) {
2033
2079
  /** @type {?} */
2034
- var resolvedParameter = this.getResolvedParameter(parameterDef);
2035
- return resolvedParameter ? resolvedParameter.value : null;
2080
+ var model = (/** @type {?} */ (this[parameterDef.propertyName]));
2081
+ // this.txo.observe(parameterDef.propertyName, model);
2082
+ this.registerDisposable(new pectin.Binding(this.resolvedParameters, model, {
2083
+ toRight: /**
2084
+ * @param {?} parameters
2085
+ * @return {?}
2086
+ */
2087
+ function (parameters) {
2088
+ return parameters.getResolvedParameterValue(parameterDef);
2089
+ },
2090
+ toLeft: /**
2091
+ * @param {?} value
2092
+ * @param {?=} currentParameters
2093
+ * @return {?}
2094
+ */
2095
+ function (value, currentParameters) {
2096
+ return currentParameters.replace(parameterDef, value);
2097
+ }
2098
+ }));
2036
2099
  };
2100
+ Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
2101
+ get: /**
2102
+ * @return {?}
2103
+ */
2104
+ function () {
2105
+ return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2106
+ },
2107
+ enumerable: true,
2108
+ configurable: true
2109
+ });
2110
+ Object.defineProperty(PlaceComponent.prototype, "childPlaces", {
2111
+ get: /**
2112
+ * @return {?}
2113
+ */
2114
+ function () {
2115
+ return this.placeDefinition.children.map((/**
2116
+ * @param {?} d
2117
+ * @return {?}
2118
+ */
2119
+ function (d) { return d.component; }));
2120
+ },
2121
+ enumerable: true,
2122
+ configurable: true
2123
+ });
2037
2124
  /**
2038
2125
  * @return {?}
2039
2126
  */
2040
- ParameterSnapshot.prototype.getRouteId = /**
2127
+ PlaceComponent.prototype.canDeactivate = /**
2041
2128
  * @return {?}
2042
2129
  */
2043
2130
  function () {
2044
- return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
2131
+ return true;
2045
2132
  };
2046
2133
  /**
2047
- * @param {?} name
2048
2134
  * @return {?}
2049
2135
  */
2050
- ParameterSnapshot.prototype.getRouteParameter = /**
2051
- * @param {?} name
2136
+ PlaceComponent.prototype.onPlaceReady = /**
2052
2137
  * @return {?}
2053
2138
  */
2054
- function (name) {
2055
- /** @type {?} */
2056
- var resolvedParameter = this.resolved.find((/**
2057
- * @param {?} r
2058
- * @return {?}
2059
- */
2060
- function (r) { return r.parameterDef.name === name; }));
2061
- return resolvedParameter ? resolvedParameter.value : null;
2139
+ function () {
2062
2140
  };
2141
+ __decorate([
2142
+ fastMemoizeDecorator.Memoize(),
2143
+ __metadata("design:type", PlaceDefinition),
2144
+ __metadata("design:paramtypes", [])
2145
+ ], PlaceComponent.prototype, "placeDefinition", null);
2146
+ return PlaceComponent;
2147
+ }(DisposableComponent));
2148
+ if (false) {
2063
2149
  /**
2150
+ * @type {?}
2064
2151
  * @private
2065
- * @return {?}
2066
- */
2067
- ParameterSnapshot.prototype.getResolvedRouteId = /**
2068
- * @private
2069
- * @return {?}
2070
2152
  */
2071
- function () {
2072
- // RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
2073
- // capture this in the type system though
2074
- return (/** @type {?} */ (this.resolved.find((/**
2075
- * @param {?} p
2076
- * @return {?}
2077
- */
2078
- function (p) { return p.parameterDef.isRouteId; }))));
2079
- };
2153
+ exports.PlaceComponent.prototype.resolvedParameters;
2154
+ }
2155
+ (function (PlaceComponent) {
2080
2156
  /**
2157
+ * @param {?} target
2081
2158
  * @return {?}
2082
2159
  */
2083
- ParameterSnapshot.prototype.hasRouteId = /**
2160
+ function isPlaceComponentConstructor(target) {
2161
+ return pectin.lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
2162
+ }
2163
+ PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
2164
+ /**
2165
+ * @param {?} klass
2084
2166
  * @return {?}
2085
2167
  */
2086
- function () {
2087
- return !!this.getResolvedRouteId();
2088
- };
2168
+ function getRouteParameters(klass) {
2169
+ return typescriptUtilities.Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
2170
+ }
2171
+ PlaceComponent.getRouteParameters = getRouteParameters;
2089
2172
  /**
2173
+ * @param {?} klass
2090
2174
  * @return {?}
2091
2175
  */
2092
- ParameterSnapshot.prototype.getFormattedRouteId = /**
2176
+ function getDefinition(klass) {
2177
+ return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
2178
+ }
2179
+ PlaceComponent.getDefinition = getDefinition;
2180
+ /**
2181
+ * @param {?} klass
2182
+ * @param {?} definition
2093
2183
  * @return {?}
2094
2184
  */
2095
- function () {
2096
- /** @type {?} */
2097
- var routeIdParam = this.getResolvedRouteId();
2098
- return routeIdParam ? routeIdParam.formattedValue() : null;
2099
- };
2185
+ function injectDefinition(klass, definition) {
2186
+ Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
2187
+ }
2188
+ PlaceComponent.injectDefinition = injectDefinition;
2189
+ })(exports.PlaceComponent || (exports.PlaceComponent = {}));
2190
+
2191
+ /**
2192
+ * @fileoverview added by tsickle
2193
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2194
+ */
2195
+ var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
2196
+ __extends(AbstractPlaceNavigationComponent, _super);
2197
+ function AbstractPlaceNavigationComponent() {
2198
+ var _this = _super.call(this) || this;
2199
+ var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2200
+ _this.placeDefinitions = chain(_this.placesModel).map((/**
2201
+ * @param {?} c
2202
+ * @return {?}
2203
+ */
2204
+ function (c) { return exports.PlaceComponent.getDefinition(c); }));
2205
+ return _this;
2206
+ }
2100
2207
  /**
2208
+ * @param {?} placeDef
2101
2209
  * @return {?}
2102
2210
  */
2103
- ParameterSnapshot.prototype.getFormattedParameters = /**
2211
+ AbstractPlaceNavigationComponent.prototype.getNav = /**
2212
+ * @param {?} placeDef
2104
2213
  * @return {?}
2105
2214
  */
2106
- function () {
2107
- /** @type {?} */
2108
- var params = {};
2215
+ function (placeDef) {
2109
2216
  /** @type {?} */
2110
- var routeIdParam = this.resolved.filter((/**
2111
- * @param {?} p
2112
- * @return {?}
2113
- */
2114
- function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
2115
- * @param {?} p
2116
- * @return {?}
2117
- */
2118
- function (p) {
2119
- params[p.parameterDef.name] = p.formattedValue();
2120
- }));
2121
- return params;
2217
+ var navItem = (/** @type {?} */ (placeDef.getData('nav')));
2218
+ return {
2219
+ title: (/**
2220
+ * @return {?}
2221
+ */
2222
+ function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
2223
+ tooltip: (/**
2224
+ * @return {?}
2225
+ */
2226
+ function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
2227
+ icon: (/**
2228
+ * @return {?}
2229
+ */
2230
+ function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
2231
+ };
2122
2232
  };
2123
2233
  /**
2124
- * @template T, S
2125
- * @param {?} parameter
2126
- * @param {?} value
2127
2234
  * @return {?}
2128
2235
  */
2129
- ParameterSnapshot.prototype.replace = /**
2130
- * @template T, S
2131
- * @param {?} parameter
2132
- * @param {?} value
2236
+ AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
2133
2237
  * @return {?}
2134
2238
  */
2135
- function (parameter, value) {
2136
- return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
2137
- * @param {?} p
2138
- * @return {?}
2139
- */
2140
- function (p) {
2141
- return p.parameterDef === parameter ? p.replace(value) : p;
2142
- })));
2239
+ function () {
2143
2240
  };
2144
- /**
2145
- * @param {?} url
2146
- * @return {?}
2147
- */
2148
- ParameterSnapshot.prototype.updateUrl = /**
2149
- * @param {?} url
2150
- * @return {?}
2151
- */
2152
- function (url) {
2153
- return url;
2241
+ AbstractPlaceNavigationComponent.propDecorators = {
2242
+ places: [{ type: core.Input }],
2243
+ placesModel: [{ type: core.Input }]
2154
2244
  };
2155
- var _a;
2156
2245
  __decorate([
2157
- src.Memoize(),
2158
- __metadata("design:type", Function),
2159
- __metadata("design:paramtypes", [Object]),
2160
- __metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
2161
- ], ParameterSnapshot.prototype, "getResolvedParameter", null);
2246
+ pectin.StoreInListModel('placesModel'),
2247
+ __metadata("design:type", Array)
2248
+ ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
2162
2249
  __decorate([
2163
- src.Memoize(),
2164
- __metadata("design:type", Function),
2165
- __metadata("design:paramtypes", [Object]),
2166
- __metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
2167
- ], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
2250
+ pectin.UseDelegate(),
2251
+ __metadata("design:type", pectin.ListModel)
2252
+ ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
2168
2253
  __decorate([
2169
2254
  src.Memoize(),
2170
2255
  __metadata("design:type", Function),
2171
- __metadata("design:paramtypes", [String]),
2256
+ __metadata("design:paramtypes", [PlaceDefinition]),
2172
2257
  __metadata("design:returntype", Object)
2173
- ], ParameterSnapshot.prototype, "getRouteParameter", null);
2174
- __decorate([
2175
- src.Memoize(),
2176
- __metadata("design:type", Function),
2177
- __metadata("design:paramtypes", []),
2178
- __metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
2179
- ], ParameterSnapshot.prototype, "getResolvedRouteId", null);
2180
- return ParameterSnapshot;
2181
- }());
2258
+ ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
2259
+ return AbstractPlaceNavigationComponent;
2260
+ }(DisposableComponent));
2182
2261
  if (false) {
2183
2262
  /** @type {?} */
2184
- exports.ParameterSnapshot.prototype.placeDefinition;
2263
+ AbstractPlaceNavigationComponent.prototype.places;
2264
+ /** @type {?} */
2265
+ AbstractPlaceNavigationComponent.prototype.placesModel;
2266
+ /** @type {?} */
2267
+ AbstractPlaceNavigationComponent.prototype.placeDefinitions;
2268
+ }
2269
+
2270
+ /**
2271
+ * @fileoverview added by tsickle
2272
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2273
+ */
2274
+ var ListPlaceNavComponent = /** @class */ (function (_super) {
2275
+ __extends(ListPlaceNavComponent, _super);
2276
+ function ListPlaceNavComponent() {
2277
+ var _this = _super.call(this) || this;
2278
+ _this.expanded = true;
2279
+ return _this;
2280
+ }
2185
2281
  /**
2186
- * @type {?}
2187
- * @private
2282
+ * @return {?}
2188
2283
  */
2189
- exports.ParameterSnapshot.prototype.resolved;
2284
+ ListPlaceNavComponent.prototype.expandMenu = /**
2285
+ * @return {?}
2286
+ */
2287
+ function () {
2288
+ this.expanded = true;
2289
+ };
2290
+ /**
2291
+ * @return {?}
2292
+ */
2293
+ ListPlaceNavComponent.prototype.collapseMenu = /**
2294
+ * @return {?}
2295
+ */
2296
+ function () {
2297
+ this.expanded = false;
2298
+ };
2299
+ /**
2300
+ * @return {?}
2301
+ */
2302
+ ListPlaceNavComponent.prototype.toggleMenu = /**
2303
+ * @return {?}
2304
+ */
2305
+ function () {
2306
+ this.expanded = !this.expanded;
2307
+ };
2308
+ ListPlaceNavComponent.decorators = [
2309
+ { type: core.Component, args: [{
2310
+ selector: 'angular-ui-powerups-list-place-nav',
2311
+ template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
2312
+ styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
2313
+ }] }
2314
+ ];
2315
+ /** @nocollapse */
2316
+ ListPlaceNavComponent.ctorParameters = function () { return []; };
2317
+ ListPlaceNavComponent.propDecorators = {
2318
+ expanded: [{ type: core.HostBinding, args: ['class.expanded',] }]
2319
+ };
2320
+ return ListPlaceNavComponent;
2321
+ }(AbstractPlaceNavigationComponent));
2322
+ if (false) {
2323
+ /** @type {?} */
2324
+ ListPlaceNavComponent.prototype.expanded;
2190
2325
  }
2191
- (function (ParameterSnapshot) {
2326
+
2327
+ /**
2328
+ * @fileoverview added by tsickle
2329
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2330
+ */
2331
+ var PlaceHistory = /** @class */ (function () {
2332
+ function PlaceHistory(router) {
2333
+ this.router = router;
2334
+ this._history = [];
2335
+ }
2192
2336
  /**
2193
- * @param {?} placeDef
2194
- * @param {?} paramMap
2337
+ * @param {?} state
2195
2338
  * @return {?}
2196
2339
  */
2197
- function create(placeDef, paramMap) {
2340
+ PlaceHistory.prototype.add = /**
2341
+ * @param {?} state
2342
+ * @return {?}
2343
+ */
2344
+ function (state) {
2198
2345
  /** @type {?} */
2199
- var resolvedParameters = placeDef.getRouteParameters()
2200
- .map((/**
2201
- * @param {?} def
2202
- * @return {?}
2203
- */
2204
- function (def) {
2205
- if (def.isArray) {
2206
- /** @type {?} */
2207
- var value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
2208
- * @param {?} raw
2209
- * @return {?}
2210
- */
2211
- function (raw) { return def.type.parse(raw); })) : null;
2212
- return new ResolvedArrayParameter(def, value);
2213
- }
2214
- else {
2215
- /** @type {?} */
2216
- var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
2217
- return new ResolvedValueParameter(def, value);
2218
- }
2219
- }));
2220
- return new ParameterSnapshot(placeDef, resolvedParameters);
2346
+ var previousState = ___default__default.last(this._history);
2347
+ if (!previousState || state.hasChanged(previousState)) {
2348
+ this._history.push(state);
2349
+ // limit our history to 100 visits
2350
+ this._history = this._history.slice(-100);
2351
+ }
2352
+ };
2353
+ PlaceHistory.decorators = [
2354
+ { type: core.Injectable, args: [{
2355
+ providedIn: 'root'
2356
+ },] }
2357
+ ];
2358
+ /** @nocollapse */
2359
+ PlaceHistory.ctorParameters = function () { return [
2360
+ { type: router.Router }
2361
+ ]; };
2362
+ /** @nocollapse */ PlaceHistory.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(core.ɵɵinject(router.Router)); }, token: PlaceHistory, providedIn: "root" });
2363
+ return PlaceHistory;
2364
+ }());
2365
+ if (false) {
2366
+ /**
2367
+ * @type {?}
2368
+ * @private
2369
+ */
2370
+ PlaceHistory.prototype._history;
2371
+ /**
2372
+ * @type {?}
2373
+ * @private
2374
+ */
2375
+ PlaceHistory.prototype.router;
2376
+ }
2377
+
2378
+ /**
2379
+ * @fileoverview added by tsickle
2380
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2381
+ */
2382
+ var PlaceRouter = /** @class */ (function () {
2383
+ function PlaceRouter(router) {
2384
+ this.router = router;
2221
2385
  }
2222
- ParameterSnapshot.create = create;
2223
2386
  /**
2224
- * @abstract
2225
- * @template T, S
2387
+ * @param {?} activatedRoute
2388
+ * @param {?} previous
2389
+ * @param {?} next
2390
+ * @return {?}
2226
2391
  */
2227
- var /**
2228
- * @abstract
2229
- * @template T, S
2392
+ PlaceRouter.prototype.pushParameterChangesToRoute = /**
2393
+ * @param {?} activatedRoute
2394
+ * @param {?} previous
2395
+ * @param {?} next
2396
+ * @return {?}
2230
2397
  */
2231
- ResolvedParameter = /** @class */ (function () {
2232
- function ResolvedParameter(parameterDef, value) {
2233
- this.parameterDef = parameterDef;
2234
- this.value = value;
2235
- }
2236
- /**
2237
- * @return {?}
2238
- */
2239
- ResolvedParameter.prototype.isRouteId = /**
2398
+ function (activatedRoute, previous, next) {
2399
+ this.router.navigate(this.redirect(activatedRoute.snapshot, previous, next), {
2400
+ relativeTo: activatedRoute
2401
+ });
2402
+ };
2403
+ /**
2404
+ * @param {?} activatedRoute
2405
+ * @param {?} sanitised
2406
+ * @param {?} snapshot
2407
+ * @return {?}
2408
+ */
2409
+ PlaceRouter.prototype.createUrlTree = /**
2410
+ * @param {?} activatedRoute
2411
+ * @param {?} sanitised
2412
+ * @param {?} snapshot
2413
+ * @return {?}
2414
+ */
2415
+ function (activatedRoute, sanitised, snapshot) {
2416
+ return this.router.createUrlTree(this.redirect(activatedRoute, snapshot, sanitised));
2417
+ };
2418
+ /**
2419
+ * @protected
2420
+ * @param {?} activatedRoute
2421
+ * @param {?} previous
2422
+ * @param {?} next
2423
+ * @return {?}
2424
+ */
2425
+ PlaceRouter.prototype.redirect = /**
2426
+ * @protected
2427
+ * @param {?} activatedRoute
2428
+ * @param {?} previous
2429
+ * @param {?} next
2430
+ * @return {?}
2431
+ */
2432
+ function (activatedRoute, previous, next) {
2433
+ /** @type {?} */
2434
+ var childSegments = ___default__default.flatten(activatedRoute.children.map((/**
2435
+ * @param {?} child
2240
2436
  * @return {?}
2241
2437
  */
2242
- function () {
2243
- return this.parameterDef.isRouteId;
2244
- };
2245
- return ResolvedParameter;
2246
- }());
2247
- ParameterSnapshot.ResolvedParameter = ResolvedParameter;
2248
- if (false) {
2438
+ function (child) { return child.url; })));
2249
2439
  /** @type {?} */
2250
- ResolvedParameter.prototype.parameterDef;
2440
+ var relativePath = !!previous.hasRouteId() ? '..' : '.';
2251
2441
  /** @type {?} */
2252
- ResolvedParameter.prototype.value;
2253
- /**
2254
- * @abstract
2255
- * @param {?} dest
2256
- * @return {?}
2257
- */
2258
- ResolvedParameter.prototype.injectRouteParam = function (dest) { };
2259
- /**
2260
- * @abstract
2261
- * @param {?} otherValue
2262
- * @return {?}
2263
- */
2264
- ResolvedParameter.prototype.isSame = function (otherValue) { };
2265
- /**
2266
- * @abstract
2267
- * @return {?}
2268
- */
2269
- ResolvedParameter.prototype.formattedValue = function () { };
2270
- /**
2271
- * @abstract
2272
- * @param {?} value
2442
+ var routeId = next.getFormattedRouteId();
2443
+ /** @type {?} */
2444
+ var path = routeId ?
2445
+ [relativePath, routeId, next.getFormattedParameters()] :
2446
+ [relativePath, next.getFormattedParameters()];
2447
+ return path.concat(childSegments.map((/**
2448
+ * @param {?} s
2273
2449
  * @return {?}
2274
2450
  */
2275
- ResolvedParameter.prototype.replace = function (value) { };
2276
- }
2451
+ function (s) { return s.path; })));
2452
+ };
2453
+ PlaceRouter.decorators = [
2454
+ { type: core.Injectable, args: [{
2455
+ providedIn: 'root'
2456
+ },] }
2457
+ ];
2458
+ /** @nocollapse */
2459
+ PlaceRouter.ctorParameters = function () { return [
2460
+ { type: router.Router }
2461
+ ]; };
2462
+ /** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router)); }, token: PlaceRouter, providedIn: "root" });
2463
+ return PlaceRouter;
2464
+ }());
2465
+ if (false) {
2277
2466
  /**
2278
- * @template T
2467
+ * @type {?}
2468
+ * @private
2279
2469
  */
2280
- var ResolvedValueParameter = /** @class */ (function (_super) {
2281
- __extends(ResolvedValueParameter, _super);
2282
- function ResolvedValueParameter() {
2283
- return _super !== null && _super.apply(this, arguments) || this;
2284
- }
2285
- /**
2286
- * @param {?} otherValue
2287
- * @return {?}
2288
- */
2289
- ResolvedValueParameter.prototype.isSame = /**
2290
- * @param {?} otherValue
2291
- * @return {?}
2292
- */
2293
- function (otherValue) {
2294
- return this.value === otherValue;
2295
- };
2296
- /**
2297
- * @param {?} dest
2298
- * @return {?}
2299
- */
2300
- ResolvedValueParameter.prototype.injectRouteParam = /**
2301
- * @param {?} dest
2302
- * @return {?}
2303
- */
2304
- function (dest) {
2305
- dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
2306
- };
2307
- /**
2308
- * @param {?} value
2309
- * @return {?}
2310
- */
2311
- ResolvedValueParameter.prototype.replace = /**
2312
- * @param {?} value
2313
- * @return {?}
2314
- */
2315
- function (value) {
2316
- return new ResolvedValueParameter(this.parameterDef, value);
2317
- };
2318
- /**
2319
- * @return {?}
2320
- */
2321
- ResolvedValueParameter.prototype.formattedValue = /**
2322
- * @return {?}
2323
- */
2324
- function () {
2325
- return !lodash.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
2326
- };
2327
- __decorate([
2328
- pectin.Trace(),
2329
- __metadata("design:type", Function),
2330
- __metadata("design:paramtypes", [Object]),
2331
- __metadata("design:returntype", Boolean)
2332
- ], ResolvedValueParameter.prototype, "isSame", null);
2333
- return ResolvedValueParameter;
2334
- }(ResolvedParameter));
2335
- ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
2336
- /**
2337
- * @template T
2338
- */
2339
- var ResolvedArrayParameter = /** @class */ (function (_super) {
2340
- __extends(ResolvedArrayParameter, _super);
2341
- function ResolvedArrayParameter() {
2342
- return _super !== null && _super.apply(this, arguments) || this;
2343
- }
2344
- /**
2345
- * @param {?} otherValue
2346
- * @return {?}
2347
- */
2348
- ResolvedArrayParameter.prototype.isSame = /**
2349
- * @param {?} otherValue
2350
- * @return {?}
2351
- */
2352
- function (otherValue) {
2353
- return lodash.isEqual(this.value, otherValue);
2354
- };
2355
- /**
2356
- * @param {?} dest
2357
- * @return {?}
2358
- */
2359
- ResolvedArrayParameter.prototype.injectRouteParam = /**
2360
- * @param {?} dest
2361
- * @return {?}
2362
- */
2363
- function (dest) {
2364
- var _this = this;
2365
- dest[this.parameterDef.name] = this.value.map((/**
2366
- * @param {?} v
2367
- * @return {?}
2368
- */
2369
- function (v) { return _this.parameterDef.type.format(v); }));
2370
- };
2371
- /**
2372
- * @param {?} value
2373
- * @return {?}
2374
- */
2375
- ResolvedArrayParameter.prototype.replace = /**
2376
- * @param {?} value
2377
- * @return {?}
2378
- */
2379
- function (value) {
2380
- return new ResolvedArrayParameter(this.parameterDef, value);
2381
- };
2382
- /**
2383
- * @return {?}
2384
- */
2385
- ResolvedArrayParameter.prototype.formattedValue = /**
2386
- * @return {?}
2387
- */
2388
- function () {
2389
- var _this = this;
2390
- return this.value ? this.value.map((/**
2391
- * @param {?} v
2392
- * @return {?}
2393
- */
2394
- function (v) { return _this.parameterDef.type.format(v); })) : [];
2395
- };
2396
- __decorate([
2397
- pectin.Trace(),
2398
- __metadata("design:type", Function),
2399
- __metadata("design:paramtypes", [Array]),
2400
- __metadata("design:returntype", Boolean)
2401
- ], ResolvedArrayParameter.prototype, "isSame", null);
2402
- return ResolvedArrayParameter;
2403
- }(ResolvedParameter));
2404
- ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
2405
- })(exports.ParameterSnapshot || (exports.ParameterSnapshot = {}));
2470
+ PlaceRouter.prototype.router;
2471
+ }
2406
2472
 
2407
2473
  /**
2408
2474
  * @fileoverview added by tsickle
2409
2475
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2410
2476
  */
2411
- // RAKE: making this Symbol(...) broke things.
2412
- /** @type {?} */
2413
- var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
2414
- // this one seems ok.
2415
- /** @type {?} */
2416
- var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2417
- exports.PlaceComponent = /** @class */ (function (_super) {
2418
- __extends(PlaceComponent, _super);
2419
- function PlaceComponent(activatedRoute, placeService) {
2420
- var _this = _super.call(this) || this;
2421
- _this.activatedRoute = activatedRoute;
2422
- _this._incomingRouteChange = new pectin.MutableValueModel(false);
2423
- _this.resolvedParameters = new pectin.MutableValueModel();
2424
- var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2425
- _this.placeDefinition.getRouteParameters().forEach((/**
2426
- * @param {?} p
2427
- * @return {?}
2428
- */
2429
- function (p) { return _this.installBinding(p); }));
2430
- observe.valuesFrom(activatedRoute.paramMap)
2431
- .last()
2432
- .map((/**
2433
- * @param {?} params
2434
- * @return {?}
2435
- */
2436
- function (params) { return exports.ParameterSnapshot.create(_this.placeDefinition, params); }))
2437
- .subscribe((/**
2438
- * @param {?} resolvedParameters
2439
- * @return {?}
2440
- */
2441
- function (resolvedParameters) {
2442
- _this._incomingRouteChange.value = true;
2443
- _this.resolvedParameters.value = resolvedParameters;
2444
- _this._incomingRouteChange.value = false;
2445
- }));
2446
- when.valueOf(_this.resolvedParameters).changes((/**
2447
- * @param {?} params
2448
- * @param {?} previous
2449
- * @return {?}
2450
- */
2451
- function (params, previous) {
2452
- placeService.notifyRouteParametersChanged({
2453
- activatedRoute: _this.activatedRoute,
2454
- next: params,
2455
- previous: previous,
2456
- updateRoute: !_this.incomingRouteChange.value // we update the route if it's a component triggered change.
2457
- });
2458
- }));
2459
- return _this;
2460
- }
2461
- Object.defineProperty(PlaceComponent.prototype, "incomingRouteChange", {
2462
- get: /**
2463
- * @return {?}
2464
- */
2465
- function () {
2466
- return this._incomingRouteChange.readonly;
2467
- },
2468
- enumerable: true,
2469
- configurable: true
2470
- });
2471
- /**
2472
- * @private
2473
- * @template T, S
2474
- * @param {?} parameterDef
2475
- * @return {?}
2476
- */
2477
- PlaceComponent.prototype.installBinding = /**
2478
- * @private
2479
- * @template T, S
2480
- * @param {?} parameterDef
2481
- * @return {?}
2482
- */
2483
- function (parameterDef) {
2477
+ /**
2478
+ * @abstract
2479
+ * @template T, S
2480
+ */
2481
+ /**
2482
+ * @abstract
2483
+ * @template T, S
2484
+ */
2485
+ exports.ParameterDefinition = /** @class */ (function () {
2486
+ function ParameterDefinition(propertyName, type, options) {
2487
+ this.propertyName = propertyName;
2488
+ this.type = type;
2484
2489
  /** @type {?} */
2485
- var model = (/** @type {?} */ (this[parameterDef.propertyName]));
2486
- // this.txo.observe(parameterDef.propertyName, model);
2487
- this.registerDisposable(new pectin.Binding(this.resolvedParameters, model, {
2488
- toRight: /**
2489
- * @param {?} parameters
2490
- * @return {?}
2491
- */
2492
- function (parameters) {
2493
- return parameters.getResolvedParameterValue(parameterDef);
2494
- },
2495
- toLeft: /**
2496
- * @param {?} value
2497
- * @param {?=} currentParameters
2498
- * @return {?}
2499
- */
2500
- function (value, currentParameters) {
2501
- return currentParameters.replace(parameterDef, value);
2502
- }
2503
- }));
2504
- };
2505
- Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
2506
- get: /**
2507
- * @return {?}
2508
- */
2509
- function () {
2510
- return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2511
- },
2512
- enumerable: true,
2513
- configurable: true
2514
- });
2515
- /**
2516
- * @return {?}
2517
- */
2518
- PlaceComponent.prototype.canDeactivate = /**
2519
- * @return {?}
2520
- */
2521
- function () {
2522
- return true;
2523
- };
2524
- // @Trace()
2525
- // @Trace()
2490
+ var opts = typescriptUtilities.Opts.get(options);
2491
+ this.name = opts.getOptional('as', propertyName);
2492
+ // this.sanitiser = new DefaultParameterSanitiser(
2493
+ // this,
2494
+ // opts.getOptional('remember', false),
2495
+ // opts.getOptional('defaultValue', null)
2496
+ // );
2497
+ }
2526
2498
  /**
2499
+ * @param {?} injector
2527
2500
  * @return {?}
2528
2501
  */
2529
- PlaceComponent.prototype.onPlaceReady =
2530
- // @Trace()
2531
- /**
2502
+ ParameterDefinition.prototype.getSanitiser = /**
2503
+ * @param {?} injector
2532
2504
  * @return {?}
2533
2505
  */
2534
- function () {
2506
+ function (injector) {
2507
+ return this.sanitiser;
2535
2508
  };
2536
- __decorate([
2537
- fastMemoizeDecorator.Memoize(),
2538
- __metadata("design:type", PlaceComponent.Definition),
2539
- __metadata("design:paramtypes", [])
2540
- ], PlaceComponent.prototype, "placeDefinition", null);
2541
- return PlaceComponent;
2542
- }(DisposableComponent));
2509
+ return ParameterDefinition;
2510
+ }());
2543
2511
  if (false) {
2544
- /** @type {?} */
2545
- exports.PlaceComponent.prototype._incomingRouteChange;
2546
- /**
2547
- * @type {?}
2548
- * @private
2549
- */
2550
- exports.PlaceComponent.prototype.resolvedParameters;
2551
- /** @type {?} */
2552
- exports.PlaceComponent.prototype.activatedRoute;
2553
- }
2554
- (function (PlaceComponent) {
2555
- var Definition = /** @class */ (function () {
2556
- function Definition(component, options) {
2557
- this.component = component;
2558
- pectin.assert.notNil(options);
2559
- this.path = options.path;
2560
- this.order = options.order;
2561
- this.data = options.data;
2562
- this.authenticate = lodash.isNil(options.authenticate) || options.authenticate;
2563
- this.children = (options.children || []).map((/**
2564
- * @param {?} c
2565
- * @return {?}
2566
- */
2567
- function (c) { return PlaceComponent.getDefinition(c).component; }));
2568
- }
2569
- /**
2570
- * @return {?}
2571
- */
2572
- Definition.prototype.getRouteParameters = /**
2573
- * @return {?}
2574
- */
2575
- function () {
2576
- return typescriptUtilities.Klass.get(this.component).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
2577
- };
2578
- /**
2579
- * @param {?} constructable
2580
- * @return {?}
2581
- */
2582
- Definition.prototype.isDescriptorForType = /**
2583
- * @param {?} constructable
2584
- * @return {?}
2585
- */
2586
- function (constructable) {
2587
- return pectin.lang.constructorChain(constructable).includes(PlaceComponent);
2588
- };
2589
- /**
2590
- * @param {?} placeComponent
2591
- * @return {?}
2592
- */
2593
- Definition.prototype.isDescriptorFor = /**
2594
- * @param {?} placeComponent
2595
- * @return {?}
2596
- */
2597
- function (placeComponent) {
2598
- return placeComponent.constructor === this.component;
2599
- };
2600
- /**
2601
- * @template T
2602
- * @param {?} key
2603
- * @param {?=} defaultValue
2604
- * @return {?}
2605
- */
2606
- Definition.prototype.getData = /**
2607
- * @template T
2608
- * @param {?} key
2609
- * @param {?=} defaultValue
2610
- * @return {?}
2611
- */
2612
- function (key, defaultValue) {
2613
- return this.data ?
2614
- lodash.isNil(this.data[key]) ? defaultValue : this.data[key] :
2615
- defaultValue;
2616
- };
2617
- /**
2618
- * @template T
2619
- * @param {?} keys
2620
- * @param {?=} defaultValue
2621
- * @return {?}
2622
- */
2623
- Definition.prototype.searchData = /**
2624
- * @template T
2625
- * @param {?} keys
2626
- * @param {?=} defaultValue
2627
- * @return {?}
2628
- */
2629
- function (keys, defaultValue) {
2630
- var _this = this;
2631
- if (this.data) {
2632
- /** @type {?} */
2633
- var found = keys.find((/**
2634
- * @param {?} key
2635
- * @return {?}
2636
- */
2637
- function (key) { return !lodash.isNil(_this.data[key]); }));
2638
- return found ? this.data[found] : defaultValue;
2639
- }
2640
- else {
2641
- return defaultValue;
2642
- }
2643
- };
2644
- __decorate([
2645
- fastMemoizeDecorator.Memoize(),
2646
- __metadata("design:type", Function),
2647
- __metadata("design:paramtypes", []),
2648
- __metadata("design:returntype", Array)
2649
- ], Definition.prototype, "getRouteParameters", null);
2650
- return Definition;
2651
- }());
2652
- PlaceComponent.Definition = Definition;
2653
- if (false) {
2654
- /** @type {?} */
2655
- Definition.prototype.path;
2656
- /** @type {?} */
2657
- Definition.prototype.authenticate;
2658
- /** @type {?} */
2659
- Definition.prototype.order;
2660
- /** @type {?} */
2661
- Definition.prototype.data;
2662
- /** @type {?} */
2663
- Definition.prototype.children;
2664
- /** @type {?} */
2665
- Definition.prototype.component;
2666
- }
2512
+ /** @type {?} */
2513
+ exports.ParameterDefinition.prototype.isRouteId;
2514
+ /** @type {?} */
2515
+ exports.ParameterDefinition.prototype.isArray;
2516
+ /** @type {?} */
2517
+ exports.ParameterDefinition.prototype.name;
2518
+ /** @type {?} */
2519
+ exports.ParameterDefinition.prototype.sanitiser;
2520
+ /** @type {?} */
2521
+ exports.ParameterDefinition.prototype.propertyName;
2522
+ /** @type {?} */
2523
+ exports.ParameterDefinition.prototype.type;
2524
+ }
2525
+ (function (ParameterDefinition) {
2667
2526
  /**
2668
2527
  * @record
2528
+ * @template T
2669
2529
  */
2670
2530
  function Options() { }
2671
- PlaceComponent.Options = Options;
2531
+ ParameterDefinition.Options = Options;
2672
2532
  if (false) {
2673
- /** @type {?} */
2674
- Options.prototype.path;
2675
- /** @type {?} */
2676
- Options.prototype.order;
2677
2533
  /** @type {?|undefined} */
2678
- Options.prototype.data;
2534
+ Options.prototype.as;
2679
2535
  /** @type {?|undefined} */
2680
- Options.prototype.authenticate;
2536
+ Options.prototype.optional;
2681
2537
  /** @type {?|undefined} */
2682
- Options.prototype.children;
2538
+ Options.prototype.remember;
2539
+ /** @type {?|undefined} */
2540
+ Options.prototype.defaultValue;
2683
2541
  }
2684
2542
  /**
2685
- * @record
2543
+ * @template T
2686
2544
  */
2687
- function ChildOptions() { }
2688
- PlaceComponent.ChildOptions = ChildOptions;
2545
+ var /**
2546
+ * @template T
2547
+ */
2548
+ RouteId = /** @class */ (function (_super) {
2549
+ __extends(RouteId, _super);
2550
+ function RouteId() {
2551
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2552
+ _this.isRouteId = true;
2553
+ _this.isArray = false;
2554
+ return _this;
2555
+ }
2556
+ return RouteId;
2557
+ }(ParameterDefinition));
2558
+ ParameterDefinition.RouteId = RouteId;
2689
2559
  if (false) {
2690
2560
  /** @type {?} */
2691
- ChildOptions.prototype.parent;
2561
+ RouteId.prototype.isRouteId;
2562
+ /** @type {?} */
2563
+ RouteId.prototype.isArray;
2692
2564
  }
2693
2565
  /**
2694
- * @param {?} klass
2695
- * @return {?}
2566
+ * @template T
2696
2567
  */
2697
- function getDefinition(klass) {
2698
- return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
2568
+ var /**
2569
+ * @template T
2570
+ */
2571
+ ValueParameter = /** @class */ (function (_super) {
2572
+ __extends(ValueParameter, _super);
2573
+ function ValueParameter() {
2574
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2575
+ _this.isRouteId = false;
2576
+ _this.isArray = false;
2577
+ return _this;
2578
+ }
2579
+ return ValueParameter;
2580
+ }(ParameterDefinition));
2581
+ ParameterDefinition.ValueParameter = ValueParameter;
2582
+ if (false) {
2583
+ /** @type {?} */
2584
+ ValueParameter.prototype.isRouteId;
2585
+ /** @type {?} */
2586
+ ValueParameter.prototype.isArray;
2699
2587
  }
2700
- PlaceComponent.getDefinition = getDefinition;
2701
2588
  /**
2702
- * @param {?} klass
2703
- * @param {?} options
2704
- * @return {?}
2589
+ * @template T
2590
+ */
2591
+ var /**
2592
+ * @template T
2705
2593
  */
2706
- function injectDefinition(klass, options) {
2707
- Reflect.defineMetadata(DEFINITION_META_DATA_KEY, new Definition(klass, options), klass);
2594
+ ArrayParameter = /** @class */ (function (_super) {
2595
+ __extends(ArrayParameter, _super);
2596
+ function ArrayParameter() {
2597
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2598
+ _this.isRouteId = false;
2599
+ _this.isArray = true;
2600
+ return _this;
2601
+ }
2602
+ return ArrayParameter;
2603
+ }(ParameterDefinition));
2604
+ ParameterDefinition.ArrayParameter = ArrayParameter;
2605
+ if (false) {
2606
+ /** @type {?} */
2607
+ ArrayParameter.prototype.isRouteId;
2608
+ /** @type {?} */
2609
+ ArrayParameter.prototype.isArray;
2708
2610
  }
2709
- PlaceComponent.injectDefinition = injectDefinition;
2710
- })(exports.PlaceComponent || (exports.PlaceComponent = {}));
2611
+ })(exports.ParameterDefinition || (exports.ParameterDefinition = {}));
2711
2612
 
2712
2613
  /**
2713
2614
  * @fileoverview added by tsickle
2714
2615
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2715
2616
  */
2716
- var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
2717
- __extends(AbstractPlaceNavigationComponent, _super);
2718
- function AbstractPlaceNavigationComponent() {
2719
- var _this = _super.call(this) || this;
2720
- var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2721
- _this.placeDefinitions = chain(_this.placesModel).map((/**
2722
- * @param {?} c
2723
- * @return {?}
2724
- */
2725
- function (c) { return exports.PlaceComponent.getDefinition(c); }));
2726
- return _this;
2617
+ exports.ParameterSnapshot = /** @class */ (function () {
2618
+ function ParameterSnapshot(placeDefinition, resolved) {
2619
+ this.placeDefinition = placeDefinition;
2620
+ this.resolved = resolved;
2727
2621
  }
2728
2622
  /**
2729
- * @param {?} placeDef
2623
+ * @param {?} other
2730
2624
  * @return {?}
2731
2625
  */
2732
- AbstractPlaceNavigationComponent.prototype.getNav = /**
2733
- * @param {?} placeDef
2626
+ ParameterSnapshot.prototype.hasChanged = /**
2627
+ * @param {?} other
2734
2628
  * @return {?}
2735
2629
  */
2736
- function (placeDef) {
2630
+ function (other) {
2737
2631
  /** @type {?} */
2738
- var navItem = (/** @type {?} */ (placeDef.getData('nav')));
2739
- return {
2740
- title: (/**
2741
- * @return {?}
2742
- */
2743
- function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
2744
- tooltip: (/**
2745
- * @return {?}
2746
- */
2747
- function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
2748
- icon: (/**
2749
- * @return {?}
2750
- */
2751
- function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
2752
- };
2632
+ var changed = this.resolved.find((/**
2633
+ * @param {?} r
2634
+ * @return {?}
2635
+ */
2636
+ function (r) {
2637
+ return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
2638
+ }));
2639
+ // if (changed) {
2640
+ // console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
2641
+ // }
2642
+ return !!changed;
2753
2643
  };
2754
2644
  /**
2645
+ * @template T, S
2646
+ * @param {?} parameterDef
2755
2647
  * @return {?}
2756
2648
  */
2757
- AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
2649
+ ParameterSnapshot.prototype.getResolvedParameter = /**
2650
+ * @template T, S
2651
+ * @param {?} parameterDef
2758
2652
  * @return {?}
2759
2653
  */
2760
- function () {
2654
+ function (parameterDef) {
2655
+ return this.resolved.find((/**
2656
+ * @param {?} r
2657
+ * @return {?}
2658
+ */
2659
+ function (r) { return r.parameterDef === parameterDef; }));
2761
2660
  };
2762
- AbstractPlaceNavigationComponent.propDecorators = {
2763
- places: [{ type: core.Input }],
2764
- placesModel: [{ type: core.Input }]
2661
+ /**
2662
+ * @template T, S
2663
+ * @param {?} parameterDef
2664
+ * @return {?}
2665
+ */
2666
+ ParameterSnapshot.prototype.getResolvedParameterValue = /**
2667
+ * @template T, S
2668
+ * @param {?} parameterDef
2669
+ * @return {?}
2670
+ */
2671
+ function (parameterDef) {
2672
+ /** @type {?} */
2673
+ var resolvedParameter = this.getResolvedParameter(parameterDef);
2674
+ return resolvedParameter ? resolvedParameter.value : null;
2765
2675
  };
2766
- __decorate([
2767
- pectin.StoreInListModel('placesModel'),
2768
- __metadata("design:type", Array)
2769
- ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
2770
- __decorate([
2771
- pectin.UseDelegate(),
2772
- __metadata("design:type", pectin.ListModel)
2773
- ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
2774
- __decorate([
2775
- src.Memoize(),
2776
- __metadata("design:type", Function),
2777
- __metadata("design:paramtypes", [exports.PlaceComponent.Definition]),
2778
- __metadata("design:returntype", Object)
2779
- ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
2780
- return AbstractPlaceNavigationComponent;
2781
- }(DisposableComponent));
2782
- if (false) {
2783
- /** @type {?} */
2784
- AbstractPlaceNavigationComponent.prototype.places;
2785
- /** @type {?} */
2786
- AbstractPlaceNavigationComponent.prototype.placesModel;
2787
- /** @type {?} */
2788
- AbstractPlaceNavigationComponent.prototype.placeDefinitions;
2789
- }
2790
-
2791
- /**
2792
- * @fileoverview added by tsickle
2793
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2794
- */
2795
- var ListPlaceNavComponent = /** @class */ (function (_super) {
2796
- __extends(ListPlaceNavComponent, _super);
2797
- function ListPlaceNavComponent() {
2798
- var _this = _super.call(this) || this;
2799
- _this.expanded = true;
2800
- return _this;
2801
- }
2802
2676
  /**
2803
2677
  * @return {?}
2804
2678
  */
2805
- ListPlaceNavComponent.prototype.expandMenu = /**
2679
+ ParameterSnapshot.prototype.getRouteId = /**
2806
2680
  * @return {?}
2807
2681
  */
2808
2682
  function () {
2809
- this.expanded = true;
2683
+ return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
2810
2684
  };
2811
2685
  /**
2686
+ * @param {?} name
2812
2687
  * @return {?}
2813
2688
  */
2814
- ListPlaceNavComponent.prototype.collapseMenu = /**
2689
+ ParameterSnapshot.prototype.getRouteParameter = /**
2690
+ * @param {?} name
2815
2691
  * @return {?}
2816
2692
  */
2817
- function () {
2818
- this.expanded = false;
2693
+ function (name) {
2694
+ /** @type {?} */
2695
+ var resolvedParameter = this.resolved.find((/**
2696
+ * @param {?} r
2697
+ * @return {?}
2698
+ */
2699
+ function (r) { return r.parameterDef.name === name; }));
2700
+ return resolvedParameter ? resolvedParameter.value : null;
2819
2701
  };
2820
2702
  /**
2703
+ * @private
2821
2704
  * @return {?}
2822
2705
  */
2823
- ListPlaceNavComponent.prototype.toggleMenu = /**
2706
+ ParameterSnapshot.prototype.getResolvedRouteId = /**
2707
+ * @private
2824
2708
  * @return {?}
2825
2709
  */
2826
2710
  function () {
2827
- this.expanded = !this.expanded;
2828
- };
2829
- ListPlaceNavComponent.decorators = [
2830
- { type: core.Component, args: [{
2831
- selector: 'angular-ui-powerups-list-place-nav',
2832
- template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
2833
- styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
2834
- }] }
2835
- ];
2836
- /** @nocollapse */
2837
- ListPlaceNavComponent.ctorParameters = function () { return []; };
2838
- ListPlaceNavComponent.propDecorators = {
2839
- expanded: [{ type: core.HostBinding, args: ['class.expanded',] }]
2840
- };
2841
- return ListPlaceNavComponent;
2842
- }(AbstractPlaceNavigationComponent));
2843
- if (false) {
2844
- /** @type {?} */
2845
- ListPlaceNavComponent.prototype.expanded;
2846
- }
2847
-
2848
- /**
2849
- * @fileoverview added by tsickle
2850
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2851
- */
2852
- var PlaceService = /** @class */ (function (_super) {
2853
- __extends(PlaceService, _super);
2854
- function PlaceService(router, injector) {
2855
- var _this = _super.call(this) || this;
2856
- _this.router = router;
2857
- _this.injector = injector;
2858
- _this._activePlaces = new pectin.MutableListModel();
2859
- return _this;
2860
- }
2861
- Object.defineProperty(PlaceService.prototype, "activePlaces", {
2862
- get: /**
2711
+ // RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
2712
+ // capture this in the type system though
2713
+ return (/** @type {?} */ (this.resolved.find((/**
2714
+ * @param {?} p
2863
2715
  * @return {?}
2864
2716
  */
2865
- function () {
2866
- return this._activePlaces.readonly;
2867
- },
2868
- enumerable: true,
2869
- configurable: true
2870
- });
2871
- // @Trace()
2872
- // @Trace()
2717
+ function (p) { return p.parameterDef.isRouteId; }))));
2718
+ };
2873
2719
  /**
2874
- * @param {?} place
2875
2720
  * @return {?}
2876
2721
  */
2877
- PlaceService.prototype.onActivate =
2878
- // @Trace()
2879
- /**
2880
- * @param {?} place
2722
+ ParameterSnapshot.prototype.hasRouteId = /**
2881
2723
  * @return {?}
2882
2724
  */
2883
- function (place) {
2884
- this._activePlaces.push(place);
2725
+ function () {
2726
+ return !!this.getResolvedRouteId();
2885
2727
  };
2886
- // @Trace()
2887
- // @Trace()
2888
2728
  /**
2889
- * @param {?} place
2890
2729
  * @return {?}
2891
2730
  */
2892
- PlaceService.prototype.onDeactivate =
2893
- // @Trace()
2731
+ ParameterSnapshot.prototype.getFormattedRouteId = /**
2732
+ * @return {?}
2733
+ */
2734
+ function () {
2735
+ /** @type {?} */
2736
+ var routeIdParam = this.getResolvedRouteId();
2737
+ return routeIdParam ? routeIdParam.formattedValue() : null;
2738
+ };
2894
2739
  /**
2895
- * @param {?} place
2896
2740
  * @return {?}
2897
2741
  */
2898
- function (place) {
2899
- this._activePlaces.remove(place);
2742
+ ParameterSnapshot.prototype.getFormattedParameters = /**
2743
+ * @return {?}
2744
+ */
2745
+ function () {
2746
+ /** @type {?} */
2747
+ var params = {};
2748
+ /** @type {?} */
2749
+ var routeIdParam = this.resolved.filter((/**
2750
+ * @param {?} p
2751
+ * @return {?}
2752
+ */
2753
+ function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
2754
+ * @param {?} p
2755
+ * @return {?}
2756
+ */
2757
+ function (p) {
2758
+ params[p.parameterDef.name] = p.formattedValue();
2759
+ }));
2760
+ return params;
2900
2761
  };
2901
- // @Trace()
2902
- // @Trace()
2903
2762
  /**
2904
- * @param {?} params
2763
+ * @template T, S
2764
+ * @param {?} parameter
2765
+ * @param {?} value
2905
2766
  * @return {?}
2906
2767
  */
2907
- PlaceService.prototype.notifyRouteParametersChanged =
2908
- // @Trace()
2909
- /**
2910
- * @param {?} params
2768
+ ParameterSnapshot.prototype.replace = /**
2769
+ * @template T, S
2770
+ * @param {?} parameter
2771
+ * @param {?} value
2911
2772
  * @return {?}
2912
2773
  */
2913
- function (params) {
2914
- // We update the router state...
2915
- if (params.updateRoute) {
2916
- /** @type {?} */
2917
- var routeId = params.next.getFormattedRouteId();
2918
- /** @type {?} */
2919
- var relativePath = !!params.previous.hasRouteId() ? '..' : '.';
2920
- /** @type {?} */
2921
- var path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
2922
- this.router.navigate(path, {
2923
- relativeTo: params.activatedRoute
2924
- });
2925
- }
2774
+ function (parameter, value) {
2775
+ return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
2776
+ * @param {?} p
2777
+ * @return {?}
2778
+ */
2779
+ function (p) {
2780
+ return p.parameterDef === parameter ? p.replace(value) : p;
2781
+ })));
2926
2782
  };
2927
- // @Trace()
2928
- // @Trace()
2929
2783
  /**
2930
- * @param {?} snapshot
2784
+ * @param {?} injector
2931
2785
  * @return {?}
2932
2786
  */
2933
- PlaceService.prototype.sanitise =
2934
- // @Trace()
2935
- /**
2936
- * @param {?} snapshot
2787
+ ParameterSnapshot.prototype.sanitise = /**
2788
+ * @param {?} injector
2937
2789
  * @return {?}
2938
2790
  */
2939
- function (snapshot) {
2791
+ function (injector) {
2940
2792
  return __awaiter(this, void 0, void 0, function () {
2941
2793
  return __generator(this, function (_a) {
2942
- return [2 /*return*/, snapshot];
2794
+ return [2 /*return*/, this];
2943
2795
  });
2944
2796
  });
2945
2797
  };
2946
- PlaceService.decorators = [
2947
- { type: core.Injectable, args: [{
2948
- providedIn: 'root'
2949
- },] }
2950
- ];
2951
- /** @nocollapse */
2952
- PlaceService.ctorParameters = function () { return [
2953
- { type: router.Router },
2954
- { type: core.Injector }
2955
- ]; };
2956
- /** @nocollapse */ PlaceService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR)); }, token: PlaceService, providedIn: "root" });
2957
- return PlaceService;
2958
- }(pectin.GarbageCollector));
2798
+ var _a;
2799
+ __decorate([
2800
+ src.Memoize(),
2801
+ __metadata("design:type", Function),
2802
+ __metadata("design:paramtypes", [exports.ParameterDefinition]),
2803
+ __metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
2804
+ ], ParameterSnapshot.prototype, "getResolvedParameter", null);
2805
+ __decorate([
2806
+ src.Memoize(),
2807
+ __metadata("design:type", Function),
2808
+ __metadata("design:paramtypes", [exports.ParameterDefinition]),
2809
+ __metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
2810
+ ], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
2811
+ __decorate([
2812
+ src.Memoize(),
2813
+ __metadata("design:type", Function),
2814
+ __metadata("design:paramtypes", [String]),
2815
+ __metadata("design:returntype", Object)
2816
+ ], ParameterSnapshot.prototype, "getRouteParameter", null);
2817
+ __decorate([
2818
+ src.Memoize(),
2819
+ __metadata("design:type", Function),
2820
+ __metadata("design:paramtypes", []),
2821
+ __metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
2822
+ ], ParameterSnapshot.prototype, "getResolvedRouteId", null);
2823
+ return ParameterSnapshot;
2824
+ }());
2959
2825
  if (false) {
2826
+ /** @type {?} */
2827
+ exports.ParameterSnapshot.prototype.placeDefinition;
2960
2828
  /**
2961
2829
  * @type {?}
2962
2830
  * @private
2963
2831
  */
2964
- PlaceService.prototype._activePlaces;
2832
+ exports.ParameterSnapshot.prototype.resolved;
2833
+ }
2834
+ (function (ParameterSnapshot) {
2965
2835
  /**
2966
- * @type {?}
2967
- * @protected
2836
+ * @param {?} placeDef
2837
+ * @param {?} paramMap
2838
+ * @return {?}
2968
2839
  */
2969
- PlaceService.prototype.router;
2840
+ function create(placeDef, paramMap) {
2841
+ /** @type {?} */
2842
+ var resolvedParameters = placeDef.getRouteParameters()
2843
+ .map((/**
2844
+ * @param {?} def
2845
+ * @return {?}
2846
+ */
2847
+ function (def) {
2848
+ if (def.isArray) {
2849
+ /** @type {?} */
2850
+ var value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
2851
+ * @param {?} raw
2852
+ * @return {?}
2853
+ */
2854
+ function (raw) { return def.type.parse(raw); })) : null;
2855
+ return new ResolvedArrayParameter(def, value);
2856
+ }
2857
+ else {
2858
+ /** @type {?} */
2859
+ var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
2860
+ return new ResolvedValueParameter(def, value);
2861
+ }
2862
+ }));
2863
+ return new ParameterSnapshot(placeDef, resolvedParameters);
2864
+ }
2865
+ ParameterSnapshot.create = create;
2970
2866
  /**
2971
- * @type {?}
2972
- * @protected
2867
+ * @abstract
2868
+ * @template T, S
2973
2869
  */
2974
- PlaceService.prototype.injector;
2975
- }
2870
+ var /**
2871
+ * @abstract
2872
+ * @template T, S
2873
+ */
2874
+ ResolvedParameter = /** @class */ (function () {
2875
+ function ResolvedParameter(parameterDef, value) {
2876
+ this.parameterDef = parameterDef;
2877
+ this.value = value;
2878
+ }
2879
+ /**
2880
+ * @return {?}
2881
+ */
2882
+ ResolvedParameter.prototype.isRouteId = /**
2883
+ * @return {?}
2884
+ */
2885
+ function () {
2886
+ return this.parameterDef.isRouteId;
2887
+ };
2888
+ return ResolvedParameter;
2889
+ }());
2890
+ ParameterSnapshot.ResolvedParameter = ResolvedParameter;
2891
+ if (false) {
2892
+ /** @type {?} */
2893
+ ResolvedParameter.prototype.parameterDef;
2894
+ /** @type {?} */
2895
+ ResolvedParameter.prototype.value;
2896
+ /**
2897
+ * @abstract
2898
+ * @param {?} dest
2899
+ * @return {?}
2900
+ */
2901
+ ResolvedParameter.prototype.injectRouteParam = function (dest) { };
2902
+ /**
2903
+ * @abstract
2904
+ * @param {?} otherValue
2905
+ * @return {?}
2906
+ */
2907
+ ResolvedParameter.prototype.isSame = function (otherValue) { };
2908
+ /**
2909
+ * @abstract
2910
+ * @return {?}
2911
+ */
2912
+ ResolvedParameter.prototype.formattedValue = function () { };
2913
+ /**
2914
+ * @abstract
2915
+ * @param {?} value
2916
+ * @return {?}
2917
+ */
2918
+ ResolvedParameter.prototype.replace = function (value) { };
2919
+ }
2920
+ /**
2921
+ * @template T
2922
+ */
2923
+ var /**
2924
+ * @template T
2925
+ */
2926
+ ResolvedValueParameter = /** @class */ (function (_super) {
2927
+ __extends(ResolvedValueParameter, _super);
2928
+ function ResolvedValueParameter() {
2929
+ return _super !== null && _super.apply(this, arguments) || this;
2930
+ }
2931
+ /**
2932
+ * @param {?} otherValue
2933
+ * @return {?}
2934
+ */
2935
+ ResolvedValueParameter.prototype.isSame = /**
2936
+ * @param {?} otherValue
2937
+ * @return {?}
2938
+ */
2939
+ function (otherValue) {
2940
+ return this.value === otherValue;
2941
+ };
2942
+ /**
2943
+ * @param {?} dest
2944
+ * @return {?}
2945
+ */
2946
+ ResolvedValueParameter.prototype.injectRouteParam = /**
2947
+ * @param {?} dest
2948
+ * @return {?}
2949
+ */
2950
+ function (dest) {
2951
+ dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
2952
+ };
2953
+ /**
2954
+ * @param {?} value
2955
+ * @return {?}
2956
+ */
2957
+ ResolvedValueParameter.prototype.replace = /**
2958
+ * @param {?} value
2959
+ * @return {?}
2960
+ */
2961
+ function (value) {
2962
+ return new ResolvedValueParameter(this.parameterDef, value);
2963
+ };
2964
+ /**
2965
+ * @return {?}
2966
+ */
2967
+ ResolvedValueParameter.prototype.formattedValue = /**
2968
+ * @return {?}
2969
+ */
2970
+ function () {
2971
+ return !___default__default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
2972
+ };
2973
+ return ResolvedValueParameter;
2974
+ }(ResolvedParameter));
2975
+ ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
2976
+ /**
2977
+ * @template T
2978
+ */
2979
+ var /**
2980
+ * @template T
2981
+ */
2982
+ ResolvedArrayParameter = /** @class */ (function (_super) {
2983
+ __extends(ResolvedArrayParameter, _super);
2984
+ function ResolvedArrayParameter() {
2985
+ return _super !== null && _super.apply(this, arguments) || this;
2986
+ }
2987
+ /**
2988
+ * @param {?} otherValue
2989
+ * @return {?}
2990
+ */
2991
+ ResolvedArrayParameter.prototype.isSame = /**
2992
+ * @param {?} otherValue
2993
+ * @return {?}
2994
+ */
2995
+ function (otherValue) {
2996
+ return ___default__default.isEqual(this.value, otherValue);
2997
+ };
2998
+ /**
2999
+ * @param {?} dest
3000
+ * @return {?}
3001
+ */
3002
+ ResolvedArrayParameter.prototype.injectRouteParam = /**
3003
+ * @param {?} dest
3004
+ * @return {?}
3005
+ */
3006
+ function (dest) {
3007
+ var _this = this;
3008
+ dest[this.parameterDef.name] = this.value.map((/**
3009
+ * @param {?} v
3010
+ * @return {?}
3011
+ */
3012
+ function (v) { return _this.parameterDef.type.format(v); }));
3013
+ };
3014
+ /**
3015
+ * @param {?} value
3016
+ * @return {?}
3017
+ */
3018
+ ResolvedArrayParameter.prototype.replace = /**
3019
+ * @param {?} value
3020
+ * @return {?}
3021
+ */
3022
+ function (value) {
3023
+ return new ResolvedArrayParameter(this.parameterDef, value);
3024
+ };
3025
+ /**
3026
+ * @return {?}
3027
+ */
3028
+ ResolvedArrayParameter.prototype.formattedValue = /**
3029
+ * @return {?}
3030
+ */
3031
+ function () {
3032
+ var _this = this;
3033
+ return this.value ? this.value.map((/**
3034
+ * @param {?} v
3035
+ * @return {?}
3036
+ */
3037
+ function (v) { return _this.parameterDef.type.format(v); })) : [];
3038
+ };
3039
+ return ResolvedArrayParameter;
3040
+ }(ResolvedParameter));
3041
+ ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
3042
+ })(exports.ParameterSnapshot || (exports.ParameterSnapshot = {}));
2976
3043
 
2977
3044
  /**
2978
3045
  * @fileoverview added by tsickle
@@ -3025,56 +3092,88 @@
3025
3092
  ]);
3026
3093
  }
3027
3094
  /** @type {?} */
3028
- var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
3095
+ var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation('0.3s');
3029
3096
 
3030
3097
  /**
3031
3098
  * @fileoverview added by tsickle
3032
3099
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3033
3100
  */
3101
+ /**
3102
+ * @record
3103
+ */
3104
+ function PlaceRef() { }
3105
+ if (false) {
3106
+ /** @type {?} */
3107
+ PlaceRef.prototype.placeDefinition;
3108
+ /**
3109
+ * @param {?} param
3110
+ * @return {?}
3111
+ */
3112
+ PlaceRef.prototype.initialiseBindings = function (param) { };
3113
+ /**
3114
+ * @return {?}
3115
+ */
3116
+ PlaceRef.prototype.onPlaceReady = function () { };
3117
+ }
3034
3118
  var PlaceOutletComponent = /** @class */ (function (_super) {
3035
3119
  __extends(PlaceOutletComponent, _super);
3036
- function PlaceOutletComponent(placeService, activatedRoute) {
3120
+ function PlaceOutletComponent(router, placeHistory) {
3037
3121
  var _this = _super.call(this) || this;
3038
- _this.placeService = placeService;
3039
- _this.activatedRoute = activatedRoute;
3122
+ _this.router = router;
3123
+ _this.placeHistory = placeHistory;
3040
3124
  _this.animate = true;
3041
- _this.outletUrlSegment = new pectin.MutableListModel();
3125
+ _this._incomingRouteChange = new pectin.Guard();
3126
+ _this._inOutletUpdate = new pectin.Guard();
3127
+ _this._activatedRouteModel = new pectin.MutableValueModel();
3128
+ _this._placeDefinition = new pectin.MutableValueModel();
3129
+ _this._resolvedParameters = new pectin.MutableValueModel();
3042
3130
  var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
3043
- _this.myPath = observe.listsFrom(activatedRoute.url).last().map((/**
3044
- * @param {?} s
3045
- * @return {?}
3046
- */
3047
- function (s) { return s.toString(); })).reduce((/**
3048
- * @param {?} bits
3049
- * @return {?}
3050
- */
3051
- function (bits) { return bits.join(','); }));
3052
- console.log("new outlet@(" + _this.myPath.value + ")");
3053
- _this.outletChildPath = chain(_this.outletUrlSegment).map((/**
3054
- * @param {?} s
3131
+ _this._paramMap = chain(_this._activatedRouteModel).pullObservableValue((/**
3132
+ * @param {?} ar
3055
3133
  * @return {?}
3056
3134
  */
3057
- function (s) { return s.toString(); })).reduce((/**
3058
- * @param {?} bits
3059
- * @return {?}
3060
- */
3061
- function (bits) { return bits.join(","); }));
3062
- _this.state = chain(_this.myPath).map((/**
3063
- * @param {?} path
3135
+ function (ar) { return ar.paramMap; }));
3136
+ _this.placeConfigured = valueOf.all(chain(_this._inOutletUpdate).isFalsey(), _this._placeDefinition, _this._paramMap).areTruthy();
3137
+ when.valueOf(_this._paramMap).changes((/**
3138
+ * @param {?} params
3064
3139
  * @return {?}
3065
3140
  */
3066
- function (path) {
3067
- return "outlet@(" + path + "), child path->" + _this.outletChildPath.value;
3068
- }), { dependsOn: _this.outletChildPath });
3069
- when.valueOf(_this.state).changes((/**
3070
- * @param {?} debug
3141
+ function (params) {
3142
+ /** @type {?} */
3143
+ var snapshot = exports.ParameterSnapshot.create(_this._placeDefinition.value, params);
3144
+ _this._incomingRouteChange.whileTrue((/**
3145
+ * @return {?}
3146
+ */
3147
+ function () {
3148
+ _this._resolvedParameters.value = snapshot;
3149
+ _this.placeHistory.add(snapshot);
3150
+ }));
3151
+ }), {
3152
+ postponeUntil: _this.placeConfigured
3153
+ });
3154
+ when.valueOf(_this._resolvedParameters).changes((/**
3155
+ * @param {?} next
3156
+ * @param {?} previous
3071
3157
  * @return {?}
3072
3158
  */
3073
- function (debug) {
3074
- console.log("Outlet Changed -> " + debug);
3075
- }));
3159
+ function (next, previous) {
3160
+ _this.pushChangesToRoute(next, previous);
3161
+ _this.placeHistory.add(next); // the above route change doesn't seem to propagate back in, so I'm add the state to the history manually for now.
3162
+ }), {
3163
+ unless: _this.incomingRouteChange
3164
+ });
3076
3165
  return _this;
3077
3166
  }
3167
+ Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
3168
+ get: /**
3169
+ * @return {?}
3170
+ */
3171
+ function () {
3172
+ return this._incomingRouteChange;
3173
+ },
3174
+ enumerable: true,
3175
+ configurable: true
3176
+ });
3078
3177
  /**
3079
3178
  * @return {?}
3080
3179
  */
@@ -3084,76 +3183,56 @@
3084
3183
  function () {
3085
3184
  };
3086
3185
  /**
3186
+ * @param {?} routerOutlet
3187
+ * @param {?} place
3087
3188
  * @return {?}
3088
3189
  */
3089
- PlaceOutletComponent.prototype.ngAfterViewInit = /**
3090
- * @return {?}
3091
- */
3092
- function () {
3093
- // this.routerOutLetQuery.changes.subscribe(() => {
3094
- // this.updateRouterOutlet(this.routerOutLetQuery.first);
3095
- // });
3096
- };
3097
- /**
3098
- * @return {?}
3099
- */
3100
- PlaceOutletComponent.prototype.ngAfterViewChecked = /**
3101
- * @return {?}
3102
- */
3103
- function () {
3104
- // console.log(`@AfterViewChecked: ${this.state.value}`);
3105
- this.updateRouterOutlet(this.routerOutLetQuery.first);
3106
- };
3107
- // @Trace()
3108
- // ngOnDestroy(): void {
3109
- // console.log('outletSegments', this.outletUrlSegment.value);
3110
- // console.log('mySegments', this.myPath.value);
3111
- // super.ngOnDestroy();
3112
- // }
3113
- // @Trace()
3114
- // @Trace()
3115
- // ngOnDestroy(): void {
3116
- // console.log('outletSegments', this.outletUrlSegment.value);
3117
- // console.log('mySegments', this.myPath.value);
3118
- // super.ngOnDestroy();
3119
- // }
3120
- // @Trace()
3121
- /**
3122
- * @param {?} $event
3123
- * @return {?}
3124
- */
3125
- PlaceOutletComponent.prototype.onOutletActivated =
3126
- // @Trace()
3127
- // ngOnDestroy(): void {
3128
- // console.log('outletSegments', this.outletUrlSegment.value);
3129
- // console.log('mySegments', this.myPath.value);
3130
- // super.ngOnDestroy();
3131
- // }
3132
- // @Trace()
3133
- /**
3134
- * @param {?} $event
3190
+ PlaceOutletComponent.prototype.onOutletActivated = /**
3191
+ * @param {?} routerOutlet
3192
+ * @param {?} place
3135
3193
  * @return {?}
3136
3194
  */
3137
- function ($event) {
3138
- // console.log(this.routerOutLet.activatedRoute.snapshot.url);
3139
- this.currentPlace = $event;
3140
- this.placeService.onActivate($event);
3195
+ function (routerOutlet, place) {
3196
+ var _this = this;
3197
+ this._inOutletUpdate.whileTrue((/**
3198
+ * @return {?}
3199
+ */
3200
+ function () {
3201
+ try {
3202
+ _this._currentPlace = place;
3203
+ _this._activatedRouteModel.value = routerOutlet.activatedRoute;
3204
+ _this._placeDefinition.value = place.placeDefinition;
3205
+ place.initialiseBindings(_this._resolvedParameters);
3206
+ }
3207
+ catch (error) {
3208
+ console.error(error);
3209
+ }
3210
+ }));
3141
3211
  if (!this.animate) {
3142
3212
  // we're not animating so trigger any post animation callbacks now.
3143
3213
  this.animationDone();
3144
3214
  }
3145
3215
  };
3146
3216
  /**
3217
+ * @param {?} routerOutlet
3147
3218
  * @param {?} $event
3148
3219
  * @return {?}
3149
3220
  */
3150
3221
  PlaceOutletComponent.prototype.onOutletDeactivated = /**
3222
+ * @param {?} routerOutlet
3151
3223
  * @param {?} $event
3152
3224
  * @return {?}
3153
3225
  */
3154
- function ($event) {
3155
- this.currentPlace = null;
3156
- this.placeService.onDeactivate($event);
3226
+ function (routerOutlet, $event) {
3227
+ var _this = this;
3228
+ this._inOutletUpdate.whileTrue((/**
3229
+ * @return {?}
3230
+ */
3231
+ function () {
3232
+ _this._currentPlace = null;
3233
+ _this._activatedRouteModel.value = null;
3234
+ _this._placeDefinition.value = null;
3235
+ }));
3157
3236
  };
3158
3237
  /**
3159
3238
  * @param {?} outlet
@@ -3173,45 +3252,54 @@
3173
3252
  * @return {?}
3174
3253
  */
3175
3254
  function () {
3176
- if (this.currentPlace) {
3177
- this.currentPlace.onPlaceReady();
3255
+ if (this._currentPlace) {
3256
+ this._currentPlace.onPlaceReady();
3178
3257
  }
3179
3258
  };
3180
- // @Trace()
3181
- // @Trace()
3182
3259
  /**
3183
- * @private
3184
- * @param {?} first
3260
+ * @param {?} next
3261
+ * @param {?} previous
3262
+ * @return {?}
3263
+ */
3264
+ PlaceOutletComponent.prototype.pushChangesToRoute = /**
3265
+ * @param {?} next
3266
+ * @param {?} previous
3185
3267
  * @return {?}
3186
3268
  */
3187
- PlaceOutletComponent.prototype.updateRouterOutlet =
3188
- // @Trace()
3269
+ function (next, previous) {
3270
+ /** @type {?} */
3271
+ var activatedRoute = this._activatedRouteModel.value;
3272
+ this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
3273
+ };
3189
3274
  /**
3190
- * @private
3191
- * @param {?} first
3275
+ * @param {?} snapshot
3276
+ * @param {?} callback
3192
3277
  * @return {?}
3193
3278
  */
3194
- function (first) {
3195
- if (first.isActivated) {
3196
- this.outletUrlSegment.value = first.activatedRoute.snapshot.url;
3197
- }
3279
+ PlaceOutletComponent.prototype.sanitise = /**
3280
+ * @param {?} snapshot
3281
+ * @param {?} callback
3282
+ * @return {?}
3283
+ */
3284
+ function (snapshot, callback) {
3285
+ return snapshot;
3198
3286
  };
3199
3287
  PlaceOutletComponent.decorators = [
3200
3288
  { type: core.Component, args: [{
3201
3289
  selector: 'angular-ui-powerups-place-outlet',
3202
- template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated($event)\"\n (deactivate)=\"onOutletDeactivated($event)\">\n </router-outlet>\n</div>\n\n",
3290
+ template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\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",
3203
3291
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
3204
3292
  styles: [":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
3205
3293
  }] }
3206
3294
  ];
3207
3295
  /** @nocollapse */
3208
3296
  PlaceOutletComponent.ctorParameters = function () { return [
3209
- { type: PlaceService },
3210
- { type: router.ActivatedRoute }
3297
+ { type: PlaceRouter },
3298
+ { type: PlaceHistory }
3211
3299
  ]; };
3212
3300
  PlaceOutletComponent.propDecorators = {
3213
3301
  animate: [{ type: core.Input }],
3214
- routerOutLetQuery: [{ type: core.ViewChildren, args: [router.RouterOutlet,] }]
3302
+ routerOut: [{ type: core.ViewChild, args: ['routeOutlet', { static: true },] }]
3215
3303
  };
3216
3304
  return PlaceOutletComponent;
3217
3305
  }(DisposableComponent));
@@ -3219,42 +3307,54 @@
3219
3307
  /** @type {?} */
3220
3308
  PlaceOutletComponent.prototype.animate;
3221
3309
  /** @type {?} */
3222
- PlaceOutletComponent.prototype.routerOutLetQuery;
3310
+ PlaceOutletComponent.prototype.routerOut;
3311
+ /**
3312
+ * @type {?}
3313
+ * @private
3314
+ */
3315
+ PlaceOutletComponent.prototype._currentPlace;
3316
+ /**
3317
+ * @type {?}
3318
+ * @private
3319
+ */
3320
+ PlaceOutletComponent.prototype._incomingRouteChange;
3223
3321
  /**
3224
3322
  * @type {?}
3225
3323
  * @private
3226
3324
  */
3227
- PlaceOutletComponent.prototype.currentPlace;
3325
+ PlaceOutletComponent.prototype._inOutletUpdate;
3228
3326
  /**
3229
3327
  * @type {?}
3230
3328
  * @private
3231
3329
  */
3232
- PlaceOutletComponent.prototype.myPath;
3330
+ PlaceOutletComponent.prototype._activatedRouteModel;
3233
3331
  /**
3234
3332
  * @type {?}
3235
3333
  * @private
3236
3334
  */
3237
- PlaceOutletComponent.prototype.outletUrlSegment;
3335
+ PlaceOutletComponent.prototype._placeDefinition;
3238
3336
  /**
3239
3337
  * @type {?}
3240
3338
  * @private
3241
3339
  */
3242
- PlaceOutletComponent.prototype.outletChildPath;
3340
+ PlaceOutletComponent.prototype._paramMap;
3341
+ /** @type {?} */
3342
+ PlaceOutletComponent.prototype._resolvedParameters;
3243
3343
  /**
3244
3344
  * @type {?}
3245
3345
  * @private
3246
3346
  */
3247
- PlaceOutletComponent.prototype.state;
3347
+ PlaceOutletComponent.prototype.placeConfigured;
3248
3348
  /**
3249
3349
  * @type {?}
3250
3350
  * @private
3251
3351
  */
3252
- PlaceOutletComponent.prototype.placeService;
3352
+ PlaceOutletComponent.prototype.router;
3253
3353
  /**
3254
3354
  * @type {?}
3255
3355
  * @private
3256
3356
  */
3257
- PlaceOutletComponent.prototype.activatedRoute;
3357
+ PlaceOutletComponent.prototype.placeHistory;
3258
3358
  }
3259
3359
 
3260
3360
  /**
@@ -3312,9 +3412,7 @@
3312
3412
  TabbedPlaceNavigationComponent,
3313
3413
  ListPlaceNavComponent
3314
3414
  ],
3315
- providers: [
3316
- PlaceService
3317
- ]
3415
+ providers: []
3318
3416
  },] }
3319
3417
  ];
3320
3418
  return PlaceModule;
@@ -3753,39 +3851,6 @@
3753
3851
  NavItem.prototype.tooltip = function () { };
3754
3852
  }
3755
3853
 
3756
- /**
3757
- * @fileoverview added by tsickle
3758
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3759
- */
3760
- /**
3761
- * @record
3762
- */
3763
- function PlaceComponentLike() { }
3764
- if (false) {
3765
- /** @type {?} */
3766
- PlaceComponentLike.prototype.activatedRoute;
3767
- /**
3768
- * @return {?}
3769
- */
3770
- PlaceComponentLike.prototype.onPlaceReady = function () { };
3771
- }
3772
-
3773
- /**
3774
- * @fileoverview added by tsickle
3775
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3776
- */
3777
- /**
3778
- * @record
3779
- */
3780
- function PlaceUpdatesService() { }
3781
- if (false) {
3782
- /**
3783
- * @param {?} params
3784
- * @return {?}
3785
- */
3786
- PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
3787
- }
3788
-
3789
3854
  /**
3790
3855
  * @fileoverview added by tsickle
3791
3856
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -3800,12 +3865,37 @@
3800
3865
  * @return {?}
3801
3866
  */
3802
3867
  function (target) {
3803
- if (!pectin.lang.constructorChain((/** @type {?} */ (target))).includes(exports.PlaceComponent)) {
3868
+ if (exports.PlaceComponent.isPlaceComponentConstructor(target)) {
3869
+ exports.PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, ___default.isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, exports.PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
3870
+ * @param {?} c
3871
+ * @return {?}
3872
+ */
3873
+ function (c) { return exports.PlaceComponent.getDefinition(c); }))));
3874
+ }
3875
+ else {
3804
3876
  pectin.lang.illegalState(target + " must extend PlaceComponent to use the @Place decorator");
3805
3877
  }
3806
- exports.PlaceComponent.injectDefinition((/** @type {?} */ (target)), options);
3807
3878
  });
3808
3879
  }
3880
+ (function (Place) {
3881
+ /**
3882
+ * @record
3883
+ */
3884
+ function Options() { }
3885
+ Place.Options = Options;
3886
+ if (false) {
3887
+ /** @type {?} */
3888
+ Options.prototype.path;
3889
+ /** @type {?} */
3890
+ Options.prototype.order;
3891
+ /** @type {?|undefined} */
3892
+ Options.prototype.data;
3893
+ /** @type {?|undefined} */
3894
+ Options.prototype.authenticate;
3895
+ /** @type {?|undefined} */
3896
+ Options.prototype.children;
3897
+ }
3898
+ })(Place || (Place = {}));
3809
3899
 
3810
3900
  /**
3811
3901
  * @fileoverview added by tsickle
@@ -3856,14 +3946,16 @@
3856
3946
  // HACK: this will break with child routes...
3857
3947
  /** @type {?} */
3858
3948
  var path = "/" + component.placeDefinition.path;
3859
- console.log({
3860
- placePath: path,
3861
- currentRoute: currentRoute.toString(),
3862
- currentStateUrl: currentState.url,
3863
- nextStateUrl: nextState.url,
3864
- currentStateUrlTree: this.router.parseUrl(currentState.url).root.children[router.PRIMARY_OUTLET].segments,
3865
- nextStateUrlTree: this.router.parseUrl(nextState.url).root.children[router.PRIMARY_OUTLET].segments
3866
- });
3949
+ // let thisTree = this.router.parseUrl(currentState.url);
3950
+ // let nextTree = this.router.parseUrl(nextState.url);
3951
+ // console.log({
3952
+ // placePath: path,
3953
+ // currentRoute: currentRoute.toString(),
3954
+ // currentStateUrl: currentState.url,
3955
+ // nextStateUrl: nextState.url,
3956
+ // currentStateUrlTree: thisTree.root.children[PRIMARY_OUTLET].segments,
3957
+ // nextStateUrlTree: nextTree.root.children[PRIMARY_OUTLET].segments
3958
+ // });
3867
3959
  // nextState is the full path...
3868
3960
  if (!nextState.url.startsWith(path)) {
3869
3961
  return component.canDeactivate();
@@ -3903,36 +3995,43 @@
3903
3995
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3904
3996
  */
3905
3997
  var PlaceRouteGuard = /** @class */ (function () {
3906
- function PlaceRouteGuard(placeService, router) {
3907
- this.placeService = placeService;
3908
- this.router = router;
3998
+ function PlaceRouteGuard(placeRouter, injector) {
3999
+ this.placeRouter = placeRouter;
4000
+ this.injector = injector;
3909
4001
  }
3910
4002
  /**
3911
- * @param {?} route
4003
+ * @param {?} activatedRoute
3912
4004
  * @param {?} state
3913
4005
  * @return {?}
3914
4006
  */
3915
4007
  PlaceRouteGuard.prototype.canActivate = /**
3916
- * @param {?} route
4008
+ * @param {?} activatedRoute
3917
4009
  * @param {?} state
3918
4010
  * @return {?}
3919
4011
  */
3920
- function (route, state) {
3921
- // Implement this when adding child routes.
3922
- // TODO: there are really two types of snapshot, ones with id's and ones without.
3923
- // Id snapshot are repesented by 2 url segments
3924
- // ID => [{'/basePath', params}, {'id', params}]
3925
- // NO ID => [{'/basePath', params}]
3926
- // console.log({urlSegments: route.url});
3927
- // const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
3928
- // return this.placeService.sanitise(snapshot).then(sanitised => {
3929
- // if (sanitised.hasChanged(snapshot)) {
3930
- // return this.router.createUrlTree(snapshot.updateUrl(route.url))
3931
- // } else {
3932
- // return true;
3933
- // }
3934
- // });
3935
- return true;
4012
+ function (activatedRoute, state) {
4013
+ var _this = this;
4014
+ if (exports.PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
4015
+ /** @type {?} */
4016
+ var placeDefinition = exports.PlaceComponent.getDefinition(activatedRoute.component);
4017
+ /** @type {?} */
4018
+ var snapshot_1 = exports.ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap);
4019
+ return snapshot_1.sanitise(this.injector).then((/**
4020
+ * @param {?} sanitised
4021
+ * @return {?}
4022
+ */
4023
+ function (sanitised) {
4024
+ if (sanitised.hasChanged(snapshot_1)) {
4025
+ return _this.placeRouter.createUrlTree(activatedRoute, snapshot_1, sanitised);
4026
+ }
4027
+ else {
4028
+ return true;
4029
+ }
4030
+ }));
4031
+ }
4032
+ else {
4033
+ return pectin.lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component);
4034
+ }
3936
4035
  };
3937
4036
  PlaceRouteGuard.decorators = [
3938
4037
  { type: core.Injectable, args: [{
@@ -3941,10 +4040,10 @@
3941
4040
  ];
3942
4041
  /** @nocollapse */
3943
4042
  PlaceRouteGuard.ctorParameters = function () { return [
3944
- { type: PlaceService },
3945
- { type: router.Router }
4043
+ { type: PlaceRouter },
4044
+ { type: core.Injector }
3946
4045
  ]; };
3947
- /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(core.ɵɵinject(PlaceService), core.ɵɵinject(router.Router)); }, token: PlaceRouteGuard, providedIn: "root" });
4046
+ /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(core.ɵɵinject(PlaceRouter), core.ɵɵinject(core.INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
3948
4047
  return PlaceRouteGuard;
3949
4048
  }());
3950
4049
  if (false) {
@@ -3952,12 +4051,12 @@
3952
4051
  * @type {?}
3953
4052
  * @private
3954
4053
  */
3955
- PlaceRouteGuard.prototype.placeService;
4054
+ PlaceRouteGuard.prototype.placeRouter;
3956
4055
  /**
3957
4056
  * @type {?}
3958
4057
  * @private
3959
4058
  */
3960
- PlaceRouteGuard.prototype.router;
4059
+ PlaceRouteGuard.prototype.injector;
3961
4060
  }
3962
4061
 
3963
4062
  /**
@@ -3968,11 +4067,10 @@
3968
4067
  * @template T, S
3969
4068
  */
3970
4069
  var DefaultParameterSanitiser = /** @class */ (function () {
3971
- function DefaultParameterSanitiser(def, placeService, options) {
4070
+ function DefaultParameterSanitiser(def, remember, defaultValue) {
3972
4071
  this.def = def;
3973
- this.placeService = placeService;
3974
- this.remember = lodash.isNil(options.remember) ? false : options.remember;
3975
- this.defaultValue = lodash.isNil(options.defaultValue) ? null : options.defaultValue;
4072
+ this.remember = remember;
4073
+ this.defaultValue = defaultValue;
3976
4074
  }
3977
4075
  /**
3978
4076
  * @param {?} value
@@ -3989,7 +4087,7 @@
3989
4087
  if (this.remember) {
3990
4088
  // value = null;
3991
4089
  }
3992
- return this.isBlank(value) && !lodash.isNil(this.defaultValue) ? this.defaultValue : value;
4090
+ return this.isBlank(value) && !___default__default.isNil(this.defaultValue) ? this.defaultValue : value;
3993
4091
  }
3994
4092
  else {
3995
4093
  return value;
@@ -4007,8 +4105,8 @@
4007
4105
  */
4008
4106
  function (value) {
4009
4107
  /** @type {?} */
4010
- var isNil$1 = lodash.isNil(value);
4011
- return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
4108
+ var isNil = ___default__default.isNil(value);
4109
+ return this.def.isArray ? !isNil || value['length'] < 1 : isNil;
4012
4110
  };
4013
4111
  __decorate([
4014
4112
  pectin.Trace(),
@@ -4023,22 +4121,11 @@
4023
4121
  * @type {?}
4024
4122
  * @private
4025
4123
  */
4124
+ DefaultParameterSanitiser.prototype.def;
4125
+ /** @type {?} */
4026
4126
  DefaultParameterSanitiser.prototype.remember;
4027
- /**
4028
- * @type {?}
4029
- * @private
4030
- */
4127
+ /** @type {?} */
4031
4128
  DefaultParameterSanitiser.prototype.defaultValue;
4032
- /**
4033
- * @type {?}
4034
- * @private
4035
- */
4036
- DefaultParameterSanitiser.prototype.def;
4037
- /**
4038
- * @type {?}
4039
- * @private
4040
- */
4041
- DefaultParameterSanitiser.prototype.placeService;
4042
4129
  }
4043
4130
 
4044
4131
  /**
@@ -4072,8 +4159,6 @@
4072
4159
  ParameterOptions.prototype.remember;
4073
4160
  /** @type {?|undefined} */
4074
4161
  ParameterOptions.prototype.defaultValue;
4075
- /** @type {?|undefined} */
4076
- ParameterOptions.prototype.sanitiser;
4077
4162
  }
4078
4163
  /**
4079
4164
  * @record
@@ -4089,8 +4174,6 @@
4089
4174
  ListParameterOptions.prototype.remember;
4090
4175
  /** @type {?|undefined} */
4091
4176
  ListParameterOptions.prototype.defaultValue;
4092
- /** @type {?|undefined} */
4093
- ListParameterOptions.prototype.sanitiser;
4094
4177
  }
4095
4178
  /**
4096
4179
  * @template T
@@ -4099,7 +4182,6 @@
4099
4182
  * @return {?}
4100
4183
  */
4101
4184
  function RouteId(type, options) {
4102
- // assert.isTruthy(type.isValid());
4103
4185
  return (/**
4104
4186
  * @param {?} prototype
4105
4187
  * @param {?} propertyKey
@@ -4107,7 +4189,7 @@
4107
4189
  */
4108
4190
  function (prototype, propertyKey) {
4109
4191
  /** @type {?} */
4110
- var param = createDefinition(propertyKey, type, options, true);
4192
+ var param = new exports.ParameterDefinition.RouteId(propertyKey.toString(), type, options);
4111
4193
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
4112
4194
  pectin.UseDelegate()(prototype, propertyKey);
4113
4195
  });
@@ -4119,7 +4201,6 @@
4119
4201
  * @return {?}
4120
4202
  */
4121
4203
  function RouteParameter(type, options) {
4122
- // assert.isTruthy(type.isValid());
4123
4204
  return (/**
4124
4205
  * @param {?} prototype
4125
4206
  * @param {?} propertyKey
@@ -4127,7 +4208,7 @@
4127
4208
  */
4128
4209
  function (prototype, propertyKey) {
4129
4210
  /** @type {?} */
4130
- var param = createDefinition(propertyKey, type, options, false);
4211
+ var param = new exports.ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
4131
4212
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
4132
4213
  pectin.UseDelegate()(prototype, propertyKey);
4133
4214
  });
@@ -4139,7 +4220,6 @@
4139
4220
  * @return {?}
4140
4221
  */
4141
4222
  function RouteParameterList(elementType, options) {
4142
- // assert.isTruthy(type.isValid());
4143
4223
  return (/**
4144
4224
  * @param {?} prototype
4145
4225
  * @param {?} propertyKey
@@ -4147,82 +4227,11 @@
4147
4227
  */
4148
4228
  function (prototype, propertyKey) {
4149
4229
  /** @type {?} */
4150
- var param = createArrayDefinition(propertyKey, elementType, options);
4230
+ var param = new exports.ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
4151
4231
  typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
4152
4232
  pectin.UseDelegate()(prototype, propertyKey);
4153
4233
  });
4154
4234
  }
4155
- /**
4156
- * @template T
4157
- * @param {?} propertyName
4158
- * @param {?} type
4159
- * @param {?} options
4160
- * @param {?} routeId
4161
- * @return {?}
4162
- */
4163
- function createDefinition(propertyName, type, options, routeId) {
4164
- /** @type {?} */
4165
- var opts = typescriptUtilities.Opts.get(options);
4166
- /** @type {?} */
4167
- var propertyNameAsString = pectin.assert.notNil(propertyName).toString();
4168
- /** @type {?} */
4169
- var def = {
4170
- name: opts.getOptional('as', propertyNameAsString),
4171
- propertyName: propertyNameAsString,
4172
- type: pectin.assert.notNil(type),
4173
- sanitiser: opts.getOptional('sanitiser', null),
4174
- isRouteId: routeId,
4175
- isArray: false
4176
- };
4177
- return def;
4178
- }
4179
- /**
4180
- * @template T
4181
- * @param {?} propertyName
4182
- * @param {?} type
4183
- * @param {?} options
4184
- * @return {?}
4185
- */
4186
- function createArrayDefinition(propertyName, type, options) {
4187
- /** @type {?} */
4188
- var opts = typescriptUtilities.Opts.get(options);
4189
- /** @type {?} */
4190
- var propertyNameAsString = pectin.assert.notNil(propertyName).toString();
4191
- /** @type {?} */
4192
- var def = {
4193
- name: opts.getOptional('as', propertyNameAsString),
4194
- propertyName: propertyNameAsString,
4195
- type: pectin.assert.notNil(type),
4196
- sanitiser: opts.getOptional('sanitiser', null),
4197
- isRouteId: false,
4198
- isArray: true
4199
- };
4200
- return def;
4201
- }
4202
-
4203
- /**
4204
- * @fileoverview added by tsickle
4205
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4206
- */
4207
- /**
4208
- * @record
4209
- * @template T, S
4210
- */
4211
- function ParameterDefinition() { }
4212
- if (false) {
4213
- /** @type {?} */
4214
- ParameterDefinition.prototype.name;
4215
- /** @type {?} */
4216
- ParameterDefinition.prototype.propertyName;
4217
- /** @type {?} */
4218
- ParameterDefinition.prototype.type;
4219
- /** @type {?} */
4220
- ParameterDefinition.prototype.sanitiser;
4221
- /** @type {?} */
4222
- ParameterDefinition.prototype.isRouteId;
4223
- /** @type {?} */
4224
- ParameterDefinition.prototype.isArray;
4225
- }
4226
4235
 
4227
4236
  /**
4228
4237
  * @fileoverview added by tsickle
@@ -4241,20 +4250,6 @@
4241
4250
  */
4242
4251
  ParameterSanitiser.prototype.sanitise = function (value, visit) { };
4243
4252
  }
4244
- (function (ParameterSanitiser) {
4245
- /**
4246
- * @record
4247
- * @template T
4248
- */
4249
- function Options() { }
4250
- ParameterSanitiser.Options = Options;
4251
- if (false) {
4252
- /** @type {?|undefined} */
4253
- Options.prototype.remember;
4254
- /** @type {?|undefined} */
4255
- Options.prototype.defaultValue;
4256
- }
4257
- })(ParameterSanitiser || (ParameterSanitiser = {}));
4258
4253
 
4259
4254
  /**
4260
4255
  * @fileoverview added by tsickle
@@ -4313,7 +4308,7 @@
4313
4308
  * @return {?}
4314
4309
  */
4315
4310
  function (value) {
4316
- return lodash.isNil(value) || lodash.isEmpty(value) ? null : +value;
4311
+ return ___default__default.isNil(value) || ___default__default.isEmpty(value) ? null : +value;
4317
4312
  };
4318
4313
  return NumberType;
4319
4314
  }());
@@ -4379,7 +4374,7 @@
4379
4374
  * @return {?}
4380
4375
  */
4381
4376
  function () {
4382
- return !lodash.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
4377
+ return !___default__default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
4383
4378
  },
4384
4379
  enumerable: true,
4385
4380
  configurable: true
@@ -4481,11 +4476,10 @@
4481
4476
  exports.Sanitiser.prototype.sanitiser;
4482
4477
  }
4483
4478
  var RouteParameterSanitiser = /** @class */ (function () {
4484
- function RouteParameterSanitiser(parameterDefs, snapshot, placeService, injector) {
4479
+ function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
4485
4480
  var _this = this;
4486
4481
  this.parameterDefs = parameterDefs;
4487
4482
  this.snapshot = snapshot;
4488
- this.placeService = placeService;
4489
4483
  this.injector = injector;
4490
4484
  this.parameterSanitisers = [];
4491
4485
  /** @type {?} */
@@ -4578,17 +4572,7 @@
4578
4572
  * @return {?}
4579
4573
  */
4580
4574
  function (def) {
4581
- if (def.sanitiser) {
4582
- if (this.isSanitiserContructor(def.sanitiser)) {
4583
- return this.injector.get(def.sanitiser, new def.sanitiser());
4584
- }
4585
- else {
4586
- return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
4587
- }
4588
- }
4589
- else {
4590
- return null;
4591
- }
4575
+ return def.getSanitiser(this.injector);
4592
4576
  };
4593
4577
  /**
4594
4578
  * @return {?}
@@ -4634,12 +4618,12 @@
4634
4618
  * @return {?}
4635
4619
  */
4636
4620
  function (value) {
4637
- return lodash.isFunction(value) && pectin.lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(exports.Sanitiser);
4621
+ return ___default__default.isFunction(value) && pectin.lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(exports.Sanitiser);
4638
4622
  };
4639
4623
  __decorate([
4640
4624
  src.Memoize(),
4641
4625
  __metadata("design:type", Function),
4642
- __metadata("design:paramtypes", [Object]),
4626
+ __metadata("design:paramtypes", [exports.ParameterDefinition]),
4643
4627
  __metadata("design:returntype", Object)
4644
4628
  ], RouteParameterSanitiser.prototype, "getSanitiser", null);
4645
4629
  __decorate([
@@ -4666,8 +4650,6 @@
4666
4650
  /** @type {?} */
4667
4651
  RouteParameterSanitiser.prototype.snapshot;
4668
4652
  /** @type {?} */
4669
- RouteParameterSanitiser.prototype.placeService;
4670
- /** @type {?} */
4671
4653
  RouteParameterSanitiser.prototype.injector;
4672
4654
  }
4673
4655
  (function (Sanitiser) {
@@ -4793,8 +4775,8 @@
4793
4775
  exports.AbstractActivity = AbstractActivity;
4794
4776
  exports.AbstractInputComponent = AbstractInputComponent;
4795
4777
  exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
4796
- exports.ActivityContainerComponent = exports.ɵt;
4797
- exports.ActivityOutletComponent = exports.ɵu;
4778
+ exports.ActivityContainerComponent = exports.ɵu;
4779
+ exports.ActivityOutletComponent = exports.ɵv;
4798
4780
  exports.AlertDialogComponent = AlertDialogComponent;
4799
4781
  exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
4800
4782
  exports.BusyOverlayComponent = BusyOverlayComponent;
@@ -4816,10 +4798,12 @@
4816
4798
  exports.NumberInputComponent = NumberInputComponent;
4817
4799
  exports.PasswordInputComponent = PasswordInputComponent;
4818
4800
  exports.Place = Place;
4801
+ exports.PlaceDefinition = PlaceDefinition;
4802
+ exports.PlaceHistory = PlaceHistory;
4819
4803
  exports.PlaceModule = PlaceModule;
4820
4804
  exports.PlaceOutletComponent = PlaceOutletComponent;
4821
4805
  exports.PlaceRouteGuard = PlaceRouteGuard;
4822
- exports.PlaceService = PlaceService;
4806
+ exports.PlaceRouter = PlaceRouter;
4823
4807
  exports.Point = Point;
4824
4808
  exports.ROUTE_PARAMETER_LIST_KEY = ROUTE_PARAMETER_LIST_KEY;
4825
4809
  exports.ResizeAwareComponent = ResizeAwareComponent;
@@ -4834,8 +4818,9 @@
4834
4818
  exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
4835
4819
  exports.ɵa = CommandDirective;
4836
4820
  exports.ɵb = FocusBindingDirective;
4837
- exports.ɵbb = DialogInteractionService;
4838
- exports.ɵbc = InteractionContext;
4821
+ exports.ɵba = AlertDialogComponent;
4822
+ exports.ɵbc = DialogInteractionService;
4823
+ exports.ɵbd = InteractionContext;
4839
4824
  exports.ɵc = DisposableComponent;
4840
4825
  exports.ɵd = NumberInputComponent;
4841
4826
  exports.ɵe = AbstractInputComponent;
@@ -4848,15 +4833,15 @@
4848
4833
  exports.ɵl = PlaceOutletComponent;
4849
4834
  exports.ɵm = leftRightPlaceAnimation;
4850
4835
  exports.ɵn = LEFT_RIGHT_PLACE_ANIMATION;
4851
- exports.ɵo = PlaceService;
4852
- exports.ɵp = TabbedPlaceNavigationComponent;
4853
- exports.ɵq = AbstractPlaceNavigationComponent;
4854
- exports.ɵr = ListPlaceNavComponent;
4855
- exports.ɵs = InteractionModule;
4856
- exports.ɵv = ConfirmationDialogComponent;
4857
- exports.ɵw = AbstractActivity;
4858
- exports.ɵx = ACTIVITY_DATA;
4859
- exports.ɵz = AlertDialogComponent;
4836
+ exports.ɵo = PlaceRouter;
4837
+ exports.ɵp = PlaceHistory;
4838
+ exports.ɵq = TabbedPlaceNavigationComponent;
4839
+ exports.ɵr = AbstractPlaceNavigationComponent;
4840
+ exports.ɵs = ListPlaceNavComponent;
4841
+ exports.ɵt = InteractionModule;
4842
+ exports.ɵw = ConfirmationDialogComponent;
4843
+ exports.ɵx = AbstractActivity;
4844
+ exports.ɵy = ACTIVITY_DATA;
4860
4845
 
4861
4846
  Object.defineProperty(exports, '__esModule', { value: true });
4862
4847