@coolon/angular-ui-powerups 0.0.43 → 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 (131) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +1165 -1181
  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 +2 -2
  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 +2 -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 +2 -2
  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 +2 -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 +944 -959
  96. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  97. package/fesm5/coolon-angular-ui-powerups.js +1147 -1167
  98. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  99. package/index.d.ts +1 -1
  100. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +7 -0
  101. package/lib/place/components/abstract-place-navigation.component.d.ts +3 -2
  102. package/lib/place/components/place-outlet/place-outlet.component.d.ts +31 -19
  103. package/lib/place/guards/place-route.guard.d.ts +7 -6
  104. package/lib/place/index.d.ts +3 -3
  105. package/lib/place/place-component.d.ts +13 -41
  106. package/lib/place/place-definition.d.ts +20 -0
  107. package/lib/place/place-history.d.ts +10 -0
  108. package/lib/place/place-router.d.ts +9 -0
  109. package/lib/place/place.decorator.d.ts +13 -1
  110. package/lib/place/route/default-parameter-sanitiser.d.ts +3 -5
  111. package/lib/place/route/parameter-decorators.d.ts +0 -4
  112. package/lib/place/route/parameter-definition.class.d.ts +29 -6
  113. package/lib/place/route/parameter-sanitiser.d.ts +0 -6
  114. package/lib/place/route/parameter-snapshot.d.ts +7 -7
  115. package/lib/place/route/route-parameter-sanitiser.d.ts +1 -3
  116. package/lib/place/visit.d.ts +2 -2
  117. package/package.json +1 -1
  118. package/schematics/place-routes/index.js.map +1 -1
  119. package/schematics/place-routes/place-def.js +1 -1
  120. package/schematics/place-routes/place-def.js.map +1 -1
  121. package/schematics/place-routes/templates/place-destinations.ts.template +21 -0
  122. package/schematics/place-routes/templates/{places.ts.template → place-routes.ts.template} +1 -13
  123. package/esm2015/lib/place/place-component-like.js +0 -17
  124. package/esm2015/lib/place/place-updates-service.js +0 -16
  125. package/esm2015/lib/place/place.service.js +0 -102
  126. package/esm5/lib/place/place-component-like.js +0 -17
  127. package/esm5/lib/place/place-updates-service.js +0 -16
  128. package/esm5/lib/place/place.service.js +0 -136
  129. package/lib/place/place-component-like.d.ts +0 -5
  130. package/lib/place/place-updates-service.d.ts +0 -10
  131. package/lib/place/place.service.d.ts +0 -22
@@ -5,7 +5,7 @@ import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgress
5
5
  import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
6
6
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
7
  import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
8
- import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, Trace, MutableListModel, StoreInValueModel, MutableValueModel, Binding, OptionsHelper, ValueHolder } from '@coolon/pectin';
8
+ import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, Trace, MutableListModel, StoreInValueModel, Binding, Guard, MutableValueModel, OptionsHelper, ValueHolder } from '@coolon/pectin';
9
9
  import { PortalModule } from '@angular/cdk/portal';
10
10
  import { Deferred } from '@coolon/pectin/lib/promise/deferred.class';
11
11
  import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
@@ -13,11 +13,11 @@ import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
13
13
  import { MatIconModule } from '@angular/material/icon';
14
14
  import { MatListModule } from '@angular/material/list';
15
15
  import { MatTooltipModule } from '@angular/material/tooltip';
16
- import { Router, ActivatedRoute, RouterOutlet, RouterModule, PRIMARY_OUTLET } from '@angular/router';
17
- import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
18
- import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
19
- import { isNil, isEqual, isEmpty, isFunction } from 'lodash';
16
+ import { Router, RouterModule } from '@angular/router';
17
+ import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator/dist/src';
18
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator';
20
19
  import 'reflect-metadata';
20
+ import ___default, { isNil } from 'lodash';
21
21
  import { style, query, group, animate, trigger, transition } from '@angular/animations';
22
22
  import ResizeObserver from 'resize-observer-polyfill';
23
23
 
@@ -634,7 +634,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
634
634
  }));
635
635
  }
636
636
  else {
637
- Logger.get(this).warn("pectinFocusBinding was nil");
637
+ Logger.get(this).warn('pectinFocusBinding was nil');
638
638
  }
639
639
  };
640
640
  /**
@@ -864,6 +864,11 @@ if (false) {
864
864
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
865
865
  */
866
866
  /**
867
+ * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an
868
+ * external service.
869
+ *
870
+ * It might be nice to have wrapper component that allows more declarative use, i.e.
871
+ * <activity-view [activityClass]="...", [activityData]="..." (done)=".." (cancel)="..."></activity-view>
867
872
  * @template D, R, E
868
873
  */
