@coolon/angular-ui-powerups 0.0.43 → 0.0.46
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.
- package/bundles/coolon-angular-ui-powerups.umd.js +1499 -1188
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +16 -15
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +16 -15
- package/esm2015/index.js +2 -2
- package/esm2015/lib/components/disposable-component.js +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.js +1 -1
- package/esm2015/lib/components/resize-aware.component.js +1 -1
- package/esm2015/lib/components/types/bounds.class.js +1 -1
- package/esm2015/lib/components/types/dimension.class.js +1 -1
- package/esm2015/lib/components/types/point.class.js +1 -1
- package/esm2015/lib/directives/command.directive.js +1 -1
- package/esm2015/lib/directives/focus-binding.directive.js +2 -2
- package/esm2015/lib/interaction/alert.js +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +6 -1
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
- package/esm2015/lib/interaction/confirm.js +1 -1
- package/esm2015/lib/interaction/interaction.module.js +2 -2
- package/esm2015/lib/interaction/result.js +1 -1
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +2 -2
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +3 -2
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +135 -84
- package/esm2015/lib/place/components/place-outlet/route-animations.js +2 -2
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
- package/esm2015/lib/place/guards/leave-place.guard.js +12 -10
- package/esm2015/lib/place/guards/place-route.guard.js +40 -33
- package/esm2015/lib/place/index.js +5 -6
- package/esm2015/lib/place/nav-item.js +1 -1
- package/esm2015/lib/place/place-component.js +39 -169
- package/esm2015/lib/place/place-definition.js +79 -0
- package/esm2015/lib/place/place-history.js +77 -0
- package/esm2015/lib/place/place-router.js +98 -0
- package/esm2015/lib/place/place.decorator.js +30 -3
- package/esm2015/lib/place/place.module.js +2 -5
- package/esm2015/lib/place/route/json-types.js +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +7 -60
- package/esm2015/lib/place/route/parameter-definition.class.js +187 -9
- package/esm2015/lib/place/route/parameter-sanitiser.js +4 -17
- package/esm2015/lib/place/route/parameter-snapshot.js +228 -72
- package/esm2015/lib/place/route/parameter-type.js +2 -2
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +7 -21
- package/esm2015/lib/place/visit.js +3 -3
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +16 -15
- package/esm5/index.js +2 -2
- package/esm5/lib/components/disposable-component.js +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm5/lib/components/forms/string-input/string-input.component.js +1 -1
- package/esm5/lib/components/resize-aware.component.js +1 -1
- package/esm5/lib/components/types/bounds.class.js +1 -1
- package/esm5/lib/components/types/dimension.class.js +1 -1
- package/esm5/lib/components/types/point.class.js +1 -1
- package/esm5/lib/directives/command.directive.js +1 -1
- package/esm5/lib/directives/focus-binding.directive.js +2 -2
- package/esm5/lib/interaction/alert.js +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +6 -1
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
- package/esm5/lib/interaction/confirm.js +1 -1
- package/esm5/lib/interaction/interaction.module.js +2 -2
- package/esm5/lib/interaction/result.js +1 -1
- package/esm5/lib/interaction/services/dialog-interaction.service.js +2 -2
- package/esm5/lib/place/components/abstract-place-navigation.component.js +3 -2
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +153 -113
- package/esm5/lib/place/components/place-outlet/route-animations.js +2 -2
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
- package/esm5/lib/place/guards/leave-place.guard.js +12 -10
- package/esm5/lib/place/guards/place-route.guard.js +40 -32
- package/esm5/lib/place/index.js +5 -6
- package/esm5/lib/place/nav-item.js +1 -1
- package/esm5/lib/place/place-component.js +53 -199
- package/esm5/lib/place/place-definition.js +88 -0
- package/esm5/lib/place/place-history.js +90 -0
- package/esm5/lib/place/place-router.js +118 -0
- package/esm5/lib/place/place.decorator.js +30 -3
- package/esm5/lib/place/place.module.js +2 -5
- package/esm5/lib/place/route/json-types.js +1 -1
- package/esm5/lib/place/route/parameter-decorators.js +7 -60
- package/esm5/lib/place/route/parameter-definition.class.js +227 -9
- package/esm5/lib/place/route/parameter-sanitiser.js +4 -17
- package/esm5/lib/place/route/parameter-snapshot.js +295 -80
- package/esm5/lib/place/route/parameter-type.js +2 -2
- package/esm5/lib/place/route/route-parameter-sanitiser.js +7 -20
- package/esm5/lib/place/visit.js +3 -3
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +1144 -904
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1462 -1154
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/index.d.ts +1 -1
- package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +7 -0
- package/lib/place/components/abstract-place-navigation.component.d.ts +3 -2
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +30 -19
- package/lib/place/guards/place-route.guard.d.ts +7 -6
- package/lib/place/index.d.ts +3 -4
- package/lib/place/place-component.d.ts +13 -41
- package/lib/place/place-definition.d.ts +20 -0
- package/lib/place/place-history.d.ts +13 -0
- package/lib/place/place-router.d.ts +10 -0
- package/lib/place/place.decorator.d.ts +13 -1
- package/lib/place/route/parameter-decorators.d.ts +0 -4
- package/lib/place/route/parameter-definition.class.d.ts +39 -6
- package/lib/place/route/parameter-sanitiser.d.ts +3 -8
- package/lib/place/route/parameter-snapshot.d.ts +15 -12
- package/lib/place/route/route-parameter-sanitiser.d.ts +1 -3
- package/lib/place/visit.d.ts +4 -4
- package/package.json +1 -1
- package/schematics/place-routes/index.js.map +1 -1
- package/schematics/place-routes/place-def.js +1 -1
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/place-routes/templates/place-destinations.ts.template +21 -0
- package/schematics/place-routes/templates/{places.ts.template → place-routes.ts.template} +1 -13
- package/esm2015/lib/place/place-component-like.js +0 -17
- package/esm2015/lib/place/place-updates-service.js +0 -16
- package/esm2015/lib/place/place.service.js +0 -102
- package/esm2015/lib/place/route/default-parameter-sanitiser.js +0 -78
- package/esm5/lib/place/place-component-like.js +0 -17
- package/esm5/lib/place/place-updates-service.js +0 -16
- package/esm5/lib/place/place.service.js +0 -136
- package/esm5/lib/place/route/default-parameter-sanitiser.js +0 -85
- package/lib/place/place-component-like.d.ts +0 -5
- package/lib/place/place-updates-service.d.ts +0 -10
- package/lib/place/place.service.d.ts +0 -22
- package/lib/place/route/default-parameter-sanitiser.d.ts +0 -13
|
@@ -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,
|
|
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,
|
|
17
|
-
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
18
|
-
import { Memoize
|
|
19
|
-
import { isNil, isEqual, isEmpty, isFunction } from 'lodash';
|
|
16
|
+
import { Router, ActivatedRouteSnapshot, UrlTree, 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(
|
|
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'\"
|
|
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\"
|
|
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,1039 +1763,1490 @@ 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
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
this.
|
|
1768
|
-
this.
|
|
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
|
-
|
|
1775
|
-
* @param {?} other
|
|
1779
|
+
PlaceDefinition.prototype.getRouteParameters = /**
|
|
1776
1780
|
* @return {?}
|
|
1777
1781
|
*/
|
|
1778
|
-
function (
|
|
1779
|
-
|
|
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
|
-
* @
|
|
1786
|
+
* @template T
|
|
1787
|
+
* @param {?} key
|
|
1788
|
+
* @param {?=} defaultValue
|
|
1794
1789
|
* @return {?}
|
|
1795
1790
|
*/
|
|
1796
|
-
|
|
1797
|
-
* @
|
|
1791
|
+
PlaceDefinition.prototype.getData = /**
|
|
1792
|
+
* @template T
|
|
1793
|
+
* @param {?} key
|
|
1794
|
+
* @param {?=} defaultValue
|
|
1798
1795
|
* @return {?}
|
|
1799
1796
|
*/
|
|
1800
|
-
function (
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
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
|
-
|
|
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
|
-
* @
|
|
1826
|
-
* @param {?} parameterDef
|
|
1864
|
+
* @param {?} resolvedParameters
|
|
1827
1865
|
* @return {?}
|
|
1828
1866
|
*/
|
|
1829
|
-
|
|
1830
|
-
* @
|
|
1831
|
-
* @param {?} parameterDef
|
|
1867
|
+
PlaceComponent.prototype.initialiseBindings = /**
|
|
1868
|
+
* @param {?} resolvedParameters
|
|
1832
1869
|
* @return {?}
|
|
1833
1870
|
*/
|
|
1834
|
-
function (
|
|
1835
|
-
|
|
1836
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
1854
|
-
|
|
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.getValueOf(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
|
-
|
|
1944
|
+
PlaceComponent.prototype.canDeactivate = /**
|
|
1860
1945
|
* @return {?}
|
|
1861
1946
|
*/
|
|
1862
1947
|
function () {
|
|
1863
|
-
return
|
|
1948
|
+
return true;
|
|
1864
1949
|
};
|
|
1865
1950
|
/**
|
|
1866
|
-
* @param {?} name
|
|
1867
1951
|
* @return {?}
|
|
1868
1952
|
*/
|
|
1869
|
-
|
|
1870
|
-
* @param {?} name
|
|
1953
|
+
PlaceComponent.prototype.onPlaceReady = /**
|
|
1871
1954
|
* @return {?}
|
|
1872
1955
|
*/
|
|
1873
|
-
function (
|
|
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
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
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
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
return !!this.getResolvedRouteId();
|
|
1907
|
-
};
|
|
1977
|
+
function isPlaceComponentConstructor(target) {
|
|
1978
|
+
return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
|
|
1979
|
+
}
|
|
1980
|
+
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
1908
1981
|
/**
|
|
1982
|
+
* @param {?} klass
|
|
1909
1983
|
* @return {?}
|
|
1910
1984
|
*/
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
/** @type {?} */
|
|
1916
|
-
var routeIdParam = this.getResolvedRouteId();
|
|
1917
|
-
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
1918
|
-
};
|
|
1985
|
+
function getRouteParameters(klass) {
|
|
1986
|
+
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
1987
|
+
}
|
|
1988
|
+
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
1919
1989
|
/**
|
|
1990
|
+
* @param {?} klass
|
|
1920
1991
|
* @return {?}
|
|
1921
1992
|
*/
|
|
1922
|
-
|
|
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
|
|
1923
2000
|
* @return {?}
|
|
1924
2001
|
*/
|
|
1925
|
-
function () {
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
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
|
|
1935
2019
|
* @return {?}
|
|
1936
2020
|
*/
|
|
1937
|
-
function (
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
return params;
|
|
1941
|
-
};
|
|
2021
|
+
function (c) { return PlaceComponent.getDefinition(c); }));
|
|
2022
|
+
return _this;
|
|
2023
|
+
}
|
|
1942
2024
|
/**
|
|
1943
|
-
* @
|
|
1944
|
-
* @param {?} parameter
|
|
1945
|
-
* @param {?} value
|
|
2025
|
+
* @param {?} placeDef
|
|
1946
2026
|
* @return {?}
|
|
1947
2027
|
*/
|
|
1948
|
-
|
|
1949
|
-
* @
|
|
1950
|
-
* @param {?} parameter
|
|
1951
|
-
* @param {?} value
|
|
2028
|
+
AbstractPlaceNavigationComponent.prototype.getNav = /**
|
|
2029
|
+
* @param {?} placeDef
|
|
1952
2030
|
* @return {?}
|
|
1953
2031
|
*/
|
|
1954
|
-
function (
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
2032
|
+
function (placeDef) {
|
|
2033
|
+
/** @type {?} */
|
|
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
|
+
};
|
|
1962
2049
|
};
|
|
1963
2050
|
/**
|
|
1964
|
-
* @param {?} url
|
|
1965
2051
|
* @return {?}
|
|
1966
2052
|
*/
|
|
1967
|
-
|
|
1968
|
-
* @param {?} url
|
|
2053
|
+
AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
1969
2054
|
* @return {?}
|
|
1970
2055
|
*/
|
|
1971
|
-
function (
|
|
1972
|
-
|
|
2056
|
+
function () {
|
|
2057
|
+
};
|
|
2058
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
2059
|
+
places: [{ type: Input }],
|
|
2060
|
+
placesModel: [{ type: Input }]
|
|
1973
2061
|
};
|
|
1974
|
-
var _a;
|
|
1975
|
-
__decorate([
|
|
1976
|
-
Memoize(),
|
|
1977
|
-
__metadata("design:type", Function),
|
|
1978
|
-
__metadata("design:paramtypes", [Object]),
|
|
1979
|
-
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
1980
|
-
], ParameterSnapshot.prototype, "getResolvedParameter", null);
|
|
1981
2062
|
__decorate([
|
|
1982
|
-
|
|
1983
|
-
__metadata("design:type",
|
|
1984
|
-
|
|
1985
|
-
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
1986
|
-
], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
|
|
2063
|
+
StoreInListModel('placesModel'),
|
|
2064
|
+
__metadata("design:type", Array)
|
|
2065
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
1987
2066
|
__decorate([
|
|
1988
|
-
|
|
1989
|
-
__metadata("design:type",
|
|
1990
|
-
|
|
1991
|
-
__metadata("design:returntype", Object)
|
|
1992
|
-
], ParameterSnapshot.prototype, "getRouteParameter", null);
|
|
2067
|
+
UseDelegate(),
|
|
2068
|
+
__metadata("design:type", ListModel)
|
|
2069
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
1993
2070
|
__decorate([
|
|
1994
|
-
Memoize(),
|
|
2071
|
+
Memoize$1(),
|
|
1995
2072
|
__metadata("design:type", Function),
|
|
1996
|
-
__metadata("design:paramtypes", []),
|
|
1997
|
-
__metadata("design:returntype",
|
|
1998
|
-
],
|
|
1999
|
-
return
|
|
2000
|
-
}());
|
|
2073
|
+
__metadata("design:paramtypes", [PlaceDefinition]),
|
|
2074
|
+
__metadata("design:returntype", Object)
|
|
2075
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
2076
|
+
return AbstractPlaceNavigationComponent;
|
|
2077
|
+
}(DisposableComponent));
|
|
2001
2078
|
if (false) {
|
|
2002
2079
|
/** @type {?} */
|
|
2003
|
-
|
|
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
|
-
* @
|
|
2006
|
-
* @private
|
|
2099
|
+
* @return {?}
|
|
2007
2100
|
*/
|
|
2008
|
-
|
|
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
|
-
|
|
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 = new Map();
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* @param {?} state
|
|
2155
|
+
* @return {?}
|
|
2156
|
+
*/
|
|
2157
|
+
PlaceHistory.prototype.add = /**
|
|
2158
|
+
* @param {?} state
|
|
2159
|
+
* @return {?}
|
|
2160
|
+
*/
|
|
2161
|
+
function (state) {
|
|
2162
|
+
/** @type {?} */
|
|
2163
|
+
var history = this.getHistory(state.placeDefinition);
|
|
2164
|
+
/** @type {?} */
|
|
2165
|
+
var previousState = ___default.last(history);
|
|
2166
|
+
if (!previousState || state.hasChanged(previousState)) {
|
|
2167
|
+
history.unshift(state); // LIFO
|
|
2168
|
+
this.setHistory(state.placeDefinition, history.slice(-3)); // limit our history to 3 visits
|
|
2169
|
+
}
|
|
2170
|
+
};
|
|
2011
2171
|
/**
|
|
2012
2172
|
* @param {?} placeDef
|
|
2013
|
-
* @param {?} paramMap
|
|
2014
2173
|
* @return {?}
|
|
2015
2174
|
*/
|
|
2016
|
-
|
|
2175
|
+
PlaceHistory.prototype.getHistory = /**
|
|
2176
|
+
* @param {?} placeDef
|
|
2177
|
+
* @return {?}
|
|
2178
|
+
*/
|
|
2179
|
+
function (placeDef) {
|
|
2017
2180
|
/** @type {?} */
|
|
2018
|
-
var
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2181
|
+
var history = this._history.get(placeDef);
|
|
2182
|
+
if (!history) {
|
|
2183
|
+
history = [];
|
|
2184
|
+
this.setHistory(placeDef, history);
|
|
2185
|
+
}
|
|
2186
|
+
return history;
|
|
2187
|
+
};
|
|
2188
|
+
/**
|
|
2189
|
+
* @private
|
|
2190
|
+
* @param {?} placeDef
|
|
2191
|
+
* @param {?} history
|
|
2192
|
+
* @return {?}
|
|
2193
|
+
*/
|
|
2194
|
+
PlaceHistory.prototype.setHistory = /**
|
|
2195
|
+
* @private
|
|
2196
|
+
* @param {?} placeDef
|
|
2197
|
+
* @param {?} history
|
|
2198
|
+
* @return {?}
|
|
2199
|
+
*/
|
|
2200
|
+
function (placeDef, history) {
|
|
2201
|
+
this._history.set(placeDef, history);
|
|
2202
|
+
};
|
|
2203
|
+
PlaceHistory.decorators = [
|
|
2204
|
+
{ type: Injectable, args: [{
|
|
2205
|
+
providedIn: 'root'
|
|
2206
|
+
},] }
|
|
2207
|
+
];
|
|
2208
|
+
/** @nocollapse */
|
|
2209
|
+
PlaceHistory.ctorParameters = function () { return [
|
|
2210
|
+
{ type: Router }
|
|
2211
|
+
]; };
|
|
2212
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
2213
|
+
return PlaceHistory;
|
|
2214
|
+
}());
|
|
2215
|
+
if (false) {
|
|
2216
|
+
/**
|
|
2217
|
+
* @type {?}
|
|
2218
|
+
* @private
|
|
2219
|
+
*/
|
|
2220
|
+
PlaceHistory.prototype._history;
|
|
2221
|
+
/**
|
|
2222
|
+
* @type {?}
|
|
2223
|
+
* @private
|
|
2224
|
+
*/
|
|
2225
|
+
PlaceHistory.prototype.router;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* @fileoverview added by tsickle
|
|
2230
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2231
|
+
*/
|
|
2232
|
+
/**
|
|
2233
|
+
* @abstract
|
|
2234
|
+
* @template T, S
|
|
2235
|
+
*/
|
|
2236
|
+
var /**
|
|
2237
|
+
* @abstract
|
|
2238
|
+
* @template T, S
|
|
2239
|
+
*/
|
|
2240
|
+
ParameterDefinition = /** @class */ (function () {
|
|
2241
|
+
function ParameterDefinition(propertyName, type, options) {
|
|
2242
|
+
this.propertyName = propertyName;
|
|
2243
|
+
this.type = type;
|
|
2244
|
+
/** @type {?} */
|
|
2245
|
+
var opts = Opts.get(options);
|
|
2246
|
+
this.name = opts.getOptional('as', propertyName);
|
|
2247
|
+
this.remember = opts.getOptional('remember', false);
|
|
2248
|
+
this.defaultValue = opts.getOptional('defaultValue', null);
|
|
2040
2249
|
}
|
|
2041
|
-
ParameterSnapshot.create = create;
|
|
2042
2250
|
/**
|
|
2043
|
-
* @
|
|
2044
|
-
* @
|
|
2251
|
+
* @param {?} injector
|
|
2252
|
+
* @return {?}
|
|
2253
|
+
*/
|
|
2254
|
+
ParameterDefinition.prototype.getSanitiser = /**
|
|
2255
|
+
* @param {?} injector
|
|
2256
|
+
* @return {?}
|
|
2257
|
+
*/
|
|
2258
|
+
function (injector) {
|
|
2259
|
+
if (this.remember || !___default.isNil(this.defaultValue)) {
|
|
2260
|
+
return new ParameterDefinition.DefaultParameterSanitiser(this.remember, this.defaultValue, injector.get(PlaceHistory));
|
|
2261
|
+
}
|
|
2262
|
+
else {
|
|
2263
|
+
return null;
|
|
2264
|
+
}
|
|
2265
|
+
};
|
|
2266
|
+
return ParameterDefinition;
|
|
2267
|
+
}());
|
|
2268
|
+
if (false) {
|
|
2269
|
+
/** @type {?} */
|
|
2270
|
+
ParameterDefinition.prototype.isRouteId;
|
|
2271
|
+
/** @type {?} */
|
|
2272
|
+
ParameterDefinition.prototype.isArray;
|
|
2273
|
+
/** @type {?} */
|
|
2274
|
+
ParameterDefinition.prototype.name;
|
|
2275
|
+
/**
|
|
2276
|
+
* @type {?}
|
|
2277
|
+
* @private
|
|
2278
|
+
*/
|
|
2279
|
+
ParameterDefinition.prototype.remember;
|
|
2280
|
+
/**
|
|
2281
|
+
* @type {?}
|
|
2282
|
+
* @private
|
|
2283
|
+
*/
|
|
2284
|
+
ParameterDefinition.prototype.defaultValue;
|
|
2285
|
+
/** @type {?} */
|
|
2286
|
+
ParameterDefinition.prototype.propertyName;
|
|
2287
|
+
/** @type {?} */
|
|
2288
|
+
ParameterDefinition.prototype.type;
|
|
2289
|
+
}
|
|
2290
|
+
(function (ParameterDefinition) {
|
|
2291
|
+
/**
|
|
2292
|
+
* @record
|
|
2293
|
+
* @template T
|
|
2294
|
+
*/
|
|
2295
|
+
function Options() { }
|
|
2296
|
+
ParameterDefinition.Options = Options;
|
|
2297
|
+
if (false) {
|
|
2298
|
+
/** @type {?|undefined} */
|
|
2299
|
+
Options.prototype.as;
|
|
2300
|
+
/** @type {?|undefined} */
|
|
2301
|
+
Options.prototype.optional;
|
|
2302
|
+
/** @type {?|undefined} */
|
|
2303
|
+
Options.prototype.remember;
|
|
2304
|
+
/** @type {?|undefined} */
|
|
2305
|
+
Options.prototype.defaultValue;
|
|
2306
|
+
}
|
|
2307
|
+
/**
|
|
2308
|
+
* @template T
|
|
2045
2309
|
*/
|
|
2046
2310
|
var /**
|
|
2047
|
-
* @
|
|
2048
|
-
* @template T, S
|
|
2311
|
+
* @template T
|
|
2049
2312
|
*/
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2313
|
+
RouteId = /** @class */ (function (_super) {
|
|
2314
|
+
__extends(RouteId, _super);
|
|
2315
|
+
function RouteId() {
|
|
2316
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2317
|
+
_this.isRouteId = true;
|
|
2318
|
+
_this.isArray = false;
|
|
2319
|
+
return _this;
|
|
2054
2320
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
ResolvedParameter.prototype.isRouteId = /**
|
|
2059
|
-
* @return {?}
|
|
2060
|
-
*/
|
|
2061
|
-
function () {
|
|
2062
|
-
return this.parameterDef.isRouteId;
|
|
2063
|
-
};
|
|
2064
|
-
return ResolvedParameter;
|
|
2065
|
-
}());
|
|
2066
|
-
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
2321
|
+
return RouteId;
|
|
2322
|
+
}(ParameterDefinition));
|
|
2323
|
+
ParameterDefinition.RouteId = RouteId;
|
|
2067
2324
|
if (false) {
|
|
2068
2325
|
/** @type {?} */
|
|
2069
|
-
|
|
2326
|
+
RouteId.prototype.isRouteId;
|
|
2070
2327
|
/** @type {?} */
|
|
2071
|
-
|
|
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
|
|
2092
|
-
* @return {?}
|
|
2093
|
-
*/
|
|
2094
|
-
ResolvedParameter.prototype.replace = function (value) { };
|
|
2328
|
+
RouteId.prototype.isArray;
|
|
2095
2329
|
}
|
|
2096
2330
|
/**
|
|
2097
2331
|
* @template T
|
|
2098
2332
|
*/
|
|
2099
|
-
var
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2333
|
+
var /**
|
|
2334
|
+
* @template T
|
|
2335
|
+
*/
|
|
2336
|
+
ValueParameter = /** @class */ (function (_super) {
|
|
2337
|
+
__extends(ValueParameter, _super);
|
|
2338
|
+
function ValueParameter() {
|
|
2339
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2340
|
+
_this.isRouteId = false;
|
|
2341
|
+
_this.isArray = false;
|
|
2342
|
+
return _this;
|
|
2103
2343
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
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;
|
|
2344
|
+
return ValueParameter;
|
|
2345
|
+
}(ParameterDefinition));
|
|
2346
|
+
ParameterDefinition.ValueParameter = ValueParameter;
|
|
2347
|
+
if (false) {
|
|
2348
|
+
/** @type {?} */
|
|
2349
|
+
ValueParameter.prototype.isRouteId;
|
|
2350
|
+
/** @type {?} */
|
|
2351
|
+
ValueParameter.prototype.isArray;
|
|
2352
|
+
}
|
|
2155
2353
|
/**
|
|
2156
2354
|
* @template T
|
|
2157
2355
|
*/
|
|
2158
|
-
var
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2356
|
+
var /**
|
|
2357
|
+
* @template T
|
|
2358
|
+
*/
|
|
2359
|
+
ArrayParameter = /** @class */ (function (_super) {
|
|
2360
|
+
__extends(ArrayParameter, _super);
|
|
2361
|
+
function ArrayParameter() {
|
|
2362
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2363
|
+
_this.isRouteId = false;
|
|
2364
|
+
_this.isArray = true;
|
|
2365
|
+
return _this;
|
|
2366
|
+
}
|
|
2367
|
+
return ArrayParameter;
|
|
2368
|
+
}(ParameterDefinition));
|
|
2369
|
+
ParameterDefinition.ArrayParameter = ArrayParameter;
|
|
2370
|
+
if (false) {
|
|
2371
|
+
/** @type {?} */
|
|
2372
|
+
ArrayParameter.prototype.isRouteId;
|
|
2373
|
+
/** @type {?} */
|
|
2374
|
+
ArrayParameter.prototype.isArray;
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* @template T, S
|
|
2378
|
+
*/
|
|
2379
|
+
var /**
|
|
2380
|
+
* @template T, S
|
|
2381
|
+
*/
|
|
2382
|
+
DefaultParameterSanitiser = /** @class */ (function () {
|
|
2383
|
+
function DefaultParameterSanitiser(remember, defaultValue, placeHistory) {
|
|
2384
|
+
this.remember = remember;
|
|
2385
|
+
this.defaultValue = defaultValue;
|
|
2386
|
+
this.placeHistory = placeHistory;
|
|
2162
2387
|
}
|
|
2163
2388
|
/**
|
|
2164
|
-
* @param {?}
|
|
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
|
-
/**
|
|
2389
|
+
* @param {?} parameterDef
|
|
2191
2390
|
* @param {?} value
|
|
2391
|
+
* @param {?=} visit
|
|
2192
2392
|
* @return {?}
|
|
2193
2393
|
*/
|
|
2194
|
-
|
|
2394
|
+
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
2395
|
+
* @param {?} parameterDef
|
|
2195
2396
|
* @param {?} value
|
|
2397
|
+
* @param {?=} visit
|
|
2196
2398
|
* @return {?}
|
|
2197
2399
|
*/
|
|
2198
|
-
function (value) {
|
|
2199
|
-
|
|
2400
|
+
function (parameterDef, value, visit) {
|
|
2401
|
+
var _this = this;
|
|
2402
|
+
if (this.isBlank(parameterDef, value)) {
|
|
2403
|
+
if (this.remember) {
|
|
2404
|
+
/** @type {?} */
|
|
2405
|
+
var visits = this.placeHistory.getHistory(visit.placeDefinition);
|
|
2406
|
+
value = visits.map((/**
|
|
2407
|
+
* @param {?} v
|
|
2408
|
+
* @return {?}
|
|
2409
|
+
*/
|
|
2410
|
+
function (v) { return v.getValueOf(parameterDef); }))
|
|
2411
|
+
.filter((/**
|
|
2412
|
+
* @param {?} v
|
|
2413
|
+
* @return {?}
|
|
2414
|
+
*/
|
|
2415
|
+
function (v) { return !___default.isNil(v); }))
|
|
2416
|
+
.find((/**
|
|
2417
|
+
* @param {?} v
|
|
2418
|
+
* @return {?}
|
|
2419
|
+
*/
|
|
2420
|
+
function (v) { return !_this.isBlank(parameterDef, v); }));
|
|
2421
|
+
}
|
|
2422
|
+
value = this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2423
|
+
console.log(parameterDef.name + " is blank, returning: " + value);
|
|
2424
|
+
return value;
|
|
2425
|
+
}
|
|
2426
|
+
else {
|
|
2427
|
+
console.log(parameterDef.name + " is not blank");
|
|
2428
|
+
return value;
|
|
2429
|
+
}
|
|
2200
2430
|
};
|
|
2201
2431
|
/**
|
|
2432
|
+
* @private
|
|
2433
|
+
* @param {?} def
|
|
2434
|
+
* @param {?} value
|
|
2202
2435
|
* @return {?}
|
|
2203
2436
|
*/
|
|
2204
|
-
|
|
2437
|
+
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
2438
|
+
* @private
|
|
2439
|
+
* @param {?} def
|
|
2440
|
+
* @param {?} value
|
|
2205
2441
|
* @return {?}
|
|
2206
2442
|
*/
|
|
2207
|
-
function () {
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
* @return {?}
|
|
2212
|
-
*/
|
|
2213
|
-
function (v) { return _this.parameterDef.type.format(v); })) : [];
|
|
2443
|
+
function (def, value) {
|
|
2444
|
+
/** @type {?} */
|
|
2445
|
+
var isNil = ___default.isNil(value);
|
|
2446
|
+
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2214
2447
|
};
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2448
|
+
return DefaultParameterSanitiser;
|
|
2449
|
+
}());
|
|
2450
|
+
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
2451
|
+
if (false) {
|
|
2452
|
+
/** @type {?} */
|
|
2453
|
+
DefaultParameterSanitiser.prototype.remember;
|
|
2454
|
+
/** @type {?} */
|
|
2455
|
+
DefaultParameterSanitiser.prototype.defaultValue;
|
|
2456
|
+
/** @type {?} */
|
|
2457
|
+
DefaultParameterSanitiser.prototype.placeHistory;
|
|
2458
|
+
}
|
|
2459
|
+
})(ParameterDefinition || (ParameterDefinition = {}));
|
|
2225
2460
|
|
|
2226
2461
|
/**
|
|
2227
2462
|
* @fileoverview added by tsickle
|
|
2228
2463
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2229
2464
|
*/
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
.last()
|
|
2251
|
-
.map((/**
|
|
2252
|
-
* @param {?} params
|
|
2253
|
-
* @return {?}
|
|
2254
|
-
*/
|
|
2255
|
-
function (params) { return ParameterSnapshot.create(_this.placeDefinition, params); }))
|
|
2256
|
-
.subscribe((/**
|
|
2257
|
-
* @param {?} resolvedParameters
|
|
2465
|
+
var ParameterSnapshot = /** @class */ (function () {
|
|
2466
|
+
function ParameterSnapshot(placeDefinition, resolved) {
|
|
2467
|
+
this.placeDefinition = placeDefinition;
|
|
2468
|
+
this.resolved = resolved;
|
|
2469
|
+
}
|
|
2470
|
+
/**
|
|
2471
|
+
* @param {?} other
|
|
2472
|
+
* @param {?=} debug
|
|
2473
|
+
* @return {?}
|
|
2474
|
+
*/
|
|
2475
|
+
ParameterSnapshot.prototype.hasChanged = /**
|
|
2476
|
+
* @param {?} other
|
|
2477
|
+
* @param {?=} debug
|
|
2478
|
+
* @return {?}
|
|
2479
|
+
*/
|
|
2480
|
+
function (other, debug) {
|
|
2481
|
+
if (debug === void 0) { debug = false; }
|
|
2482
|
+
/** @type {?} */
|
|
2483
|
+
var changed = this.resolved.find((/**
|
|
2484
|
+
* @param {?} r
|
|
2258
2485
|
* @return {?}
|
|
2259
2486
|
*/
|
|
2260
|
-
function (
|
|
2261
|
-
|
|
2262
|
-
_this.resolvedParameters.value = resolvedParameters;
|
|
2263
|
-
_this._incomingRouteChange.value = false;
|
|
2487
|
+
function (r) {
|
|
2488
|
+
return !r.isSame(other.getValueOf(r.parameterDef));
|
|
2264
2489
|
}));
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
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.
|
|
2490
|
+
if (changed && debug) {
|
|
2491
|
+
console.log({
|
|
2492
|
+
name: changed.parameterDef.name,
|
|
2493
|
+
mine: changed.value,
|
|
2494
|
+
theirs: other.getValueOf(changed.parameterDef)
|
|
2276
2495
|
});
|
|
2277
|
-
}
|
|
2278
|
-
return
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2496
|
+
}
|
|
2497
|
+
return !!changed;
|
|
2498
|
+
};
|
|
2499
|
+
/**
|
|
2500
|
+
* @template T, S
|
|
2501
|
+
* @param {?} parameterDef
|
|
2502
|
+
* @return {?}
|
|
2503
|
+
*/
|
|
2504
|
+
ParameterSnapshot.prototype.getParameter = /**
|
|
2505
|
+
* @template T, S
|
|
2506
|
+
* @param {?} parameterDef
|
|
2507
|
+
* @return {?}
|
|
2508
|
+
*/
|
|
2509
|
+
function (parameterDef) {
|
|
2510
|
+
return this.resolved.find((/**
|
|
2511
|
+
* @param {?} r
|
|
2282
2512
|
* @return {?}
|
|
2283
2513
|
*/
|
|
2284
|
-
function () {
|
|
2285
|
-
|
|
2286
|
-
},
|
|
2287
|
-
enumerable: true,
|
|
2288
|
-
configurable: true
|
|
2289
|
-
});
|
|
2514
|
+
function (r) { return r.parameterDef === parameterDef; }));
|
|
2515
|
+
};
|
|
2290
2516
|
/**
|
|
2291
|
-
* @private
|
|
2292
2517
|
* @template T, S
|
|
2293
2518
|
* @param {?} parameterDef
|
|
2294
2519
|
* @return {?}
|
|
2295
2520
|
*/
|
|
2296
|
-
|
|
2297
|
-
* @private
|
|
2521
|
+
ParameterSnapshot.prototype.getValueOf = /**
|
|
2298
2522
|
* @template T, S
|
|
2299
2523
|
* @param {?} parameterDef
|
|
2300
2524
|
* @return {?}
|
|
2301
2525
|
*/
|
|
2302
2526
|
function (parameterDef) {
|
|
2303
2527
|
/** @type {?} */
|
|
2304
|
-
var
|
|
2305
|
-
|
|
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
|
-
}));
|
|
2528
|
+
var resolvedParameter = this.getParameter(parameterDef);
|
|
2529
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
2323
2530
|
};
|
|
2324
|
-
|
|
2325
|
-
|
|
2531
|
+
/**
|
|
2532
|
+
* @return {?}
|
|
2533
|
+
*/
|
|
2534
|
+
ParameterSnapshot.prototype.getRouteIdValue = /**
|
|
2535
|
+
* @return {?}
|
|
2536
|
+
*/
|
|
2537
|
+
function () {
|
|
2538
|
+
return this.getRouteIdParameter() ? this.getRouteIdParameter().value : null;
|
|
2539
|
+
};
|
|
2540
|
+
/**
|
|
2541
|
+
* @param {?} name
|
|
2542
|
+
* @return {?}
|
|
2543
|
+
*/
|
|
2544
|
+
ParameterSnapshot.prototype.getParameterValue = /**
|
|
2545
|
+
* @param {?} name
|
|
2546
|
+
* @return {?}
|
|
2547
|
+
*/
|
|
2548
|
+
function (name) {
|
|
2549
|
+
/** @type {?} */
|
|
2550
|
+
var resolvedParameter = this.resolved.find((/**
|
|
2551
|
+
* @param {?} r
|
|
2326
2552
|
* @return {?}
|
|
2327
2553
|
*/
|
|
2328
|
-
function () {
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
enumerable: true,
|
|
2332
|
-
configurable: true
|
|
2333
|
-
});
|
|
2554
|
+
function (r) { return r.parameterDef.name === name; }));
|
|
2555
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
2556
|
+
};
|
|
2334
2557
|
/**
|
|
2558
|
+
* @private
|
|
2335
2559
|
* @return {?}
|
|
2336
2560
|
*/
|
|
2337
|
-
|
|
2561
|
+
ParameterSnapshot.prototype.getRouteIdParameter = /**
|
|
2562
|
+
* @private
|
|
2338
2563
|
* @return {?}
|
|
2339
2564
|
*/
|
|
2340
2565
|
function () {
|
|
2341
|
-
|
|
2566
|
+
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
2567
|
+
// capture this in the type system though
|
|
2568
|
+
return (/** @type {?} */ (this.resolved.find((/**
|
|
2569
|
+
* @param {?} p
|
|
2570
|
+
* @return {?}
|
|
2571
|
+
*/
|
|
2572
|
+
function (p) { return p.parameterDef.isRouteId; }))));
|
|
2573
|
+
};
|
|
2574
|
+
/**
|
|
2575
|
+
* @private
|
|
2576
|
+
* @return {?}
|
|
2577
|
+
*/
|
|
2578
|
+
ParameterSnapshot.prototype.getRouteParameters = /**
|
|
2579
|
+
* @private
|
|
2580
|
+
* @return {?}
|
|
2581
|
+
*/
|
|
2582
|
+
function () {
|
|
2583
|
+
return this.resolved.filter((/**
|
|
2584
|
+
* @param {?} r
|
|
2585
|
+
* @return {?}
|
|
2586
|
+
*/
|
|
2587
|
+
function (r) { return !r.parameterDef.isRouteId; }));
|
|
2588
|
+
};
|
|
2589
|
+
/**
|
|
2590
|
+
* @return {?}
|
|
2591
|
+
*/
|
|
2592
|
+
ParameterSnapshot.prototype.hasRouteId = /**
|
|
2593
|
+
* @return {?}
|
|
2594
|
+
*/
|
|
2595
|
+
function () {
|
|
2596
|
+
return !!this.getRouteIdParameter();
|
|
2597
|
+
};
|
|
2598
|
+
/**
|
|
2599
|
+
* @return {?}
|
|
2600
|
+
*/
|
|
2601
|
+
ParameterSnapshot.prototype.getFormattedRouteId = /**
|
|
2602
|
+
* @return {?}
|
|
2603
|
+
*/
|
|
2604
|
+
function () {
|
|
2605
|
+
/** @type {?} */
|
|
2606
|
+
var routeIdParam = this.getRouteIdParameter();
|
|
2607
|
+
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
2342
2608
|
};
|
|
2343
|
-
// @Trace()
|
|
2344
|
-
// @Trace()
|
|
2345
2609
|
/**
|
|
2346
2610
|
* @return {?}
|
|
2347
2611
|
*/
|
|
2348
|
-
|
|
2349
|
-
|
|
2612
|
+
ParameterSnapshot.prototype.getFormattedParameters = /**
|
|
2613
|
+
* @return {?}
|
|
2614
|
+
*/
|
|
2615
|
+
function () {
|
|
2616
|
+
/** @type {?} */
|
|
2617
|
+
var params = {};
|
|
2618
|
+
/** @type {?} */
|
|
2619
|
+
var routeIdParam = this.resolved.filter((/**
|
|
2620
|
+
* @param {?} p
|
|
2621
|
+
* @return {?}
|
|
2622
|
+
*/
|
|
2623
|
+
function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
|
|
2624
|
+
* @param {?} p
|
|
2625
|
+
* @return {?}
|
|
2626
|
+
*/
|
|
2627
|
+
function (p) {
|
|
2628
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
2629
|
+
}));
|
|
2630
|
+
return params;
|
|
2631
|
+
};
|
|
2350
2632
|
/**
|
|
2351
2633
|
* @return {?}
|
|
2352
2634
|
*/
|
|
2635
|
+
ParameterSnapshot.prototype.getAllFormattedParameters = /**
|
|
2636
|
+
* @return {?}
|
|
2637
|
+
*/
|
|
2353
2638
|
function () {
|
|
2639
|
+
/** @type {?} */
|
|
2640
|
+
var params = {};
|
|
2641
|
+
/** @type {?} */
|
|
2642
|
+
var routeIdParam = this.resolved.forEach((/**
|
|
2643
|
+
* @param {?} p
|
|
2644
|
+
* @return {?}
|
|
2645
|
+
*/
|
|
2646
|
+
function (p) {
|
|
2647
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
2648
|
+
}));
|
|
2649
|
+
return params;
|
|
2650
|
+
};
|
|
2651
|
+
/**
|
|
2652
|
+
* @template T, S
|
|
2653
|
+
* @param {?} parameter
|
|
2654
|
+
* @param {?} value
|
|
2655
|
+
* @return {?}
|
|
2656
|
+
*/
|
|
2657
|
+
ParameterSnapshot.prototype.replace = /**
|
|
2658
|
+
* @template T, S
|
|
2659
|
+
* @param {?} parameter
|
|
2660
|
+
* @param {?} value
|
|
2661
|
+
* @return {?}
|
|
2662
|
+
*/
|
|
2663
|
+
function (parameter, value) {
|
|
2664
|
+
return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
|
|
2665
|
+
* @param {?} p
|
|
2666
|
+
* @return {?}
|
|
2667
|
+
*/
|
|
2668
|
+
function (p) {
|
|
2669
|
+
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2670
|
+
})));
|
|
2671
|
+
};
|
|
2672
|
+
/**
|
|
2673
|
+
* @param {?} injector
|
|
2674
|
+
* @return {?}
|
|
2675
|
+
*/
|
|
2676
|
+
ParameterSnapshot.prototype.sanitise = /**
|
|
2677
|
+
* @param {?} injector
|
|
2678
|
+
* @return {?}
|
|
2679
|
+
*/
|
|
2680
|
+
function (injector) {
|
|
2681
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2682
|
+
var routeId, sanitisedValue, result, routeParameters, i, sanitisedValue;
|
|
2683
|
+
return __generator(this, function (_a) {
|
|
2684
|
+
switch (_a.label) {
|
|
2685
|
+
case 0:
|
|
2686
|
+
if (!this.hasRouteId()) return [3 /*break*/, 2];
|
|
2687
|
+
routeId = this.getRouteIdParameter();
|
|
2688
|
+
return [4 /*yield*/, routeId.sanitise(this, injector)];
|
|
2689
|
+
case 1:
|
|
2690
|
+
sanitisedValue = _a.sent();
|
|
2691
|
+
if (!routeId.isSame(sanitisedValue)) {
|
|
2692
|
+
// if the route id has changed we redirect immediately as other
|
|
2693
|
+
// parameter sanitisers might use it.
|
|
2694
|
+
return [2 /*return*/, this.replace(routeId.parameterDef, sanitisedValue)];
|
|
2695
|
+
}
|
|
2696
|
+
_a.label = 2;
|
|
2697
|
+
case 2:
|
|
2698
|
+
result = this;
|
|
2699
|
+
routeParameters = this.getRouteParameters();
|
|
2700
|
+
i = 0;
|
|
2701
|
+
_a.label = 3;
|
|
2702
|
+
case 3:
|
|
2703
|
+
if (!(i < routeParameters.length)) return [3 /*break*/, 6];
|
|
2704
|
+
return [4 /*yield*/, routeParameters[i].sanitise(this, injector)];
|
|
2705
|
+
case 4:
|
|
2706
|
+
sanitisedValue = _a.sent();
|
|
2707
|
+
if (!routeParameters[i].isSame(sanitisedValue)) {
|
|
2708
|
+
result = this.replace(routeParameters[i].parameterDef, sanitisedValue);
|
|
2709
|
+
}
|
|
2710
|
+
_a.label = 5;
|
|
2711
|
+
case 5:
|
|
2712
|
+
i++;
|
|
2713
|
+
return [3 /*break*/, 3];
|
|
2714
|
+
case 6: return [2 /*return*/, result];
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
});
|
|
2354
2718
|
};
|
|
2719
|
+
var _a;
|
|
2720
|
+
__decorate([
|
|
2721
|
+
Memoize$1(),
|
|
2722
|
+
__metadata("design:type", Function),
|
|
2723
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
2724
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
2725
|
+
], ParameterSnapshot.prototype, "getParameter", null);
|
|
2726
|
+
__decorate([
|
|
2727
|
+
Memoize$1(),
|
|
2728
|
+
__metadata("design:type", Function),
|
|
2729
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
2730
|
+
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
2731
|
+
], ParameterSnapshot.prototype, "getValueOf", null);
|
|
2732
|
+
__decorate([
|
|
2733
|
+
Memoize$1(),
|
|
2734
|
+
__metadata("design:type", Function),
|
|
2735
|
+
__metadata("design:paramtypes", [String]),
|
|
2736
|
+
__metadata("design:returntype", Object)
|
|
2737
|
+
], ParameterSnapshot.prototype, "getParameterValue", null);
|
|
2355
2738
|
__decorate([
|
|
2356
2739
|
Memoize$1(),
|
|
2357
|
-
__metadata("design:type",
|
|
2358
|
-
__metadata("design:paramtypes", [])
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2740
|
+
__metadata("design:type", Function),
|
|
2741
|
+
__metadata("design:paramtypes", []),
|
|
2742
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
2743
|
+
], ParameterSnapshot.prototype, "getRouteIdParameter", null);
|
|
2744
|
+
__decorate([
|
|
2745
|
+
Memoize$1(),
|
|
2746
|
+
__metadata("design:type", Function),
|
|
2747
|
+
__metadata("design:paramtypes", []),
|
|
2748
|
+
__metadata("design:returntype", Array)
|
|
2749
|
+
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2750
|
+
__decorate([
|
|
2751
|
+
Trace(),
|
|
2752
|
+
__metadata("design:type", Function),
|
|
2753
|
+
__metadata("design:paramtypes", [Injector]),
|
|
2754
|
+
__metadata("design:returntype", Promise)
|
|
2755
|
+
], ParameterSnapshot.prototype, "sanitise", null);
|
|
2756
|
+
return ParameterSnapshot;
|
|
2757
|
+
}());
|
|
2362
2758
|
if (false) {
|
|
2363
2759
|
/** @type {?} */
|
|
2364
|
-
|
|
2760
|
+
ParameterSnapshot.prototype.placeDefinition;
|
|
2365
2761
|
/**
|
|
2366
2762
|
* @type {?}
|
|
2367
2763
|
* @private
|
|
2368
2764
|
*/
|
|
2369
|
-
|
|
2370
|
-
/** @type {?} */
|
|
2371
|
-
PlaceComponent.prototype.activatedRoute;
|
|
2765
|
+
ParameterSnapshot.prototype.resolved;
|
|
2372
2766
|
}
|
|
2373
|
-
(function (
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2767
|
+
(function (ParameterSnapshot) {
|
|
2768
|
+
/**
|
|
2769
|
+
* @param {?} placeDef
|
|
2770
|
+
* @param {?} params
|
|
2771
|
+
* @param {?} urlSegments
|
|
2772
|
+
* @return {?}
|
|
2773
|
+
*/
|
|
2774
|
+
function create(placeDef, params, urlSegments) {
|
|
2775
|
+
/** @type {?} */
|
|
2776
|
+
var paramMap = new ConsolidatedParameterMap(params, urlSegments);
|
|
2777
|
+
/** @type {?} */
|
|
2778
|
+
var resolvedParameters = placeDef.getRouteParameters()
|
|
2779
|
+
.map((/**
|
|
2780
|
+
* @param {?} def
|
|
2781
|
+
* @return {?}
|
|
2782
|
+
*/
|
|
2783
|
+
function (def) {
|
|
2784
|
+
if (def.isArray) {
|
|
2785
|
+
/** @type {?} */
|
|
2786
|
+
var value = paramMap.has(def.name) ? paramMap.getAll(def.name).filter((/**
|
|
2787
|
+
* @param {?} s
|
|
2788
|
+
* @return {?}
|
|
2789
|
+
*/
|
|
2790
|
+
function (s) { return !___default.isEmpty(s); })).map((/**
|
|
2791
|
+
* @param {?} raw
|
|
2792
|
+
* @return {?}
|
|
2793
|
+
*/
|
|
2794
|
+
function (raw) { return def.type.parse(raw); })) : null;
|
|
2795
|
+
return new ResolvedArrayParameter(def, value);
|
|
2796
|
+
}
|
|
2797
|
+
else {
|
|
2798
|
+
/** @type {?} */
|
|
2799
|
+
var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
2800
|
+
return new ResolvedValueParameter(def, value);
|
|
2801
|
+
}
|
|
2802
|
+
}));
|
|
2803
|
+
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
2804
|
+
}
|
|
2805
|
+
ParameterSnapshot.create = create;
|
|
2806
|
+
/**
|
|
2807
|
+
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
2808
|
+
* include the segment params in the paramMap as well as each segment returns an empty
|
|
2809
|
+
* param map even when `parameter`s has content.
|
|
2810
|
+
*/
|
|
2811
|
+
var /**
|
|
2812
|
+
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
2813
|
+
* include the segment params in the paramMap as well as each segment returns an empty
|
|
2814
|
+
* param map even when `parameter`s has content.
|
|
2815
|
+
*/
|
|
2816
|
+
ConsolidatedParameterMap = /** @class */ (function () {
|
|
2817
|
+
function ConsolidatedParameterMap(paramMap, urlSegments) {
|
|
2818
|
+
this.paramMaps = [paramMap].concat((urlSegments || []).map((/**
|
|
2819
|
+
* @param {?} s
|
|
2820
|
+
* @return {?}
|
|
2821
|
+
*/
|
|
2822
|
+
function (s) { return new ParamMapAdapter(s.parameters); }))).filter((/**
|
|
2823
|
+
* @param {?} m
|
|
2384
2824
|
* @return {?}
|
|
2385
2825
|
*/
|
|
2386
|
-
function (
|
|
2826
|
+
function (m) { return !!m; })); // the activated route param map can be null
|
|
2387
2827
|
}
|
|
2388
2828
|
/**
|
|
2829
|
+
* @param {?} name
|
|
2389
2830
|
* @return {?}
|
|
2390
2831
|
*/
|
|
2391
|
-
|
|
2832
|
+
ConsolidatedParameterMap.prototype.get = /**
|
|
2833
|
+
* @param {?} name
|
|
2392
2834
|
* @return {?}
|
|
2393
2835
|
*/
|
|
2394
|
-
function () {
|
|
2395
|
-
return
|
|
2836
|
+
function (name) {
|
|
2837
|
+
return this.paramMaps.find((/**
|
|
2838
|
+
* @param {?} m
|
|
2839
|
+
* @return {?}
|
|
2840
|
+
*/
|
|
2841
|
+
function (m) { return m.has(name); })).get(name);
|
|
2842
|
+
};
|
|
2843
|
+
/**
|
|
2844
|
+
* @param {?} name
|
|
2845
|
+
* @return {?}
|
|
2846
|
+
*/
|
|
2847
|
+
ConsolidatedParameterMap.prototype.getAll = /**
|
|
2848
|
+
* @param {?} name
|
|
2849
|
+
* @return {?}
|
|
2850
|
+
*/
|
|
2851
|
+
function (name) {
|
|
2852
|
+
return this.paramMaps.find((/**
|
|
2853
|
+
* @param {?} m
|
|
2854
|
+
* @return {?}
|
|
2855
|
+
*/
|
|
2856
|
+
function (m) { return m.has(name); })).getAll(name);
|
|
2396
2857
|
};
|
|
2397
2858
|
/**
|
|
2398
|
-
* @param {?}
|
|
2859
|
+
* @param {?} name
|
|
2399
2860
|
* @return {?}
|
|
2400
2861
|
*/
|
|
2401
|
-
|
|
2402
|
-
* @param {?}
|
|
2862
|
+
ConsolidatedParameterMap.prototype.has = /**
|
|
2863
|
+
* @param {?} name
|
|
2403
2864
|
* @return {?}
|
|
2404
2865
|
*/
|
|
2405
|
-
function (
|
|
2406
|
-
return
|
|
2866
|
+
function (name) {
|
|
2867
|
+
return !!this.paramMaps.find((/**
|
|
2868
|
+
* @param {?} m
|
|
2869
|
+
* @return {?}
|
|
2870
|
+
*/
|
|
2871
|
+
function (m) { return m.has(name); }));
|
|
2407
2872
|
};
|
|
2873
|
+
return ConsolidatedParameterMap;
|
|
2874
|
+
}());
|
|
2875
|
+
if (false) {
|
|
2876
|
+
/**
|
|
2877
|
+
* @type {?}
|
|
2878
|
+
* @private
|
|
2879
|
+
*/
|
|
2880
|
+
ConsolidatedParameterMap.prototype.paramMaps;
|
|
2881
|
+
}
|
|
2882
|
+
var ParamMapAdapter = /** @class */ (function () {
|
|
2883
|
+
function ParamMapAdapter(params) {
|
|
2884
|
+
this.params = params;
|
|
2885
|
+
}
|
|
2408
2886
|
/**
|
|
2409
|
-
* @param {?}
|
|
2887
|
+
* @param {?} name
|
|
2410
2888
|
* @return {?}
|
|
2411
2889
|
*/
|
|
2412
|
-
|
|
2413
|
-
* @param {?}
|
|
2890
|
+
ParamMapAdapter.prototype.get = /**
|
|
2891
|
+
* @param {?} name
|
|
2414
2892
|
* @return {?}
|
|
2415
2893
|
*/
|
|
2416
|
-
function (
|
|
2417
|
-
return
|
|
2894
|
+
function (name) {
|
|
2895
|
+
return this.params[name];
|
|
2418
2896
|
};
|
|
2419
2897
|
/**
|
|
2420
|
-
* @
|
|
2421
|
-
* @param {?} key
|
|
2422
|
-
* @param {?=} defaultValue
|
|
2898
|
+
* @param {?} name
|
|
2423
2899
|
* @return {?}
|
|
2424
2900
|
*/
|
|
2425
|
-
|
|
2426
|
-
* @
|
|
2427
|
-
* @param {?} key
|
|
2428
|
-
* @param {?=} defaultValue
|
|
2901
|
+
ParamMapAdapter.prototype.getAll = /**
|
|
2902
|
+
* @param {?} name
|
|
2429
2903
|
* @return {?}
|
|
2430
2904
|
*/
|
|
2431
|
-
function (
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2905
|
+
function (name) {
|
|
2906
|
+
/** @type {?} */
|
|
2907
|
+
var value = this.get(name);
|
|
2908
|
+
return Array.isArray(value) ? value : [value];
|
|
2435
2909
|
};
|
|
2436
2910
|
/**
|
|
2437
|
-
* @
|
|
2438
|
-
* @param {?} keys
|
|
2439
|
-
* @param {?=} defaultValue
|
|
2911
|
+
* @param {?} name
|
|
2440
2912
|
* @return {?}
|
|
2441
2913
|
*/
|
|
2442
|
-
|
|
2443
|
-
* @
|
|
2444
|
-
* @param {?} keys
|
|
2445
|
-
* @param {?=} defaultValue
|
|
2914
|
+
ParamMapAdapter.prototype.has = /**
|
|
2915
|
+
* @param {?} name
|
|
2446
2916
|
* @return {?}
|
|
2447
2917
|
*/
|
|
2448
|
-
function (
|
|
2449
|
-
|
|
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
|
-
}
|
|
2918
|
+
function (name) {
|
|
2919
|
+
return this.keys.includes(name);
|
|
2462
2920
|
};
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2921
|
+
Object.defineProperty(ParamMapAdapter.prototype, "keys", {
|
|
2922
|
+
get: /**
|
|
2923
|
+
* @return {?}
|
|
2924
|
+
*/
|
|
2925
|
+
function () {
|
|
2926
|
+
return Object.keys(this.params);
|
|
2927
|
+
},
|
|
2928
|
+
enumerable: true,
|
|
2929
|
+
configurable: true
|
|
2930
|
+
});
|
|
2931
|
+
return ParamMapAdapter;
|
|
2470
2932
|
}());
|
|
2471
|
-
PlaceComponent.Definition = Definition;
|
|
2472
2933
|
if (false) {
|
|
2473
|
-
/**
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
Definition.prototype.order;
|
|
2479
|
-
/** @type {?} */
|
|
2480
|
-
Definition.prototype.data;
|
|
2481
|
-
/** @type {?} */
|
|
2482
|
-
Definition.prototype.children;
|
|
2483
|
-
/** @type {?} */
|
|
2484
|
-
Definition.prototype.component;
|
|
2934
|
+
/**
|
|
2935
|
+
* @type {?}
|
|
2936
|
+
* @private
|
|
2937
|
+
*/
|
|
2938
|
+
ParamMapAdapter.prototype.params;
|
|
2485
2939
|
}
|
|
2486
2940
|
/**
|
|
2487
|
-
* @
|
|
2941
|
+
* @abstract
|
|
2942
|
+
* @template T, S
|
|
2488
2943
|
*/
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
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
|
|
2944
|
+
var /**
|
|
2945
|
+
* @abstract
|
|
2946
|
+
* @template T, S
|
|
2505
2947
|
*/
|
|
2506
|
-
function
|
|
2507
|
-
|
|
2948
|
+
ResolvedParameter = /** @class */ (function () {
|
|
2949
|
+
function ResolvedParameter(parameterDef, value) {
|
|
2950
|
+
this.parameterDef = parameterDef;
|
|
2951
|
+
this.value = value;
|
|
2952
|
+
}
|
|
2953
|
+
/**
|
|
2954
|
+
* @return {?}
|
|
2955
|
+
*/
|
|
2956
|
+
ResolvedParameter.prototype.isRouteId = /**
|
|
2957
|
+
* @return {?}
|
|
2958
|
+
*/
|
|
2959
|
+
function () {
|
|
2960
|
+
return this.parameterDef.isRouteId;
|
|
2961
|
+
};
|
|
2962
|
+
/**
|
|
2963
|
+
* @param {?} visit
|
|
2964
|
+
* @param {?} injector
|
|
2965
|
+
* @return {?}
|
|
2966
|
+
*/
|
|
2967
|
+
ResolvedParameter.prototype.sanitise = /**
|
|
2968
|
+
* @param {?} visit
|
|
2969
|
+
* @param {?} injector
|
|
2970
|
+
* @return {?}
|
|
2971
|
+
*/
|
|
2972
|
+
function (visit, injector) {
|
|
2973
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2974
|
+
var sanitiser;
|
|
2975
|
+
return __generator(this, function (_a) {
|
|
2976
|
+
sanitiser = this.parameterDef.getSanitiser(injector);
|
|
2977
|
+
if (sanitiser) {
|
|
2978
|
+
return [2 /*return*/, sanitiser.sanitise(this.parameterDef, this.value, visit)];
|
|
2979
|
+
}
|
|
2980
|
+
else {
|
|
2981
|
+
return [2 /*return*/, this.value];
|
|
2982
|
+
}
|
|
2983
|
+
return [2 /*return*/];
|
|
2984
|
+
});
|
|
2985
|
+
});
|
|
2986
|
+
};
|
|
2987
|
+
return ResolvedParameter;
|
|
2988
|
+
}());
|
|
2989
|
+
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
2508
2990
|
if (false) {
|
|
2509
2991
|
/** @type {?} */
|
|
2510
|
-
|
|
2992
|
+
ResolvedParameter.prototype.parameterDef;
|
|
2993
|
+
/** @type {?} */
|
|
2994
|
+
ResolvedParameter.prototype.value;
|
|
2995
|
+
/**
|
|
2996
|
+
* @abstract
|
|
2997
|
+
* @param {?} dest
|
|
2998
|
+
* @return {?}
|
|
2999
|
+
*/
|
|
3000
|
+
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
3001
|
+
/**
|
|
3002
|
+
* @abstract
|
|
3003
|
+
* @param {?} otherValue
|
|
3004
|
+
* @return {?}
|
|
3005
|
+
*/
|
|
3006
|
+
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
3007
|
+
/**
|
|
3008
|
+
* @abstract
|
|
3009
|
+
* @return {?}
|
|
3010
|
+
*/
|
|
3011
|
+
ResolvedParameter.prototype.formattedValue = function () { };
|
|
3012
|
+
/**
|
|
3013
|
+
* @abstract
|
|
3014
|
+
* @param {?} value
|
|
3015
|
+
* @return {?}
|
|
3016
|
+
*/
|
|
3017
|
+
ResolvedParameter.prototype.replace = function (value) { };
|
|
2511
3018
|
}
|
|
2512
3019
|
/**
|
|
2513
|
-
* @
|
|
2514
|
-
* @return {?}
|
|
3020
|
+
* @template T
|
|
2515
3021
|
*/
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
}
|
|
2519
|
-
PlaceComponent.getDefinition = getDefinition;
|
|
2520
|
-
/**
|
|
2521
|
-
* @param {?} klass
|
|
2522
|
-
* @param {?} options
|
|
2523
|
-
* @return {?}
|
|
3022
|
+
var /**
|
|
3023
|
+
* @template T
|
|
2524
3024
|
*/
|
|
2525
|
-
function
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
}
|
|
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
|
|
3025
|
+
ResolvedValueParameter = /** @class */ (function (_super) {
|
|
3026
|
+
__extends(ResolvedValueParameter, _super);
|
|
3027
|
+
function ResolvedValueParameter() {
|
|
3028
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3029
|
+
}
|
|
3030
|
+
/**
|
|
3031
|
+
* @param {?} otherValue
|
|
2542
3032
|
* @return {?}
|
|
2543
3033
|
*/
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
3034
|
+
ResolvedValueParameter.prototype.isSame = /**
|
|
3035
|
+
* @param {?} otherValue
|
|
3036
|
+
* @return {?}
|
|
3037
|
+
*/
|
|
3038
|
+
function (otherValue) {
|
|
3039
|
+
return this.value === otherValue;
|
|
3040
|
+
};
|
|
3041
|
+
/**
|
|
3042
|
+
* @param {?} dest
|
|
3043
|
+
* @return {?}
|
|
3044
|
+
*/
|
|
3045
|
+
ResolvedValueParameter.prototype.injectRouteParam = /**
|
|
3046
|
+
* @param {?} dest
|
|
3047
|
+
* @return {?}
|
|
3048
|
+
*/
|
|
3049
|
+
function (dest) {
|
|
3050
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
3051
|
+
};
|
|
3052
|
+
/**
|
|
3053
|
+
* @param {?} value
|
|
3054
|
+
* @return {?}
|
|
3055
|
+
*/
|
|
3056
|
+
ResolvedValueParameter.prototype.replace = /**
|
|
3057
|
+
* @param {?} value
|
|
3058
|
+
* @return {?}
|
|
3059
|
+
*/
|
|
3060
|
+
function (value) {
|
|
3061
|
+
return new ResolvedValueParameter(this.parameterDef, value);
|
|
3062
|
+
};
|
|
3063
|
+
/**
|
|
3064
|
+
* @return {?}
|
|
3065
|
+
*/
|
|
3066
|
+
ResolvedValueParameter.prototype.formattedValue = /**
|
|
3067
|
+
* @return {?}
|
|
3068
|
+
*/
|
|
3069
|
+
function () {
|
|
3070
|
+
return !___default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
3071
|
+
};
|
|
3072
|
+
return ResolvedValueParameter;
|
|
3073
|
+
}(ResolvedParameter));
|
|
3074
|
+
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
2547
3075
|
/**
|
|
2548
|
-
* @
|
|
2549
|
-
* @return {?}
|
|
3076
|
+
* @template T
|
|
2550
3077
|
*/
|
|
2551
|
-
|
|
2552
|
-
* @
|
|
2553
|
-
* @return {?}
|
|
3078
|
+
var /**
|
|
3079
|
+
* @template T
|
|
2554
3080
|
*/
|
|
2555
|
-
function (
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
3081
|
+
ResolvedArrayParameter = /** @class */ (function (_super) {
|
|
3082
|
+
__extends(ResolvedArrayParameter, _super);
|
|
3083
|
+
function ResolvedArrayParameter() {
|
|
3084
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3085
|
+
}
|
|
3086
|
+
/**
|
|
3087
|
+
* @param {?} otherValue
|
|
3088
|
+
* @return {?}
|
|
3089
|
+
*/
|
|
3090
|
+
ResolvedArrayParameter.prototype.isSame = /**
|
|
3091
|
+
* @param {?} otherValue
|
|
3092
|
+
* @return {?}
|
|
3093
|
+
*/
|
|
3094
|
+
function (otherValue) {
|
|
3095
|
+
return ___default.isEqual(this.value, otherValue);
|
|
3096
|
+
};
|
|
3097
|
+
/**
|
|
3098
|
+
* @param {?} dest
|
|
3099
|
+
* @return {?}
|
|
3100
|
+
*/
|
|
3101
|
+
ResolvedArrayParameter.prototype.injectRouteParam = /**
|
|
3102
|
+
* @param {?} dest
|
|
3103
|
+
* @return {?}
|
|
3104
|
+
*/
|
|
3105
|
+
function (dest) {
|
|
3106
|
+
var _this = this;
|
|
3107
|
+
dest[this.parameterDef.name] = this.value.map((/**
|
|
3108
|
+
* @param {?} v
|
|
2564
3109
|
* @return {?}
|
|
2565
3110
|
*/
|
|
2566
|
-
function () { return
|
|
2567
|
-
|
|
3111
|
+
function (v) { return _this.parameterDef.type.format(v); }));
|
|
3112
|
+
};
|
|
3113
|
+
/**
|
|
3114
|
+
* @param {?} value
|
|
3115
|
+
* @return {?}
|
|
3116
|
+
*/
|
|
3117
|
+
ResolvedArrayParameter.prototype.replace = /**
|
|
3118
|
+
* @param {?} value
|
|
3119
|
+
* @return {?}
|
|
3120
|
+
*/
|
|
3121
|
+
function (value) {
|
|
3122
|
+
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
3123
|
+
};
|
|
3124
|
+
/**
|
|
3125
|
+
* @return {?}
|
|
3126
|
+
*/
|
|
3127
|
+
ResolvedArrayParameter.prototype.formattedValue = /**
|
|
3128
|
+
* @return {?}
|
|
3129
|
+
*/
|
|
3130
|
+
function () {
|
|
3131
|
+
var _this = this;
|
|
3132
|
+
return this.value ? this.value.map((/**
|
|
3133
|
+
* @param {?} v
|
|
2568
3134
|
* @return {?}
|
|
2569
3135
|
*/
|
|
2570
|
-
function () { return
|
|
3136
|
+
function (v) { return _this.parameterDef.type.format(v); })) : [];
|
|
2571
3137
|
};
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
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
|
-
}
|
|
3138
|
+
return ResolvedArrayParameter;
|
|
3139
|
+
}(ResolvedParameter));
|
|
3140
|
+
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
3141
|
+
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
2609
3142
|
|
|
2610
3143
|
/**
|
|
2611
3144
|
* @fileoverview added by tsickle
|
|
2612
3145
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2613
3146
|
*/
|
|
2614
|
-
var
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
var _this = _super.call(this) || this;
|
|
2618
|
-
_this.expanded = true;
|
|
2619
|
-
return _this;
|
|
3147
|
+
var PlaceRouter = /** @class */ (function () {
|
|
3148
|
+
function PlaceRouter(router) {
|
|
3149
|
+
this.router = router;
|
|
2620
3150
|
}
|
|
2621
3151
|
/**
|
|
3152
|
+
* @param {?} activatedRoute
|
|
3153
|
+
* @param {?} previous
|
|
3154
|
+
* @param {?} next
|
|
2622
3155
|
* @return {?}
|
|
2623
3156
|
*/
|
|
2624
|
-
|
|
3157
|
+
PlaceRouter.prototype.pushParameterChangesToRoute = /**
|
|
3158
|
+
* @param {?} activatedRoute
|
|
3159
|
+
* @param {?} previous
|
|
3160
|
+
* @param {?} next
|
|
2625
3161
|
* @return {?}
|
|
2626
3162
|
*/
|
|
2627
|
-
function () {
|
|
2628
|
-
|
|
3163
|
+
function (activatedRoute, previous, next) {
|
|
3164
|
+
/** @type {?} */
|
|
3165
|
+
var relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
3166
|
+
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
3167
|
+
relativeTo: activatedRoute
|
|
3168
|
+
});
|
|
2629
3169
|
};
|
|
2630
3170
|
/**
|
|
3171
|
+
* @param {?} activatedRoute
|
|
3172
|
+
* @param {?} sanitised
|
|
2631
3173
|
* @return {?}
|
|
2632
3174
|
*/
|
|
2633
|
-
|
|
3175
|
+
PlaceRouter.prototype.getRedirectUrlTree = /**
|
|
3176
|
+
* @param {?} activatedRoute
|
|
3177
|
+
* @param {?} sanitised
|
|
2634
3178
|
* @return {?}
|
|
2635
3179
|
*/
|
|
2636
|
-
function () {
|
|
2637
|
-
|
|
3180
|
+
function (activatedRoute, sanitised) {
|
|
3181
|
+
/** @type {?} */
|
|
3182
|
+
var urlSegments = activatedRoute.url;
|
|
3183
|
+
/** @type {?} */
|
|
3184
|
+
var weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
3185
|
+
/** @type {?} */
|
|
3186
|
+
var commands = (weHaveARouteId) ?
|
|
3187
|
+
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
3188
|
+
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
3189
|
+
console.log("redirect path", commands);
|
|
3190
|
+
return this.router.createUrlTree(commands);
|
|
2638
3191
|
};
|
|
2639
3192
|
/**
|
|
3193
|
+
* @protected
|
|
3194
|
+
* @param {?} activatedRoute
|
|
2640
3195
|
* @return {?}
|
|
2641
3196
|
*/
|
|
2642
|
-
|
|
3197
|
+
PlaceRouter.prototype.getChildPath = /**
|
|
3198
|
+
* @protected
|
|
3199
|
+
* @param {?} activatedRoute
|
|
2643
3200
|
* @return {?}
|
|
2644
3201
|
*/
|
|
2645
|
-
function () {
|
|
2646
|
-
|
|
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: /**
|
|
3202
|
+
function (activatedRoute) {
|
|
3203
|
+
return ___default.flatten(activatedRoute.children.map((/**
|
|
3204
|
+
* @param {?} child
|
|
2682
3205
|
* @return {?}
|
|
2683
3206
|
*/
|
|
2684
|
-
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
|
-
}
|
|
3207
|
+
function (child) { return child.url; })));
|
|
2745
3208
|
};
|
|
2746
|
-
// @Trace()
|
|
2747
|
-
// @Trace()
|
|
2748
3209
|
/**
|
|
2749
|
-
* @
|
|
3210
|
+
* @protected
|
|
3211
|
+
* @param {?} parameters
|
|
2750
3212
|
* @return {?}
|
|
2751
3213
|
*/
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
* @param {?} snapshot
|
|
3214
|
+
PlaceRouter.prototype.createRouteParameters = /**
|
|
3215
|
+
* @protected
|
|
3216
|
+
* @param {?} parameters
|
|
2756
3217
|
* @return {?}
|
|
2757
3218
|
*/
|
|
2758
|
-
function (
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
3219
|
+
function (parameters) {
|
|
3220
|
+
/** @type {?} */
|
|
3221
|
+
var routeId = parameters.getFormattedRouteId();
|
|
3222
|
+
return routeId ?
|
|
3223
|
+
[routeId, parameters.getFormattedParameters()] :
|
|
3224
|
+
[parameters.getFormattedParameters()];
|
|
2764
3225
|
};
|
|
2765
|
-
|
|
3226
|
+
PlaceRouter.decorators = [
|
|
2766
3227
|
{ type: Injectable, args: [{
|
|
2767
3228
|
providedIn: 'root'
|
|
2768
3229
|
},] }
|
|
2769
3230
|
];
|
|
2770
3231
|
/** @nocollapse */
|
|
2771
|
-
|
|
2772
|
-
{ type: Router }
|
|
2773
|
-
{ type: Injector }
|
|
3232
|
+
PlaceRouter.ctorParameters = function () { return [
|
|
3233
|
+
{ type: Router }
|
|
2774
3234
|
]; };
|
|
2775
|
-
/** @nocollapse */
|
|
2776
|
-
|
|
2777
|
-
|
|
3235
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
3236
|
+
__decorate([
|
|
3237
|
+
Trace(),
|
|
3238
|
+
__metadata("design:type", Function),
|
|
3239
|
+
__metadata("design:paramtypes", [ActivatedRouteSnapshot, ParameterSnapshot]),
|
|
3240
|
+
__metadata("design:returntype", UrlTree)
|
|
3241
|
+
], PlaceRouter.prototype, "getRedirectUrlTree", null);
|
|
3242
|
+
return PlaceRouter;
|
|
3243
|
+
}());
|
|
2778
3244
|
if (false) {
|
|
2779
3245
|
/**
|
|
2780
3246
|
* @type {?}
|
|
2781
3247
|
* @private
|
|
2782
3248
|
*/
|
|
2783
|
-
|
|
2784
|
-
/**
|
|
2785
|
-
* @type {?}
|
|
2786
|
-
* @protected
|
|
2787
|
-
*/
|
|
2788
|
-
PlaceService.prototype.router;
|
|
2789
|
-
/**
|
|
2790
|
-
* @type {?}
|
|
2791
|
-
* @protected
|
|
2792
|
-
*/
|
|
2793
|
-
PlaceService.prototype.injector;
|
|
3249
|
+
PlaceRouter.prototype.router;
|
|
2794
3250
|
}
|
|
2795
3251
|
|
|
2796
3252
|
/**
|
|
@@ -2844,56 +3300,98 @@ function leftRightPlaceAnimation(duration) {
|
|
|
2844
3300
|
]);
|
|
2845
3301
|
}
|
|
2846
3302
|
/** @type {?} */
|
|
2847
|
-
var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation(
|
|
3303
|
+
var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation('0.3s');
|
|
2848
3304
|
|
|
2849
3305
|
/**
|
|
2850
3306
|
* @fileoverview added by tsickle
|
|
2851
3307
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2852
3308
|
*/
|
|
3309
|
+
/**
|
|
3310
|
+
* @record
|
|
3311
|
+
*/
|
|
3312
|
+
function PlaceRef() { }
|
|
3313
|
+
if (false) {
|
|
3314
|
+
/** @type {?} */
|
|
3315
|
+
PlaceRef.prototype.placeDefinition;
|
|
3316
|
+
/**
|
|
3317
|
+
* @param {?} param
|
|
3318
|
+
* @return {?}
|
|
3319
|
+
*/
|
|
3320
|
+
PlaceRef.prototype.initialiseBindings = function (param) { };
|
|
3321
|
+
/**
|
|
3322
|
+
* @return {?}
|
|
3323
|
+
*/
|
|
3324
|
+
PlaceRef.prototype.onPlaceReady = function () { };
|
|
3325
|
+
}
|
|
2853
3326
|
var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
2854
3327
|
__extends(PlaceOutletComponent, _super);
|
|
2855
|
-
function PlaceOutletComponent(
|
|
3328
|
+
function PlaceOutletComponent(router, placeHistory) {
|
|
2856
3329
|
var _this = _super.call(this) || this;
|
|
2857
|
-
_this.
|
|
2858
|
-
_this.
|
|
3330
|
+
_this.router = router;
|
|
3331
|
+
_this.placeHistory = placeHistory;
|
|
2859
3332
|
_this.animate = true;
|
|
2860
|
-
_this.
|
|
3333
|
+
_this._incomingRouteChange = new Guard();
|
|
3334
|
+
_this._inOutletUpdate = new Guard();
|
|
3335
|
+
_this._activatedRouteModel = new MutableValueModel();
|
|
3336
|
+
_this._placeDefinition = new MutableValueModel();
|
|
3337
|
+
_this._resolvedParameters = new MutableValueModel();
|
|
2861
3338
|
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
|
-
|
|
2863
|
-
|
|
2864
|
-
* @
|
|
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
|
|
3339
|
+
/** @type {?} */
|
|
3340
|
+
var paramMap = chain(_this._activatedRouteModel).pullObservableValue((/**
|
|
3341
|
+
* @param {?} ar
|
|
2874
3342
|
* @return {?}
|
|
2875
3343
|
*/
|
|
2876
|
-
function (
|
|
2877
|
-
|
|
3344
|
+
function (ar) { return ar.paramMap; }));
|
|
3345
|
+
/** @type {?} */
|
|
3346
|
+
var urls = chain(_this._activatedRouteModel).pullObservableValue((/**
|
|
3347
|
+
* @param {?} ar
|
|
2878
3348
|
* @return {?}
|
|
2879
3349
|
*/
|
|
2880
|
-
function (
|
|
2881
|
-
_this.
|
|
2882
|
-
|
|
3350
|
+
function (ar) { return ar.url; }));
|
|
3351
|
+
_this.placeConfigured = valueOf.all(chain(_this._inOutletUpdate).isFalsey(), _this._placeDefinition, paramMap, urls).areTruthy();
|
|
3352
|
+
when.anyOf(paramMap, urls).changes((/**
|
|
2883
3353
|
* @return {?}
|
|
2884
3354
|
*/
|
|
2885
|
-
function (
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
3355
|
+
function () {
|
|
3356
|
+
/** @type {?} */
|
|
3357
|
+
var snapshot = ParameterSnapshot.create(_this._placeDefinition.value, paramMap.value, urls.value);
|
|
3358
|
+
_this._incomingRouteChange.whileTrue((/**
|
|
3359
|
+
* @return {?}
|
|
3360
|
+
*/
|
|
3361
|
+
function () {
|
|
3362
|
+
_this._resolvedParameters.value = snapshot;
|
|
3363
|
+
_this.placeHistory.add(snapshot);
|
|
3364
|
+
}));
|
|
3365
|
+
}), {
|
|
3366
|
+
postponeUntil: _this.placeConfigured
|
|
3367
|
+
});
|
|
3368
|
+
when.valueOf(_this._resolvedParameters).changes((/**
|
|
3369
|
+
* @param {?} next
|
|
3370
|
+
* @param {?} previous
|
|
2890
3371
|
* @return {?}
|
|
2891
3372
|
*/
|
|
2892
|
-
function (
|
|
2893
|
-
|
|
2894
|
-
|
|
3373
|
+
function (next, previous) {
|
|
3374
|
+
_this.pushChangesToRoute(next, previous);
|
|
3375
|
+
_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.
|
|
3376
|
+
}), {
|
|
3377
|
+
unless: _this.incomingRouteChange
|
|
3378
|
+
});
|
|
2895
3379
|
return _this;
|
|
3380
|
+
// const txo = new TransactionObserver().onEvent(e => console.log(e.toString()));
|
|
3381
|
+
// txo.observe('paramMap', paramMap);
|
|
3382
|
+
// txo.observe('urls', urls);
|
|
3383
|
+
// txo.observe('this._resolvedParameters', this._resolvedParameters);
|
|
2896
3384
|
}
|
|
3385
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
|
|
3386
|
+
get: /**
|
|
3387
|
+
* @return {?}
|
|
3388
|
+
*/
|
|
3389
|
+
function () {
|
|
3390
|
+
return this._incomingRouteChange;
|
|
3391
|
+
},
|
|
3392
|
+
enumerable: true,
|
|
3393
|
+
configurable: true
|
|
3394
|
+
});
|
|
2897
3395
|
/**
|
|
2898
3396
|
* @return {?}
|
|
2899
3397
|
*/
|
|
@@ -2903,76 +3401,56 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
2903
3401
|
function () {
|
|
2904
3402
|
};
|
|
2905
3403
|
/**
|
|
3404
|
+
* @param {?} routerOutlet
|
|
3405
|
+
* @param {?} place
|
|
2906
3406
|
* @return {?}
|
|
2907
3407
|
*/
|
|
2908
|
-
PlaceOutletComponent.prototype.
|
|
2909
|
-
* @
|
|
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
|
|
3408
|
+
PlaceOutletComponent.prototype.onOutletActivated = /**
|
|
3409
|
+
* @param {?} routerOutlet
|
|
3410
|
+
* @param {?} place
|
|
2954
3411
|
* @return {?}
|
|
2955
3412
|
*/
|
|
2956
|
-
function (
|
|
2957
|
-
|
|
2958
|
-
this.
|
|
2959
|
-
|
|
3413
|
+
function (routerOutlet, place) {
|
|
3414
|
+
var _this = this;
|
|
3415
|
+
this._inOutletUpdate.whileTrue((/**
|
|
3416
|
+
* @return {?}
|
|
3417
|
+
*/
|
|
3418
|
+
function () {
|
|
3419
|
+
try {
|
|
3420
|
+
_this._currentPlace = place;
|
|
3421
|
+
_this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
3422
|
+
_this._placeDefinition.value = place.placeDefinition;
|
|
3423
|
+
place.initialiseBindings(_this._resolvedParameters);
|
|
3424
|
+
}
|
|
3425
|
+
catch (error) {
|
|
3426
|
+
console.error(error);
|
|
3427
|
+
}
|
|
3428
|
+
}));
|
|
2960
3429
|
if (!this.animate) {
|
|
2961
3430
|
// we're not animating so trigger any post animation callbacks now.
|
|
2962
3431
|
this.animationDone();
|
|
2963
3432
|
}
|
|
2964
3433
|
};
|
|
2965
3434
|
/**
|
|
3435
|
+
* @param {?} routerOutlet
|
|
2966
3436
|
* @param {?} $event
|
|
2967
3437
|
* @return {?}
|
|
2968
3438
|
*/
|
|
2969
3439
|
PlaceOutletComponent.prototype.onOutletDeactivated = /**
|
|
3440
|
+
* @param {?} routerOutlet
|
|
2970
3441
|
* @param {?} $event
|
|
2971
3442
|
* @return {?}
|
|
2972
3443
|
*/
|
|
2973
|
-
function ($event) {
|
|
2974
|
-
|
|
2975
|
-
this.
|
|
3444
|
+
function (routerOutlet, $event) {
|
|
3445
|
+
var _this = this;
|
|
3446
|
+
this._inOutletUpdate.whileTrue((/**
|
|
3447
|
+
* @return {?}
|
|
3448
|
+
*/
|
|
3449
|
+
function () {
|
|
3450
|
+
_this._currentPlace = null;
|
|
3451
|
+
_this._activatedRouteModel.value = null;
|
|
3452
|
+
_this._placeDefinition.value = null;
|
|
3453
|
+
}));
|
|
2976
3454
|
};
|
|
2977
3455
|
/**
|
|
2978
3456
|
* @param {?} outlet
|
|
@@ -2992,45 +3470,54 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
2992
3470
|
* @return {?}
|
|
2993
3471
|
*/
|
|
2994
3472
|
function () {
|
|
2995
|
-
if (this.
|
|
2996
|
-
this.
|
|
3473
|
+
if (this._currentPlace) {
|
|
3474
|
+
this._currentPlace.onPlaceReady();
|
|
2997
3475
|
}
|
|
2998
3476
|
};
|
|
2999
|
-
// @Trace()
|
|
3000
|
-
// @Trace()
|
|
3001
3477
|
/**
|
|
3002
|
-
* @
|
|
3003
|
-
* @param {?}
|
|
3478
|
+
* @param {?} next
|
|
3479
|
+
* @param {?} previous
|
|
3480
|
+
* @return {?}
|
|
3481
|
+
*/
|
|
3482
|
+
PlaceOutletComponent.prototype.pushChangesToRoute = /**
|
|
3483
|
+
* @param {?} next
|
|
3484
|
+
* @param {?} previous
|
|
3004
3485
|
* @return {?}
|
|
3005
3486
|
*/
|
|
3006
|
-
|
|
3007
|
-
|
|
3487
|
+
function (next, previous) {
|
|
3488
|
+
/** @type {?} */
|
|
3489
|
+
var activatedRoute = this._activatedRouteModel.value;
|
|
3490
|
+
this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
|
|
3491
|
+
};
|
|
3008
3492
|
/**
|
|
3009
|
-
* @
|
|
3010
|
-
* @param {?}
|
|
3493
|
+
* @param {?} snapshot
|
|
3494
|
+
* @param {?} callback
|
|
3011
3495
|
* @return {?}
|
|
3012
3496
|
*/
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3497
|
+
PlaceOutletComponent.prototype.sanitise = /**
|
|
3498
|
+
* @param {?} snapshot
|
|
3499
|
+
* @param {?} callback
|
|
3500
|
+
* @return {?}
|
|
3501
|
+
*/
|
|
3502
|
+
function (snapshot, callback) {
|
|
3503
|
+
return snapshot;
|
|
3017
3504
|
};
|
|
3018
3505
|
PlaceOutletComponent.decorators = [
|
|
3019
3506
|
{ type: Component, args: [{
|
|
3020
3507
|
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",
|
|
3508
|
+
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
3509
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
3023
3510
|
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
3511
|
}] }
|
|
3025
3512
|
];
|
|
3026
3513
|
/** @nocollapse */
|
|
3027
3514
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
3028
|
-
{ type:
|
|
3029
|
-
{ type:
|
|
3515
|
+
{ type: PlaceRouter },
|
|
3516
|
+
{ type: PlaceHistory }
|
|
3030
3517
|
]; };
|
|
3031
3518
|
PlaceOutletComponent.propDecorators = {
|
|
3032
3519
|
animate: [{ type: Input }],
|
|
3033
|
-
|
|
3520
|
+
routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
3034
3521
|
};
|
|
3035
3522
|
return PlaceOutletComponent;
|
|
3036
3523
|
}(DisposableComponent));
|
|
@@ -3038,42 +3525,49 @@ if (false) {
|
|
|
3038
3525
|
/** @type {?} */
|
|
3039
3526
|
PlaceOutletComponent.prototype.animate;
|
|
3040
3527
|
/** @type {?} */
|
|
3041
|
-
PlaceOutletComponent.prototype.
|
|
3528
|
+
PlaceOutletComponent.prototype.routerOut;
|
|
3529
|
+
/**
|
|
3530
|
+
* @type {?}
|
|
3531
|
+
* @private
|
|
3532
|
+
*/
|
|
3533
|
+
PlaceOutletComponent.prototype._currentPlace;
|
|
3042
3534
|
/**
|
|
3043
3535
|
* @type {?}
|
|
3044
3536
|
* @private
|
|
3045
3537
|
*/
|
|
3046
|
-
PlaceOutletComponent.prototype.
|
|
3538
|
+
PlaceOutletComponent.prototype._incomingRouteChange;
|
|
3047
3539
|
/**
|
|
3048
3540
|
* @type {?}
|
|
3049
3541
|
* @private
|
|
3050
3542
|
*/
|
|
3051
|
-
PlaceOutletComponent.prototype.
|
|
3543
|
+
PlaceOutletComponent.prototype._inOutletUpdate;
|
|
3052
3544
|
/**
|
|
3053
3545
|
* @type {?}
|
|
3054
3546
|
* @private
|
|
3055
3547
|
*/
|
|
3056
|
-
PlaceOutletComponent.prototype.
|
|
3548
|
+
PlaceOutletComponent.prototype._activatedRouteModel;
|
|
3057
3549
|
/**
|
|
3058
3550
|
* @type {?}
|
|
3059
3551
|
* @private
|
|
3060
3552
|
*/
|
|
3061
|
-
PlaceOutletComponent.prototype.
|
|
3553
|
+
PlaceOutletComponent.prototype._placeDefinition;
|
|
3554
|
+
/** @type {?} */
|
|
3555
|
+
PlaceOutletComponent.prototype._resolvedParameters;
|
|
3062
3556
|
/**
|
|
3063
3557
|
* @type {?}
|
|
3064
3558
|
* @private
|
|
3065
3559
|
*/
|
|
3066
|
-
PlaceOutletComponent.prototype.
|
|
3560
|
+
PlaceOutletComponent.prototype.placeConfigured;
|
|
3067
3561
|
/**
|
|
3068
3562
|
* @type {?}
|
|
3069
3563
|
* @private
|
|
3070
3564
|
*/
|
|
3071
|
-
PlaceOutletComponent.prototype.
|
|
3565
|
+
PlaceOutletComponent.prototype.router;
|
|
3072
3566
|
/**
|
|
3073
3567
|
* @type {?}
|
|
3074
3568
|
* @private
|
|
3075
3569
|
*/
|
|
3076
|
-
PlaceOutletComponent.prototype.
|
|
3570
|
+
PlaceOutletComponent.prototype.placeHistory;
|
|
3077
3571
|
}
|
|
3078
3572
|
|
|
3079
3573
|
/**
|
|
@@ -3131,9 +3625,7 @@ var PlaceModule = /** @class */ (function () {
|
|
|
3131
3625
|
TabbedPlaceNavigationComponent,
|
|
3132
3626
|
ListPlaceNavComponent
|
|
3133
3627
|
],
|
|
3134
|
-
providers: [
|
|
3135
|
-
PlaceService
|
|
3136
|
-
]
|
|
3628
|
+
providers: []
|
|
3137
3629
|
},] }
|
|
3138
3630
|
];
|
|
3139
3631
|
return PlaceModule;
|
|
@@ -3572,39 +4064,6 @@ if (false) {
|
|
|
3572
4064
|
NavItem.prototype.tooltip = function () { };
|
|
3573
4065
|
}
|
|
3574
4066
|
|
|
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
4067
|
/**
|
|
3609
4068
|
* @fileoverview added by tsickle
|
|
3610
4069
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3619,12 +4078,37 @@ function Place(options) {
|
|
|
3619
4078
|
* @return {?}
|
|
3620
4079
|
*/
|
|
3621
4080
|
function (target) {
|
|
3622
|
-
if (
|
|
4081
|
+
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
4082
|
+
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
|
|
4083
|
+
* @param {?} c
|
|
4084
|
+
* @return {?}
|
|
4085
|
+
*/
|
|
4086
|
+
function (c) { return PlaceComponent.getDefinition(c); }))));
|
|
4087
|
+
}
|
|
4088
|
+
else {
|
|
3623
4089
|
lang.illegalState(target + " must extend PlaceComponent to use the @Place decorator");
|
|
3624
4090
|
}
|
|
3625
|
-
PlaceComponent.injectDefinition((/** @type {?} */ (target)), options);
|
|
3626
4091
|
});
|
|
3627
4092
|
}
|
|
4093
|
+
(function (Place) {
|
|
4094
|
+
/**
|
|
4095
|
+
* @record
|
|
4096
|
+
*/
|
|
4097
|
+
function Options() { }
|
|
4098
|
+
Place.Options = Options;
|
|
4099
|
+
if (false) {
|
|
4100
|
+
/** @type {?} */
|
|
4101
|
+
Options.prototype.path;
|
|
4102
|
+
/** @type {?} */
|
|
4103
|
+
Options.prototype.order;
|
|
4104
|
+
/** @type {?|undefined} */
|
|
4105
|
+
Options.prototype.data;
|
|
4106
|
+
/** @type {?|undefined} */
|
|
4107
|
+
Options.prototype.authenticate;
|
|
4108
|
+
/** @type {?|undefined} */
|
|
4109
|
+
Options.prototype.children;
|
|
4110
|
+
}
|
|
4111
|
+
})(Place || (Place = {}));
|
|
3628
4112
|
|
|
3629
4113
|
/**
|
|
3630
4114
|
* @fileoverview added by tsickle
|
|
@@ -3640,12 +4124,12 @@ if (false) {
|
|
|
3640
4124
|
/**
|
|
3641
4125
|
* @return {?}
|
|
3642
4126
|
*/
|
|
3643
|
-
Visit.prototype.
|
|
4127
|
+
Visit.prototype.getRouteIdValue = function () { };
|
|
3644
4128
|
/**
|
|
3645
4129
|
* @param {?} name
|
|
3646
4130
|
* @return {?}
|
|
3647
4131
|
*/
|
|
3648
|
-
Visit.prototype.
|
|
4132
|
+
Visit.prototype.getParameterValue = function (name) { };
|
|
3649
4133
|
}
|
|
3650
4134
|
|
|
3651
4135
|
/**
|
|
@@ -3675,14 +4159,16 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
3675
4159
|
// HACK: this will break with child routes...
|
|
3676
4160
|
/** @type {?} */
|
|
3677
4161
|
var path = "/" + component.placeDefinition.path;
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
4162
|
+
// let thisTree = this.router.parseUrl(currentState.url);
|
|
4163
|
+
// let nextTree = this.router.parseUrl(nextState.url);
|
|
4164
|
+
// console.log({
|
|
4165
|
+
// placePath: path,
|
|
4166
|
+
// currentRoute: currentRoute.toString(),
|
|
4167
|
+
// currentStateUrl: currentState.url,
|
|
4168
|
+
// nextStateUrl: nextState.url,
|
|
4169
|
+
// currentStateUrlTree: thisTree.root.children[PRIMARY_OUTLET].segments,
|
|
4170
|
+
// nextStateUrlTree: nextTree.root.children[PRIMARY_OUTLET].segments
|
|
4171
|
+
// });
|
|
3686
4172
|
// nextState is the full path...
|
|
3687
4173
|
if (!nextState.url.startsWith(path)) {
|
|
3688
4174
|
return component.canDeactivate();
|
|
@@ -3722,36 +4208,43 @@ if (false) {
|
|
|
3722
4208
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3723
4209
|
*/
|
|
3724
4210
|
var PlaceRouteGuard = /** @class */ (function () {
|
|
3725
|
-
function PlaceRouteGuard(
|
|
3726
|
-
this.
|
|
3727
|
-
this.
|
|
4211
|
+
function PlaceRouteGuard(placeRouter, injector) {
|
|
4212
|
+
this.placeRouter = placeRouter;
|
|
4213
|
+
this.injector = injector;
|
|
3728
4214
|
}
|
|
3729
4215
|
/**
|
|
3730
|
-
* @param {?}
|
|
4216
|
+
* @param {?} activatedRoute
|
|
3731
4217
|
* @param {?} state
|
|
3732
4218
|
* @return {?}
|
|
3733
4219
|
*/
|
|
3734
4220
|
PlaceRouteGuard.prototype.canActivate = /**
|
|
3735
|
-
* @param {?}
|
|
4221
|
+
* @param {?} activatedRoute
|
|
3736
4222
|
* @param {?} state
|
|
3737
4223
|
* @return {?}
|
|
3738
4224
|
*/
|
|
3739
|
-
function (
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
4225
|
+
function (activatedRoute, state) {
|
|
4226
|
+
var _this = this;
|
|
4227
|
+
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
4228
|
+
/** @type {?} */
|
|
4229
|
+
var placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
4230
|
+
/** @type {?} */
|
|
4231
|
+
var snapshot_1 = ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap, activatedRoute.url);
|
|
4232
|
+
return snapshot_1.sanitise(this.injector).then((/**
|
|
4233
|
+
* @param {?} sanitised
|
|
4234
|
+
* @return {?}
|
|
4235
|
+
*/
|
|
4236
|
+
function (sanitised) {
|
|
4237
|
+
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4238
|
+
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4239
|
+
}
|
|
4240
|
+
else {
|
|
4241
|
+
return true;
|
|
4242
|
+
}
|
|
4243
|
+
}));
|
|
4244
|
+
}
|
|
4245
|
+
else {
|
|
4246
|
+
return lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component);
|
|
4247
|
+
}
|
|
3755
4248
|
};
|
|
3756
4249
|
PlaceRouteGuard.decorators = [
|
|
3757
4250
|
{ type: Injectable, args: [{
|
|
@@ -3760,10 +4253,10 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
3760
4253
|
];
|
|
3761
4254
|
/** @nocollapse */
|
|
3762
4255
|
PlaceRouteGuard.ctorParameters = function () { return [
|
|
3763
|
-
{ type:
|
|
3764
|
-
{ type:
|
|
4256
|
+
{ type: PlaceRouter },
|
|
4257
|
+
{ type: Injector }
|
|
3765
4258
|
]; };
|
|
3766
|
-
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(
|
|
4259
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceRouter), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3767
4260
|
return PlaceRouteGuard;
|
|
3768
4261
|
}());
|
|
3769
4262
|
if (false) {
|
|
@@ -3771,93 +4264,12 @@ if (false) {
|
|
|
3771
4264
|
* @type {?}
|
|
3772
4265
|
* @private
|
|
3773
4266
|
*/
|
|
3774
|
-
PlaceRouteGuard.prototype.
|
|
3775
|
-
/**
|
|
3776
|
-
* @type {?}
|
|
3777
|
-
* @private
|
|
3778
|
-
*/
|
|
3779
|
-
PlaceRouteGuard.prototype.router;
|
|
3780
|
-
}
|
|
3781
|
-
|
|
3782
|
-
/**
|
|
3783
|
-
* @fileoverview added by tsickle
|
|
3784
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3785
|
-
*/
|
|
3786
|
-
/**
|
|
3787
|
-
* @template T, S
|
|
3788
|
-
*/
|
|
3789
|
-
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
3790
|
-
function DefaultParameterSanitiser(def, placeService, options) {
|
|
3791
|
-
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;
|
|
3795
|
-
}
|
|
3796
|
-
/**
|
|
3797
|
-
* @param {?} value
|
|
3798
|
-
* @param {?} visit
|
|
3799
|
-
* @return {?}
|
|
3800
|
-
*/
|
|
3801
|
-
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
3802
|
-
* @param {?} value
|
|
3803
|
-
* @param {?} visit
|
|
3804
|
-
* @return {?}
|
|
3805
|
-
*/
|
|
3806
|
-
function (value, visit) {
|
|
3807
|
-
if (this.isBlank(value)) {
|
|
3808
|
-
if (this.remember) {
|
|
3809
|
-
// value = null;
|
|
3810
|
-
}
|
|
3811
|
-
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3812
|
-
}
|
|
3813
|
-
else {
|
|
3814
|
-
return value;
|
|
3815
|
-
}
|
|
3816
|
-
};
|
|
3817
|
-
/**
|
|
3818
|
-
* @private
|
|
3819
|
-
* @param {?} value
|
|
3820
|
-
* @return {?}
|
|
3821
|
-
*/
|
|
3822
|
-
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
3823
|
-
* @private
|
|
3824
|
-
* @param {?} value
|
|
3825
|
-
* @return {?}
|
|
3826
|
-
*/
|
|
3827
|
-
function (value) {
|
|
3828
|
-
/** @type {?} */
|
|
3829
|
-
var isNil$1 = isNil(value);
|
|
3830
|
-
return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
|
|
3831
|
-
};
|
|
3832
|
-
__decorate([
|
|
3833
|
-
Trace(),
|
|
3834
|
-
__metadata("design:type", Function),
|
|
3835
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
3836
|
-
__metadata("design:returntype", Object)
|
|
3837
|
-
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
3838
|
-
return DefaultParameterSanitiser;
|
|
3839
|
-
}());
|
|
3840
|
-
if (false) {
|
|
3841
|
-
/**
|
|
3842
|
-
* @type {?}
|
|
3843
|
-
* @private
|
|
3844
|
-
*/
|
|
3845
|
-
DefaultParameterSanitiser.prototype.remember;
|
|
3846
|
-
/**
|
|
3847
|
-
* @type {?}
|
|
3848
|
-
* @private
|
|
3849
|
-
*/
|
|
3850
|
-
DefaultParameterSanitiser.prototype.defaultValue;
|
|
3851
|
-
/**
|
|
3852
|
-
* @type {?}
|
|
3853
|
-
* @private
|
|
3854
|
-
*/
|
|
3855
|
-
DefaultParameterSanitiser.prototype.def;
|
|
4267
|
+
PlaceRouteGuard.prototype.placeRouter;
|
|
3856
4268
|
/**
|
|
3857
4269
|
* @type {?}
|
|
3858
4270
|
* @private
|
|
3859
4271
|
*/
|
|
3860
|
-
|
|
4272
|
+
PlaceRouteGuard.prototype.injector;
|
|
3861
4273
|
}
|
|
3862
4274
|
|
|
3863
4275
|
/**
|
|
@@ -3891,8 +4303,6 @@ if (false) {
|
|
|
3891
4303
|
ParameterOptions.prototype.remember;
|
|
3892
4304
|
/** @type {?|undefined} */
|
|
3893
4305
|
ParameterOptions.prototype.defaultValue;
|
|
3894
|
-
/** @type {?|undefined} */
|
|
3895
|
-
ParameterOptions.prototype.sanitiser;
|
|
3896
4306
|
}
|
|
3897
4307
|
/**
|
|
3898
4308
|
* @record
|
|
@@ -3908,8 +4318,6 @@ if (false) {
|
|
|
3908
4318
|
ListParameterOptions.prototype.remember;
|
|
3909
4319
|
/** @type {?|undefined} */
|
|
3910
4320
|
ListParameterOptions.prototype.defaultValue;
|
|
3911
|
-
/** @type {?|undefined} */
|
|
3912
|
-
ListParameterOptions.prototype.sanitiser;
|
|
3913
4321
|
}
|
|
3914
4322
|
/**
|
|
3915
4323
|
* @template T
|
|
@@ -3918,7 +4326,6 @@ if (false) {
|
|
|
3918
4326
|
* @return {?}
|
|
3919
4327
|
*/
|
|
3920
4328
|
function RouteId(type, options) {
|
|
3921
|
-
// assert.isTruthy(type.isValid());
|
|
3922
4329
|
return (/**
|
|
3923
4330
|
* @param {?} prototype
|
|
3924
4331
|
* @param {?} propertyKey
|
|
@@ -3926,7 +4333,7 @@ function RouteId(type, options) {
|
|
|
3926
4333
|
*/
|
|
3927
4334
|
function (prototype, propertyKey) {
|
|
3928
4335
|
/** @type {?} */
|
|
3929
|
-
var param =
|
|
4336
|
+
var param = new ParameterDefinition.RouteId(propertyKey.toString(), type, options);
|
|
3930
4337
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3931
4338
|
UseDelegate()(prototype, propertyKey);
|
|
3932
4339
|
});
|
|
@@ -3938,7 +4345,6 @@ function RouteId(type, options) {
|
|
|
3938
4345
|
* @return {?}
|
|
3939
4346
|
*/
|
|
3940
4347
|
function RouteParameter(type, options) {
|
|
3941
|
-
// assert.isTruthy(type.isValid());
|
|
3942
4348
|
return (/**
|
|
3943
4349
|
* @param {?} prototype
|
|
3944
4350
|
* @param {?} propertyKey
|
|
@@ -3946,7 +4352,7 @@ function RouteParameter(type, options) {
|
|
|
3946
4352
|
*/
|
|
3947
4353
|
function (prototype, propertyKey) {
|
|
3948
4354
|
/** @type {?} */
|
|
3949
|
-
var param =
|
|
4355
|
+
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
|
|
3950
4356
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3951
4357
|
UseDelegate()(prototype, propertyKey);
|
|
3952
4358
|
});
|
|
@@ -3958,7 +4364,6 @@ function RouteParameter(type, options) {
|
|
|
3958
4364
|
* @return {?}
|
|
3959
4365
|
*/
|
|
3960
4366
|
function RouteParameterList(elementType, options) {
|
|
3961
|
-
// assert.isTruthy(type.isValid());
|
|
3962
4367
|
return (/**
|
|
3963
4368
|
* @param {?} prototype
|
|
3964
4369
|
* @param {?} propertyKey
|
|
@@ -3966,82 +4371,11 @@ function RouteParameterList(elementType, options) {
|
|
|
3966
4371
|
*/
|
|
3967
4372
|
function (prototype, propertyKey) {
|
|
3968
4373
|
/** @type {?} */
|
|
3969
|
-
var param =
|
|
4374
|
+
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
|
|
3970
4375
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3971
4376
|
UseDelegate()(prototype, propertyKey);
|
|
3972
4377
|
});
|
|
3973
4378
|
}
|
|
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
4379
|
|
|
4046
4380
|
/**
|
|
4047
4381
|
* @fileoverview added by tsickle
|
|
@@ -4049,31 +4383,18 @@ if (false) {
|
|
|
4049
4383
|
*/
|
|
4050
4384
|
/**
|
|
4051
4385
|
* @record
|
|
4052
|
-
* @template
|
|
4386
|
+
* @template S
|
|
4053
4387
|
*/
|
|
4054
4388
|
function ParameterSanitiser() { }
|
|
4055
4389
|
if (false) {
|
|
4056
4390
|
/**
|
|
4391
|
+
* @param {?} parameterDef
|
|
4057
4392
|
* @param {?} value
|
|
4058
4393
|
* @param {?=} visit
|
|
4059
4394
|
* @return {?}
|
|
4060
4395
|
*/
|
|
4061
|
-
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
4396
|
+
ParameterSanitiser.prototype.sanitise = function (parameterDef, value, visit) { };
|
|
4062
4397
|
}
|
|
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
4398
|
|
|
4078
4399
|
/**
|
|
4079
4400
|
* @fileoverview added by tsickle
|
|
@@ -4132,7 +4453,7 @@ var ParameterType;
|
|
|
4132
4453
|
* @return {?}
|
|
4133
4454
|
*/
|
|
4134
4455
|
function (value) {
|
|
4135
|
-
return isNil(value) || isEmpty(value) ? null : +value;
|
|
4456
|
+
return ___default.isNil(value) || ___default.isEmpty(value) ? null : +value;
|
|
4136
4457
|
};
|
|
4137
4458
|
return NumberType;
|
|
4138
4459
|
}());
|
|
@@ -4198,7 +4519,7 @@ Sanitiser = /** @class */ (function () {
|
|
|
4198
4519
|
* @return {?}
|
|
4199
4520
|
*/
|
|
4200
4521
|
function () {
|
|
4201
|
-
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
4522
|
+
return !___default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
4202
4523
|
},
|
|
4203
4524
|
enumerable: true,
|
|
4204
4525
|
configurable: true
|
|
@@ -4267,7 +4588,7 @@ Sanitiser = /** @class */ (function () {
|
|
|
4267
4588
|
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
4268
4589
|
this.initialValue = this.readFrom(this.snapshot);
|
|
4269
4590
|
_a = this;
|
|
4270
|
-
return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
|
|
4591
|
+
return [4 /*yield*/, this.sanitiser.sanitise(null, this.initialValue)];
|
|
4271
4592
|
case 1:
|
|
4272
4593
|
_a._sanitisedValue = _b.sent();
|
|
4273
4594
|
if (this.initialValue !== this._sanitisedValue) {
|
|
@@ -4300,11 +4621,10 @@ if (false) {
|
|
|
4300
4621
|
Sanitiser.prototype.sanitiser;
|
|
4301
4622
|
}
|
|
4302
4623
|
var RouteParameterSanitiser = /** @class */ (function () {
|
|
4303
|
-
function RouteParameterSanitiser(parameterDefs, snapshot,
|
|
4624
|
+
function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
|
|
4304
4625
|
var _this = this;
|
|
4305
4626
|
this.parameterDefs = parameterDefs;
|
|
4306
4627
|
this.snapshot = snapshot;
|
|
4307
|
-
this.placeService = placeService;
|
|
4308
4628
|
this.injector = injector;
|
|
4309
4629
|
this.parameterSanitisers = [];
|
|
4310
4630
|
/** @type {?} */
|
|
@@ -4397,17 +4717,7 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
4397
4717
|
* @return {?}
|
|
4398
4718
|
*/
|
|
4399
4719
|
function (def) {
|
|
4400
|
-
|
|
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
|
-
}
|
|
4720
|
+
return def.getSanitiser(this.injector);
|
|
4411
4721
|
};
|
|
4412
4722
|
/**
|
|
4413
4723
|
* @return {?}
|
|
@@ -4453,12 +4763,12 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
4453
4763
|
* @return {?}
|
|
4454
4764
|
*/
|
|
4455
4765
|
function (value) {
|
|
4456
|
-
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
4766
|
+
return ___default.isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
4457
4767
|
};
|
|
4458
4768
|
__decorate([
|
|
4459
|
-
Memoize(),
|
|
4769
|
+
Memoize$1(),
|
|
4460
4770
|
__metadata("design:type", Function),
|
|
4461
|
-
__metadata("design:paramtypes", [
|
|
4771
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
4462
4772
|
__metadata("design:returntype", Object)
|
|
4463
4773
|
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
4464
4774
|
__decorate([
|
|
@@ -4485,8 +4795,6 @@ if (false) {
|
|
|
4485
4795
|
/** @type {?} */
|
|
4486
4796
|
RouteParameterSanitiser.prototype.snapshot;
|
|
4487
4797
|
/** @type {?} */
|
|
4488
|
-
RouteParameterSanitiser.prototype.placeService;
|
|
4489
|
-
/** @type {?} */
|
|
4490
4798
|
RouteParameterSanitiser.prototype.injector;
|
|
4491
4799
|
}
|
|
4492
4800
|
(function (Sanitiser) {
|
|
@@ -4628,5 +4936,5 @@ if (false) {
|
|
|
4628
4936
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4629
4937
|
*/
|
|
4630
4938
|
|
|
4631
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY,
|
|
4939
|
+
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, 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
4940
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|