869
874
  var ActivityOutletComponent = /** @class */ (function () {
@@ -1317,7 +1322,7 @@ var ConfirmationDialogComponent = /** @class */ (function (_super) {
1317
1322
  ConfirmationDialogComponent.decorators = [
1318
1323
  { type: Component, args: [{
1319
1324
  selector: 'angular-ui-powerups-confirmation-dialog',
1320
- 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",
1325
+ 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",
1321
1326
  styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1322
1327
  }] }
1323
1328
  ];
@@ -1459,7 +1464,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1459
1464
  ActivityContainerComponent.decorators = [
1460
1465
  { type: Component, args: [{
1461
1466
  selector: 'angular-ui-powerups-activity-container',
1462
- template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\" [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\" [activityContext]=\"tab\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1467
+ 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",
1463
1468
  styles: [":host{display:block}"]
1464
1469
  }] }
1465
1470
  ];
@@ -1758,1040 +1763,1100 @@ var EmptyStateComponent = /** @class */ (function () {
1758
1763
  * @fileoverview added by tsickle
1759
1764
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1760
1765
  */
1761
- // TODO: there are really two types of snapshot, ones with id's and ones without.
1762
- // Id snapshot are repesented by 2 url segments
1763
- // ID => [{'/basePath', params}, {'id', params}]
1764
- // NO ID => [{'/basePath', params}]
1765
- var ParameterSnapshot = /** @class */ (function () {
1766
- function ParameterSnapshot(placeDefinition, resolved) {
1767
- this.placeDefinition = placeDefinition;
1768
- this.resolved = resolved;
1766
+ var PlaceDefinition = /** @class */ (function () {
1767
+ function PlaceDefinition(component, path, authenticate, order, data, routeParameters, children) {
1768
+ this.component = component;
1769
+ this.path = path;
1770
+ this.authenticate = authenticate;
1771
+ this.order = order;
1772
+ this.data = data;
1773
+ this.routeParameters = routeParameters;
1774
+ this.children = children;
1769
1775
  }
1770
1776
  /**
1771
- * @param {?} other
1772
1777
  * @return {?}
1773
1778
  */
1774
- ParameterSnapshot.prototype.hasChanged = /**
1775
- * @param {?} other
1779
+ PlaceDefinition.prototype.getRouteParameters = /**
1776
1780
  * @return {?}
1777
1781
  */
1778
- function (other) {
1779
- /** @type {?} */
1780
- var changed = this.resolved.find((/**
1781
- * @param {?} r
1782
- * @return {?}
1783
- */
1784
- function (r) {
1785
- return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
1786
- }));
1787
- if (changed) {
1788
- console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
1789
- }
1790
- return !!changed;
1782
+ function () {
1783
+ return this.routeParameters;
1791
1784
  };
1792
1785
  /**
1793
- * @param {?} other
1786
+ * @template T
1787
+ * @param {?} key
1788
+ * @param {?=} defaultValue
1794
1789
  * @return {?}
1795
1790
  */
1796
- ParameterSnapshot.prototype.asUrlSegment = /**
1797
- * @param {?} other
1791
+ PlaceDefinition.prototype.getData = /**
1792
+ * @template T
1793
+ * @param {?} key
1794
+ * @param {?=} defaultValue
1798
1795
  * @return {?}
1799
1796
  */
1800
- function (other) {
1801
- assert.isTruthy(this.hasChanged(other));
1802
- /** @type {?} */
1803
- var routeParts = [];
1804
- /** @type {?} */
1805
- var gainedId = this.getFormattedRouteId() && !other.getFormattedRouteId();
1806
- /** @type {?} */
1807
- var sameId = this.getFormattedRouteId() === other.getFormattedRouteId();
1808
- /** @type {?} */
1809
- var lostId = (!this.getFormattedRouteId() && other.getFormattedRouteId());
1810
- /** @type {?} */
1811
- var changedId = (this.getFormattedRouteId() !== other.getFormattedRouteId());
1812
- if (lostId || changedId) {
1813
- routeParts.push('..');
1814
- if (changedId) {
1815
- routeParts.push(this.getFormattedRouteId());
1816
- }
1797
+ function (key, defaultValue) {
1798
+ return this.data ?
1799
+ ___default.isNil(this.data[key]) ? defaultValue : this.data[key] :
1800
+ defaultValue;
1801
+ };
1802
+ /**
1803
+ * @template T
1804
+ * @param {?} keys
1805
+ * @param {?=} defaultValue
1806
+ * @return {?}
1807
+ */
1808
+ PlaceDefinition.prototype.searchData = /**
1809
+ * @template T
1810
+ * @param {?} keys
1811
+ * @param {?=} defaultValue
1812
+ * @return {?}
1813
+ */
1814
+ function (keys, defaultValue) {
1815
+ var _this = this;
1816
+ if (this.data) {
1817
+ /** @type {?} */
1818
+ var found = keys.find((/**
1819
+ * @param {?} key
1820
+ * @return {?}
1821
+ */
1822
+ function (key) { return !___default.isNil(_this.data[key]); }));
1823
+ return found ? this.data[found] : defaultValue;
1817
1824
  }
1818
1825
  else {
1819
- routeParts.push('.');
1826
+ return defaultValue;
1820
1827
  }
1821
- routeParts.push(this.getFormattedParameters());
1822
- return routeParts;
1823
1828
  };
1829
+ return PlaceDefinition;
1830
+ }());
1831
+ if (false) {
1832
+ /** @type {?} */
1833
+ PlaceDefinition.prototype.component;
1834
+ /** @type {?} */
1835
+ PlaceDefinition.prototype.path;
1836
+ /** @type {?} */
1837
+ PlaceDefinition.prototype.authenticate;
1838
+ /** @type {?} */
1839
+ PlaceDefinition.prototype.order;
1840
+ /** @type {?} */
1841
+ PlaceDefinition.prototype.data;
1842
+ /** @type {?} */
1843
+ PlaceDefinition.prototype.routeParameters;
1844
+ /** @type {?} */
1845
+ PlaceDefinition.prototype.children;
1846
+ }
1847
+
1848
+ /**
1849
+ * @fileoverview added by tsickle
1850
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1851
+ */
1852
+ // RAKE: making this Symbol(...) broke things.
1853
+ /** @type {?} */
1854
+ var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
1855
+ // this one seems ok.
1856
+ /** @type {?} */
1857
+ var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
1858
+ var PlaceComponent = /** @class */ (function (_super) {
1859
+ __extends(PlaceComponent, _super);
1860
+ function PlaceComponent() {
1861
+ return _super.call(this) || this;
1862
+ }
1824
1863
  /**
1825
- * @template T, S
1826
- * @param {?} parameterDef
1864
+ * @param {?} resolvedParameters
1827
1865
  * @return {?}
1828
1866
  */
1829
- ParameterSnapshot.prototype.getResolvedParameter = /**
1830
- * @template T, S
1831
- * @param {?} parameterDef
1867
+ PlaceComponent.prototype.initialiseBindings = /**
1868
+ * @param {?} resolvedParameters
1832
1869
  * @return {?}
1833
1870
  */
1834
- function (parameterDef) {
1835
- return this.resolved.find((/**
1836
- * @param {?} r
1871
+ function (resolvedParameters) {
1872
+ var _this = this;
1873
+ assert.isNil(this.resolvedParameters);
1874
+ this.resolvedParameters = resolvedParameters;
1875
+ this.placeDefinition.getRouteParameters().forEach((/**
1876
+ * @param {?} parameterDef
1837
1877
  * @return {?}
1838
1878
  */
1839
- function (r) { return r.parameterDef === parameterDef; }));
1879
+ function (parameterDef) {
1880
+ _this.installBinding(parameterDef);
1881
+ }));
1840
1882
  };
1841
1883
  /**
1884
+ * @private
1842
1885
  * @template T, S
1843
1886
  * @param {?} parameterDef
1844
1887
  * @return {?}
1845
1888
  */
1846
- ParameterSnapshot.prototype.getResolvedParameterValue = /**
1889
+ PlaceComponent.prototype.installBinding = /**
1890
+ * @private
1847
1891
  * @template T, S
1848
1892
  * @param {?} parameterDef
1849
1893
  * @return {?}
1850
1894
  */
1851
1895
  function (parameterDef) {
1852
1896
  /** @type {?} */
1853
- var resolvedParameter = this.getResolvedParameter(parameterDef);
1854
- return resolvedParameter ? resolvedParameter.value : null;
1897
+ var model = (/** @type {?} */ (this[parameterDef.propertyName]));
1898
+ // this.txo.observe(parameterDef.propertyName, model);
1899
+ this.registerDisposable(new Binding(this.resolvedParameters, model, {
1900
+ toRight: /**
1901
+ * @param {?} parameters
1902
+ * @return {?}
1903
+ */
1904
+ function (parameters) {
1905
+ return parameters.getResolvedParameterValue(parameterDef);
1906
+ },
1907
+ toLeft: /**
1908
+ * @param {?} value
1909
+ * @param {?=} currentParameters
1910
+ * @return {?}
1911
+ */
1912
+ function (value, currentParameters) {
1913
+ return currentParameters.replace(parameterDef, value);
1914
+ }
1915
+ }));
1855
1916
  };
1917
+ Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
1918
+ get: /**
1919
+ * @return {?}
1920
+ */
1921
+ function () {
1922
+ return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
1923
+ },
1924
+ enumerable: true,
1925
+ configurable: true
1926
+ });
1927
+ Object.defineProperty(PlaceComponent.prototype, "childPlaces", {
1928
+ get: /**
1929
+ * @return {?}
1930
+ */
1931
+ function () {
1932
+ return this.placeDefinition.children.map((/**
1933
+ * @param {?} d
1934
+ * @return {?}
1935
+ */
1936
+ function (d) { return d.component; }));
1937
+ },
1938
+ enumerable: true,
1939
+ configurable: true
1940
+ });
1856
1941
  /**
1857
1942
  * @return {?}
1858
1943
  */
1859
- ParameterSnapshot.prototype.getRouteId = /**
1944
+ PlaceComponent.prototype.canDeactivate = /**
1860
1945
  * @return {?}
1861
1946
  */
1862
1947
  function () {
1863
- return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
1948
+ return true;
1864
1949
  };
1865
1950
  /**
1866
- * @param {?} name
1867
1951
  * @return {?}
1868
1952
  */
1869
- ParameterSnapshot.prototype.getRouteParameter = /**
1870
- * @param {?} name
1953
+ PlaceComponent.prototype.onPlaceReady = /**
1871
1954
  * @return {?}
1872
1955
  */
1873
- function (name) {
1874
- /** @type {?} */
1875
- var resolvedParameter = this.resolved.find((/**
1876
- * @param {?} r
1877
- * @return {?}
1878
- */
1879
- function (r) { return r.parameterDef.name === name; }));
1880
- return resolvedParameter ? resolvedParameter.value : null;
1956
+ function () {
1881
1957
  };
1958
+ __decorate([
1959
+ Memoize(),
1960
+ __metadata("design:type", PlaceDefinition),
1961
+ __metadata("design:paramtypes", [])
1962
+ ], PlaceComponent.prototype, "placeDefinition", null);
1963
+ return PlaceComponent;
1964
+ }(DisposableComponent));
1965
+ if (false) {
1882
1966
  /**
1967
+ * @type {?}
1883
1968
  * @private
1884
- * @return {?}
1885
- */
1886
- ParameterSnapshot.prototype.getResolvedRouteId = /**
1887
- * @private
1888
- * @return {?}
1889
1969
  */
1890
- function () {
1891
- // RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
1892
- // capture this in the type system though
1893
- return (/** @type {?} */ (this.resolved.find((/**
1894
- * @param {?} p
1895
- * @return {?}
1896
- */
1897
- function (p) { return p.parameterDef.isRouteId; }))));
1898
- };
1970
+ PlaceComponent.prototype.resolvedParameters;
1971
+ }
1972
+ (function (PlaceComponent) {
1899
1973
  /**
1974
+ * @param {?} target
1900
1975
  * @return {?}
1901
1976
  */
1902
- ParameterSnapshot.prototype.hasRouteId = /**
1977
+ function isPlaceComponentConstructor(target) {
1978
+ return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
1979
+ }
1980
+ PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
1981
+ /**
1982
+ * @param {?} klass
1903
1983
  * @return {?}
1904
1984
  */
1905
- function () {
1906
- return !!this.getResolvedRouteId();
1907
- };
1985
+ function getRouteParameters(klass) {
1986
+ return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
1987
+ }
1988
+ PlaceComponent.getRouteParameters = getRouteParameters;
1908
1989
  /**
1990
+ * @param {?} klass
1909
1991
  * @return {?}
1910
1992
  */
1911
- ParameterSnapshot.prototype.getFormattedRouteId = /**
1993
+ function getDefinition(klass) {
1994
+ return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
1995
+ }
1996
+ PlaceComponent.getDefinition = getDefinition;
1997
+ /**
1998
+ * @param {?} klass
1999
+ * @param {?} definition
1912
2000
  * @return {?}
1913
2001
  */
1914
- function () {
1915
- /** @type {?} */
1916
- var routeIdParam = this.getResolvedRouteId();
1917
- return routeIdParam ? routeIdParam.formattedValue() : null;
1918
- };
2002
+ function injectDefinition(klass, definition) {
2003
+ Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
2004
+ }
2005
+ PlaceComponent.injectDefinition = injectDefinition;
2006
+ })(PlaceComponent || (PlaceComponent = {}));
2007
+
2008
+ /**
2009
+ * @fileoverview added by tsickle
2010
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2011
+ */
2012
+ var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
2013
+ __extends(AbstractPlaceNavigationComponent, _super);
2014
+ function AbstractPlaceNavigationComponent() {
2015
+ var _this = _super.call(this) || this;
2016
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2017
+ _this.placeDefinitions = chain(_this.placesModel).map((/**
2018
+ * @param {?} c
2019
+ * @return {?}
2020
+ */
2021
+ function (c) { return PlaceComponent.getDefinition(c); }));
2022
+ return _this;
2023
+ }
1919
2024
  /**
2025
+ * @param {?} placeDef
1920
2026
  * @return {?}
1921
2027
  */
1922
- ParameterSnapshot.prototype.getFormattedParameters = /**
2028
+ AbstractPlaceNavigationComponent.prototype.getNav = /**
2029
+ * @param {?} placeDef
1923
2030
  * @return {?}
1924
2031
  */
1925
- function () {
1926
- /** @type {?} */
1927
- var params = {};
2032
+ function (placeDef) {
1928
2033
  /** @type {?} */
1929
- var routeIdParam = this.resolved.filter((/**
1930
- * @param {?} p
1931
- * @return {?}
1932
- */
1933
- function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
1934
- * @param {?} p
1935
- * @return {?}
1936
- */
1937
- function (p) {
1938
- params[p.parameterDef.name] = p.formattedValue();
1939
- }));
1940
- return params;
2034
+ var navItem = (/** @type {?} */ (placeDef.getData('nav')));
2035
+ return {
2036
+ title: (/**
2037
+ * @return {?}
2038
+ */
2039
+ function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
2040
+ tooltip: (/**
2041
+ * @return {?}
2042
+ */
2043
+ function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
2044
+ icon: (/**
2045
+ * @return {?}
2046
+ */
2047
+ function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
2048
+ };
1941
2049
  };
1942
2050
  /**
1943
- * @template T, S
1944
- * @param {?} parameter
1945
- * @param {?} value
1946
2051
  * @return {?}
1947
2052
  */
1948
- ParameterSnapshot.prototype.replace = /**
1949
- * @template T, S
1950
- * @param {?} parameter
1951
- * @param {?} value
2053
+ AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
1952
2054
  * @return {?}
1953
2055
  */
1954
- function (parameter, value) {
1955
- return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
1956
- * @param {?} p
1957
- * @return {?}
1958
- */
1959
- function (p) {
1960
- return p.parameterDef === parameter ? p.replace(value) : p;
1961
- })));
2056
+ function () {
1962
2057
  };
1963
- /**
1964
- * @param {?} url
1965
- * @return {?}
1966
- */
1967
- ParameterSnapshot.prototype.updateUrl = /**
1968
- * @param {?} url
1969
- * @return {?}
1970
- */
1971
- function (url) {
1972
- return url;
2058
+ AbstractPlaceNavigationComponent.propDecorators = {
2059
+ places: [{ type: Input }],
2060
+ placesModel: [{ type: Input }]
1973
2061
  };
1974
- var _a;
1975
2062
  __decorate([
1976
- Memoize(),
1977
- __metadata("design:type", Function),
1978
- __metadata("design:paramtypes", [Object]),
1979
- __metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
1980
- ], ParameterSnapshot.prototype, "getResolvedParameter", null);
2063
+ StoreInListModel('placesModel'),
2064
+ __metadata("design:type", Array)
2065
+ ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
1981
2066
  __decorate([
1982
- Memoize(),
1983
- __metadata("design:type", Function),
1984
- __metadata("design:paramtypes", [Object]),
1985
- __metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
1986
- ], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
2067
+ UseDelegate(),
2068
+ __metadata("design:type", ListModel)
2069
+ ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
1987
2070
  __decorate([
1988
- Memoize(),
2071
+ Memoize$1(),
1989
2072
  __metadata("design:type", Function),
1990
- __metadata("design:paramtypes", [String]),
2073
+ __metadata("design:paramtypes", [PlaceDefinition]),
1991
2074
  __metadata("design:returntype", Object)
1992
- ], ParameterSnapshot.prototype, "getRouteParameter", null);
1993
- __decorate([
1994
- Memoize(),
1995
- __metadata("design:type", Function),
1996
- __metadata("design:paramtypes", []),
1997
- __metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
1998
- ], ParameterSnapshot.prototype, "getResolvedRouteId", null);
1999
- return ParameterSnapshot;
2000
- }());
2075
+ ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
2076
+ return AbstractPlaceNavigationComponent;
2077
+ }(DisposableComponent));
2001
2078
  if (false) {
2002
2079
  /** @type {?} */
2003
- ParameterSnapshot.prototype.placeDefinition;
2080
+ AbstractPlaceNavigationComponent.prototype.places;
2081
+ /** @type {?} */
2082
+ AbstractPlaceNavigationComponent.prototype.placesModel;
2083
+ /** @type {?} */
2084
+ AbstractPlaceNavigationComponent.prototype.placeDefinitions;
2085
+ }
2086
+
2087
+ /**
2088
+ * @fileoverview added by tsickle
2089
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2090
+ */
2091
+ var ListPlaceNavComponent = /** @class */ (function (_super) {
2092
+ __extends(ListPlaceNavComponent, _super);
2093
+ function ListPlaceNavComponent() {
2094
+ var _this = _super.call(this) || this;
2095
+ _this.expanded = true;
2096
+ return _this;
2097
+ }
2004
2098
  /**
2005
- * @type {?}
2006
- * @private
2099
+ * @return {?}
2007
2100
  */
2008
- ParameterSnapshot.prototype.resolved;
2101
+ ListPlaceNavComponent.prototype.expandMenu = /**
2102
+ * @return {?}
2103
+ */
2104
+ function () {
2105
+ this.expanded = true;
2106
+ };
2107
+ /**
2108
+ * @return {?}
2109
+ */
2110
+ ListPlaceNavComponent.prototype.collapseMenu = /**
2111
+ * @return {?}
2112
+ */
2113
+ function () {
2114
+ this.expanded = false;
2115
+ };
2116
+ /**
2117
+ * @return {?}
2118
+ */
2119
+ ListPlaceNavComponent.prototype.toggleMenu = /**
2120
+ * @return {?}
2121
+ */
2122
+ function () {
2123
+ this.expanded = !this.expanded;
2124
+ };
2125
+ ListPlaceNavComponent.decorators = [
2126
+ { type: Component, args: [{
2127
+ selector: 'angular-ui-powerups-list-place-nav',
2128
+ 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",
2129
+ 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}"]
2130
+ }] }
2131
+ ];
2132
+ /** @nocollapse */
2133
+ ListPlaceNavComponent.ctorParameters = function () { return []; };
2134
+ ListPlaceNavComponent.propDecorators = {
2135
+ expanded: [{ type: HostBinding, args: ['class.expanded',] }]
2136
+ };
2137
+ return ListPlaceNavComponent;
2138
+ }(AbstractPlaceNavigationComponent));
2139
+ if (false) {
2140
+ /** @type {?} */
2141
+ ListPlaceNavComponent.prototype.expanded;
2009
2142
  }
2010
- (function (ParameterSnapshot) {
2143
+
2144
+ /**
2145
+ * @fileoverview added by tsickle
2146
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2147
+ */
2148
+ var PlaceHistory = /** @class */ (function () {
2149
+ function PlaceHistory(router) {
2150
+ this.router = router;
2151
+ this._history = [];
2152
+ }
2011
2153
  /**
2012
- * @param {?} placeDef
2013
- * @param {?} paramMap
2154
+ * @param {?} state
2014
2155
  * @return {?}
2015
2156
  */
2016
- function create(placeDef, paramMap) {
2157
+ PlaceHistory.prototype.add = /**
2158
+ * @param {?} state
2159
+ * @return {?}
2160
+ */
2161
+ function (state) {
2017
2162
  /** @type {?} */
2018
- var resolvedParameters = placeDef.getRouteParameters()
2019
- .map((/**
2020
- * @param {?} def
2021
- * @return {?}
2022
- */
2023
- function (def) {
2024
- if (def.isArray) {
2025
- /** @type {?} */
2026
- var value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
2027
- * @param {?} raw
2028
- * @return {?}
2029
- */
2030
- function (raw) { return def.type.parse(raw); })) : null;
2031
- return new ResolvedArrayParameter(def, value);
2032
- }
2033
- else {
2034
- /** @type {?} */
2035
- var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
2036
- return new ResolvedValueParameter(def, value);
2037
- }
2038
- }));
2039
- return new ParameterSnapshot(placeDef, resolvedParameters);
2163
+ var previousState = ___default.last(this._history);
2164
+ if (!previousState || state.hasChanged(previousState)) {
2165
+ this._history.push(state);
2166
+ // limit our history to 100 visits
2167
+ this._history = this._history.slice(-100);
2168
+ }
2169
+ };
2170
+ PlaceHistory.decorators = [
2171
+ { type: Injectable, args: [{
2172
+ providedIn: 'root'
2173
+ },] }
2174
+ ];
2175
+ /** @nocollapse */
2176
+ PlaceHistory.ctorParameters = function () { return [
2177
+ { type: Router }
2178
+ ]; };
2179
+ /** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
2180
+ return PlaceHistory;
2181
+ }());
2182
+ if (false) {
2183
+ /**
2184
+ * @type {?}
2185
+ * @private
2186
+ */
2187
+ PlaceHistory.prototype._history;
2188
+ /**
2189
+ * @type {?}
2190
+ * @private
2191
+ */
2192
+ PlaceHistory.prototype.router;
2193
+ }
2194
+
2195
+ /**
2196
+ * @fileoverview added by tsickle
2197
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2198
+ */
2199
+ var PlaceRouter = /** @class */ (function () {
2200
+ function PlaceRouter(router) {
2201
+ this.router = router;
2040
2202
  }
2041
- ParameterSnapshot.create = create;
2042
2203
  /**
2043
- * @abstract
2044
- * @template T, S
2204
+ * @param {?} activatedRoute
2205
+ * @param {?} previous
2206
+ * @param {?} next
2207
+ * @return {?}
2045
2208
  */
2046
- var /**
2047
- * @abstract
2048
- * @template T, S
2209
+ PlaceRouter.prototype.pushParameterChangesToRoute = /**
2210
+ * @param {?} activatedRoute
2211
+ * @param {?} previous
2212
+ * @param {?} next
2213
+ * @return {?}
2049
2214
  */
2050
- ResolvedParameter = /** @class */ (function () {
2051
- function ResolvedParameter(parameterDef, value) {
2052
- this.parameterDef = parameterDef;
2053
- this.value = value;
2054
- }
2055
- /**
2056
- * @return {?}
2057
- */
2058
- ResolvedParameter.prototype.isRouteId = /**
2215
+ function (activatedRoute, previous, next) {
2216
+ this.router.navigate(this.redirect(activatedRoute.snapshot, previous, next), {
2217
+ relativeTo: activatedRoute
2218
+ });
2219
+ };
2220
+ /**
2221
+ * @param {?} activatedRoute
2222
+ * @param {?} sanitised
2223
+ * @param {?} snapshot
2224
+ * @return {?}
2225
+ */
2226
+ PlaceRouter.prototype.createUrlTree = /**
2227
+ * @param {?} activatedRoute
2228
+ * @param {?} sanitised
2229
+ * @param {?} snapshot
2230
+ * @return {?}
2231
+ */
2232
+ function (activatedRoute, sanitised, snapshot) {
2233
+ return this.router.createUrlTree(this.redirect(activatedRoute, snapshot, sanitised));
2234
+ };
2235
+ /**
2236
+ * @protected
2237
+ * @param {?} activatedRoute
2238
+ * @param {?} previous
2239
+ * @param {?} next
2240
+ * @return {?}
2241
+ */
2242
+ PlaceRouter.prototype.redirect = /**
2243
+ * @protected
2244
+ * @param {?} activatedRoute
2245
+ * @param {?} previous
2246
+ * @param {?} next
2247
+ * @return {?}
2248
+ */
2249
+ function (activatedRoute, previous, next) {
2250
+ /** @type {?} */
2251
+ var childSegments = ___default.flatten(activatedRoute.children.map((/**
2252
+ * @param {?} child
2059
2253
  * @return {?}
2060
2254
  */
2061
- function () {
2062
- return this.parameterDef.isRouteId;
2063
- };
2064
- return ResolvedParameter;
2065
- }());
2066
- ParameterSnapshot.ResolvedParameter = ResolvedParameter;
2067
- if (false) {
2255
+ function (child) { return child.url; })));
2068
2256
  /** @type {?} */
2069
- ResolvedParameter.prototype.parameterDef;
2257
+ var relativePath = !!previous.hasRouteId() ? '..' : '.';
2070
2258
  /** @type {?} */
2071
- ResolvedParameter.prototype.value;
2072
- /**
2073
- * @abstract
2074
- * @param {?} dest
2075
- * @return {?}
2076
- */
2077
- ResolvedParameter.prototype.injectRouteParam = function (dest) { };
2078
- /**
2079
- * @abstract
2080
- * @param {?} otherValue
2081
- * @return {?}
2082
- */
2083
- ResolvedParameter.prototype.isSame = function (otherValue) { };
2084
- /**
2085
- * @abstract
2086
- * @return {?}
2087
- */
2088
- ResolvedParameter.prototype.formattedValue = function () { };
2089
- /**
2090
- * @abstract
2091
- * @param {?} value
2259
+ var routeId = next.getFormattedRouteId();
2260
+ /** @type {?} */
2261
+ var path = routeId ?
2262
+ [relativePath, routeId, next.getFormattedParameters()] :
2263
+ [relativePath, next.getFormattedParameters()];
2264
+ return path.concat(childSegments.map((/**
2265
+ * @param {?} s
2092
2266
  * @return {?}
2093
2267
  */
2094
- ResolvedParameter.prototype.replace = function (value) { };
2095
- }
2268
+ function (s) { return s.path; })));
2269
+ };
2270
+ PlaceRouter.decorators = [
2271
+ { type: Injectable, args: [{
2272
+ providedIn: 'root'
2273
+ },] }
2274
+ ];
2275
+ /** @nocollapse */
2276
+ PlaceRouter.ctorParameters = function () { return [
2277
+ { type: Router }
2278
+ ]; };
2279
+ /** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
2280
+ return PlaceRouter;
2281
+ }());
2282
+ if (false) {
2096
2283
  /**
2097
- * @template T
2284
+ * @type {?}
2285
+ * @private
2098
2286
  */
2099
- var ResolvedValueParameter = /** @class */ (function (_super) {
2100
- __extends(ResolvedValueParameter, _super);
2101
- function ResolvedValueParameter() {
2102
- return _super !== null && _super.apply(this, arguments) || this;
2103
- }
2104
- /**
2105
- * @param {?} otherValue
2106
- * @return {?}
2107
- */
2108
- ResolvedValueParameter.prototype.isSame = /**
2109
- * @param {?} otherValue
2110
- * @return {?}
2111
- */
2112
- function (otherValue) {
2113
- return this.value === otherValue;
2114
- };
2115
- /**
2116
- * @param {?} dest
2117
- * @return {?}
2118
- */
2119
- ResolvedValueParameter.prototype.injectRouteParam = /**
2120
- * @param {?} dest
2121
- * @return {?}
2122
- */
2123
- function (dest) {
2124
- dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
2125
- };
2126
- /**
2127
- * @param {?} value
2128
- * @return {?}
2129
- */
2130
- ResolvedValueParameter.prototype.replace = /**
2131
- * @param {?} value
2132
- * @return {?}
2133
- */
2134
- function (value) {
2135
- return new ResolvedValueParameter(this.parameterDef, value);
2136
- };
2137
- /**
2138
- * @return {?}
2139
- */
2140
- ResolvedValueParameter.prototype.formattedValue = /**
2141
- * @return {?}
2142
- */
2143
- function () {
2144
- return !isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
2145
- };
2146
- __decorate([
2147
- Trace(),
2148
- __metadata("design:type", Function),
2149
- __metadata("design:paramtypes", [Object]),
2150
- __metadata("design:returntype", Boolean)
2151
- ], ResolvedValueParameter.prototype, "isSame", null);
2152
- return ResolvedValueParameter;
2153
- }(ResolvedParameter));
2154
- ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
2287
+ PlaceRouter.prototype.router;
2288
+ }
2289
+
2290
+ /**
2291
+ * @fileoverview added by tsickle
2292
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2293
+ */
2294
+ /**
2295
+ * @abstract
2296
+ * @template T, S
2297
+ */
2298
+ var /**
2299
+ * @abstract
2300
+ * @template T, S
2301
+ */
2302
+ ParameterDefinition = /** @class */ (function () {
2303
+ function ParameterDefinition(propertyName, type, options) {
2304
+ this.propertyName = propertyName;
2305
+ this.type = type;
2306
+ /** @type {?} */
2307
+ var opts = Opts.get(options);
2308
+ this.name = opts.getOptional('as', propertyName);
2309
+ // this.sanitiser = new DefaultParameterSanitiser(
2310
+ // this,
2311
+ // opts.getOptional('remember', false),
2312
+ // opts.getOptional('defaultValue', null)
2313
+ // );
2314
+ }
2315
+ /**
2316
+ * @param {?} injector
2317
+ * @return {?}
2318
+ */
2319
+ ParameterDefinition.prototype.getSanitiser = /**
2320
+ * @param {?} injector
2321
+ * @return {?}
2322
+ */
2323
+ function (injector) {
2324
+ return this.sanitiser;
2325
+ };
2326
+ return ParameterDefinition;
2327
+ }());
2328
+ if (false) {
2329
+ /** @type {?} */
2330
+ ParameterDefinition.prototype.isRouteId;
2331
+ /** @type {?} */
2332
+ ParameterDefinition.prototype.isArray;
2333
+ /** @type {?} */
2334
+ ParameterDefinition.prototype.name;
2335
+ /** @type {?} */
2336
+ ParameterDefinition.prototype.sanitiser;
2337
+ /** @type {?} */
2338
+ ParameterDefinition.prototype.propertyName;
2339
+ /** @type {?} */
2340
+ ParameterDefinition.prototype.type;
2341
+ }
2342
+ (function (ParameterDefinition) {
2155
2343
  /**
2344
+ * @record
2156
2345
  * @template T
2157
2346
  */
2158
- var ResolvedArrayParameter = /** @class */ (function (_super) {
2159
- __extends(ResolvedArrayParameter, _super);
2160
- function ResolvedArrayParameter() {
2161
- return _super !== null && _super.apply(this, arguments) || this;
2347
+ function Options() { }
2348
+ ParameterDefinition.Options = Options;
2349
+ if (false) {
2350
+ /** @type {?|undefined} */
2351
+ Options.prototype.as;
2352
+ /** @type {?|undefined} */
2353
+ Options.prototype.optional;
2354
+ /** @type {?|undefined} */
2355
+ Options.prototype.remember;
2356
+ /** @type {?|undefined} */
2357
+ Options.prototype.defaultValue;
2358
+ }
2359
+ /**
2360
+ * @template T
2361
+ */
2362
+ var /**
2363
+ * @template T
2364
+ */
2365
+ RouteId = /** @class */ (function (_super) {
2366
+ __extends(RouteId, _super);
2367
+ function RouteId() {
2368
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2369
+ _this.isRouteId = true;
2370
+ _this.isArray = false;
2371
+ return _this;
2162
2372
  }
2163
- /**
2164
- * @param {?} otherValue
2165
- * @return {?}
2166
- */
2167
- ResolvedArrayParameter.prototype.isSame = /**
2168
- * @param {?} otherValue
2169
- * @return {?}
2170
- */
2171
- function (otherValue) {
2172
- return isEqual(this.value, otherValue);
2173
- };
2174
- /**
2175
- * @param {?} dest
2176
- * @return {?}
2177
- */
2178
- ResolvedArrayParameter.prototype.injectRouteParam = /**
2179
- * @param {?} dest
2180
- * @return {?}
2181
- */
2182
- function (dest) {
2183
- var _this = this;
2184
- dest[this.parameterDef.name] = this.value.map((/**
2185
- * @param {?} v
2186
- * @return {?}
2187
- */
2188
- function (v) { return _this.parameterDef.type.format(v); }));
2189
- };
2190
- /**
2191
- * @param {?} value
2192
- * @return {?}
2193
- */
2194
- ResolvedArrayParameter.prototype.replace = /**
2195
- * @param {?} value
2196
- * @return {?}
2197
- */
2198
- function (value) {
2199
- return new ResolvedArrayParameter(this.parameterDef, value);
2200
- };
2201
- /**
2202
- * @return {?}
2203
- */
2204
- ResolvedArrayParameter.prototype.formattedValue = /**
2205
- * @return {?}
2206
- */
2207
- function () {
2208
- var _this = this;
2209
- return this.value ? this.value.map((/**
2210
- * @param {?} v
2211
- * @return {?}
2212
- */
2213
- function (v) { return _this.parameterDef.type.format(v); })) : [];
2214
- };
2215
- __decorate([
2216
- Trace(),
2217
- __metadata("design:type", Function),
2218
- __metadata("design:paramtypes", [Array]),
2219
- __metadata("design:returntype", Boolean)
2220
- ], ResolvedArrayParameter.prototype, "isSame", null);
2221
- return ResolvedArrayParameter;
2222
- }(ResolvedParameter));
2223
- ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
2224
- })(ParameterSnapshot || (ParameterSnapshot = {}));
2373
+ return RouteId;
2374
+ }(ParameterDefinition));
2375
+ ParameterDefinition.RouteId = RouteId;
2376
+ if (false) {
2377
+ /** @type {?} */
2378
+ RouteId.prototype.isRouteId;
2379
+ /** @type {?} */
2380
+ RouteId.prototype.isArray;
2381
+ }
2382
+ /**
2383
+ * @template T
2384
+ */
2385
+ var /**
2386
+ * @template T
2387
+ */
2388
+ ValueParameter = /** @class */ (function (_super) {
2389
+ __extends(ValueParameter, _super);
2390
+ function ValueParameter() {
2391
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2392
+ _this.isRouteId = false;
2393
+ _this.isArray = false;
2394
+ return _this;
2395
+ }
2396
+ return ValueParameter;
2397
+ }(ParameterDefinition));
2398
+ ParameterDefinition.ValueParameter = ValueParameter;
2399
+ if (false) {
2400
+ /** @type {?} */
2401
+ ValueParameter.prototype.isRouteId;
2402
+ /** @type {?} */
2403
+ ValueParameter.prototype.isArray;
2404
+ }
2405
+ /**
2406
+ * @template T
2407
+ */
2408
+ var /**
2409
+ * @template T
2410
+ */
2411
+ ArrayParameter = /** @class */ (function (_super) {
2412
+ __extends(ArrayParameter, _super);
2413
+ function ArrayParameter() {
2414
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2415
+ _this.isRouteId = false;
2416
+ _this.isArray = true;
2417
+ return _this;
2418
+ }
2419
+ return ArrayParameter;
2420
+ }(ParameterDefinition));
2421
+ ParameterDefinition.ArrayParameter = ArrayParameter;
2422
+ if (false) {
2423
+ /** @type {?} */
2424
+ ArrayParameter.prototype.isRouteId;
2425
+ /** @type {?} */
2426
+ ArrayParameter.prototype.isArray;
2427
+ }
2428
+ })(ParameterDefinition || (ParameterDefinition = {}));
2225
2429
 
2226
2430
  /**
2227
2431
  * @fileoverview added by tsickle
2228
2432
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2229
2433
  */
2230
- // RAKE: making this Symbol(...) broke things.
2231
- /** @type {?} */
2232
- var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
2233
- // this one seems ok.
2234
- /** @type {?} */
2235
- var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2236
- var PlaceComponent = /** @class */ (function (_super) {
2237
- __extends(PlaceComponent, _super);
2238
- function PlaceComponent(activatedRoute, placeService) {
2239
- var _this = _super.call(this) || this;
2240
- _this.activatedRoute = activatedRoute;
2241
- _this._incomingRouteChange = new MutableValueModel(false);
2242
- _this.resolvedParameters = new MutableValueModel();
2243
- var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2244
- _this.placeDefinition.getRouteParameters().forEach((/**
2245
- * @param {?} p
2246
- * @return {?}
2247
- */
2248
- function (p) { return _this.installBinding(p); }));
2249
- observe.valuesFrom(activatedRoute.paramMap)
2250
- .last()
2251
- .map((/**
2252
- * @param {?} params
2253
- * @return {?}
2254
- */
2255
- function (params) { return ParameterSnapshot.create(_this.placeDefinition, params); }))
2256
- .subscribe((/**
2257
- * @param {?} resolvedParameters
2258
- * @return {?}
2259
- */
2260
- function (resolvedParameters) {
2261
- _this._incomingRouteChange.value = true;
2262
- _this.resolvedParameters.value = resolvedParameters;
2263
- _this._incomingRouteChange.value = false;
2264
- }));
2265
- when.valueOf(_this.resolvedParameters).changes((/**
2266
- * @param {?} params
2267
- * @param {?} previous
2434
+ var ParameterSnapshot = /** @class */ (function () {
2435
+ function ParameterSnapshot(placeDefinition, resolved) {
2436
+ this.placeDefinition = placeDefinition;
2437
+ this.resolved = resolved;
2438
+ }
2439
+ /**
2440
+ * @param {?} other
2441
+ * @return {?}
2442
+ */
2443
+ ParameterSnapshot.prototype.hasChanged = /**
2444
+ * @param {?} other
2445
+ * @return {?}
2446
+ */
2447
+ function (other) {
2448
+ /** @type {?} */
2449
+ var changed = this.resolved.find((/**
2450
+ * @param {?} r
2268
2451
  * @return {?}
2269
2452
  */
2270
- function (params, previous) {
2271
- placeService.notifyRouteParametersChanged({
2272
- activatedRoute: _this.activatedRoute,
2273
- next: params,
2274
- previous: previous,
2275
- updateRoute: !_this.incomingRouteChange.value // we update the route if it's a component triggered change.
2276
- });
2453
+ function (r) {
2454
+ return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
2277
2455
  }));
2278
- return _this;
2279
- }
2280
- Object.defineProperty(PlaceComponent.prototype, "incomingRouteChange", {
2281
- get: /**
2456
+ // if (changed) {
2457
+ // console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
2458
+ // }
2459
+ return !!changed;
2460
+ };
2461
+ /**
2462
+ * @template T, S
2463
+ * @param {?} parameterDef
2464
+ * @return {?}
2465
+ */
2466
+ ParameterSnapshot.prototype.getResolvedParameter = /**
2467
+ * @template T, S
2468
+ * @param {?} parameterDef
2469
+ * @return {?}
2470
+ */
2471
+ function (parameterDef) {
2472
+ return this.resolved.find((/**
2473
+ * @param {?} r
2282
2474
  * @return {?}
2283
2475
  */
2284
- function () {
2285
- return this._incomingRouteChange.readonly;
2286
- },
2287
- enumerable: true,
2288
- configurable: true
2289
- });
2476
+ function (r) { return r.parameterDef === parameterDef; }));
2477
+ };
2290
2478
  /**
2291
- * @private
2292
2479
  * @template T, S
2293
2480
  * @param {?} parameterDef
2294
2481
  * @return {?}
2295
2482
  */
2296
- PlaceComponent.prototype.installBinding = /**
2297
- * @private
2483
+ ParameterSnapshot.prototype.getResolvedParameterValue = /**
2298
2484
  * @template T, S
2299
2485
  * @param {?} parameterDef
2300
2486
  * @return {?}
2301
2487
  */
2302
2488
  function (parameterDef) {
2303
2489
  /** @type {?} */
2304
- var model = (/** @type {?} */ (this[parameterDef.propertyName]));
2305
- // this.txo.observe(parameterDef.propertyName, model);
2306
- this.registerDisposable(new Binding(this.resolvedParameters, model, {
2307
- toRight: /**
2308
- * @param {?} parameters
2309
- * @return {?}
2310
- */
2311
- function (parameters) {
2312
- return parameters.getResolvedParameterValue(parameterDef);
2313
- },
2314
- toLeft: /**
2315
- * @param {?} value
2316
- * @param {?=} currentParameters
2317
- * @return {?}
2318
- */
2319
- function (value, currentParameters) {
2320
- return currentParameters.replace(parameterDef, value);
2321
- }
2322
- }));
2490
+ var resolvedParameter = this.getResolvedParameter(parameterDef);
2491
+ return resolvedParameter ? resolvedParameter.value : null;
2323
2492
  };
2324
- Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
2325
- get: /**
2493
+ /**
2494
+ * @return {?}
2495
+ */
2496
+ ParameterSnapshot.prototype.getRouteId = /**
2497
+ * @return {?}
2498
+ */
2499
+ function () {
2500
+ return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
2501
+ };
2502
+ /**
2503
+ * @param {?} name
2504
+ * @return {?}
2505
+ */
2506
+ ParameterSnapshot.prototype.getRouteParameter = /**
2507
+ * @param {?} name
2508
+ * @return {?}
2509
+ */
2510
+ function (name) {
2511
+ /** @type {?} */
2512
+ var resolvedParameter = this.resolved.find((/**
2513
+ * @param {?} r
2326
2514
  * @return {?}
2327
2515
  */
2328
- function () {
2329
- return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2330
- },
2331
- enumerable: true,
2332
- configurable: true
2333
- });
2516
+ function (r) { return r.parameterDef.name === name; }));
2517
+ return resolvedParameter ? resolvedParameter.value : null;
2518
+ };
2334
2519
  /**
2520
+ * @private
2335
2521
  * @return {?}
2336
2522
  */
2337
- PlaceComponent.prototype.canDeactivate = /**
2523
+ ParameterSnapshot.prototype.getResolvedRouteId = /**
2524
+ * @private
2338
2525
  * @return {?}
2339
2526
  */
2340
2527
  function () {
2341
- return true;
2528
+ // RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
2529
+ // capture this in the type system though
2530
+ return (/** @type {?} */ (this.resolved.find((/**
2531
+ * @param {?} p
2532
+ * @return {?}
2533
+ */
2534
+ function (p) { return p.parameterDef.isRouteId; }))));
2535
+ };
2536
+ /**
2537
+ * @return {?}
2538
+ */
2539
+ ParameterSnapshot.prototype.hasRouteId = /**
2540
+ * @return {?}
2541
+ */
2542
+ function () {
2543
+ return !!this.getResolvedRouteId();
2342
2544
  };
2343
- // @Trace()
2344
- // @Trace()
2345
2545
  /**
2346
2546
  * @return {?}
2347
2547
  */
2348
- PlaceComponent.prototype.onPlaceReady =
2349
- // @Trace()
2548
+ ParameterSnapshot.prototype.getFormattedRouteId = /**
2549
+ * @return {?}
2550
+ */
2551
+ function () {
2552
+ /** @type {?} */
2553
+ var routeIdParam = this.getResolvedRouteId();
2554
+ return routeIdParam ? routeIdParam.formattedValue() : null;
2555
+ };
2350
2556
  /**
2351
2557
  * @return {?}
2352
2558
  */
2559
+ ParameterSnapshot.prototype.getFormattedParameters = /**
2560
+ * @return {?}
2561
+ */
2353
2562
  function () {
2563
+ /** @type {?} */
2564
+ var params = {};
2565
+ /** @type {?} */
2566
+ var routeIdParam = this.resolved.filter((/**
2567
+ * @param {?} p
2568
+ * @return {?}
2569
+ */
2570
+ function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
2571
+ * @param {?} p
2572
+ * @return {?}
2573
+ */
2574
+ function (p) {
2575
+ params[p.parameterDef.name] = p.formattedValue();
2576
+ }));
2577
+ return params;
2578
+ };
2579
+ /**
2580
+ * @template T, S
2581
+ * @param {?} parameter
2582
+ * @param {?} value
2583
+ * @return {?}
2584
+ */
2585
+ ParameterSnapshot.prototype.replace = /**
2586
+ * @template T, S
2587
+ * @param {?} parameter
2588
+ * @param {?} value
2589
+ * @return {?}
2590
+ */
2591
+ function (parameter, value) {
2592
+ return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
2593
+ * @param {?} p
2594
+ * @return {?}
2595
+ */
2596
+ function (p) {
2597
+ return p.parameterDef === parameter ? p.replace(value) : p;
2598
+ })));
2599
+ };
2600
+ /**
2601
+ * @param {?} injector
2602
+ * @return {?}
2603
+ */
2604
+ ParameterSnapshot.prototype.sanitise = /**
2605
+ * @param {?} injector
2606
+ * @return {?}
2607
+ */
2608
+ function (injector) {
2609
+ return __awaiter(this, void 0, void 0, function () {
2610
+ return __generator(this, function (_a) {
2611
+ return [2 /*return*/, this];
2612
+ });
2613
+ });
2354
2614
  };
2615
+ var _a;
2355
2616
  __decorate([
2356
2617
  Memoize$1(),
2357
- __metadata("design:type", PlaceComponent.Definition),
2358
- __metadata("design:paramtypes", [])
2359
- ], PlaceComponent.prototype, "placeDefinition", null);
2360
- return PlaceComponent;
2361
- }(DisposableComponent));
2618
+ __metadata("design:type", Function),
2619
+ __metadata("design:paramtypes", [ParameterDefinition]),
2620
+ __metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
2621
+ ], ParameterSnapshot.prototype, "getResolvedParameter", null);
2622
+ __decorate([
2623
+ Memoize$1(),
2624
+ __metadata("design:type", Function),
2625
+ __metadata("design:paramtypes", [ParameterDefinition]),
2626
+ __metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
2627
+ ], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
2628
+ __decorate([
2629
+ Memoize$1(),
2630
+ __metadata("design:type", Function),
2631
+ __metadata("design:paramtypes", [String]),
2632
+ __metadata("design:returntype", Object)
2633
+ ], ParameterSnapshot.prototype, "getRouteParameter", null);
2634
+ __decorate([
2635
+ Memoize$1(),
2636
+ __metadata("design:type", Function),
2637
+ __metadata("design:paramtypes", []),
2638
+ __metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
2639
+ ], ParameterSnapshot.prototype, "getResolvedRouteId", null);
2640
+ return ParameterSnapshot;
2641
+ }());
2362
2642
  if (false) {
2363
2643
  /** @type {?} */
2364
- PlaceComponent.prototype._incomingRouteChange;
2644
+ ParameterSnapshot.prototype.placeDefinition;
2365
2645
  /**
2366
2646
  * @type {?}
2367
2647
  * @private
2368
2648
  */
2369
- PlaceComponent.prototype.resolvedParameters;
2370
- /** @type {?} */
2371
- PlaceComponent.prototype.activatedRoute;
2649
+ ParameterSnapshot.prototype.resolved;
2372
2650
  }
2373
- (function (PlaceComponent) {
2374
- var Definition = /** @class */ (function () {
2375
- function Definition(component, options) {
2376
- this.component = component;
2377
- assert.notNil(options);
2378
- this.path = options.path;
2379
- this.order = options.order;
2380
- this.data = options.data;
2381
- this.authenticate = isNil(options.authenticate) || options.authenticate;
2382
- this.children = (options.children || []).map((/**
2383
- * @param {?} c
2384
- * @return {?}
2385
- */
2386
- function (c) { return PlaceComponent.getDefinition(c).component; }));
2651
+ (function (ParameterSnapshot) {
2652
+ /**
2653
+ * @param {?} placeDef
2654
+ * @param {?} paramMap
2655
+ * @return {?}
2656
+ */
2657
+ function create(placeDef, paramMap) {
2658
+ /** @type {?} */
2659
+ var resolvedParameters = placeDef.getRouteParameters()
2660
+ .map((/**
2661
+ * @param {?} def
2662
+ * @return {?}
2663
+ */
2664
+ function (def) {
2665
+ if (def.isArray) {
2666
+ /** @type {?} */
2667
+ var value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
2668
+ * @param {?} raw
2669
+ * @return {?}
2670
+ */
2671
+ function (raw) { return def.type.parse(raw); })) : null;
2672
+ return new ResolvedArrayParameter(def, value);
2673
+ }
2674
+ else {
2675
+ /** @type {?} */
2676
+ var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
2677
+ return new ResolvedValueParameter(def, value);
2678
+ }
2679
+ }));
2680
+ return new ParameterSnapshot(placeDef, resolvedParameters);
2681
+ }
2682
+ ParameterSnapshot.create = create;
2683
+ /**
2684
+ * @abstract
2685
+ * @template T, S
2686
+ */
2687
+ var /**
2688
+ * @abstract
2689
+ * @template T, S
2690
+ */
2691
+ ResolvedParameter = /** @class */ (function () {
2692
+ function ResolvedParameter(parameterDef, value) {
2693
+ this.parameterDef = parameterDef;
2694
+ this.value = value;
2387
2695
  }
2388
2696
  /**
2389
2697
  * @return {?}
2390
2698
  */
2391
- Definition.prototype.getRouteParameters = /**
2699
+ ResolvedParameter.prototype.isRouteId = /**
2392
2700
  * @return {?}
2393
2701
  */
2394
2702
  function () {
2395
- return Klass.get(this.component).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
2703
+ return this.parameterDef.isRouteId;
2396
2704
  };
2705
+ return ResolvedParameter;
2706
+ }());
2707
+ ParameterSnapshot.ResolvedParameter = ResolvedParameter;
2708
+ if (false) {
2709
+ /** @type {?} */
2710
+ ResolvedParameter.prototype.parameterDef;
2711
+ /** @type {?} */
2712
+ ResolvedParameter.prototype.value;
2397
2713
  /**
2398
- * @param {?} constructable
2714
+ * @abstract
2715
+ * @param {?} dest
2399
2716
  * @return {?}
2400
2717
  */
2401
- Definition.prototype.isDescriptorForType = /**
2402
- * @param {?} constructable
2718
+ ResolvedParameter.prototype.injectRouteParam = function (dest) { };
2719
+ /**
2720
+ * @abstract
2721
+ * @param {?} otherValue
2403
2722
  * @return {?}
2404
2723
  */
2405
- function (constructable) {
2406
- return lang.constructorChain(constructable).includes(PlaceComponent);
2407
- };
2724
+ ResolvedParameter.prototype.isSame = function (otherValue) { };
2408
2725
  /**
2409
- * @param {?} placeComponent
2726
+ * @abstract
2410
2727
  * @return {?}
2411
2728
  */
2412
- Definition.prototype.isDescriptorFor = /**
2413
- * @param {?} placeComponent
2729
+ ResolvedParameter.prototype.formattedValue = function () { };
2730
+ /**
2731
+ * @abstract
2732
+ * @param {?} value
2414
2733
  * @return {?}
2415
2734
  */
2416
- function (placeComponent) {
2417
- return placeComponent.constructor === this.component;
2418
- };
2735
+ ResolvedParameter.prototype.replace = function (value) { };
2736
+ }
2737
+ /**
2738
+ * @template T
2739
+ */
2740
+ var /**
2741
+ * @template T
2742
+ */
2743
+ ResolvedValueParameter = /** @class */ (function (_super) {
2744
+ __extends(ResolvedValueParameter, _super);
2745
+ function ResolvedValueParameter() {
2746
+ return _super !== null && _super.apply(this, arguments) || this;
2747
+ }
2419
2748
  /**
2420
- * @template T
2421
- * @param {?} key
2422
- * @param {?=} defaultValue
2749
+ * @param {?} otherValue
2423
2750
  * @return {?}
2424
2751
  */
2425
- Definition.prototype.getData = /**
2426
- * @template T
2427
- * @param {?} key
2428
- * @param {?=} defaultValue
2752
+ ResolvedValueParameter.prototype.isSame = /**
2753
+ * @param {?} otherValue
2429
2754
  * @return {?}
2430
2755
  */
2431
- function (key, defaultValue) {
2432
- return this.data ?
2433
- isNil(this.data[key]) ? defaultValue : this.data[key] :
2434
- defaultValue;
2756
+ function (otherValue) {
2757
+ return this.value === otherValue;
2435
2758
  };
2436
2759
  /**
2437
- * @template T
2438
- * @param {?} keys
2439
- * @param {?=} defaultValue
2760
+ * @param {?} dest
2440
2761
  * @return {?}
2441
2762
  */
2442
- Definition.prototype.searchData = /**
2443
- * @template T
2444
- * @param {?} keys
2445
- * @param {?=} defaultValue
2763
+ ResolvedValueParameter.prototype.injectRouteParam = /**
2764
+ * @param {?} dest
2446
2765
  * @return {?}
2447
2766
  */
2448
- function (keys, defaultValue) {
2449
- var _this = this;
2450
- if (this.data) {
2451
- /** @type {?} */
2452
- var found = keys.find((/**
2453
- * @param {?} key
2454
- * @return {?}
2455
- */
2456
- function (key) { return !isNil(_this.data[key]); }));
2457
- return found ? this.data[found] : defaultValue;
2458
- }
2459
- else {
2460
- return defaultValue;
2461
- }
2767
+ function (dest) {
2768
+ dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
2462
2769
  };
2463
- __decorate([
2464
- Memoize$1(),
2465
- __metadata("design:type", Function),
2466
- __metadata("design:paramtypes", []),
2467
- __metadata("design:returntype", Array)
2468
- ], Definition.prototype, "getRouteParameters", null);
2469
- return Definition;
2470
- }());
2471
- PlaceComponent.Definition = Definition;
2472
- if (false) {
2473
- /** @type {?} */
2474
- Definition.prototype.path;
2475
- /** @type {?} */
2476
- Definition.prototype.authenticate;
2477
- /** @type {?} */
2478
- Definition.prototype.order;
2479
- /** @type {?} */
2480
- Definition.prototype.data;
2481
- /** @type {?} */
2482
- Definition.prototype.children;
2483
- /** @type {?} */
2484
- Definition.prototype.component;
2485
- }
2486
- /**
2487
- * @record
2488
- */
2489
- function Options() { }
2490
- PlaceComponent.Options = Options;
2491
- if (false) {
2492
- /** @type {?} */
2493
- Options.prototype.path;
2494
- /** @type {?} */
2495
- Options.prototype.order;
2496
- /** @type {?|undefined} */
2497
- Options.prototype.data;
2498
- /** @type {?|undefined} */
2499
- Options.prototype.authenticate;
2500
- /** @type {?|undefined} */
2501
- Options.prototype.children;
2502
- }
2503
- /**
2504
- * @record
2505
- */
2506
- function ChildOptions() { }
2507
- PlaceComponent.ChildOptions = ChildOptions;
2508
- if (false) {
2509
- /** @type {?} */
2510
- ChildOptions.prototype.parent;
2511
- }
2512
- /**
2513
- * @param {?} klass
2514
- * @return {?}
2515
- */
2516
- function getDefinition(klass) {
2517
- return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
2518
- }
2519
- PlaceComponent.getDefinition = getDefinition;
2520
- /**
2521
- * @param {?} klass
2522
- * @param {?} options
2523
- * @return {?}
2524
- */
2525
- function injectDefinition(klass, options) {
2526
- Reflect.defineMetadata(DEFINITION_META_DATA_KEY, new Definition(klass, options), klass);
2527
- }
2528
- PlaceComponent.injectDefinition = injectDefinition;
2529
- })(PlaceComponent || (PlaceComponent = {}));
2530
-
2531
- /**
2532
- * @fileoverview added by tsickle
2533
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2534
- */
2535
- var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
2536
- __extends(AbstractPlaceNavigationComponent, _super);
2537
- function AbstractPlaceNavigationComponent() {
2538
- var _this = _super.call(this) || this;
2539
- var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2540
- _this.placeDefinitions = chain(_this.placesModel).map((/**
2541
- * @param {?} c
2770
+ /**
2771
+ * @param {?} value
2542
2772
  * @return {?}
2543
2773
  */
2544
- function (c) { return PlaceComponent.getDefinition(c); }));
2545
- return _this;
2546
- }
2774
+ ResolvedValueParameter.prototype.replace = /**
2775
+ * @param {?} value
2776
+ * @return {?}
2777
+ */
2778
+ function (value) {
2779
+ return new ResolvedValueParameter(this.parameterDef, value);
2780
+ };
2781
+ /**
2782
+ * @return {?}
2783
+ */
2784
+ ResolvedValueParameter.prototype.formattedValue = /**
2785
+ * @return {?}
2786
+ */
2787
+ function () {
2788
+ return !___default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
2789
+ };
2790
+ return ResolvedValueParameter;
2791
+ }(ResolvedParameter));
2792
+ ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
2547
2793
  /**
2548
- * @param {?} placeDef
2549
- * @return {?}
2794
+ * @template T
2550
2795
  */
2551
- AbstractPlaceNavigationComponent.prototype.getNav = /**
2552
- * @param {?} placeDef
2553
- * @return {?}
2796
+ var /**
2797
+ * @template T
2554
2798
  */
2555
- function (placeDef) {
2556
- /** @type {?} */
2557
- var navItem = (/** @type {?} */ (placeDef.getData('nav')));
2558
- return {
2559
- title: (/**
2560
- * @return {?}
2561
- */
2562
- function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
2563
- tooltip: (/**
2564
- * @return {?}
2565
- */
2566
- function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
2567
- icon: (/**
2799
+ ResolvedArrayParameter = /** @class */ (function (_super) {
2800
+ __extends(ResolvedArrayParameter, _super);
2801
+ function ResolvedArrayParameter() {
2802
+ return _super !== null && _super.apply(this, arguments) || this;
2803
+ }
2804
+ /**
2805
+ * @param {?} otherValue
2806
+ * @return {?}
2807
+ */
2808
+ ResolvedArrayParameter.prototype.isSame = /**
2809
+ * @param {?} otherValue
2810
+ * @return {?}
2811
+ */
2812
+ function (otherValue) {
2813
+ return ___default.isEqual(this.value, otherValue);
2814
+ };
2815
+ /**
2816
+ * @param {?} dest
2817
+ * @return {?}
2818
+ */
2819
+ ResolvedArrayParameter.prototype.injectRouteParam = /**
2820
+ * @param {?} dest
2821
+ * @return {?}
2822
+ */
2823
+ function (dest) {
2824
+ var _this = this;
2825
+ dest[this.parameterDef.name] = this.value.map((/**
2826
+ * @param {?} v
2568
2827
  * @return {?}
2569
2828
  */
2570
- function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
2829
+ function (v) { return _this.parameterDef.type.format(v); }));
2571
2830
  };
2572
- };
2573
- /**
2574
- * @return {?}
2575
- */
2576
- AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
2577
- * @return {?}
2578
- */
2579
- function () {
2580
- };
2581
- AbstractPlaceNavigationComponent.propDecorators = {
2582
- places: [{ type: Input }],
2583
- placesModel: [{ type: Input }]
2584
- };
2585
- __decorate([
2586
- StoreInListModel('placesModel'),
2587
- __metadata("design:type", Array)
2588
- ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
2589
- __decorate([
2590
- UseDelegate(),
2591
- __metadata("design:type", ListModel)
2592
- ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
2593
- __decorate([
2594
- Memoize(),
2595
- __metadata("design:type", Function),
2596
- __metadata("design:paramtypes", [PlaceComponent.Definition]),
2597
- __metadata("design:returntype", Object)
2598
- ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
2599
- return AbstractPlaceNavigationComponent;
2600
- }(DisposableComponent));
2601
- if (false) {
2602
- /** @type {?} */
2603
- AbstractPlaceNavigationComponent.prototype.places;
2604
- /** @type {?} */
2605
- AbstractPlaceNavigationComponent.prototype.placesModel;
2606
- /** @type {?} */
2607
- AbstractPlaceNavigationComponent.prototype.placeDefinitions;
2608
- }
2609
-
2610
- /**
2611
- * @fileoverview added by tsickle
2612
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2613
- */
2614
- var ListPlaceNavComponent = /** @class */ (function (_super) {
2615
- __extends(ListPlaceNavComponent, _super);
2616
- function ListPlaceNavComponent() {
2617
- var _this = _super.call(this) || this;
2618
- _this.expanded = true;
2619
- return _this;
2620
- }
2621
- /**
2622
- * @return {?}
2623
- */
2624
- ListPlaceNavComponent.prototype.expandMenu = /**
2625
- * @return {?}
2626
- */
2627
- function () {
2628
- this.expanded = true;
2629
- };
2630
- /**
2631
- * @return {?}
2632
- */
2633
- ListPlaceNavComponent.prototype.collapseMenu = /**
2634
- * @return {?}
2635
- */
2636
- function () {
2637
- this.expanded = false;
2638
- };
2639
- /**
2640
- * @return {?}
2641
- */
2642
- ListPlaceNavComponent.prototype.toggleMenu = /**
2643
- * @return {?}
2644
- */
2645
- function () {
2646
- this.expanded = !this.expanded;
2647
- };
2648
- ListPlaceNavComponent.decorators = [
2649
- { type: Component, args: [{
2650
- selector: 'angular-ui-powerups-list-place-nav',
2651
- 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",
2652
- 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}"]
2653
- }] }
2654
- ];
2655
- /** @nocollapse */
2656
- ListPlaceNavComponent.ctorParameters = function () { return []; };
2657
- ListPlaceNavComponent.propDecorators = {
2658
- expanded: [{ type: HostBinding, args: ['class.expanded',] }]
2659
- };
2660
- return ListPlaceNavComponent;
2661
- }(AbstractPlaceNavigationComponent));
2662
- if (false) {
2663
- /** @type {?} */
2664
- ListPlaceNavComponent.prototype.expanded;
2665
- }
2666
-
2667
- /**
2668
- * @fileoverview added by tsickle
2669
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2670
- */
2671
- var PlaceService = /** @class */ (function (_super) {
2672
- __extends(PlaceService, _super);
2673
- function PlaceService(router, injector) {
2674
- var _this = _super.call(this) || this;
2675
- _this.router = router;
2676
- _this.injector = injector;
2677
- _this._activePlaces = new MutableListModel();
2678
- return _this;
2679
- }
2680
- Object.defineProperty(PlaceService.prototype, "activePlaces", {
2681
- get: /**
2831
+ /**
2832
+ * @param {?} value
2833
+ * @return {?}
2834
+ */
2835
+ ResolvedArrayParameter.prototype.replace = /**
2836
+ * @param {?} value
2837
+ * @return {?}
2838
+ */
2839
+ function (value) {
2840
+ return new ResolvedArrayParameter(this.parameterDef, value);
2841
+ };
2842
+ /**
2843
+ * @return {?}
2844
+ */
2845
+ ResolvedArrayParameter.prototype.formattedValue = /**
2682
2846
  * @return {?}
2683
2847
  */
2684
2848
  function () {
2685
- return this._activePlaces.readonly;
2686
- },
2687
- enumerable: true,
2688
- configurable: true
2689
- });
2690
- // @Trace()
2691
- // @Trace()
2692
- /**
2693
- * @param {?} place
2694
- * @return {?}
2695
- */
2696
- PlaceService.prototype.onActivate =
2697
- // @Trace()
2698
- /**
2699
- * @param {?} place
2700
- * @return {?}
2701
- */
2702
- function (place) {
2703
- this._activePlaces.push(place);
2704
- };
2705
- // @Trace()
2706
- // @Trace()
2707
- /**
2708
- * @param {?} place
2709
- * @return {?}
2710
- */
2711
- PlaceService.prototype.onDeactivate =
2712
- // @Trace()
2713
- /**
2714
- * @param {?} place
2715
- * @return {?}
2716
- */
2717
- function (place) {
2718
- this._activePlaces.remove(place);
2719
- };
2720
- // @Trace()
2721
- // @Trace()
2722
- /**
2723
- * @param {?} params
2724
- * @return {?}
2725
- */
2726
- PlaceService.prototype.notifyRouteParametersChanged =
2727
- // @Trace()
2728
- /**
2729
- * @param {?} params
2730
- * @return {?}
2731
- */
2732
- function (params) {
2733
- // We update the router state...
2734
- if (params.updateRoute) {
2735
- /** @type {?} */
2736
- var routeId = params.next.getFormattedRouteId();
2737
- /** @type {?} */
2738
- var relativePath = !!params.previous.hasRouteId() ? '..' : '.';
2739
- /** @type {?} */
2740
- var path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
2741
- this.router.navigate(path, {
2742
- relativeTo: params.activatedRoute
2743
- });
2744
- }
2745
- };
2746
- // @Trace()
2747
- // @Trace()
2748
- /**
2749
- * @param {?} snapshot
2750
- * @return {?}
2751
- */
2752
- PlaceService.prototype.sanitise =
2753
- // @Trace()
2754
- /**
2755
- * @param {?} snapshot
2756
- * @return {?}
2757
- */
2758
- function (snapshot) {
2759
- return __awaiter(this, void 0, void 0, function () {
2760
- return __generator(this, function (_a) {
2761
- return [2 /*return*/, snapshot];
2762
- });
2763
- });
2764
- };
2765
- PlaceService.decorators = [
2766
- { type: Injectable, args: [{
2767
- providedIn: 'root'
2768
- },] }
2769
- ];
2770
- /** @nocollapse */
2771
- PlaceService.ctorParameters = function () { return [
2772
- { type: Router },
2773
- { type: Injector }
2774
- ]; };
2775
- /** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
2776
- return PlaceService;
2777
- }(GarbageCollector));
2778
- if (false) {
2779
- /**
2780
- * @type {?}
2781
- * @private
2782
- */
2783
- PlaceService.prototype._activePlaces;
2784
- /**
2785
- * @type {?}
2786
- * @protected
2787
- */
2788
- PlaceService.prototype.router;
2789
- /**
2790
- * @type {?}
2791
- * @protected
2792
- */
2793
- PlaceService.prototype.injector;
2794
- }
2849
+ var _this = this;
2850
+ return this.value ? this.value.map((/**
2851
+ * @param {?} v
2852
+ * @return {?}
2853
+ */
2854
+ function (v) { return _this.parameterDef.type.format(v); })) : [];
2855
+ };
2856
+ return ResolvedArrayParameter;
2857
+ }(ResolvedParameter));
2858
+ ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
2859
+ })(ParameterSnapshot || (ParameterSnapshot = {}));
2795
2860
 
2796
2861
  /**
2797
2862
  * @fileoverview added by tsickle
@@ -2844,56 +2909,88 @@ function leftRightPlaceAnimation(duration) {
2844
2909
  ]);
2845
2910
  }
2846
2911
  /** @type {?} */
2847
- var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
2912
+ var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation('0.3s');
2848
2913
 
2849
2914
  /**
2850
2915
  * @fileoverview added by tsickle
2851
2916
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2852
2917
  */
2918
+ /**
2919
+ * @record
2920
+ */
2921
+ function PlaceRef() { }
2922
+ if (false) {
2923
+ /** @type {?} */
2924
+ PlaceRef.prototype.placeDefinition;
2925
+ /**
2926
+ * @param {?} param
2927
+ * @return {?}
2928
+ */
2929
+ PlaceRef.prototype.initialiseBindings = function (param) { };
2930
+ /**
2931
+ * @return {?}
2932
+ */
2933
+ PlaceRef.prototype.onPlaceReady = function () { };
2934
+ }
2853
2935
  var PlaceOutletComponent = /** @class */ (function (_super) {
2854
2936
  __extends(PlaceOutletComponent, _super);
2855
- function PlaceOutletComponent(placeService, activatedRoute) {
2937
+ function PlaceOutletComponent(router, placeHistory) {
2856
2938
  var _this = _super.call(this) || this;
2857
- _this.placeService = placeService;
2858
- _this.activatedRoute = activatedRoute;
2939
+ _this.router = router;
2940
+ _this.placeHistory = placeHistory;
2859
2941
  _this.animate = true;
2860
- _this.outletUrlSegment = new MutableListModel();
2942
+ _this._incomingRouteChange = new Guard();
2943
+ _this._inOutletUpdate = new Guard();
2944
+ _this._activatedRouteModel = new MutableValueModel();
2945
+ _this._placeDefinition = new MutableValueModel();
2946
+ _this._resolvedParameters = new MutableValueModel();
2861
2947
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2862
- _this.myPath = observe.listsFrom(activatedRoute.url).last().map((/**
2863
- * @param {?} s
2864
- * @return {?}
2865
- */
2866
- function (s) { return s.toString(); })).reduce((/**
2867
- * @param {?} bits
2868
- * @return {?}
2869
- */
2870
- function (bits) { return bits.join(','); }));
2871
- console.log("new outlet@(" + _this.myPath.value + ")");
2872
- _this.outletChildPath = chain(_this.outletUrlSegment).map((/**
2873
- * @param {?} s
2948
+ _this._paramMap = chain(_this._activatedRouteModel).pullObservableValue((/**
2949
+ * @param {?} ar
2874
2950
  * @return {?}
2875
2951
  */
2876
- function (s) { return s.toString(); })).reduce((/**
2877
- * @param {?} bits
2878
- * @return {?}
2879
- */
2880
- function (bits) { return bits.join(","); }));
2881
- _this.state = chain(_this.myPath).map((/**
2882
- * @param {?} path
2952
+ function (ar) { return ar.paramMap; }));
2953
+ _this.placeConfigured = valueOf.all(chain(_this._inOutletUpdate).isFalsey(), _this._placeDefinition, _this._paramMap).areTruthy();
2954
+ when.valueOf(_this._paramMap).changes((/**
2955
+ * @param {?} params
2883
2956
  * @return {?}
2884
2957
  */
2885
- function (path) {
2886
- return "outlet@(" + path + "), child path->" + _this.outletChildPath.value;
2887
- }), { dependsOn: _this.outletChildPath });
2888
- when.valueOf(_this.state).changes((/**
2889
- * @param {?} debug
2958
+ function (params) {
2959
+ /** @type {?} */
2960
+ var snapshot = ParameterSnapshot.create(_this._placeDefinition.value, params);
2961
+ _this._incomingRouteChange.whileTrue((/**
2962
+ * @return {?}
2963
+ */
2964
+ function () {
2965
+ _this._resolvedParameters.value = snapshot;
2966
+ _this.placeHistory.add(snapshot);
2967
+ }));
2968
+ }), {
2969
+ postponeUntil: _this.placeConfigured
2970
+ });
2971
+ when.valueOf(_this._resolvedParameters).changes((/**
2972
+ * @param {?} next
2973
+ * @param {?} previous
2890
2974
  * @return {?}
2891
2975
  */
2892
- function (debug) {
2893
- console.log("Outlet Changed -> " + debug);
2894
- }));
2976
+ function (next, previous) {
2977
+ _this.pushChangesToRoute(next, previous);
2978
+ _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.
2979
+ }), {
2980
+ unless: _this.incomingRouteChange
2981
+ });
2895
2982
  return _this;
2896
2983
  }
2984
+ Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
2985
+ get: /**
2986
+ * @return {?}
2987
+ */
2988
+ function () {
2989
+ return this._incomingRouteChange;
2990
+ },
2991
+ enumerable: true,
2992
+ configurable: true
2993
+ });
2897
2994
  /**
2898
2995
  * @return {?}
2899
2996
  */
@@ -2903,76 +3000,56 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
2903
3000
  function () {
2904
3001
  };
2905
3002
  /**
3003
+ * @param {?} routerOutlet
3004
+ * @param {?} place
2906
3005
  * @return {?}
2907
3006
  */
2908
- PlaceOutletComponent.prototype.ngAfterViewInit = /**
2909
- * @return {?}
2910
- */
2911
- function () {
2912
- // this.routerOutLetQuery.changes.subscribe(() => {
2913
- // this.updateRouterOutlet(this.routerOutLetQuery.first);
2914
- // });
2915
- };
2916
- /**
2917
- * @return {?}
2918
- */
2919
- PlaceOutletComponent.prototype.ngAfterViewChecked = /**
2920
- * @return {?}
2921
- */
2922
- function () {
2923
- // console.log(`@AfterViewChecked: ${this.state.value}`);
2924
- this.updateRouterOutlet(this.routerOutLetQuery.first);
2925
- };
2926
- // @Trace()
2927
- // ngOnDestroy(): void {
2928
- // console.log('outletSegments', this.outletUrlSegment.value);
2929
- // console.log('mySegments', this.myPath.value);
2930
- // super.ngOnDestroy();
2931
- // }
2932
- // @Trace()
2933
- // @Trace()
2934
- // ngOnDestroy(): void {
2935
- // console.log('outletSegments', this.outletUrlSegment.value);
2936
- // console.log('mySegments', this.myPath.value);
2937
- // super.ngOnDestroy();
2938
- // }
2939
- // @Trace()
2940
- /**
2941
- * @param {?} $event
2942
- * @return {?}
2943
- */
2944
- PlaceOutletComponent.prototype.onOutletActivated =
2945
- // @Trace()
2946
- // ngOnDestroy(): void {
2947
- // console.log('outletSegments', this.outletUrlSegment.value);
2948
- // console.log('mySegments', this.myPath.value);
2949
- // super.ngOnDestroy();
2950
- // }
2951
- // @Trace()
2952
- /**
2953
- * @param {?} $event
3007
+ PlaceOutletComponent.prototype.onOutletActivated = /**
3008
+ * @param {?} routerOutlet
3009
+ * @param {?} place
2954
3010
  * @return {?}
2955
3011
  */
2956
- function ($event) {
2957
- // console.log(this.routerOutLet.activatedRoute.snapshot.url);
2958
- this.currentPlace = $event;
2959
- this.placeService.onActivate($event);
3012
+ function (routerOutlet, place) {
3013
+ var _this = this;
3014
+ this._inOutletUpdate.whileTrue((/**
3015
+ * @return {?}
3016
+ */
3017
+ function () {
3018
+ try {
3019
+ _this._currentPlace = place;
3020
+ _this._activatedRouteModel.value = routerOutlet.activatedRoute;
3021
+ _this._placeDefinition.value = place.placeDefinition;
3022
+ place.initialiseBindings(_this._resolvedParameters);
3023
+ }
3024
+ catch (error) {
3025
+ console.error(error);
3026
+ }
3027
+ }));
2960
3028
  if (!this.animate) {
2961
3029
  // we're not animating so trigger any post animation callbacks now.
2962
3030
  this.animationDone();
2963
3031
  }
2964
3032
  };
2965
3033
  /**
3034
+ * @param {?} routerOutlet
2966
3035
  * @param {?} $event
2967
3036
  * @return {?}
2968
3037
  */
2969
3038
  PlaceOutletComponent.prototype.onOutletDeactivated = /**
3039
+ * @param {?} routerOutlet
2970
3040
  * @param {?} $event
2971
3041
  * @return {?}
2972
3042
  */
2973
- function ($event) {
2974
- this.currentPlace = null;
2975
- this.placeService.onDeactivate($event);
3043
+ function (routerOutlet, $event) {
3044
+ var _this = this;
3045
+ this._inOutletUpdate.whileTrue((/**
3046
+ * @return {?}
3047
+ */
3048
+ function () {
3049
+ _this._currentPlace = null;
3050
+ _this._activatedRouteModel.value = null;
3051
+ _this._placeDefinition.value = null;
3052
+ }));
2976
3053
  };
2977
3054
  /**
2978
3055
  * @param {?} outlet
@@ -2992,45 +3069,54 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
2992
3069
  * @return {?}
2993
3070
  */
2994
3071
  function () {
2995
- if (this.currentPlace) {
2996
- this.currentPlace.onPlaceReady();
3072
+ if (this._currentPlace) {
3073
+ this._currentPlace.onPlaceReady();
2997
3074
  }
2998
3075
  };
2999
- // @Trace()
3000
- // @Trace()
3001
3076
  /**
3002
- * @private
3003
- * @param {?} first
3077
+ * @param {?} next
3078
+ * @param {?} previous
3079
+ * @return {?}
3080
+ */
3081
+ PlaceOutletComponent.prototype.pushChangesToRoute = /**
3082
+ * @param {?} next
3083
+ * @param {?} previous
3004
3084
  * @return {?}
3005
3085
  */
3006
- PlaceOutletComponent.prototype.updateRouterOutlet =
3007
- // @Trace()
3086
+ function (next, previous) {
3087
+ /** @type {?} */
3088
+ var activatedRoute = this._activatedRouteModel.value;
3089
+ this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
3090
+ };
3008
3091
  /**
3009
- * @private
3010
- * @param {?} first
3092
+ * @param {?} snapshot
3093
+ * @param {?} callback
3011
3094
  * @return {?}
3012
3095
  */
3013
- function (first) {
3014
- if (first.isActivated) {
3015
- this.outletUrlSegment.value = first.activatedRoute.snapshot.url;
3016
- }
3096
+ PlaceOutletComponent.prototype.sanitise = /**
3097
+ * @param {?} snapshot
3098
+ * @param {?} callback
3099
+ * @return {?}
3100
+ */
3101
+ function (snapshot, callback) {
3102
+ return snapshot;
3017
3103
  };
3018
3104
  PlaceOutletComponent.decorators = [
3019
3105
  { type: Component, args: [{
3020
3106
  selector: 'angular-ui-powerups-place-outlet',
3021
- 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",
3107
+ 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",
3022
3108
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
3023
3109
  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}"]
3024
3110
  }] }
3025
3111
  ];
3026
3112
  /** @nocollapse */
3027
3113
  PlaceOutletComponent.ctorParameters = function () { return [
3028
- { type: PlaceService },
3029
- { type: ActivatedRoute }
3114
+ { type: PlaceRouter },
3115
+ { type: PlaceHistory }
3030
3116
  ]; };
3031
3117
  PlaceOutletComponent.propDecorators = {
3032
3118
  animate: [{ type: Input }],
3033
- routerOutLetQuery: [{ type: ViewChildren, args: [RouterOutlet,] }]
3119
+ routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
3034
3120
  };
3035
3121
  return PlaceOutletComponent;
3036
3122
  }(DisposableComponent));
@@ -3038,42 +3124,54 @@ if (false) {
3038
3124
  /** @type {?} */
3039
3125
  PlaceOutletComponent.prototype.animate;
3040
3126
  /** @type {?} */
3041
- PlaceOutletComponent.prototype.routerOutLetQuery;
3127
+ PlaceOutletComponent.prototype.routerOut;
3128
+ /**
3129
+ * @type {?}
3130
+ * @private
3131
+ */
3132
+ PlaceOutletComponent.prototype._currentPlace;
3133
+ /**
3134
+ * @type {?}
3135
+ * @private
3136
+ */
3137
+ PlaceOutletComponent.prototype._incomingRouteChange;
3042
3138
  /**
3043
3139
  * @type {?}
3044
3140
  * @private
3045
3141
  */
3046
- PlaceOutletComponent.prototype.currentPlace;
3142
+ PlaceOutletComponent.prototype._inOutletUpdate;
3047
3143
  /**
3048
3144
  * @type {?}
3049
3145
  * @private
3050
3146
  */
3051
- PlaceOutletComponent.prototype.myPath;
3147
+ PlaceOutletComponent.prototype._activatedRouteModel;
3052
3148
  /**
3053
3149
  * @type {?}
3054
3150
  * @private
3055
3151
  */
3056
- PlaceOutletComponent.prototype.outletUrlSegment;
3152
+ PlaceOutletComponent.prototype._placeDefinition;
3057
3153
  /**
3058
3154
  * @type {?}
3059
3155
  * @private
3060
3156
  */
3061
- PlaceOutletComponent.prototype.outletChildPath;
3157
+ PlaceOutletComponent.prototype._paramMap;
3158
+ /** @type {?} */
3159
+ PlaceOutletComponent.prototype._resolvedParameters;
3062
3160
  /**
3063
3161
  * @type {?}
3064
3162
  * @private
3065
3163
  */
3066
- PlaceOutletComponent.prototype.state;
3164
+ PlaceOutletComponent.prototype.placeConfigured;
3067
3165
  /**
3068
3166
  * @type {?}
3069
3167
  * @private
3070
3168
  */
3071
- PlaceOutletComponent.prototype.placeService;
3169
+ PlaceOutletComponent.prototype.router;
3072
3170
  /**
3073
3171
  * @type {?}
3074
3172
  * @private
3075
3173
  */
3076
- PlaceOutletComponent.prototype.activatedRoute;
3174
+ PlaceOutletComponent.prototype.placeHistory;
3077
3175
  }
3078
3176
 
3079
3177
  /**
@@ -3131,9 +3229,7 @@ var PlaceModule = /** @class */ (function () {
3131
3229
  TabbedPlaceNavigationComponent,
3132
3230
  ListPlaceNavComponent
3133
3231
  ],
3134
- providers: [
3135
- PlaceService
3136
- ]
3232
+ providers: []
3137
3233
  },] }
3138
3234
  ];
3139
3235
  return PlaceModule;
@@ -3572,39 +3668,6 @@ if (false) {
3572
3668
  NavItem.prototype.tooltip = function () { };
3573
3669
  }
3574
3670
 
3575
- /**
3576
- * @fileoverview added by tsickle
3577
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3578
- */
3579
- /**
3580
- * @record
3581
- */
3582
- function PlaceComponentLike() { }
3583
- if (false) {
3584
- /** @type {?} */
3585
- PlaceComponentLike.prototype.activatedRoute;
3586
- /**
3587
- * @return {?}
3588
- */
3589
- PlaceComponentLike.prototype.onPlaceReady = function () { };
3590
- }
3591
-
3592
- /**
3593
- * @fileoverview added by tsickle
3594
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3595
- */
3596
- /**
3597
- * @record
3598
- */
3599
- function PlaceUpdatesService() { }
3600
- if (false) {
3601
- /**
3602
- * @param {?} params
3603
- * @return {?}
3604
- */
3605
- PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
3606
- }
3607
-
3608
3671
  /**
3609
3672
  * @fileoverview added by tsickle
3610
3673
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -3619,12 +3682,37 @@ function Place(options) {
3619
3682
  * @return {?}
3620
3683
  */
3621
3684
  function (target) {
3622
- if (!lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent)) {
3685
+ if (PlaceComponent.isPlaceComponentConstructor(target)) {
3686
+ PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
3687
+ * @param {?} c
3688
+ * @return {?}
3689
+ */
3690
+ function (c) { return PlaceComponent.getDefinition(c); }))));
3691
+ }
3692
+ else {
3623
3693
  lang.illegalState(target + " must extend PlaceComponent to use the @Place decorator");
3624
3694
  }
3625
- PlaceComponent.injectDefinition((/** @type {?} */ (target)), options);
3626
3695
  });
3627
3696
  }
3697
+ (function (Place) {
3698
+ /**
3699
+ * @record
3700
+ */
3701
+ function Options() { }
3702
+ Place.Options = Options;
3703
+ if (false) {
3704
+ /** @type {?} */
3705
+ Options.prototype.path;
3706
+ /** @type {?} */
3707
+ Options.prototype.order;
3708
+ /** @type {?|undefined} */
3709
+ Options.prototype.data;
3710
+ /** @type {?|undefined} */
3711
+ Options.prototype.authenticate;
3712
+ /** @type {?|undefined} */
3713
+ Options.prototype.children;
3714
+ }
3715
+ })(Place || (Place = {}));
3628
3716
 
3629
3717
  /**
3630
3718
  * @fileoverview added by tsickle
@@ -3675,14 +3763,16 @@ var LeavePlaceGuard = /** @class */ (function () {
3675
3763
  // HACK: this will break with child routes...
3676
3764
  /** @type {?} */
3677
3765
  var path = "/" + component.placeDefinition.path;
3678
- console.log({
3679
- placePath: path,
3680
- currentRoute: currentRoute.toString(),
3681
- currentStateUrl: currentState.url,
3682
- nextStateUrl: nextState.url,
3683
- currentStateUrlTree: this.router.parseUrl(currentState.url).root.children[PRIMARY_OUTLET].segments,
3684
- nextStateUrlTree: this.router.parseUrl(nextState.url).root.children[PRIMARY_OUTLET].segments
3685
- });
3766
+ // let thisTree = this.router.parseUrl(currentState.url);
3767
+ // let nextTree = this.router.parseUrl(nextState.url);
3768
+ // console.log({
3769
+ // placePath: path,
3770
+ // currentRoute: currentRoute.toString(),
3771
+ // currentStateUrl: currentState.url,
3772
+ // nextStateUrl: nextState.url,
3773
+ // currentStateUrlTree: thisTree.root.children[PRIMARY_OUTLET].segments,
3774
+ // nextStateUrlTree: nextTree.root.children[PRIMARY_OUTLET].segments
3775
+ // });
3686
3776
  // nextState is the full path...
3687
3777
  if (!nextState.url.startsWith(path)) {
3688
3778
  return component.canDeactivate();
@@ -3722,36 +3812,43 @@ if (false) {
3722
3812
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3723
3813
  */
3724
3814
  var PlaceRouteGuard = /** @class */ (function () {
3725
- function PlaceRouteGuard(placeService, router) {
3726
- this.placeService = placeService;
3727
- this.router = router;
3815
+ function PlaceRouteGuard(placeRouter, injector) {
3816
+ this.placeRouter = placeRouter;
3817
+ this.injector = injector;
3728
3818
  }
3729
3819
  /**
3730
- * @param {?} route
3820
+ * @param {?} activatedRoute
3731
3821
  * @param {?} state
3732
3822
  * @return {?}
3733
3823
  */
3734
3824
  PlaceRouteGuard.prototype.canActivate = /**
3735
- * @param {?} route
3825
+ * @param {?} activatedRoute
3736
3826
  * @param {?} state
3737
3827
  * @return {?}
3738
3828
  */
3739
- function (route, state) {
3740
- // Implement this when adding child routes.
3741
- // TODO: there are really two types of snapshot, ones with id's and ones without.
3742
- // Id snapshot are repesented by 2 url segments
3743
- // ID => [{'/basePath', params}, {'id', params}]
3744
- // NO ID => [{'/basePath', params}]
3745
- // console.log({urlSegments: route.url});
3746
- // const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
3747
- // return this.placeService.sanitise(snapshot).then(sanitised => {
3748
- // if (sanitised.hasChanged(snapshot)) {
3749
- // return this.router.createUrlTree(snapshot.updateUrl(route.url))
3750
- // } else {
3751
- // return true;
3752
- // }
3753
- // });
3754
- return true;
3829
+ function (activatedRoute, state) {
3830
+ var _this = this;
3831
+ if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
3832
+ /** @type {?} */
3833
+ var placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
3834
+ /** @type {?} */
3835
+ var snapshot_1 = ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap);
3836
+ return snapshot_1.sanitise(this.injector).then((/**
3837
+ * @param {?} sanitised
3838
+ * @return {?}
3839
+ */
3840
+ function (sanitised) {
3841
+ if (sanitised.hasChanged(snapshot_1)) {
3842
+ return _this.placeRouter.createUrlTree(activatedRoute, snapshot_1, sanitised);
3843
+ }
3844
+ else {
3845
+ return true;
3846
+ }
3847
+ }));
3848
+ }
3849
+ else {
3850
+ return lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component);
3851
+ }
3755
3852
  };
3756
3853
  PlaceRouteGuard.decorators = [
3757
3854
  { type: Injectable, args: [{
@@ -3760,10 +3857,10 @@ var PlaceRouteGuard = /** @class */ (function () {
3760
3857
  ];
3761
3858
  /** @nocollapse */
3762
3859
  PlaceRouteGuard.ctorParameters = function () { return [
3763
- { type: PlaceService },
3764
- { type: Router }
3860
+ { type: PlaceRouter },
3861
+ { type: Injector }
3765
3862
  ]; };
3766
- /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceService), ɵɵinject(Router)); }, token: PlaceRouteGuard, providedIn: "root" });
3863
+ /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceRouter), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
3767
3864
  return PlaceRouteGuard;
3768
3865
  }());
3769
3866
  if (false) {
@@ -3771,12 +3868,12 @@ if (false) {
3771
3868
  * @type {?}
3772
3869
  * @private
3773
3870
  */
3774
- PlaceRouteGuard.prototype.placeService;
3871
+ PlaceRouteGuard.prototype.placeRouter;
3775
3872
  /**
3776
3873
  * @type {?}
3777
3874
  * @private
3778
3875
  */
3779
- PlaceRouteGuard.prototype.router;
3876
+ PlaceRouteGuard.prototype.injector;
3780
3877
  }
3781
3878
 
3782
3879
  /**
@@ -3787,11 +3884,10 @@ if (false) {
3787
3884
  * @template T, S
3788
3885
  */
3789
3886
  var DefaultParameterSanitiser = /** @class */ (function () {
3790
- function DefaultParameterSanitiser(def, placeService, options) {
3887
+ function DefaultParameterSanitiser(def, remember, defaultValue) {
3791
3888
  this.def = def;
3792
- this.placeService = placeService;
3793
- this.remember = isNil(options.remember) ? false : options.remember;
3794
- this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
3889
+ this.remember = remember;
3890
+ this.defaultValue = defaultValue;
3795
3891
  }
3796
3892
  /**
3797
3893
  * @param {?} value
@@ -3808,7 +3904,7 @@ var DefaultParameterSanitiser = /** @class */ (function () {
3808
3904
  if (this.remember) {
3809
3905
  // value = null;
3810
3906
  }
3811
- return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
3907
+ return this.isBlank(value) && !___default.isNil(this.defaultValue) ? this.defaultValue : value;
3812
3908
  }
3813
3909
  else {
3814
3910
  return value;
@@ -3826,8 +3922,8 @@ var DefaultParameterSanitiser = /** @class */ (function () {
3826
3922
  */
3827
3923
  function (value) {
3828
3924
  /** @type {?} */
3829
- var isNil$1 = isNil(value);
3830
- return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
3925
+ var isNil = ___default.isNil(value);
3926
+ return this.def.isArray ? !isNil || value['length'] < 1 : isNil;
3831
3927
  };
3832
3928
  __decorate([
3833
3929
  Trace(),
@@ -3842,22 +3938,11 @@ if (false) {
3842
3938
  * @type {?}
3843
3939
  * @private
3844
3940
  */
3941
+ DefaultParameterSanitiser.prototype.def;
3942
+ /** @type {?} */
3845
3943
  DefaultParameterSanitiser.prototype.remember;
3846
- /**
3847
- * @type {?}
3848
- * @private
3849
- */
3944
+ /** @type {?} */
3850
3945
  DefaultParameterSanitiser.prototype.defaultValue;
3851
- /**
3852
- * @type {?}
3853
- * @private
3854
- */
3855
- DefaultParameterSanitiser.prototype.def;
3856
- /**
3857
- * @type {?}
3858
- * @private
3859
- */
3860
- DefaultParameterSanitiser.prototype.placeService;
3861
3946
  }
3862
3947
 
3863
3948
  /**
@@ -3891,8 +3976,6 @@ if (false) {
3891
3976
  ParameterOptions.prototype.remember;
3892
3977
  /** @type {?|undefined} */
3893
3978
  ParameterOptions.prototype.defaultValue;
3894
- /** @type {?|undefined} */
3895
- ParameterOptions.prototype.sanitiser;
3896
3979
  }
3897
3980
  /**
3898
3981
  * @record
@@ -3908,8 +3991,6 @@ if (false) {
3908
3991
  ListParameterOptions.prototype.remember;
3909
3992
  /** @type {?|undefined} */
3910
3993
  ListParameterOptions.prototype.defaultValue;
3911
- /** @type {?|undefined} */
3912
- ListParameterOptions.prototype.sanitiser;
3913
3994
  }
3914
3995
  /**
3915
3996
  * @template T
@@ -3918,7 +3999,6 @@ if (false) {
3918
3999
  * @return {?}
3919
4000
  */
3920
4001
  function RouteId(type, options) {
3921
- // assert.isTruthy(type.isValid());
3922
4002
  return (/**
3923
4003
  * @param {?} prototype
3924
4004
  * @param {?} propertyKey
@@ -3926,7 +4006,7 @@ function RouteId(type, options) {
3926
4006
  */
3927
4007
  function (prototype, propertyKey) {
3928
4008
  /** @type {?} */
3929
- var param = createDefinition(propertyKey, type, options, true);
4009
+ var param = new ParameterDefinition.RouteId(propertyKey.toString(), type, options);
3930
4010
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
3931
4011
  UseDelegate()(prototype, propertyKey);
3932
4012
  });
@@ -3938,7 +4018,6 @@ function RouteId(type, options) {
3938
4018
  * @return {?}
3939
4019
  */
3940
4020
  function RouteParameter(type, options) {
3941
- // assert.isTruthy(type.isValid());
3942
4021
  return (/**
3943
4022
  * @param {?} prototype
3944
4023
  * @param {?} propertyKey
@@ -3946,7 +4025,7 @@ function RouteParameter(type, options) {
3946
4025
  */
3947
4026
  function (prototype, propertyKey) {
3948
4027
  /** @type {?} */
3949
- var param = createDefinition(propertyKey, type, options, false);
4028
+ var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
3950
4029
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
3951
4030
  UseDelegate()(prototype, propertyKey);
3952
4031
  });
@@ -3958,7 +4037,6 @@ function RouteParameter(type, options) {
3958
4037
  * @return {?}
3959
4038
  */
3960
4039
  function RouteParameterList(elementType, options) {
3961
- // assert.isTruthy(type.isValid());
3962
4040
  return (/**
3963
4041
  * @param {?} prototype
3964
4042
  * @param {?} propertyKey
@@ -3966,82 +4044,11 @@ function RouteParameterList(elementType, options) {
3966
4044
  */
3967
4045
  function (prototype, propertyKey) {
3968
4046
  /** @type {?} */
3969
- var param = createArrayDefinition(propertyKey, elementType, options);
4047
+ var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
3970
4048
  Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
3971
4049
  UseDelegate()(prototype, propertyKey);
3972
4050
  });
3973
4051
  }
3974
- /**
3975
- * @template T
3976
- * @param {?} propertyName
3977
- * @param {?} type
3978
- * @param {?} options
3979
- * @param {?} routeId
3980
- * @return {?}
3981
- */
3982
- function createDefinition(propertyName, type, options, routeId) {
3983
- /** @type {?} */
3984
- var opts = Opts.get(options);
3985
- /** @type {?} */
3986
- var propertyNameAsString = assert.notNil(propertyName).toString();
3987
- /** @type {?} */
3988
- var def = {
3989
- name: opts.getOptional('as', propertyNameAsString),
3990
- propertyName: propertyNameAsString,
3991
- type: assert.notNil(type),
3992
- sanitiser: opts.getOptional('sanitiser', null),
3993
- isRouteId: routeId,
3994
- isArray: false
3995
- };
3996
- return def;
3997
- }
3998
- /**
3999
- * @template T
4000
- * @param {?} propertyName
4001
- * @param {?} type
4002
- * @param {?} options
4003
- * @return {?}
4004
- */
4005
- function createArrayDefinition(propertyName, type, options) {
4006
- /** @type {?} */
4007
- var opts = Opts.get(options);
4008
- /** @type {?} */
4009
- var propertyNameAsString = assert.notNil(propertyName).toString();
4010
- /** @type {?} */
4011
- var def = {
4012
- name: opts.getOptional('as', propertyNameAsString),
4013
- propertyName: propertyNameAsString,
4014
- type: assert.notNil(type),
4015
- sanitiser: opts.getOptional('sanitiser', null),
4016
- isRouteId: false,
4017
- isArray: true
4018
- };
4019
- return def;
4020
- }
4021
-
4022
- /**
4023
- * @fileoverview added by tsickle
4024
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4025
- */
4026
- /**
4027
- * @record
4028
- * @template T, S
4029
- */
4030
- function ParameterDefinition() { }
4031
- if (false) {
4032
- /** @type {?} */
4033
- ParameterDefinition.prototype.name;
4034
- /** @type {?} */
4035
- ParameterDefinition.prototype.propertyName;
4036
- /** @type {?} */
4037
- ParameterDefinition.prototype.type;
4038
- /** @type {?} */
4039
- ParameterDefinition.prototype.sanitiser;
4040
- /** @type {?} */
4041
- ParameterDefinition.prototype.isRouteId;
4042
- /** @type {?} */
4043
- ParameterDefinition.prototype.isArray;
4044
- }
4045
4052
 
4046
4053
  /**
4047
4054
  * @fileoverview added by tsickle
@@ -4060,20 +4067,6 @@ if (false) {
4060
4067
  */
4061
4068
  ParameterSanitiser.prototype.sanitise = function (value, visit) { };
4062
4069
  }
4063
- (function (ParameterSanitiser) {
4064
- /**
4065
- * @record
4066
- * @template T
4067
- */
4068
- function Options() { }
4069
- ParameterSanitiser.Options = Options;
4070
- if (false) {
4071
- /** @type {?|undefined} */
4072
- Options.prototype.remember;
4073
- /** @type {?|undefined} */
4074
- Options.prototype.defaultValue;
4075
- }
4076
- })(ParameterSanitiser || (ParameterSanitiser = {}));
4077
4070
 
4078
4071
  /**
4079
4072
  * @fileoverview added by tsickle
@@ -4132,7 +4125,7 @@ var ParameterType;
4132
4125
  * @return {?}
4133
4126
  */
4134
4127
  function (value) {
4135
- return isNil(value) || isEmpty(value) ? null : +value;
4128
+ return ___default.isNil(value) || ___default.isEmpty(value) ? null : +value;
4136
4129
  };
4137
4130
  return NumberType;
4138
4131
  }());
@@ -4198,7 +4191,7 @@ Sanitiser = /** @class */ (function () {
4198
4191
  * @return {?}
4199
4192
  */
4200
4193
  function () {
4201
- return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
4194
+ return !___default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
4202
4195
  },
4203
4196
  enumerable: true,
4204
4197
  configurable: true
@@ -4300,11 +4293,10 @@ if (false) {
4300
4293
  Sanitiser.prototype.sanitiser;
4301
4294
  }
4302
4295
  var RouteParameterSanitiser = /** @class */ (function () {
4303
- function RouteParameterSanitiser(parameterDefs, snapshot, placeService, injector) {
4296
+ function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
4304
4297
  var _this = this;
4305
4298
  this.parameterDefs = parameterDefs;
4306
4299
  this.snapshot = snapshot;
4307
- this.placeService = placeService;
4308
4300
  this.injector = injector;
4309
4301
  this.parameterSanitisers = [];
4310
4302
  /** @type {?} */
@@ -4397,17 +4389,7 @@ var RouteParameterSanitiser = /** @class */ (function () {
4397
4389
  * @return {?}
4398
4390
  */
4399
4391
  function (def) {
4400
- if (def.sanitiser) {
4401
- if (this.isSanitiserContructor(def.sanitiser)) {
4402
- return this.injector.get(def.sanitiser, new def.sanitiser());
4403
- }
4404
- else {
4405
- return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
4406
- }
4407
- }
4408
- else {
4409
- return null;
4410
- }
4392
+ return def.getSanitiser(this.injector);
4411
4393
  };
4412
4394
  /**
4413
4395
  * @return {?}
@@ -4453,12 +4435,12 @@ var RouteParameterSanitiser = /** @class */ (function () {
4453
4435
  * @return {?}
4454
4436
  */
4455
4437
  function (value) {
4456
- return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
4438
+ return ___default.isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
4457
4439
  };
4458
4440
  __decorate([
4459
- Memoize(),
4441
+ Memoize$1(),
4460
4442
  __metadata("design:type", Function),
4461
- __metadata("design:paramtypes", [Object]),
4443
+ __metadata("design:paramtypes", [ParameterDefinition]),
4462
4444
  __metadata("design:returntype", Object)
4463
4445
  ], RouteParameterSanitiser.prototype, "getSanitiser", null);
4464
4446
  __decorate([
@@ -4485,8 +4467,6 @@ if (false) {
4485
4467
  /** @type {?} */
4486
4468
  RouteParameterSanitiser.prototype.snapshot;
4487
4469
  /** @type {?} */
4488
- RouteParameterSanitiser.prototype.placeService;
4489
- /** @type {?} */
4490
4470
  RouteParameterSanitiser.prototype.injector;
4491
4471
  }
4492
4472
  (function (Sanitiser) {
@@ -4628,5 +4608,5 @@ if (false) {
4628
4608
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4629
4609
  */
4630
4610
 
4631
- export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DefaultParameterSanitiser, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, DialogInteractionService as ɵbb, InteractionContext as ɵbc, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceService as ɵo, TabbedPlaceNavigationComponent as ɵp, AbstractPlaceNavigationComponent as ɵq, ListPlaceNavComponent as ɵr, InteractionModule as ɵs, ActivityContainerComponent as ɵt, ActivityOutletComponent as ɵu, ConfirmationDialogComponent as ɵv, AbstractActivity as ɵw, ACTIVITY_DATA as ɵx, AlertDialogComponent as ɵz };
4611
+ export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DefaultParameterSanitiser, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterDefinition, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, AlertDialogComponent as ɵba, DialogInteractionService as ɵbc, InteractionContext as ɵbd, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceRouter as ɵo, PlaceHistory as ɵp, TabbedPlaceNavigationComponent as ɵq, AbstractPlaceNavigationComponent as ɵr, ListPlaceNavComponent as ɵs, InteractionModule as ɵt, ActivityContainerComponent as ɵu, ActivityOutletComponent as ɵv, ConfirmationDialogComponent as ɵw, AbstractActivity as ɵx, ACTIVITY_DATA as ɵy };
4632
4612
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map