@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 { __decorate, __metadata, __awaiter } 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
|
|
|
@@ -529,7 +529,7 @@ class FocusBindingDirective extends DisposableComponent {
|
|
|
529
529
|
}));
|
|
530
530
|
}
|
|
531
531
|
else {
|
|
532
|
-
Logger.get(this).warn(
|
|
532
|
+
Logger.get(this).warn('pectinFocusBinding was nil');
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
/**
|
|
@@ -713,6 +713,11 @@ if (false) {
|
|
|
713
713
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
714
714
|
*/
|
|
715
715
|
/**
|
|
716
|
+
* ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an
|
|
717
|
+
* external service.
|
|
718
|
+
*
|
|
719
|
+
* It might be nice to have wrapper component that allows more declarative use, i.e.
|
|
720
|
+
* <activity-view [activityClass]="...", [activityData]="..." (done)=".." (cancel)="..."></activity-view>
|
|
716
721
|
* @template D, R, E
|
|
717
722
|
*/
|
|
718
723
|
class ActivityOutletComponent {
|
|
@@ -1081,7 +1086,7 @@ class ConfirmationDialogComponent extends AbstractActivity {
|
|
|
1081
1086
|
ConfirmationDialogComponent.decorators = [
|
|
1082
1087
|
{ type: Component, args: [{
|
|
1083
1088
|
selector: 'angular-ui-powerups-confirmation-dialog',
|
|
1084
|
-
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'\"
|
|
1089
|
+
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",
|
|
1085
1090
|
styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
|
|
1086
1091
|
}] }
|
|
1087
1092
|
];
|
|
@@ -1188,7 +1193,7 @@ class ActivityContainerComponent extends DisposableComponent {
|
|
|
1188
1193
|
ActivityContainerComponent.decorators = [
|
|
1189
1194
|
{ type: Component, args: [{
|
|
1190
1195
|
selector: 'angular-ui-powerups-activity-container',
|
|
1191
|
-
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\"
|
|
1196
|
+
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",
|
|
1192
1197
|
styles: [":host{display:block}"]
|
|
1193
1198
|
}] }
|
|
1194
1199
|
];
|
|
@@ -1450,11 +1455,603 @@ EmptyStateComponent.decorators = [
|
|
|
1450
1455
|
/** @nocollapse */
|
|
1451
1456
|
EmptyStateComponent.ctorParameters = () => [];
|
|
1452
1457
|
|
|
1458
|
+
/**
|
|
1459
|
+
* @fileoverview added by tsickle
|
|
1460
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1461
|
+
*/
|
|
1462
|
+
class PlaceDefinition {
|
|
1463
|
+
/**
|
|
1464
|
+
* @param {?} component
|
|
1465
|
+
* @param {?} path
|
|
1466
|
+
* @param {?} authenticate
|
|
1467
|
+
* @param {?} order
|
|
1468
|
+
* @param {?} data
|
|
1469
|
+
* @param {?} routeParameters
|
|
1470
|
+
* @param {?} children
|
|
1471
|
+
*/
|
|
1472
|
+
constructor(component, path, authenticate, order, data, routeParameters, children) {
|
|
1473
|
+
this.component = component;
|
|
1474
|
+
this.path = path;
|
|
1475
|
+
this.authenticate = authenticate;
|
|
1476
|
+
this.order = order;
|
|
1477
|
+
this.data = data;
|
|
1478
|
+
this.routeParameters = routeParameters;
|
|
1479
|
+
this.children = children;
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* @return {?}
|
|
1483
|
+
*/
|
|
1484
|
+
getRouteParameters() {
|
|
1485
|
+
return this.routeParameters;
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* @template T
|
|
1489
|
+
* @param {?} key
|
|
1490
|
+
* @param {?=} defaultValue
|
|
1491
|
+
* @return {?}
|
|
1492
|
+
*/
|
|
1493
|
+
getData(key, defaultValue) {
|
|
1494
|
+
return this.data ?
|
|
1495
|
+
___default.isNil(this.data[key]) ? defaultValue : this.data[key] :
|
|
1496
|
+
defaultValue;
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* @template T
|
|
1500
|
+
* @param {?} keys
|
|
1501
|
+
* @param {?=} defaultValue
|
|
1502
|
+
* @return {?}
|
|
1503
|
+
*/
|
|
1504
|
+
searchData(keys, defaultValue) {
|
|
1505
|
+
if (this.data) {
|
|
1506
|
+
/** @type {?} */
|
|
1507
|
+
const found = keys.find((/**
|
|
1508
|
+
* @param {?} key
|
|
1509
|
+
* @return {?}
|
|
1510
|
+
*/
|
|
1511
|
+
key => !___default.isNil(this.data[key])));
|
|
1512
|
+
return found ? this.data[found] : defaultValue;
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
return defaultValue;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if (false) {
|
|
1520
|
+
/** @type {?} */
|
|
1521
|
+
PlaceDefinition.prototype.component;
|
|
1522
|
+
/** @type {?} */
|
|
1523
|
+
PlaceDefinition.prototype.path;
|
|
1524
|
+
/** @type {?} */
|
|
1525
|
+
PlaceDefinition.prototype.authenticate;
|
|
1526
|
+
/** @type {?} */
|
|
1527
|
+
PlaceDefinition.prototype.order;
|
|
1528
|
+
/** @type {?} */
|
|
1529
|
+
PlaceDefinition.prototype.data;
|
|
1530
|
+
/** @type {?} */
|
|
1531
|
+
PlaceDefinition.prototype.routeParameters;
|
|
1532
|
+
/** @type {?} */
|
|
1533
|
+
PlaceDefinition.prototype.children;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* @fileoverview added by tsickle
|
|
1538
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1539
|
+
*/
|
|
1540
|
+
// RAKE: making this Symbol(...) broke things.
|
|
1541
|
+
/** @type {?} */
|
|
1542
|
+
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
1543
|
+
// this one seems ok.
|
|
1544
|
+
/** @type {?} */
|
|
1545
|
+
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
1546
|
+
class PlaceComponent extends DisposableComponent {
|
|
1547
|
+
constructor() {
|
|
1548
|
+
super();
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* @param {?} resolvedParameters
|
|
1552
|
+
* @return {?}
|
|
1553
|
+
*/
|
|
1554
|
+
initialiseBindings(resolvedParameters) {
|
|
1555
|
+
assert.isNil(this.resolvedParameters);
|
|
1556
|
+
this.resolvedParameters = resolvedParameters;
|
|
1557
|
+
this.placeDefinition.getRouteParameters().forEach((/**
|
|
1558
|
+
* @param {?} parameterDef
|
|
1559
|
+
* @return {?}
|
|
1560
|
+
*/
|
|
1561
|
+
parameterDef => {
|
|
1562
|
+
this.installBinding(parameterDef);
|
|
1563
|
+
}));
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* @private
|
|
1567
|
+
* @template T, S
|
|
1568
|
+
* @param {?} parameterDef
|
|
1569
|
+
* @return {?}
|
|
1570
|
+
*/
|
|
1571
|
+
installBinding(parameterDef) {
|
|
1572
|
+
/** @type {?} */
|
|
1573
|
+
const model = (/** @type {?} */ (this[parameterDef.propertyName]));
|
|
1574
|
+
// this.txo.observe(parameterDef.propertyName, model);
|
|
1575
|
+
this.registerDisposable(new Binding(this.resolvedParameters, model, {
|
|
1576
|
+
/**
|
|
1577
|
+
* @param {?} parameters
|
|
1578
|
+
* @return {?}
|
|
1579
|
+
*/
|
|
1580
|
+
toRight(parameters) {
|
|
1581
|
+
return parameters.getValueOf(parameterDef);
|
|
1582
|
+
},
|
|
1583
|
+
/**
|
|
1584
|
+
* @param {?} value
|
|
1585
|
+
* @param {?=} currentParameters
|
|
1586
|
+
* @return {?}
|
|
1587
|
+
*/
|
|
1588
|
+
toLeft(value, currentParameters) {
|
|
1589
|
+
return currentParameters.replace(parameterDef, value);
|
|
1590
|
+
}
|
|
1591
|
+
}));
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* @return {?}
|
|
1595
|
+
*/
|
|
1596
|
+
get placeDefinition() {
|
|
1597
|
+
return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @return {?}
|
|
1601
|
+
*/
|
|
1602
|
+
get childPlaces() {
|
|
1603
|
+
return this.placeDefinition.children.map((/**
|
|
1604
|
+
* @param {?} d
|
|
1605
|
+
* @return {?}
|
|
1606
|
+
*/
|
|
1607
|
+
d => d.component));
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* @return {?}
|
|
1611
|
+
*/
|
|
1612
|
+
canDeactivate() {
|
|
1613
|
+
return true;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* @return {?}
|
|
1617
|
+
*/
|
|
1618
|
+
onPlaceReady() {
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
__decorate([
|
|
1622
|
+
Memoize(),
|
|
1623
|
+
__metadata("design:type", PlaceDefinition),
|
|
1624
|
+
__metadata("design:paramtypes", [])
|
|
1625
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
1626
|
+
if (false) {
|
|
1627
|
+
/**
|
|
1628
|
+
* @type {?}
|
|
1629
|
+
* @private
|
|
1630
|
+
*/
|
|
1631
|
+
PlaceComponent.prototype.resolvedParameters;
|
|
1632
|
+
}
|
|
1633
|
+
(function (PlaceComponent) {
|
|
1634
|
+
/**
|
|
1635
|
+
* @param {?} target
|
|
1636
|
+
* @return {?}
|
|
1637
|
+
*/
|
|
1638
|
+
function isPlaceComponentConstructor(target) {
|
|
1639
|
+
return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
|
|
1640
|
+
}
|
|
1641
|
+
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
1642
|
+
/**
|
|
1643
|
+
* @param {?} klass
|
|
1644
|
+
* @return {?}
|
|
1645
|
+
*/
|
|
1646
|
+
function getRouteParameters(klass) {
|
|
1647
|
+
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
1648
|
+
}
|
|
1649
|
+
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
1650
|
+
/**
|
|
1651
|
+
* @param {?} klass
|
|
1652
|
+
* @return {?}
|
|
1653
|
+
*/
|
|
1654
|
+
function getDefinition(klass) {
|
|
1655
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
1656
|
+
}
|
|
1657
|
+
PlaceComponent.getDefinition = getDefinition;
|
|
1658
|
+
/**
|
|
1659
|
+
* @param {?} klass
|
|
1660
|
+
* @param {?} definition
|
|
1661
|
+
* @return {?}
|
|
1662
|
+
*/
|
|
1663
|
+
function injectDefinition(klass, definition) {
|
|
1664
|
+
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
|
|
1665
|
+
}
|
|
1666
|
+
PlaceComponent.injectDefinition = injectDefinition;
|
|
1667
|
+
})(PlaceComponent || (PlaceComponent = {}));
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* @fileoverview added by tsickle
|
|
1671
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1672
|
+
*/
|
|
1673
|
+
class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
1674
|
+
constructor() {
|
|
1675
|
+
super();
|
|
1676
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1677
|
+
this.placeDefinitions = chain(this.placesModel).map((/**
|
|
1678
|
+
* @param {?} c
|
|
1679
|
+
* @return {?}
|
|
1680
|
+
*/
|
|
1681
|
+
c => PlaceComponent.getDefinition(c)));
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* @param {?} placeDef
|
|
1685
|
+
* @return {?}
|
|
1686
|
+
*/
|
|
1687
|
+
getNav(placeDef) {
|
|
1688
|
+
/** @type {?} */
|
|
1689
|
+
const navItem = (/** @type {?} */ (placeDef.getData('nav')));
|
|
1690
|
+
return {
|
|
1691
|
+
title: (/**
|
|
1692
|
+
* @return {?}
|
|
1693
|
+
*/
|
|
1694
|
+
() => navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title'])),
|
|
1695
|
+
tooltip: (/**
|
|
1696
|
+
* @return {?}
|
|
1697
|
+
*/
|
|
1698
|
+
() => navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null)),
|
|
1699
|
+
icon: (/**
|
|
1700
|
+
* @return {?}
|
|
1701
|
+
*/
|
|
1702
|
+
() => navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null))
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* @return {?}
|
|
1707
|
+
*/
|
|
1708
|
+
ngOnInit() {
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
1712
|
+
places: [{ type: Input }],
|
|
1713
|
+
placesModel: [{ type: Input }]
|
|
1714
|
+
};
|
|
1715
|
+
__decorate([
|
|
1716
|
+
StoreInListModel('placesModel'),
|
|
1717
|
+
__metadata("design:type", Array)
|
|
1718
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
1719
|
+
__decorate([
|
|
1720
|
+
UseDelegate(),
|
|
1721
|
+
__metadata("design:type", ListModel)
|
|
1722
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
1723
|
+
__decorate([
|
|
1724
|
+
Memoize$1(),
|
|
1725
|
+
__metadata("design:type", Function),
|
|
1726
|
+
__metadata("design:paramtypes", [PlaceDefinition]),
|
|
1727
|
+
__metadata("design:returntype", Object)
|
|
1728
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
1729
|
+
if (false) {
|
|
1730
|
+
/** @type {?} */
|
|
1731
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
1732
|
+
/** @type {?} */
|
|
1733
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
1734
|
+
/** @type {?} */
|
|
1735
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
/**
|
|
1739
|
+
* @fileoverview added by tsickle
|
|
1740
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1741
|
+
*/
|
|
1742
|
+
class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
1743
|
+
constructor() {
|
|
1744
|
+
super();
|
|
1745
|
+
this.expanded = true;
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* @return {?}
|
|
1749
|
+
*/
|
|
1750
|
+
expandMenu() {
|
|
1751
|
+
this.expanded = true;
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* @return {?}
|
|
1755
|
+
*/
|
|
1756
|
+
collapseMenu() {
|
|
1757
|
+
this.expanded = false;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* @return {?}
|
|
1761
|
+
*/
|
|
1762
|
+
toggleMenu() {
|
|
1763
|
+
this.expanded = !this.expanded;
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
ListPlaceNavComponent.decorators = [
|
|
1767
|
+
{ type: Component, args: [{
|
|
1768
|
+
selector: 'angular-ui-powerups-list-place-nav',
|
|
1769
|
+
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",
|
|
1770
|
+
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}"]
|
|
1771
|
+
}] }
|
|
1772
|
+
];
|
|
1773
|
+
/** @nocollapse */
|
|
1774
|
+
ListPlaceNavComponent.ctorParameters = () => [];
|
|
1775
|
+
ListPlaceNavComponent.propDecorators = {
|
|
1776
|
+
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
1777
|
+
};
|
|
1778
|
+
if (false) {
|
|
1779
|
+
/** @type {?} */
|
|
1780
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* @fileoverview added by tsickle
|
|
1785
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1786
|
+
*/
|
|
1787
|
+
class PlaceHistory {
|
|
1788
|
+
/**
|
|
1789
|
+
* @param {?} router
|
|
1790
|
+
*/
|
|
1791
|
+
constructor(router) {
|
|
1792
|
+
this.router = router;
|
|
1793
|
+
this._history = new Map();
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* @param {?} state
|
|
1797
|
+
* @return {?}
|
|
1798
|
+
*/
|
|
1799
|
+
add(state) {
|
|
1800
|
+
/** @type {?} */
|
|
1801
|
+
const history = this.getHistory(state.placeDefinition);
|
|
1802
|
+
/** @type {?} */
|
|
1803
|
+
const previousState = ___default.last(history);
|
|
1804
|
+
if (!previousState || state.hasChanged(previousState)) {
|
|
1805
|
+
history.unshift(state); // LIFO
|
|
1806
|
+
this.setHistory(state.placeDefinition, history.slice(-3)); // limit our history to 3 visits
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* @param {?} placeDef
|
|
1811
|
+
* @return {?}
|
|
1812
|
+
*/
|
|
1813
|
+
getHistory(placeDef) {
|
|
1814
|
+
/** @type {?} */
|
|
1815
|
+
let history = this._history.get(placeDef);
|
|
1816
|
+
if (!history) {
|
|
1817
|
+
history = [];
|
|
1818
|
+
this.setHistory(placeDef, history);
|
|
1819
|
+
}
|
|
1820
|
+
return history;
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* @private
|
|
1824
|
+
* @param {?} placeDef
|
|
1825
|
+
* @param {?} history
|
|
1826
|
+
* @return {?}
|
|
1827
|
+
*/
|
|
1828
|
+
setHistory(placeDef, history) {
|
|
1829
|
+
this._history.set(placeDef, history);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
PlaceHistory.decorators = [
|
|
1833
|
+
{ type: Injectable, args: [{
|
|
1834
|
+
providedIn: 'root'
|
|
1835
|
+
},] }
|
|
1836
|
+
];
|
|
1837
|
+
/** @nocollapse */
|
|
1838
|
+
PlaceHistory.ctorParameters = () => [
|
|
1839
|
+
{ type: Router }
|
|
1840
|
+
];
|
|
1841
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
1842
|
+
if (false) {
|
|
1843
|
+
/**
|
|
1844
|
+
* @type {?}
|
|
1845
|
+
* @private
|
|
1846
|
+
*/
|
|
1847
|
+
PlaceHistory.prototype._history;
|
|
1848
|
+
/**
|
|
1849
|
+
* @type {?}
|
|
1850
|
+
* @private
|
|
1851
|
+
*/
|
|
1852
|
+
PlaceHistory.prototype.router;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* @fileoverview added by tsickle
|
|
1857
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1858
|
+
*/
|
|
1859
|
+
/**
|
|
1860
|
+
* @abstract
|
|
1861
|
+
* @template T, S
|
|
1862
|
+
*/
|
|
1863
|
+
class ParameterDefinition {
|
|
1864
|
+
/**
|
|
1865
|
+
* @param {?} propertyName
|
|
1866
|
+
* @param {?} type
|
|
1867
|
+
* @param {?} options
|
|
1868
|
+
*/
|
|
1869
|
+
constructor(propertyName, type, options) {
|
|
1870
|
+
this.propertyName = propertyName;
|
|
1871
|
+
this.type = type;
|
|
1872
|
+
/** @type {?} */
|
|
1873
|
+
const opts = Opts.get(options);
|
|
1874
|
+
this.name = opts.getOptional('as', propertyName);
|
|
1875
|
+
this.remember = opts.getOptional('remember', false);
|
|
1876
|
+
this.defaultValue = opts.getOptional('defaultValue', null);
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* @param {?} injector
|
|
1880
|
+
* @return {?}
|
|
1881
|
+
*/
|
|
1882
|
+
getSanitiser(injector) {
|
|
1883
|
+
if (this.remember || !___default.isNil(this.defaultValue)) {
|
|
1884
|
+
return new ParameterDefinition.DefaultParameterSanitiser(this.remember, this.defaultValue, injector.get(PlaceHistory));
|
|
1885
|
+
}
|
|
1886
|
+
else {
|
|
1887
|
+
return null;
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
if (false) {
|
|
1892
|
+
/** @type {?} */
|
|
1893
|
+
ParameterDefinition.prototype.isRouteId;
|
|
1894
|
+
/** @type {?} */
|
|
1895
|
+
ParameterDefinition.prototype.isArray;
|
|
1896
|
+
/** @type {?} */
|
|
1897
|
+
ParameterDefinition.prototype.name;
|
|
1898
|
+
/**
|
|
1899
|
+
* @type {?}
|
|
1900
|
+
* @private
|
|
1901
|
+
*/
|
|
1902
|
+
ParameterDefinition.prototype.remember;
|
|
1903
|
+
/**
|
|
1904
|
+
* @type {?}
|
|
1905
|
+
* @private
|
|
1906
|
+
*/
|
|
1907
|
+
ParameterDefinition.prototype.defaultValue;
|
|
1908
|
+
/** @type {?} */
|
|
1909
|
+
ParameterDefinition.prototype.propertyName;
|
|
1910
|
+
/** @type {?} */
|
|
1911
|
+
ParameterDefinition.prototype.type;
|
|
1912
|
+
}
|
|
1913
|
+
(function (ParameterDefinition) {
|
|
1914
|
+
/**
|
|
1915
|
+
* @record
|
|
1916
|
+
* @template T
|
|
1917
|
+
*/
|
|
1918
|
+
function Options() { }
|
|
1919
|
+
ParameterDefinition.Options = Options;
|
|
1920
|
+
if (false) {
|
|
1921
|
+
/** @type {?|undefined} */
|
|
1922
|
+
Options.prototype.as;
|
|
1923
|
+
/** @type {?|undefined} */
|
|
1924
|
+
Options.prototype.optional;
|
|
1925
|
+
/** @type {?|undefined} */
|
|
1926
|
+
Options.prototype.remember;
|
|
1927
|
+
/** @type {?|undefined} */
|
|
1928
|
+
Options.prototype.defaultValue;
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* @template T
|
|
1932
|
+
*/
|
|
1933
|
+
class RouteId extends ParameterDefinition {
|
|
1934
|
+
constructor() {
|
|
1935
|
+
super(...arguments);
|
|
1936
|
+
this.isRouteId = true;
|
|
1937
|
+
this.isArray = false;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
ParameterDefinition.RouteId = RouteId;
|
|
1941
|
+
if (false) {
|
|
1942
|
+
/** @type {?} */
|
|
1943
|
+
RouteId.prototype.isRouteId;
|
|
1944
|
+
/** @type {?} */
|
|
1945
|
+
RouteId.prototype.isArray;
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* @template T
|
|
1949
|
+
*/
|
|
1950
|
+
class ValueParameter extends ParameterDefinition {
|
|
1951
|
+
constructor() {
|
|
1952
|
+
super(...arguments);
|
|
1953
|
+
this.isRouteId = false;
|
|
1954
|
+
this.isArray = false;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
ParameterDefinition.ValueParameter = ValueParameter;
|
|
1958
|
+
if (false) {
|
|
1959
|
+
/** @type {?} */
|
|
1960
|
+
ValueParameter.prototype.isRouteId;
|
|
1961
|
+
/** @type {?} */
|
|
1962
|
+
ValueParameter.prototype.isArray;
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* @template T
|
|
1966
|
+
*/
|
|
1967
|
+
class ArrayParameter extends ParameterDefinition {
|
|
1968
|
+
constructor() {
|
|
1969
|
+
super(...arguments);
|
|
1970
|
+
this.isRouteId = false;
|
|
1971
|
+
this.isArray = true;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
ParameterDefinition.ArrayParameter = ArrayParameter;
|
|
1975
|
+
if (false) {
|
|
1976
|
+
/** @type {?} */
|
|
1977
|
+
ArrayParameter.prototype.isRouteId;
|
|
1978
|
+
/** @type {?} */
|
|
1979
|
+
ArrayParameter.prototype.isArray;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* @template T, S
|
|
1983
|
+
*/
|
|
1984
|
+
class DefaultParameterSanitiser {
|
|
1985
|
+
/**
|
|
1986
|
+
* @param {?} remember
|
|
1987
|
+
* @param {?} defaultValue
|
|
1988
|
+
* @param {?} placeHistory
|
|
1989
|
+
*/
|
|
1990
|
+
constructor(remember, defaultValue, placeHistory) {
|
|
1991
|
+
this.remember = remember;
|
|
1992
|
+
this.defaultValue = defaultValue;
|
|
1993
|
+
this.placeHistory = placeHistory;
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* @param {?} parameterDef
|
|
1997
|
+
* @param {?} value
|
|
1998
|
+
* @param {?=} visit
|
|
1999
|
+
* @return {?}
|
|
2000
|
+
*/
|
|
2001
|
+
sanitise(parameterDef, value, visit) {
|
|
2002
|
+
if (this.isBlank(parameterDef, value)) {
|
|
2003
|
+
if (this.remember) {
|
|
2004
|
+
/** @type {?} */
|
|
2005
|
+
const visits = this.placeHistory.getHistory(visit.placeDefinition);
|
|
2006
|
+
value = visits.map((/**
|
|
2007
|
+
* @param {?} v
|
|
2008
|
+
* @return {?}
|
|
2009
|
+
*/
|
|
2010
|
+
v => v.getValueOf(parameterDef)))
|
|
2011
|
+
.filter((/**
|
|
2012
|
+
* @param {?} v
|
|
2013
|
+
* @return {?}
|
|
2014
|
+
*/
|
|
2015
|
+
v => !___default.isNil(v)))
|
|
2016
|
+
.find((/**
|
|
2017
|
+
* @param {?} v
|
|
2018
|
+
* @return {?}
|
|
2019
|
+
*/
|
|
2020
|
+
v => !this.isBlank(parameterDef, v)));
|
|
2021
|
+
}
|
|
2022
|
+
value = this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2023
|
+
console.log(`${parameterDef.name} is blank, returning: ${value}`);
|
|
2024
|
+
return value;
|
|
2025
|
+
}
|
|
2026
|
+
else {
|
|
2027
|
+
console.log(`${parameterDef.name} is not blank`);
|
|
2028
|
+
return value;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
/**
|
|
2032
|
+
* @private
|
|
2033
|
+
* @param {?} def
|
|
2034
|
+
* @param {?} value
|
|
2035
|
+
* @return {?}
|
|
2036
|
+
*/
|
|
2037
|
+
isBlank(def, value) {
|
|
2038
|
+
/** @type {?} */
|
|
2039
|
+
const isNil = ___default.isNil(value);
|
|
2040
|
+
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
2044
|
+
if (false) {
|
|
2045
|
+
/** @type {?} */
|
|
2046
|
+
DefaultParameterSanitiser.prototype.remember;
|
|
2047
|
+
/** @type {?} */
|
|
2048
|
+
DefaultParameterSanitiser.prototype.defaultValue;
|
|
2049
|
+
/** @type {?} */
|
|
2050
|
+
DefaultParameterSanitiser.prototype.placeHistory;
|
|
2051
|
+
}
|
|
2052
|
+
})(ParameterDefinition || (ParameterDefinition = {}));
|
|
2053
|
+
|
|
1453
2054
|
var _a;
|
|
1454
|
-
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
1455
|
-
// Id snapshot are repesented by 2 url segments
|
|
1456
|
-
// ID => [{'/basePath', params}, {'id', params}]
|
|
1457
|
-
// NO ID => [{'/basePath', params}]
|
|
1458
2055
|
class ParameterSnapshot {
|
|
1459
2056
|
/**
|
|
1460
2057
|
* @param {?} placeDefinition
|
|
@@ -1466,56 +2063,33 @@ class ParameterSnapshot {
|
|
|
1466
2063
|
}
|
|
1467
2064
|
/**
|
|
1468
2065
|
* @param {?} other
|
|
2066
|
+
* @param {?=} debug
|
|
1469
2067
|
* @return {?}
|
|
1470
2068
|
*/
|
|
1471
|
-
hasChanged(other) {
|
|
2069
|
+
hasChanged(other, debug = false) {
|
|
1472
2070
|
/** @type {?} */
|
|
1473
2071
|
const changed = this.resolved.find((/**
|
|
1474
2072
|
* @param {?} r
|
|
1475
2073
|
* @return {?}
|
|
1476
2074
|
*/
|
|
1477
2075
|
(r) => {
|
|
1478
|
-
return !r.isSame(other.
|
|
2076
|
+
return !r.isSame(other.getValueOf(r.parameterDef));
|
|
1479
2077
|
}));
|
|
1480
|
-
if (changed) {
|
|
1481
|
-
console.log({
|
|
2078
|
+
if (changed && debug) {
|
|
2079
|
+
console.log({
|
|
2080
|
+
name: changed.parameterDef.name,
|
|
2081
|
+
mine: changed.value,
|
|
2082
|
+
theirs: other.getValueOf(changed.parameterDef)
|
|
2083
|
+
});
|
|
1482
2084
|
}
|
|
1483
2085
|
return !!changed;
|
|
1484
2086
|
}
|
|
1485
|
-
/**
|
|
1486
|
-
* @param {?} other
|
|
1487
|
-
* @return {?}
|
|
1488
|
-
*/
|
|
1489
|
-
asUrlSegment(other) {
|
|
1490
|
-
assert.isTruthy(this.hasChanged(other));
|
|
1491
|
-
/** @type {?} */
|
|
1492
|
-
const routeParts = [];
|
|
1493
|
-
/** @type {?} */
|
|
1494
|
-
const gainedId = this.getFormattedRouteId() && !other.getFormattedRouteId();
|
|
1495
|
-
/** @type {?} */
|
|
1496
|
-
const sameId = this.getFormattedRouteId() === other.getFormattedRouteId();
|
|
1497
|
-
/** @type {?} */
|
|
1498
|
-
const lostId = (!this.getFormattedRouteId() && other.getFormattedRouteId());
|
|
1499
|
-
/** @type {?} */
|
|
1500
|
-
const changedId = (this.getFormattedRouteId() !== other.getFormattedRouteId());
|
|
1501
|
-
if (lostId || changedId) {
|
|
1502
|
-
routeParts.push('..');
|
|
1503
|
-
if (changedId) {
|
|
1504
|
-
routeParts.push(this.getFormattedRouteId());
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
else {
|
|
1508
|
-
routeParts.push('.');
|
|
1509
|
-
}
|
|
1510
|
-
routeParts.push(this.getFormattedParameters());
|
|
1511
|
-
return routeParts;
|
|
1512
|
-
}
|
|
1513
2087
|
/**
|
|
1514
2088
|
* @template T, S
|
|
1515
2089
|
* @param {?} parameterDef
|
|
1516
2090
|
* @return {?}
|
|
1517
2091
|
*/
|
|
1518
|
-
|
|
2092
|
+
getParameter(parameterDef) {
|
|
1519
2093
|
return this.resolved.find((/**
|
|
1520
2094
|
* @param {?} r
|
|
1521
2095
|
* @return {?}
|
|
@@ -1527,22 +2101,22 @@ class ParameterSnapshot {
|
|
|
1527
2101
|
* @param {?} parameterDef
|
|
1528
2102
|
* @return {?}
|
|
1529
2103
|
*/
|
|
1530
|
-
|
|
2104
|
+
getValueOf(parameterDef) {
|
|
1531
2105
|
/** @type {?} */
|
|
1532
|
-
const resolvedParameter = this.
|
|
2106
|
+
const resolvedParameter = this.getParameter(parameterDef);
|
|
1533
2107
|
return resolvedParameter ? resolvedParameter.value : null;
|
|
1534
2108
|
}
|
|
1535
2109
|
/**
|
|
1536
2110
|
* @return {?}
|
|
1537
2111
|
*/
|
|
1538
|
-
|
|
1539
|
-
return this.
|
|
2112
|
+
getRouteIdValue() {
|
|
2113
|
+
return this.getRouteIdParameter() ? this.getRouteIdParameter().value : null;
|
|
1540
2114
|
}
|
|
1541
2115
|
/**
|
|
1542
2116
|
* @param {?} name
|
|
1543
2117
|
* @return {?}
|
|
1544
2118
|
*/
|
|
1545
|
-
|
|
2119
|
+
getParameterValue(name) {
|
|
1546
2120
|
/** @type {?} */
|
|
1547
2121
|
const resolvedParameter = this.resolved.find((/**
|
|
1548
2122
|
* @param {?} r
|
|
@@ -1555,7 +2129,7 @@ class ParameterSnapshot {
|
|
|
1555
2129
|
* @private
|
|
1556
2130
|
* @return {?}
|
|
1557
2131
|
*/
|
|
1558
|
-
|
|
2132
|
+
getRouteIdParameter() {
|
|
1559
2133
|
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
1560
2134
|
// capture this in the type system though
|
|
1561
2135
|
return (/** @type {?} */ (this.resolved.find((/**
|
|
@@ -1564,18 +2138,29 @@ class ParameterSnapshot {
|
|
|
1564
2138
|
*/
|
|
1565
2139
|
p => p.parameterDef.isRouteId))));
|
|
1566
2140
|
}
|
|
2141
|
+
/**
|
|
2142
|
+
* @private
|
|
2143
|
+
* @return {?}
|
|
2144
|
+
*/
|
|
2145
|
+
getRouteParameters() {
|
|
2146
|
+
return this.resolved.filter((/**
|
|
2147
|
+
* @param {?} r
|
|
2148
|
+
* @return {?}
|
|
2149
|
+
*/
|
|
2150
|
+
r => !r.parameterDef.isRouteId));
|
|
2151
|
+
}
|
|
1567
2152
|
/**
|
|
1568
2153
|
* @return {?}
|
|
1569
2154
|
*/
|
|
1570
2155
|
hasRouteId() {
|
|
1571
|
-
return !!this.
|
|
2156
|
+
return !!this.getRouteIdParameter();
|
|
1572
2157
|
}
|
|
1573
2158
|
/**
|
|
1574
2159
|
* @return {?}
|
|
1575
2160
|
*/
|
|
1576
2161
|
getFormattedRouteId() {
|
|
1577
2162
|
/** @type {?} */
|
|
1578
|
-
const routeIdParam = this.
|
|
2163
|
+
const routeIdParam = this.getRouteIdParameter();
|
|
1579
2164
|
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
1580
2165
|
}
|
|
1581
2166
|
/**
|
|
@@ -1598,6 +2183,22 @@ class ParameterSnapshot {
|
|
|
1598
2183
|
}));
|
|
1599
2184
|
return params;
|
|
1600
2185
|
}
|
|
2186
|
+
/**
|
|
2187
|
+
* @return {?}
|
|
2188
|
+
*/
|
|
2189
|
+
getAllFormattedParameters() {
|
|
2190
|
+
/** @type {?} */
|
|
2191
|
+
const params = {};
|
|
2192
|
+
/** @type {?} */
|
|
2193
|
+
const routeIdParam = this.resolved.forEach((/**
|
|
2194
|
+
* @param {?} p
|
|
2195
|
+
* @return {?}
|
|
2196
|
+
*/
|
|
2197
|
+
p => {
|
|
2198
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
2199
|
+
}));
|
|
2200
|
+
return params;
|
|
2201
|
+
}
|
|
1601
2202
|
/**
|
|
1602
2203
|
* @template T, S
|
|
1603
2204
|
* @param {?} parameter
|
|
@@ -1614,37 +2215,73 @@ class ParameterSnapshot {
|
|
|
1614
2215
|
})));
|
|
1615
2216
|
}
|
|
1616
2217
|
/**
|
|
1617
|
-
* @param {?}
|
|
2218
|
+
* @param {?} injector
|
|
1618
2219
|
* @return {?}
|
|
1619
2220
|
*/
|
|
1620
|
-
|
|
1621
|
-
return
|
|
2221
|
+
sanitise(injector) {
|
|
2222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2223
|
+
if (this.hasRouteId()) {
|
|
2224
|
+
/** @type {?} */
|
|
2225
|
+
const routeId = this.getRouteIdParameter();
|
|
2226
|
+
/** @type {?} */
|
|
2227
|
+
const sanitisedValue = yield routeId.sanitise(this, injector);
|
|
2228
|
+
if (!routeId.isSame(sanitisedValue)) {
|
|
2229
|
+
// if the route id has changed we redirect immediately as other
|
|
2230
|
+
// parameter sanitisers might use it.
|
|
2231
|
+
return this.replace(routeId.parameterDef, sanitisedValue);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
/** @type {?} */
|
|
2235
|
+
let result = this;
|
|
2236
|
+
/** @type {?} */
|
|
2237
|
+
const routeParameters = this.getRouteParameters();
|
|
2238
|
+
for (let i = 0; i < routeParameters.length; i++) {
|
|
2239
|
+
/** @type {?} */
|
|
2240
|
+
const sanitisedValue = yield routeParameters[i].sanitise(this, injector);
|
|
2241
|
+
if (!routeParameters[i].isSame(sanitisedValue)) {
|
|
2242
|
+
result = this.replace(routeParameters[i].parameterDef, sanitisedValue);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
return result;
|
|
2246
|
+
});
|
|
1622
2247
|
}
|
|
1623
2248
|
}
|
|
1624
2249
|
__decorate([
|
|
1625
|
-
Memoize(),
|
|
2250
|
+
Memoize$1(),
|
|
1626
2251
|
__metadata("design:type", Function),
|
|
1627
|
-
__metadata("design:paramtypes", [
|
|
2252
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
1628
2253
|
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
1629
|
-
], ParameterSnapshot.prototype, "
|
|
2254
|
+
], ParameterSnapshot.prototype, "getParameter", null);
|
|
1630
2255
|
__decorate([
|
|
1631
|
-
Memoize(),
|
|
2256
|
+
Memoize$1(),
|
|
1632
2257
|
__metadata("design:type", Function),
|
|
1633
|
-
__metadata("design:paramtypes", [
|
|
2258
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
1634
2259
|
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
1635
|
-
], ParameterSnapshot.prototype, "
|
|
2260
|
+
], ParameterSnapshot.prototype, "getValueOf", null);
|
|
1636
2261
|
__decorate([
|
|
1637
|
-
Memoize(),
|
|
2262
|
+
Memoize$1(),
|
|
1638
2263
|
__metadata("design:type", Function),
|
|
1639
2264
|
__metadata("design:paramtypes", [String]),
|
|
1640
2265
|
__metadata("design:returntype", Object)
|
|
1641
|
-
], ParameterSnapshot.prototype, "
|
|
2266
|
+
], ParameterSnapshot.prototype, "getParameterValue", null);
|
|
1642
2267
|
__decorate([
|
|
1643
|
-
Memoize(),
|
|
2268
|
+
Memoize$1(),
|
|
1644
2269
|
__metadata("design:type", Function),
|
|
1645
2270
|
__metadata("design:paramtypes", []),
|
|
1646
2271
|
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
1647
|
-
], ParameterSnapshot.prototype, "
|
|
2272
|
+
], ParameterSnapshot.prototype, "getRouteIdParameter", null);
|
|
2273
|
+
__decorate([
|
|
2274
|
+
Memoize$1(),
|
|
2275
|
+
__metadata("design:type", Function),
|
|
2276
|
+
__metadata("design:paramtypes", []),
|
|
2277
|
+
__metadata("design:returntype", Array)
|
|
2278
|
+
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2279
|
+
__decorate([
|
|
2280
|
+
Trace(),
|
|
2281
|
+
__metadata("design:type", Function),
|
|
2282
|
+
__metadata("design:paramtypes", [Injector]),
|
|
2283
|
+
__metadata("design:returntype", Promise)
|
|
2284
|
+
], ParameterSnapshot.prototype, "sanitise", null);
|
|
1648
2285
|
if (false) {
|
|
1649
2286
|
/** @type {?} */
|
|
1650
2287
|
ParameterSnapshot.prototype.placeDefinition;
|
|
@@ -1657,10 +2294,13 @@ if (false) {
|
|
|
1657
2294
|
(function (ParameterSnapshot) {
|
|
1658
2295
|
/**
|
|
1659
2296
|
* @param {?} placeDef
|
|
1660
|
-
* @param {?}
|
|
2297
|
+
* @param {?} params
|
|
2298
|
+
* @param {?} urlSegments
|
|
1661
2299
|
* @return {?}
|
|
1662
2300
|
*/
|
|
1663
|
-
function create(placeDef,
|
|
2301
|
+
function create(placeDef, params, urlSegments) {
|
|
2302
|
+
/** @type {?} */
|
|
2303
|
+
const paramMap = new ConsolidatedParameterMap(params, urlSegments);
|
|
1664
2304
|
/** @type {?} */
|
|
1665
2305
|
const resolvedParameters = placeDef.getRouteParameters()
|
|
1666
2306
|
.map((/**
|
|
@@ -1670,7 +2310,11 @@ if (false) {
|
|
|
1670
2310
|
def => {
|
|
1671
2311
|
if (def.isArray) {
|
|
1672
2312
|
/** @type {?} */
|
|
1673
|
-
const value = paramMap.has(def.name) ? paramMap.getAll(def.name).
|
|
2313
|
+
const value = paramMap.has(def.name) ? paramMap.getAll(def.name).filter((/**
|
|
2314
|
+
* @param {?} s
|
|
2315
|
+
* @return {?}
|
|
2316
|
+
*/
|
|
2317
|
+
s => !___default.isEmpty(s))).map((/**
|
|
1674
2318
|
* @param {?} raw
|
|
1675
2319
|
* @return {?}
|
|
1676
2320
|
*/
|
|
@@ -1687,613 +2331,342 @@ if (false) {
|
|
|
1687
2331
|
}
|
|
1688
2332
|
ParameterSnapshot.create = create;
|
|
1689
2333
|
/**
|
|
1690
|
-
*
|
|
1691
|
-
*
|
|
2334
|
+
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
2335
|
+
* include the segment params in the paramMap as well as each segment returns an empty
|
|
2336
|
+
* param map even when `parameter`s has content.
|
|
1692
2337
|
*/
|
|
1693
|
-
class
|
|
2338
|
+
class ConsolidatedParameterMap {
|
|
1694
2339
|
/**
|
|
1695
|
-
* @param {?}
|
|
1696
|
-
* @param {?}
|
|
2340
|
+
* @param {?} paramMap
|
|
2341
|
+
* @param {?} urlSegments
|
|
1697
2342
|
*/
|
|
1698
|
-
constructor(
|
|
1699
|
-
this.
|
|
1700
|
-
|
|
2343
|
+
constructor(paramMap, urlSegments) {
|
|
2344
|
+
this.paramMaps = [paramMap].concat((urlSegments || []).map((/**
|
|
2345
|
+
* @param {?} s
|
|
2346
|
+
* @return {?}
|
|
2347
|
+
*/
|
|
2348
|
+
s => new ParamMapAdapter(s.parameters)))).filter((/**
|
|
2349
|
+
* @param {?} m
|
|
2350
|
+
* @return {?}
|
|
2351
|
+
*/
|
|
2352
|
+
m => !!m)); // the activated route param map can be null
|
|
1701
2353
|
}
|
|
1702
2354
|
/**
|
|
2355
|
+
* @param {?} name
|
|
1703
2356
|
* @return {?}
|
|
1704
2357
|
*/
|
|
1705
|
-
|
|
1706
|
-
return this.
|
|
2358
|
+
get(name) {
|
|
2359
|
+
return this.paramMaps.find((/**
|
|
2360
|
+
* @param {?} m
|
|
2361
|
+
* @return {?}
|
|
2362
|
+
*/
|
|
2363
|
+
m => m.has(name))).get(name);
|
|
1707
2364
|
}
|
|
1708
|
-
}
|
|
1709
|
-
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
1710
|
-
if (false) {
|
|
1711
|
-
/** @type {?} */
|
|
1712
|
-
ResolvedParameter.prototype.parameterDef;
|
|
1713
|
-
/** @type {?} */
|
|
1714
|
-
ResolvedParameter.prototype.value;
|
|
1715
2365
|
/**
|
|
1716
|
-
* @
|
|
1717
|
-
* @param {?} dest
|
|
2366
|
+
* @param {?} name
|
|
1718
2367
|
* @return {?}
|
|
1719
2368
|
*/
|
|
1720
|
-
|
|
2369
|
+
getAll(name) {
|
|
2370
|
+
return this.paramMaps.find((/**
|
|
2371
|
+
* @param {?} m
|
|
2372
|
+
* @return {?}
|
|
2373
|
+
*/
|
|
2374
|
+
m => m.has(name))).getAll(name);
|
|
2375
|
+
}
|
|
1721
2376
|
/**
|
|
1722
|
-
* @
|
|
1723
|
-
* @param {?} otherValue
|
|
2377
|
+
* @param {?} name
|
|
1724
2378
|
* @return {?}
|
|
1725
2379
|
*/
|
|
1726
|
-
|
|
2380
|
+
has(name) {
|
|
2381
|
+
return !!this.paramMaps.find((/**
|
|
2382
|
+
* @param {?} m
|
|
2383
|
+
* @return {?}
|
|
2384
|
+
*/
|
|
2385
|
+
m => m.has(name)));
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
if (false) {
|
|
1727
2389
|
/**
|
|
1728
|
-
* @
|
|
1729
|
-
* @
|
|
2390
|
+
* @type {?}
|
|
2391
|
+
* @private
|
|
1730
2392
|
*/
|
|
1731
|
-
|
|
2393
|
+
ConsolidatedParameterMap.prototype.paramMaps;
|
|
2394
|
+
}
|
|
2395
|
+
class ParamMapAdapter {
|
|
1732
2396
|
/**
|
|
1733
|
-
* @
|
|
1734
|
-
* @param {?} value
|
|
1735
|
-
* @return {?}
|
|
2397
|
+
* @param {?} params
|
|
1736
2398
|
*/
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
* @template T
|
|
1741
|
-
*/
|
|
1742
|
-
class ResolvedValueParameter extends ResolvedParameter {
|
|
2399
|
+
constructor(params) {
|
|
2400
|
+
this.params = params;
|
|
2401
|
+
}
|
|
1743
2402
|
/**
|
|
1744
|
-
* @param {?}
|
|
2403
|
+
* @param {?} name
|
|
1745
2404
|
* @return {?}
|
|
1746
2405
|
*/
|
|
1747
|
-
|
|
1748
|
-
return this.
|
|
2406
|
+
get(name) {
|
|
2407
|
+
return this.params[name];
|
|
1749
2408
|
}
|
|
1750
2409
|
/**
|
|
1751
|
-
* @param {?}
|
|
2410
|
+
* @param {?} name
|
|
1752
2411
|
* @return {?}
|
|
1753
2412
|
*/
|
|
1754
|
-
|
|
1755
|
-
|
|
2413
|
+
getAll(name) {
|
|
2414
|
+
/** @type {?} */
|
|
2415
|
+
const value = this.get(name);
|
|
2416
|
+
return Array.isArray(value) ? value : [value];
|
|
1756
2417
|
}
|
|
1757
2418
|
/**
|
|
1758
|
-
* @param {?}
|
|
2419
|
+
* @param {?} name
|
|
1759
2420
|
* @return {?}
|
|
1760
2421
|
*/
|
|
1761
|
-
|
|
1762
|
-
return
|
|
2422
|
+
has(name) {
|
|
2423
|
+
return this.keys.includes(name);
|
|
1763
2424
|
}
|
|
1764
2425
|
/**
|
|
1765
2426
|
* @return {?}
|
|
1766
2427
|
*/
|
|
1767
|
-
|
|
1768
|
-
return
|
|
2428
|
+
get keys() {
|
|
2429
|
+
return Object.keys(this.params);
|
|
1769
2430
|
}
|
|
1770
2431
|
}
|
|
1771
|
-
|
|
1772
|
-
Trace(),
|
|
1773
|
-
__metadata("design:type", Function),
|
|
1774
|
-
__metadata("design:paramtypes", [Object]),
|
|
1775
|
-
__metadata("design:returntype", Boolean)
|
|
1776
|
-
], ResolvedValueParameter.prototype, "isSame", null);
|
|
1777
|
-
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
1778
|
-
/**
|
|
1779
|
-
* @template T
|
|
1780
|
-
*/
|
|
1781
|
-
class ResolvedArrayParameter extends ResolvedParameter {
|
|
2432
|
+
if (false) {
|
|
1782
2433
|
/**
|
|
1783
|
-
* @
|
|
1784
|
-
* @
|
|
2434
|
+
* @type {?}
|
|
2435
|
+
* @private
|
|
1785
2436
|
*/
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
2437
|
+
ParamMapAdapter.prototype.params;
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* @abstract
|
|
2441
|
+
* @template T, S
|
|
2442
|
+
*/
|
|
2443
|
+
class ResolvedParameter {
|
|
1789
2444
|
/**
|
|
1790
|
-
* @param {?}
|
|
1791
|
-
* @
|
|
2445
|
+
* @param {?} parameterDef
|
|
2446
|
+
* @param {?} value
|
|
1792
2447
|
*/
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
* @return {?}
|
|
1797
|
-
*/
|
|
1798
|
-
v => this.parameterDef.type.format(v)));
|
|
2448
|
+
constructor(parameterDef, value) {
|
|
2449
|
+
this.parameterDef = parameterDef;
|
|
2450
|
+
this.value = value;
|
|
1799
2451
|
}
|
|
1800
2452
|
/**
|
|
1801
|
-
* @param {?} value
|
|
1802
2453
|
* @return {?}
|
|
1803
2454
|
*/
|
|
1804
|
-
|
|
1805
|
-
return
|
|
2455
|
+
isRouteId() {
|
|
2456
|
+
return this.parameterDef.isRouteId;
|
|
1806
2457
|
}
|
|
1807
2458
|
/**
|
|
2459
|
+
* @param {?} visit
|
|
2460
|
+
* @param {?} injector
|
|
1808
2461
|
* @return {?}
|
|
1809
2462
|
*/
|
|
1810
|
-
|
|
1811
|
-
return this
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
2463
|
+
sanitise(visit, injector) {
|
|
2464
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2465
|
+
/** @type {?} */
|
|
2466
|
+
const sanitiser = this.parameterDef.getSanitiser(injector);
|
|
2467
|
+
if (sanitiser) {
|
|
2468
|
+
return sanitiser.sanitise(this.parameterDef, this.value, visit);
|
|
2469
|
+
}
|
|
2470
|
+
else {
|
|
2471
|
+
return this.value;
|
|
2472
|
+
}
|
|
2473
|
+
});
|
|
1816
2474
|
}
|
|
1817
2475
|
}
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
/**
|
|
1828
|
-
* @fileoverview added by tsickle
|
|
1829
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1830
|
-
*/
|
|
1831
|
-
// RAKE: making this Symbol(...) broke things.
|
|
1832
|
-
/** @type {?} */
|
|
1833
|
-
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
1834
|
-
// this one seems ok.
|
|
1835
|
-
/** @type {?} */
|
|
1836
|
-
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
1837
|
-
class PlaceComponent extends DisposableComponent {
|
|
1838
|
-
/**
|
|
1839
|
-
* @param {?} activatedRoute
|
|
1840
|
-
* @param {?} placeService
|
|
1841
|
-
*/
|
|
1842
|
-
constructor(activatedRoute, placeService) {
|
|
1843
|
-
super();
|
|
1844
|
-
this.activatedRoute = activatedRoute;
|
|
1845
|
-
this._incomingRouteChange = new MutableValueModel(false);
|
|
1846
|
-
this.resolvedParameters = new MutableValueModel();
|
|
1847
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1848
|
-
this.placeDefinition.getRouteParameters().forEach((/**
|
|
1849
|
-
* @param {?} p
|
|
1850
|
-
* @return {?}
|
|
1851
|
-
*/
|
|
1852
|
-
p => this.installBinding(p)));
|
|
1853
|
-
observe.valuesFrom(activatedRoute.paramMap)
|
|
1854
|
-
.last()
|
|
1855
|
-
.map((/**
|
|
1856
|
-
* @param {?} params
|
|
2476
|
+
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
2477
|
+
if (false) {
|
|
2478
|
+
/** @type {?} */
|
|
2479
|
+
ResolvedParameter.prototype.parameterDef;
|
|
2480
|
+
/** @type {?} */
|
|
2481
|
+
ResolvedParameter.prototype.value;
|
|
2482
|
+
/**
|
|
2483
|
+
* @abstract
|
|
2484
|
+
* @param {?} dest
|
|
1857
2485
|
* @return {?}
|
|
1858
2486
|
*/
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
* @
|
|
2487
|
+
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
2488
|
+
/**
|
|
2489
|
+
* @abstract
|
|
2490
|
+
* @param {?} otherValue
|
|
1862
2491
|
* @return {?}
|
|
1863
2492
|
*/
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
this._incomingRouteChange.value = false;
|
|
1868
|
-
}));
|
|
1869
|
-
when.valueOf(this.resolvedParameters).changes((/**
|
|
1870
|
-
* @param {?} params
|
|
1871
|
-
* @param {?} previous
|
|
2493
|
+
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
2494
|
+
/**
|
|
2495
|
+
* @abstract
|
|
1872
2496
|
* @return {?}
|
|
1873
2497
|
*/
|
|
1874
|
-
(
|
|
1875
|
-
placeService.notifyRouteParametersChanged({
|
|
1876
|
-
activatedRoute: this.activatedRoute,
|
|
1877
|
-
next: params,
|
|
1878
|
-
previous: previous,
|
|
1879
|
-
updateRoute: !this.incomingRouteChange.value // we update the route if it's a component triggered change.
|
|
1880
|
-
});
|
|
1881
|
-
}));
|
|
1882
|
-
}
|
|
1883
|
-
/**
|
|
1884
|
-
* @return {?}
|
|
1885
|
-
*/
|
|
1886
|
-
get incomingRouteChange() {
|
|
1887
|
-
return this._incomingRouteChange.readonly;
|
|
1888
|
-
}
|
|
1889
|
-
/**
|
|
1890
|
-
* @private
|
|
1891
|
-
* @template T, S
|
|
1892
|
-
* @param {?} parameterDef
|
|
1893
|
-
* @return {?}
|
|
1894
|
-
*/
|
|
1895
|
-
installBinding(parameterDef) {
|
|
1896
|
-
/** @type {?} */
|
|
1897
|
-
const model = (/** @type {?} */ (this[parameterDef.propertyName]));
|
|
1898
|
-
// this.txo.observe(parameterDef.propertyName, model);
|
|
1899
|
-
this.registerDisposable(new Binding(this.resolvedParameters, model, {
|
|
1900
|
-
/**
|
|
1901
|
-
* @param {?} parameters
|
|
1902
|
-
* @return {?}
|
|
1903
|
-
*/
|
|
1904
|
-
toRight(parameters) {
|
|
1905
|
-
return parameters.getResolvedParameterValue(parameterDef);
|
|
1906
|
-
},
|
|
1907
|
-
/**
|
|
1908
|
-
* @param {?} value
|
|
1909
|
-
* @param {?=} currentParameters
|
|
1910
|
-
* @return {?}
|
|
1911
|
-
*/
|
|
1912
|
-
toLeft(value, currentParameters) {
|
|
1913
|
-
return currentParameters.replace(parameterDef, value);
|
|
1914
|
-
}
|
|
1915
|
-
}));
|
|
1916
|
-
}
|
|
1917
|
-
/**
|
|
1918
|
-
* @return {?}
|
|
1919
|
-
*/
|
|
1920
|
-
get placeDefinition() {
|
|
1921
|
-
return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
|
|
1922
|
-
}
|
|
1923
|
-
/**
|
|
1924
|
-
* @return {?}
|
|
1925
|
-
*/
|
|
1926
|
-
canDeactivate() {
|
|
1927
|
-
return true;
|
|
1928
|
-
}
|
|
1929
|
-
// @Trace()
|
|
1930
|
-
/**
|
|
1931
|
-
* @return {?}
|
|
1932
|
-
*/
|
|
1933
|
-
onPlaceReady() {
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
__decorate([
|
|
1937
|
-
Memoize$1(),
|
|
1938
|
-
__metadata("design:type", PlaceComponent.Definition),
|
|
1939
|
-
__metadata("design:paramtypes", [])
|
|
1940
|
-
], PlaceComponent.prototype, "placeDefinition", null);
|
|
1941
|
-
if (false) {
|
|
1942
|
-
/** @type {?} */
|
|
1943
|
-
PlaceComponent.prototype._incomingRouteChange;
|
|
1944
|
-
/**
|
|
1945
|
-
* @type {?}
|
|
1946
|
-
* @private
|
|
1947
|
-
*/
|
|
1948
|
-
PlaceComponent.prototype.resolvedParameters;
|
|
1949
|
-
/** @type {?} */
|
|
1950
|
-
PlaceComponent.prototype.activatedRoute;
|
|
1951
|
-
}
|
|
1952
|
-
(function (PlaceComponent) {
|
|
1953
|
-
class Definition {
|
|
1954
|
-
/**
|
|
1955
|
-
* @param {?} component
|
|
1956
|
-
* @param {?} options
|
|
1957
|
-
*/
|
|
1958
|
-
constructor(component, options) {
|
|
1959
|
-
this.component = component;
|
|
1960
|
-
assert.notNil(options);
|
|
1961
|
-
this.path = options.path;
|
|
1962
|
-
this.order = options.order;
|
|
1963
|
-
this.data = options.data;
|
|
1964
|
-
this.authenticate = isNil(options.authenticate) || options.authenticate;
|
|
1965
|
-
this.children = (options.children || []).map((/**
|
|
1966
|
-
* @param {?} c
|
|
1967
|
-
* @return {?}
|
|
1968
|
-
*/
|
|
1969
|
-
c => PlaceComponent.getDefinition(c).component));
|
|
1970
|
-
}
|
|
2498
|
+
ResolvedParameter.prototype.formattedValue = function () { };
|
|
1971
2499
|
/**
|
|
2500
|
+
* @abstract
|
|
2501
|
+
* @param {?} value
|
|
1972
2502
|
* @return {?}
|
|
1973
2503
|
*/
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
2504
|
+
ResolvedParameter.prototype.replace = function (value) { };
|
|
2505
|
+
}
|
|
2506
|
+
/**
|
|
2507
|
+
* @template T
|
|
2508
|
+
*/
|
|
2509
|
+
class ResolvedValueParameter extends ResolvedParameter {
|
|
1977
2510
|
/**
|
|
1978
|
-
* @param {?}
|
|
2511
|
+
* @param {?} otherValue
|
|
1979
2512
|
* @return {?}
|
|
1980
2513
|
*/
|
|
1981
|
-
|
|
1982
|
-
return
|
|
2514
|
+
isSame(otherValue) {
|
|
2515
|
+
return this.value === otherValue;
|
|
1983
2516
|
}
|
|
1984
2517
|
/**
|
|
1985
|
-
* @param {?}
|
|
2518
|
+
* @param {?} dest
|
|
1986
2519
|
* @return {?}
|
|
1987
2520
|
*/
|
|
1988
|
-
|
|
1989
|
-
|
|
2521
|
+
injectRouteParam(dest) {
|
|
2522
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
1990
2523
|
}
|
|
1991
2524
|
/**
|
|
1992
|
-
* @
|
|
1993
|
-
* @param {?} key
|
|
1994
|
-
* @param {?=} defaultValue
|
|
2525
|
+
* @param {?} value
|
|
1995
2526
|
* @return {?}
|
|
1996
2527
|
*/
|
|
1997
|
-
|
|
1998
|
-
return this.
|
|
1999
|
-
isNil(this.data[key]) ? defaultValue : this.data[key] :
|
|
2000
|
-
defaultValue;
|
|
2528
|
+
replace(value) {
|
|
2529
|
+
return new ResolvedValueParameter(this.parameterDef, value);
|
|
2001
2530
|
}
|
|
2002
2531
|
/**
|
|
2003
|
-
* @template T
|
|
2004
|
-
* @param {?} keys
|
|
2005
|
-
* @param {?=} defaultValue
|
|
2006
2532
|
* @return {?}
|
|
2007
2533
|
*/
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
/** @type {?} */
|
|
2011
|
-
const found = keys.find((/**
|
|
2012
|
-
* @param {?} key
|
|
2013
|
-
* @return {?}
|
|
2014
|
-
*/
|
|
2015
|
-
key => !isNil(this.data[key])));
|
|
2016
|
-
return found ? this.data[found] : defaultValue;
|
|
2017
|
-
}
|
|
2018
|
-
else {
|
|
2019
|
-
return defaultValue;
|
|
2020
|
-
}
|
|
2534
|
+
formattedValue() {
|
|
2535
|
+
return !___default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
2021
2536
|
}
|
|
2022
2537
|
}
|
|
2023
|
-
|
|
2024
|
-
Memoize$1(),
|
|
2025
|
-
__metadata("design:type", Function),
|
|
2026
|
-
__metadata("design:paramtypes", []),
|
|
2027
|
-
__metadata("design:returntype", Array)
|
|
2028
|
-
], Definition.prototype, "getRouteParameters", null);
|
|
2029
|
-
PlaceComponent.Definition = Definition;
|
|
2030
|
-
if (false) {
|
|
2031
|
-
/** @type {?} */
|
|
2032
|
-
Definition.prototype.path;
|
|
2033
|
-
/** @type {?} */
|
|
2034
|
-
Definition.prototype.authenticate;
|
|
2035
|
-
/** @type {?} */
|
|
2036
|
-
Definition.prototype.order;
|
|
2037
|
-
/** @type {?} */
|
|
2038
|
-
Definition.prototype.data;
|
|
2039
|
-
/** @type {?} */
|
|
2040
|
-
Definition.prototype.children;
|
|
2041
|
-
/** @type {?} */
|
|
2042
|
-
Definition.prototype.component;
|
|
2043
|
-
}
|
|
2044
|
-
/**
|
|
2045
|
-
* @record
|
|
2046
|
-
*/
|
|
2047
|
-
function Options() { }
|
|
2048
|
-
PlaceComponent.Options = Options;
|
|
2049
|
-
if (false) {
|
|
2050
|
-
/** @type {?} */
|
|
2051
|
-
Options.prototype.path;
|
|
2052
|
-
/** @type {?} */
|
|
2053
|
-
Options.prototype.order;
|
|
2054
|
-
/** @type {?|undefined} */
|
|
2055
|
-
Options.prototype.data;
|
|
2056
|
-
/** @type {?|undefined} */
|
|
2057
|
-
Options.prototype.authenticate;
|
|
2058
|
-
/** @type {?|undefined} */
|
|
2059
|
-
Options.prototype.children;
|
|
2060
|
-
}
|
|
2061
|
-
/**
|
|
2062
|
-
* @record
|
|
2063
|
-
*/
|
|
2064
|
-
function ChildOptions() { }
|
|
2065
|
-
PlaceComponent.ChildOptions = ChildOptions;
|
|
2066
|
-
if (false) {
|
|
2067
|
-
/** @type {?} */
|
|
2068
|
-
ChildOptions.prototype.parent;
|
|
2069
|
-
}
|
|
2070
|
-
/**
|
|
2071
|
-
* @param {?} klass
|
|
2072
|
-
* @return {?}
|
|
2073
|
-
*/
|
|
2074
|
-
function getDefinition(klass) {
|
|
2075
|
-
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
2076
|
-
}
|
|
2077
|
-
PlaceComponent.getDefinition = getDefinition;
|
|
2538
|
+
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
2078
2539
|
/**
|
|
2079
|
-
* @
|
|
2080
|
-
* @param {?} options
|
|
2081
|
-
* @return {?}
|
|
2540
|
+
* @template T
|
|
2082
2541
|
*/
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
PlaceComponent.injectDefinition = injectDefinition;
|
|
2087
|
-
})(PlaceComponent || (PlaceComponent = {}));
|
|
2088
|
-
|
|
2089
|
-
/**
|
|
2090
|
-
* @fileoverview added by tsickle
|
|
2091
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2092
|
-
*/
|
|
2093
|
-
class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
2094
|
-
constructor() {
|
|
2095
|
-
super();
|
|
2096
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2097
|
-
this.placeDefinitions = chain(this.placesModel).map((/**
|
|
2098
|
-
* @param {?} c
|
|
2542
|
+
class ResolvedArrayParameter extends ResolvedParameter {
|
|
2543
|
+
/**
|
|
2544
|
+
* @param {?} otherValue
|
|
2099
2545
|
* @return {?}
|
|
2100
2546
|
*/
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
title: (/**
|
|
2112
|
-
* @return {?}
|
|
2113
|
-
*/
|
|
2114
|
-
() => navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title'])),
|
|
2115
|
-
tooltip: (/**
|
|
2547
|
+
isSame(otherValue) {
|
|
2548
|
+
return ___default.isEqual(this.value, otherValue);
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* @param {?} dest
|
|
2552
|
+
* @return {?}
|
|
2553
|
+
*/
|
|
2554
|
+
injectRouteParam(dest) {
|
|
2555
|
+
dest[this.parameterDef.name] = this.value.map((/**
|
|
2556
|
+
* @param {?} v
|
|
2116
2557
|
* @return {?}
|
|
2117
2558
|
*/
|
|
2118
|
-
|
|
2119
|
-
|
|
2559
|
+
v => this.parameterDef.type.format(v)));
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* @param {?} value
|
|
2563
|
+
* @return {?}
|
|
2564
|
+
*/
|
|
2565
|
+
replace(value) {
|
|
2566
|
+
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
2567
|
+
}
|
|
2568
|
+
/**
|
|
2569
|
+
* @return {?}
|
|
2570
|
+
*/
|
|
2571
|
+
formattedValue() {
|
|
2572
|
+
return this.value ? this.value.map((/**
|
|
2573
|
+
* @param {?} v
|
|
2120
2574
|
* @return {?}
|
|
2121
2575
|
*/
|
|
2122
|
-
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
/**
|
|
2126
|
-
* @return {?}
|
|
2127
|
-
*/
|
|
2128
|
-
ngOnInit() {
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
AbstractPlaceNavigationComponent.propDecorators = {
|
|
2132
|
-
places: [{ type: Input }],
|
|
2133
|
-
placesModel: [{ type: Input }]
|
|
2134
|
-
};
|
|
2135
|
-
__decorate([
|
|
2136
|
-
StoreInListModel('placesModel'),
|
|
2137
|
-
__metadata("design:type", Array)
|
|
2138
|
-
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
2139
|
-
__decorate([
|
|
2140
|
-
UseDelegate(),
|
|
2141
|
-
__metadata("design:type", ListModel)
|
|
2142
|
-
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2143
|
-
__decorate([
|
|
2144
|
-
Memoize(),
|
|
2145
|
-
__metadata("design:type", Function),
|
|
2146
|
-
__metadata("design:paramtypes", [PlaceComponent.Definition]),
|
|
2147
|
-
__metadata("design:returntype", Object)
|
|
2148
|
-
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
2149
|
-
if (false) {
|
|
2150
|
-
/** @type {?} */
|
|
2151
|
-
AbstractPlaceNavigationComponent.prototype.places;
|
|
2152
|
-
/** @type {?} */
|
|
2153
|
-
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
2154
|
-
/** @type {?} */
|
|
2155
|
-
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
/**
|
|
2159
|
-
* @fileoverview added by tsickle
|
|
2160
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2161
|
-
*/
|
|
2162
|
-
class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
2163
|
-
constructor() {
|
|
2164
|
-
super();
|
|
2165
|
-
this.expanded = true;
|
|
2166
|
-
}
|
|
2167
|
-
/**
|
|
2168
|
-
* @return {?}
|
|
2169
|
-
*/
|
|
2170
|
-
expandMenu() {
|
|
2171
|
-
this.expanded = true;
|
|
2172
|
-
}
|
|
2173
|
-
/**
|
|
2174
|
-
* @return {?}
|
|
2175
|
-
*/
|
|
2176
|
-
collapseMenu() {
|
|
2177
|
-
this.expanded = false;
|
|
2178
|
-
}
|
|
2179
|
-
/**
|
|
2180
|
-
* @return {?}
|
|
2181
|
-
*/
|
|
2182
|
-
toggleMenu() {
|
|
2183
|
-
this.expanded = !this.expanded;
|
|
2576
|
+
v => this.parameterDef.type.format(v))) : [];
|
|
2577
|
+
}
|
|
2184
2578
|
}
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
{ type: Component, args: [{
|
|
2188
|
-
selector: 'angular-ui-powerups-list-place-nav',
|
|
2189
|
-
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",
|
|
2190
|
-
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}"]
|
|
2191
|
-
}] }
|
|
2192
|
-
];
|
|
2193
|
-
/** @nocollapse */
|
|
2194
|
-
ListPlaceNavComponent.ctorParameters = () => [];
|
|
2195
|
-
ListPlaceNavComponent.propDecorators = {
|
|
2196
|
-
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
2197
|
-
};
|
|
2198
|
-
if (false) {
|
|
2199
|
-
/** @type {?} */
|
|
2200
|
-
ListPlaceNavComponent.prototype.expanded;
|
|
2201
|
-
}
|
|
2579
|
+
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
2580
|
+
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
2202
2581
|
|
|
2203
2582
|
/**
|
|
2204
2583
|
* @fileoverview added by tsickle
|
|
2205
2584
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2206
2585
|
*/
|
|
2207
|
-
class
|
|
2586
|
+
class PlaceRouter {
|
|
2208
2587
|
/**
|
|
2209
2588
|
* @param {?} router
|
|
2210
|
-
* @param {?} injector
|
|
2211
2589
|
*/
|
|
2212
|
-
constructor(router
|
|
2213
|
-
super();
|
|
2590
|
+
constructor(router) {
|
|
2214
2591
|
this.router = router;
|
|
2215
|
-
this.injector = injector;
|
|
2216
|
-
this._activePlaces = new MutableListModel();
|
|
2217
|
-
}
|
|
2218
|
-
/**
|
|
2219
|
-
* @return {?}
|
|
2220
|
-
*/
|
|
2221
|
-
get activePlaces() {
|
|
2222
|
-
return this._activePlaces.readonly;
|
|
2223
2592
|
}
|
|
2224
|
-
// @Trace()
|
|
2225
2593
|
/**
|
|
2226
|
-
* @param {?}
|
|
2594
|
+
* @param {?} activatedRoute
|
|
2595
|
+
* @param {?} previous
|
|
2596
|
+
* @param {?} next
|
|
2227
2597
|
* @return {?}
|
|
2228
2598
|
*/
|
|
2229
|
-
|
|
2230
|
-
|
|
2599
|
+
pushParameterChangesToRoute(activatedRoute, previous, next) {
|
|
2600
|
+
/** @type {?} */
|
|
2601
|
+
const relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
2602
|
+
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
2603
|
+
relativeTo: activatedRoute
|
|
2604
|
+
});
|
|
2231
2605
|
}
|
|
2232
|
-
// @Trace()
|
|
2233
2606
|
/**
|
|
2234
|
-
* @param {?}
|
|
2607
|
+
* @param {?} activatedRoute
|
|
2608
|
+
* @param {?} sanitised
|
|
2235
2609
|
* @return {?}
|
|
2236
2610
|
*/
|
|
2237
|
-
|
|
2238
|
-
|
|
2611
|
+
getRedirectUrlTree(activatedRoute, sanitised) {
|
|
2612
|
+
/** @type {?} */
|
|
2613
|
+
const urlSegments = activatedRoute.url;
|
|
2614
|
+
/** @type {?} */
|
|
2615
|
+
const weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
2616
|
+
/** @type {?} */
|
|
2617
|
+
const commands = (weHaveARouteId) ?
|
|
2618
|
+
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
2619
|
+
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
2620
|
+
console.log("redirect path", commands);
|
|
2621
|
+
return this.router.createUrlTree(commands);
|
|
2239
2622
|
}
|
|
2240
|
-
// @Trace()
|
|
2241
2623
|
/**
|
|
2242
|
-
* @
|
|
2624
|
+
* @protected
|
|
2625
|
+
* @param {?} activatedRoute
|
|
2243
2626
|
* @return {?}
|
|
2244
2627
|
*/
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
const relativePath = !!params.previous.hasRouteId() ? '..' : '.';
|
|
2252
|
-
/** @type {?} */
|
|
2253
|
-
const path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
|
|
2254
|
-
this.router.navigate(path, {
|
|
2255
|
-
relativeTo: params.activatedRoute
|
|
2256
|
-
});
|
|
2257
|
-
}
|
|
2628
|
+
getChildPath(activatedRoute) {
|
|
2629
|
+
return ___default.flatten(activatedRoute.children.map((/**
|
|
2630
|
+
* @param {?} child
|
|
2631
|
+
* @return {?}
|
|
2632
|
+
*/
|
|
2633
|
+
child => child.url)));
|
|
2258
2634
|
}
|
|
2259
|
-
// @Trace()
|
|
2260
2635
|
/**
|
|
2261
|
-
* @
|
|
2636
|
+
* @protected
|
|
2637
|
+
* @param {?} parameters
|
|
2262
2638
|
* @return {?}
|
|
2263
2639
|
*/
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2640
|
+
createRouteParameters(parameters) {
|
|
2641
|
+
/** @type {?} */
|
|
2642
|
+
const routeId = parameters.getFormattedRouteId();
|
|
2643
|
+
return routeId ?
|
|
2644
|
+
[routeId, parameters.getFormattedParameters()] :
|
|
2645
|
+
[parameters.getFormattedParameters()];
|
|
2268
2646
|
}
|
|
2269
2647
|
}
|
|
2270
|
-
|
|
2648
|
+
PlaceRouter.decorators = [
|
|
2271
2649
|
{ type: Injectable, args: [{
|
|
2272
2650
|
providedIn: 'root'
|
|
2273
2651
|
},] }
|
|
2274
2652
|
];
|
|
2275
2653
|
/** @nocollapse */
|
|
2276
|
-
|
|
2277
|
-
{ type: Router }
|
|
2278
|
-
{ type: Injector }
|
|
2654
|
+
PlaceRouter.ctorParameters = () => [
|
|
2655
|
+
{ type: Router }
|
|
2279
2656
|
];
|
|
2280
|
-
/** @nocollapse */
|
|
2657
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
2658
|
+
__decorate([
|
|
2659
|
+
Trace(),
|
|
2660
|
+
__metadata("design:type", Function),
|
|
2661
|
+
__metadata("design:paramtypes", [ActivatedRouteSnapshot, ParameterSnapshot]),
|
|
2662
|
+
__metadata("design:returntype", UrlTree)
|
|
2663
|
+
], PlaceRouter.prototype, "getRedirectUrlTree", null);
|
|
2281
2664
|
if (false) {
|
|
2282
2665
|
/**
|
|
2283
2666
|
* @type {?}
|
|
2284
2667
|
* @private
|
|
2285
2668
|
*/
|
|
2286
|
-
|
|
2287
|
-
/**
|
|
2288
|
-
* @type {?}
|
|
2289
|
-
* @protected
|
|
2290
|
-
*/
|
|
2291
|
-
PlaceService.prototype.router;
|
|
2292
|
-
/**
|
|
2293
|
-
* @type {?}
|
|
2294
|
-
* @protected
|
|
2295
|
-
*/
|
|
2296
|
-
PlaceService.prototype.injector;
|
|
2669
|
+
PlaceRouter.prototype.router;
|
|
2297
2670
|
}
|
|
2298
2671
|
|
|
2299
2672
|
/**
|
|
@@ -2347,105 +2720,140 @@ function leftRightPlaceAnimation(duration) {
|
|
|
2347
2720
|
]);
|
|
2348
2721
|
}
|
|
2349
2722
|
/** @type {?} */
|
|
2350
|
-
const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation(
|
|
2723
|
+
const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation('0.3s');
|
|
2351
2724
|
|
|
2352
2725
|
/**
|
|
2353
2726
|
* @fileoverview added by tsickle
|
|
2354
2727
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2355
2728
|
*/
|
|
2729
|
+
/**
|
|
2730
|
+
* @record
|
|
2731
|
+
*/
|
|
2732
|
+
function PlaceRef() { }
|
|
2733
|
+
if (false) {
|
|
2734
|
+
/** @type {?} */
|
|
2735
|
+
PlaceRef.prototype.placeDefinition;
|
|
2736
|
+
/**
|
|
2737
|
+
* @param {?} param
|
|
2738
|
+
* @return {?}
|
|
2739
|
+
*/
|
|
2740
|
+
PlaceRef.prototype.initialiseBindings = function (param) { };
|
|
2741
|
+
/**
|
|
2742
|
+
* @return {?}
|
|
2743
|
+
*/
|
|
2744
|
+
PlaceRef.prototype.onPlaceReady = function () { };
|
|
2745
|
+
}
|
|
2356
2746
|
class PlaceOutletComponent extends DisposableComponent {
|
|
2357
2747
|
/**
|
|
2358
|
-
* @param {?}
|
|
2359
|
-
* @param {?}
|
|
2748
|
+
* @param {?} router
|
|
2749
|
+
* @param {?} placeHistory
|
|
2360
2750
|
*/
|
|
2361
|
-
constructor(
|
|
2751
|
+
constructor(router, placeHistory) {
|
|
2362
2752
|
super();
|
|
2363
|
-
this.
|
|
2364
|
-
this.
|
|
2753
|
+
this.router = router;
|
|
2754
|
+
this.placeHistory = placeHistory;
|
|
2365
2755
|
this.animate = true;
|
|
2366
|
-
this.
|
|
2756
|
+
this._incomingRouteChange = new Guard();
|
|
2757
|
+
this._inOutletUpdate = new Guard();
|
|
2758
|
+
this._activatedRouteModel = new MutableValueModel();
|
|
2759
|
+
this._placeDefinition = new MutableValueModel();
|
|
2760
|
+
this._resolvedParameters = new MutableValueModel();
|
|
2367
2761
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
* @
|
|
2371
|
-
*/
|
|
2372
|
-
s => s.toString())).reduce((/**
|
|
2373
|
-
* @param {?} bits
|
|
2374
|
-
* @return {?}
|
|
2375
|
-
*/
|
|
2376
|
-
bits => bits.join(',')));
|
|
2377
|
-
console.log(`new outlet@(${this.myPath.value})`);
|
|
2378
|
-
this.outletChildPath = chain(this.outletUrlSegment).map((/**
|
|
2379
|
-
* @param {?} s
|
|
2762
|
+
/** @type {?} */
|
|
2763
|
+
const paramMap = chain(this._activatedRouteModel).pullObservableValue((/**
|
|
2764
|
+
* @param {?} ar
|
|
2380
2765
|
* @return {?}
|
|
2381
2766
|
*/
|
|
2382
|
-
|
|
2383
|
-
|
|
2767
|
+
ar => ar.paramMap));
|
|
2768
|
+
/** @type {?} */
|
|
2769
|
+
const urls = chain(this._activatedRouteModel).pullObservableValue((/**
|
|
2770
|
+
* @param {?} ar
|
|
2384
2771
|
* @return {?}
|
|
2385
2772
|
*/
|
|
2386
|
-
|
|
2387
|
-
this.
|
|
2388
|
-
|
|
2773
|
+
ar => ar.url));
|
|
2774
|
+
this.placeConfigured = valueOf.all(chain(this._inOutletUpdate).isFalsey(), this._placeDefinition, paramMap, urls).areTruthy();
|
|
2775
|
+
when.anyOf(paramMap, urls).changes((/**
|
|
2389
2776
|
* @return {?}
|
|
2390
2777
|
*/
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2778
|
+
() => {
|
|
2779
|
+
/** @type {?} */
|
|
2780
|
+
const snapshot = ParameterSnapshot.create(this._placeDefinition.value, paramMap.value, urls.value);
|
|
2781
|
+
this._incomingRouteChange.whileTrue((/**
|
|
2782
|
+
* @return {?}
|
|
2783
|
+
*/
|
|
2784
|
+
() => {
|
|
2785
|
+
this._resolvedParameters.value = snapshot;
|
|
2786
|
+
this.placeHistory.add(snapshot);
|
|
2787
|
+
}));
|
|
2788
|
+
}), {
|
|
2789
|
+
postponeUntil: this.placeConfigured
|
|
2790
|
+
});
|
|
2791
|
+
when.valueOf(this._resolvedParameters).changes((/**
|
|
2792
|
+
* @param {?} next
|
|
2793
|
+
* @param {?} previous
|
|
2396
2794
|
* @return {?}
|
|
2397
2795
|
*/
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2796
|
+
(next, previous) => {
|
|
2797
|
+
this.pushChangesToRoute(next, previous);
|
|
2798
|
+
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.
|
|
2799
|
+
}), {
|
|
2800
|
+
unless: this.incomingRouteChange
|
|
2801
|
+
});
|
|
2802
|
+
// const txo = new TransactionObserver().onEvent(e => console.log(e.toString()));
|
|
2803
|
+
// txo.observe('paramMap', paramMap);
|
|
2804
|
+
// txo.observe('urls', urls);
|
|
2805
|
+
// txo.observe('this._resolvedParameters', this._resolvedParameters);
|
|
2406
2806
|
}
|
|
2407
2807
|
/**
|
|
2408
2808
|
* @return {?}
|
|
2409
2809
|
*/
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
// this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2413
|
-
// });
|
|
2810
|
+
get incomingRouteChange() {
|
|
2811
|
+
return this._incomingRouteChange;
|
|
2414
2812
|
}
|
|
2415
2813
|
/**
|
|
2416
2814
|
* @return {?}
|
|
2417
2815
|
*/
|
|
2418
|
-
|
|
2419
|
-
// console.log(`@AfterViewChecked: ${this.state.value}`);
|
|
2420
|
-
this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2816
|
+
ngOnInit() {
|
|
2421
2817
|
}
|
|
2422
|
-
// @Trace()
|
|
2423
|
-
// ngOnDestroy(): void {
|
|
2424
|
-
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2425
|
-
// console.log('mySegments', this.myPath.value);
|
|
2426
|
-
// super.ngOnDestroy();
|
|
2427
|
-
// }
|
|
2428
|
-
// @Trace()
|
|
2429
2818
|
/**
|
|
2430
|
-
* @param {?}
|
|
2819
|
+
* @param {?} routerOutlet
|
|
2820
|
+
* @param {?} place
|
|
2431
2821
|
* @return {?}
|
|
2432
2822
|
*/
|
|
2433
|
-
onOutletActivated(
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2823
|
+
onOutletActivated(routerOutlet, place) {
|
|
2824
|
+
this._inOutletUpdate.whileTrue((/**
|
|
2825
|
+
* @return {?}
|
|
2826
|
+
*/
|
|
2827
|
+
() => {
|
|
2828
|
+
try {
|
|
2829
|
+
this._currentPlace = place;
|
|
2830
|
+
this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
2831
|
+
this._placeDefinition.value = place.placeDefinition;
|
|
2832
|
+
place.initialiseBindings(this._resolvedParameters);
|
|
2833
|
+
}
|
|
2834
|
+
catch (error) {
|
|
2835
|
+
console.error(error);
|
|
2836
|
+
}
|
|
2837
|
+
}));
|
|
2437
2838
|
if (!this.animate) {
|
|
2438
2839
|
// we're not animating so trigger any post animation callbacks now.
|
|
2439
2840
|
this.animationDone();
|
|
2440
2841
|
}
|
|
2441
2842
|
}
|
|
2442
2843
|
/**
|
|
2844
|
+
* @param {?} routerOutlet
|
|
2443
2845
|
* @param {?} $event
|
|
2444
2846
|
* @return {?}
|
|
2445
2847
|
*/
|
|
2446
|
-
onOutletDeactivated($event) {
|
|
2447
|
-
this.
|
|
2448
|
-
|
|
2848
|
+
onOutletDeactivated(routerOutlet, $event) {
|
|
2849
|
+
this._inOutletUpdate.whileTrue((/**
|
|
2850
|
+
* @return {?}
|
|
2851
|
+
*/
|
|
2852
|
+
() => {
|
|
2853
|
+
this._currentPlace = null;
|
|
2854
|
+
this._activatedRouteModel.value = null;
|
|
2855
|
+
this._placeDefinition.value = null;
|
|
2856
|
+
}));
|
|
2449
2857
|
}
|
|
2450
2858
|
/**
|
|
2451
2859
|
* @param {?} outlet
|
|
@@ -2458,79 +2866,93 @@ class PlaceOutletComponent extends DisposableComponent {
|
|
|
2458
2866
|
* @return {?}
|
|
2459
2867
|
*/
|
|
2460
2868
|
animationDone() {
|
|
2461
|
-
if (this.
|
|
2462
|
-
this.
|
|
2869
|
+
if (this._currentPlace) {
|
|
2870
|
+
this._currentPlace.onPlaceReady();
|
|
2463
2871
|
}
|
|
2464
2872
|
}
|
|
2465
|
-
// @Trace()
|
|
2466
2873
|
/**
|
|
2467
|
-
* @
|
|
2468
|
-
* @param {?}
|
|
2874
|
+
* @param {?} next
|
|
2875
|
+
* @param {?} previous
|
|
2469
2876
|
* @return {?}
|
|
2470
2877
|
*/
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2878
|
+
pushChangesToRoute(next, previous) {
|
|
2879
|
+
/** @type {?} */
|
|
2880
|
+
const activatedRoute = this._activatedRouteModel.value;
|
|
2881
|
+
this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
|
|
2882
|
+
}
|
|
2883
|
+
/**
|
|
2884
|
+
* @param {?} snapshot
|
|
2885
|
+
* @param {?} callback
|
|
2886
|
+
* @return {?}
|
|
2887
|
+
*/
|
|
2888
|
+
sanitise(snapshot, callback) {
|
|
2889
|
+
return snapshot;
|
|
2475
2890
|
}
|
|
2476
2891
|
}
|
|
2477
2892
|
PlaceOutletComponent.decorators = [
|
|
2478
2893
|
{ type: Component, args: [{
|
|
2479
2894
|
selector: 'angular-ui-powerups-place-outlet',
|
|
2480
|
-
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",
|
|
2895
|
+
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",
|
|
2481
2896
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
2482
2897
|
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}"]
|
|
2483
2898
|
}] }
|
|
2484
2899
|
];
|
|
2485
2900
|
/** @nocollapse */
|
|
2486
2901
|
PlaceOutletComponent.ctorParameters = () => [
|
|
2487
|
-
{ type:
|
|
2488
|
-
{ type:
|
|
2902
|
+
{ type: PlaceRouter },
|
|
2903
|
+
{ type: PlaceHistory }
|
|
2489
2904
|
];
|
|
2490
2905
|
PlaceOutletComponent.propDecorators = {
|
|
2491
2906
|
animate: [{ type: Input }],
|
|
2492
|
-
|
|
2907
|
+
routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
2493
2908
|
};
|
|
2494
2909
|
if (false) {
|
|
2495
2910
|
/** @type {?} */
|
|
2496
2911
|
PlaceOutletComponent.prototype.animate;
|
|
2497
2912
|
/** @type {?} */
|
|
2498
|
-
PlaceOutletComponent.prototype.
|
|
2913
|
+
PlaceOutletComponent.prototype.routerOut;
|
|
2914
|
+
/**
|
|
2915
|
+
* @type {?}
|
|
2916
|
+
* @private
|
|
2917
|
+
*/
|
|
2918
|
+
PlaceOutletComponent.prototype._currentPlace;
|
|
2499
2919
|
/**
|
|
2500
2920
|
* @type {?}
|
|
2501
2921
|
* @private
|
|
2502
2922
|
*/
|
|
2503
|
-
PlaceOutletComponent.prototype.
|
|
2923
|
+
PlaceOutletComponent.prototype._incomingRouteChange;
|
|
2504
2924
|
/**
|
|
2505
2925
|
* @type {?}
|
|
2506
2926
|
* @private
|
|
2507
2927
|
*/
|
|
2508
|
-
PlaceOutletComponent.prototype.
|
|
2928
|
+
PlaceOutletComponent.prototype._inOutletUpdate;
|
|
2509
2929
|
/**
|
|
2510
2930
|
* @type {?}
|
|
2511
2931
|
* @private
|
|
2512
2932
|
*/
|
|
2513
|
-
PlaceOutletComponent.prototype.
|
|
2933
|
+
PlaceOutletComponent.prototype._activatedRouteModel;
|
|
2514
2934
|
/**
|
|
2515
2935
|
* @type {?}
|
|
2516
2936
|
* @private
|
|
2517
2937
|
*/
|
|
2518
|
-
PlaceOutletComponent.prototype.
|
|
2938
|
+
PlaceOutletComponent.prototype._placeDefinition;
|
|
2939
|
+
/** @type {?} */
|
|
2940
|
+
PlaceOutletComponent.prototype._resolvedParameters;
|
|
2519
2941
|
/**
|
|
2520
2942
|
* @type {?}
|
|
2521
2943
|
* @private
|
|
2522
2944
|
*/
|
|
2523
|
-
PlaceOutletComponent.prototype.
|
|
2945
|
+
PlaceOutletComponent.prototype.placeConfigured;
|
|
2524
2946
|
/**
|
|
2525
2947
|
* @type {?}
|
|
2526
2948
|
* @private
|
|
2527
2949
|
*/
|
|
2528
|
-
PlaceOutletComponent.prototype.
|
|
2950
|
+
PlaceOutletComponent.prototype.router;
|
|
2529
2951
|
/**
|
|
2530
2952
|
* @type {?}
|
|
2531
2953
|
* @private
|
|
2532
2954
|
*/
|
|
2533
|
-
PlaceOutletComponent.prototype.
|
|
2955
|
+
PlaceOutletComponent.prototype.placeHistory;
|
|
2534
2956
|
}
|
|
2535
2957
|
|
|
2536
2958
|
/**
|
|
@@ -2585,9 +3007,7 @@ PlaceModule.decorators = [
|
|
|
2585
3007
|
TabbedPlaceNavigationComponent,
|
|
2586
3008
|
ListPlaceNavComponent
|
|
2587
3009
|
],
|
|
2588
|
-
providers: [
|
|
2589
|
-
PlaceService
|
|
2590
|
-
]
|
|
3010
|
+
providers: []
|
|
2591
3011
|
},] }
|
|
2592
3012
|
];
|
|
2593
3013
|
|
|
@@ -2991,39 +3411,6 @@ if (false) {
|
|
|
2991
3411
|
NavItem.prototype.tooltip = function () { };
|
|
2992
3412
|
}
|
|
2993
3413
|
|
|
2994
|
-
/**
|
|
2995
|
-
* @fileoverview added by tsickle
|
|
2996
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2997
|
-
*/
|
|
2998
|
-
/**
|
|
2999
|
-
* @record
|
|
3000
|
-
*/
|
|
3001
|
-
function PlaceComponentLike() { }
|
|
3002
|
-
if (false) {
|
|
3003
|
-
/** @type {?} */
|
|
3004
|
-
PlaceComponentLike.prototype.activatedRoute;
|
|
3005
|
-
/**
|
|
3006
|
-
* @return {?}
|
|
3007
|
-
*/
|
|
3008
|
-
PlaceComponentLike.prototype.onPlaceReady = function () { };
|
|
3009
|
-
}
|
|
3010
|
-
|
|
3011
|
-
/**
|
|
3012
|
-
* @fileoverview added by tsickle
|
|
3013
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3014
|
-
*/
|
|
3015
|
-
/**
|
|
3016
|
-
* @record
|
|
3017
|
-
*/
|
|
3018
|
-
function PlaceUpdatesService() { }
|
|
3019
|
-
if (false) {
|
|
3020
|
-
/**
|
|
3021
|
-
* @param {?} params
|
|
3022
|
-
* @return {?}
|
|
3023
|
-
*/
|
|
3024
|
-
PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
3414
|
/**
|
|
3028
3415
|
* @fileoverview added by tsickle
|
|
3029
3416
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3038,12 +3425,37 @@ function Place(options) {
|
|
|
3038
3425
|
* @return {?}
|
|
3039
3426
|
*/
|
|
3040
3427
|
(target) => {
|
|
3041
|
-
if (
|
|
3428
|
+
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
3429
|
+
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
|
|
3430
|
+
* @param {?} c
|
|
3431
|
+
* @return {?}
|
|
3432
|
+
*/
|
|
3433
|
+
c => PlaceComponent.getDefinition(c)))));
|
|
3434
|
+
}
|
|
3435
|
+
else {
|
|
3042
3436
|
lang.illegalState(`${target} must extend PlaceComponent to use the @Place decorator`);
|
|
3043
3437
|
}
|
|
3044
|
-
PlaceComponent.injectDefinition((/** @type {?} */ (target)), options);
|
|
3045
3438
|
});
|
|
3046
3439
|
}
|
|
3440
|
+
(function (Place) {
|
|
3441
|
+
/**
|
|
3442
|
+
* @record
|
|
3443
|
+
*/
|
|
3444
|
+
function Options() { }
|
|
3445
|
+
Place.Options = Options;
|
|
3446
|
+
if (false) {
|
|
3447
|
+
/** @type {?} */
|
|
3448
|
+
Options.prototype.path;
|
|
3449
|
+
/** @type {?} */
|
|
3450
|
+
Options.prototype.order;
|
|
3451
|
+
/** @type {?|undefined} */
|
|
3452
|
+
Options.prototype.data;
|
|
3453
|
+
/** @type {?|undefined} */
|
|
3454
|
+
Options.prototype.authenticate;
|
|
3455
|
+
/** @type {?|undefined} */
|
|
3456
|
+
Options.prototype.children;
|
|
3457
|
+
}
|
|
3458
|
+
})(Place || (Place = {}));
|
|
3047
3459
|
|
|
3048
3460
|
/**
|
|
3049
3461
|
* @fileoverview added by tsickle
|
|
@@ -3059,12 +3471,12 @@ if (false) {
|
|
|
3059
3471
|
/**
|
|
3060
3472
|
* @return {?}
|
|
3061
3473
|
*/
|
|
3062
|
-
Visit.prototype.
|
|
3474
|
+
Visit.prototype.getRouteIdValue = function () { };
|
|
3063
3475
|
/**
|
|
3064
3476
|
* @param {?} name
|
|
3065
3477
|
* @return {?}
|
|
3066
3478
|
*/
|
|
3067
|
-
Visit.prototype.
|
|
3479
|
+
Visit.prototype.getParameterValue = function (name) { };
|
|
3068
3480
|
}
|
|
3069
3481
|
|
|
3070
3482
|
/**
|
|
@@ -3091,14 +3503,16 @@ class LeavePlaceGuard {
|
|
|
3091
3503
|
// HACK: this will break with child routes...
|
|
3092
3504
|
/** @type {?} */
|
|
3093
3505
|
const path = `/${component.placeDefinition.path}`;
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3506
|
+
// let thisTree = this.router.parseUrl(currentState.url);
|
|
3507
|
+
// let nextTree = this.router.parseUrl(nextState.url);
|
|
3508
|
+
// console.log({
|
|
3509
|
+
// placePath: path,
|
|
3510
|
+
// currentRoute: currentRoute.toString(),
|
|
3511
|
+
// currentStateUrl: currentState.url,
|
|
3512
|
+
// nextStateUrl: nextState.url,
|
|
3513
|
+
// currentStateUrlTree: thisTree.root.children[PRIMARY_OUTLET].segments,
|
|
3514
|
+
// nextStateUrlTree: nextTree.root.children[PRIMARY_OUTLET].segments
|
|
3515
|
+
// });
|
|
3102
3516
|
// nextState is the full path...
|
|
3103
3517
|
if (!nextState.url.startsWith(path)) {
|
|
3104
3518
|
return component.canDeactivate();
|
|
@@ -3138,34 +3552,40 @@ if (false) {
|
|
|
3138
3552
|
*/
|
|
3139
3553
|
class PlaceRouteGuard {
|
|
3140
3554
|
/**
|
|
3141
|
-
* @param {?}
|
|
3142
|
-
* @param {?}
|
|
3555
|
+
* @param {?} placeRouter
|
|
3556
|
+
* @param {?} injector
|
|
3143
3557
|
*/
|
|
3144
|
-
constructor(
|
|
3145
|
-
this.
|
|
3146
|
-
this.
|
|
3558
|
+
constructor(placeRouter, injector) {
|
|
3559
|
+
this.placeRouter = placeRouter;
|
|
3560
|
+
this.injector = injector;
|
|
3147
3561
|
}
|
|
3148
3562
|
/**
|
|
3149
|
-
* @param {?}
|
|
3563
|
+
* @param {?} activatedRoute
|
|
3150
3564
|
* @param {?} state
|
|
3151
3565
|
* @return {?}
|
|
3152
3566
|
*/
|
|
3153
|
-
canActivate(
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3567
|
+
canActivate(activatedRoute, state) {
|
|
3568
|
+
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
3569
|
+
/** @type {?} */
|
|
3570
|
+
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
3571
|
+
/** @type {?} */
|
|
3572
|
+
const snapshot = ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap, activatedRoute.url);
|
|
3573
|
+
return snapshot.sanitise(this.injector).then((/**
|
|
3574
|
+
* @param {?} sanitised
|
|
3575
|
+
* @return {?}
|
|
3576
|
+
*/
|
|
3577
|
+
sanitised => {
|
|
3578
|
+
if (sanitised.hasChanged(snapshot, true)) {
|
|
3579
|
+
return this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
3580
|
+
}
|
|
3581
|
+
else {
|
|
3582
|
+
return true;
|
|
3583
|
+
}
|
|
3584
|
+
}));
|
|
3585
|
+
}
|
|
3586
|
+
else {
|
|
3587
|
+
return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);
|
|
3588
|
+
}
|
|
3169
3589
|
}
|
|
3170
3590
|
}
|
|
3171
3591
|
PlaceRouteGuard.decorators = [
|
|
@@ -3175,96 +3595,21 @@ PlaceRouteGuard.decorators = [
|
|
|
3175
3595
|
];
|
|
3176
3596
|
/** @nocollapse */
|
|
3177
3597
|
PlaceRouteGuard.ctorParameters = () => [
|
|
3178
|
-
{ type:
|
|
3179
|
-
{ type:
|
|
3598
|
+
{ type: PlaceRouter },
|
|
3599
|
+
{ type: Injector }
|
|
3180
3600
|
];
|
|
3181
|
-
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(
|
|
3182
|
-
if (false) {
|
|
3183
|
-
/**
|
|
3184
|
-
* @type {?}
|
|
3185
|
-
* @private
|
|
3186
|
-
*/
|
|
3187
|
-
PlaceRouteGuard.prototype.placeService;
|
|
3188
|
-
/**
|
|
3189
|
-
* @type {?}
|
|
3190
|
-
* @private
|
|
3191
|
-
*/
|
|
3192
|
-
PlaceRouteGuard.prototype.router;
|
|
3193
|
-
}
|
|
3194
|
-
|
|
3195
|
-
/**
|
|
3196
|
-
* @fileoverview added by tsickle
|
|
3197
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3198
|
-
*/
|
|
3199
|
-
/**
|
|
3200
|
-
* @template T, S
|
|
3201
|
-
*/
|
|
3202
|
-
class DefaultParameterSanitiser {
|
|
3203
|
-
/**
|
|
3204
|
-
* @param {?} def
|
|
3205
|
-
* @param {?} placeService
|
|
3206
|
-
* @param {?} options
|
|
3207
|
-
*/
|
|
3208
|
-
constructor(def, placeService, options) {
|
|
3209
|
-
this.def = def;
|
|
3210
|
-
this.placeService = placeService;
|
|
3211
|
-
this.remember = isNil(options.remember) ? false : options.remember;
|
|
3212
|
-
this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
|
|
3213
|
-
}
|
|
3214
|
-
/**
|
|
3215
|
-
* @param {?} value
|
|
3216
|
-
* @param {?} visit
|
|
3217
|
-
* @return {?}
|
|
3218
|
-
*/
|
|
3219
|
-
sanitise(value, visit) {
|
|
3220
|
-
if (this.isBlank(value)) {
|
|
3221
|
-
if (this.remember) {
|
|
3222
|
-
// value = null;
|
|
3223
|
-
}
|
|
3224
|
-
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3225
|
-
}
|
|
3226
|
-
else {
|
|
3227
|
-
return value;
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
/**
|
|
3231
|
-
* @private
|
|
3232
|
-
* @param {?} value
|
|
3233
|
-
* @return {?}
|
|
3234
|
-
*/
|
|
3235
|
-
isBlank(value) {
|
|
3236
|
-
/** @type {?} */
|
|
3237
|
-
const isNil$1 = isNil(value);
|
|
3238
|
-
return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
__decorate([
|
|
3242
|
-
Trace(),
|
|
3243
|
-
__metadata("design:type", Function),
|
|
3244
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
3245
|
-
__metadata("design:returntype", Object)
|
|
3246
|
-
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
3601
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceRouter), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3247
3602
|
if (false) {
|
|
3248
3603
|
/**
|
|
3249
3604
|
* @type {?}
|
|
3250
3605
|
* @private
|
|
3251
3606
|
*/
|
|
3252
|
-
|
|
3253
|
-
/**
|
|
3254
|
-
* @type {?}
|
|
3255
|
-
* @private
|
|
3256
|
-
*/
|
|
3257
|
-
DefaultParameterSanitiser.prototype.defaultValue;
|
|
3258
|
-
/**
|
|
3259
|
-
* @type {?}
|
|
3260
|
-
* @private
|
|
3261
|
-
*/
|
|
3262
|
-
DefaultParameterSanitiser.prototype.def;
|
|
3607
|
+
PlaceRouteGuard.prototype.placeRouter;
|
|
3263
3608
|
/**
|
|
3264
3609
|
* @type {?}
|
|
3265
3610
|
* @private
|
|
3266
3611
|
*/
|
|
3267
|
-
|
|
3612
|
+
PlaceRouteGuard.prototype.injector;
|
|
3268
3613
|
}
|
|
3269
3614
|
|
|
3270
3615
|
/**
|
|
@@ -3298,8 +3643,6 @@ if (false) {
|
|
|
3298
3643
|
ParameterOptions.prototype.remember;
|
|
3299
3644
|
/** @type {?|undefined} */
|
|
3300
3645
|
ParameterOptions.prototype.defaultValue;
|
|
3301
|
-
/** @type {?|undefined} */
|
|
3302
|
-
ParameterOptions.prototype.sanitiser;
|
|
3303
3646
|
}
|
|
3304
3647
|
/**
|
|
3305
3648
|
* @record
|
|
@@ -3315,8 +3658,6 @@ if (false) {
|
|
|
3315
3658
|
ListParameterOptions.prototype.remember;
|
|
3316
3659
|
/** @type {?|undefined} */
|
|
3317
3660
|
ListParameterOptions.prototype.defaultValue;
|
|
3318
|
-
/** @type {?|undefined} */
|
|
3319
|
-
ListParameterOptions.prototype.sanitiser;
|
|
3320
3661
|
}
|
|
3321
3662
|
/**
|
|
3322
3663
|
* @template T
|
|
@@ -3325,7 +3666,6 @@ if (false) {
|
|
|
3325
3666
|
* @return {?}
|
|
3326
3667
|
*/
|
|
3327
3668
|
function RouteId(type, options) {
|
|
3328
|
-
// assert.isTruthy(type.isValid());
|
|
3329
3669
|
return (/**
|
|
3330
3670
|
* @param {?} prototype
|
|
3331
3671
|
* @param {?} propertyKey
|
|
@@ -3333,7 +3673,7 @@ function RouteId(type, options) {
|
|
|
3333
3673
|
*/
|
|
3334
3674
|
(prototype, propertyKey) => {
|
|
3335
3675
|
/** @type {?} */
|
|
3336
|
-
const param =
|
|
3676
|
+
const param = new ParameterDefinition.RouteId(propertyKey.toString(), type, options);
|
|
3337
3677
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3338
3678
|
UseDelegate()(prototype, propertyKey);
|
|
3339
3679
|
});
|
|
@@ -3345,7 +3685,6 @@ function RouteId(type, options) {
|
|
|
3345
3685
|
* @return {?}
|
|
3346
3686
|
*/
|
|
3347
3687
|
function RouteParameter(type, options) {
|
|
3348
|
-
// assert.isTruthy(type.isValid());
|
|
3349
3688
|
return (/**
|
|
3350
3689
|
* @param {?} prototype
|
|
3351
3690
|
* @param {?} propertyKey
|
|
@@ -3353,7 +3692,7 @@ function RouteParameter(type, options) {
|
|
|
3353
3692
|
*/
|
|
3354
3693
|
(prototype, propertyKey) => {
|
|
3355
3694
|
/** @type {?} */
|
|
3356
|
-
const param =
|
|
3695
|
+
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
|
|
3357
3696
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3358
3697
|
UseDelegate()(prototype, propertyKey);
|
|
3359
3698
|
});
|
|
@@ -3365,7 +3704,6 @@ function RouteParameter(type, options) {
|
|
|
3365
3704
|
* @return {?}
|
|
3366
3705
|
*/
|
|
3367
3706
|
function RouteParameterList(elementType, options) {
|
|
3368
|
-
// assert.isTruthy(type.isValid());
|
|
3369
3707
|
return (/**
|
|
3370
3708
|
* @param {?} prototype
|
|
3371
3709
|
* @param {?} propertyKey
|
|
@@ -3373,82 +3711,11 @@ function RouteParameterList(elementType, options) {
|
|
|
3373
3711
|
*/
|
|
3374
3712
|
(prototype, propertyKey) => {
|
|
3375
3713
|
/** @type {?} */
|
|
3376
|
-
const param =
|
|
3714
|
+
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
|
|
3377
3715
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3378
3716
|
UseDelegate()(prototype, propertyKey);
|
|
3379
3717
|
});
|
|
3380
3718
|
}
|
|
3381
|
-
/**
|
|
3382
|
-
* @template T
|
|
3383
|
-
* @param {?} propertyName
|
|
3384
|
-
* @param {?} type
|
|
3385
|
-
* @param {?} options
|
|
3386
|
-
* @param {?} routeId
|
|
3387
|
-
* @return {?}
|
|
3388
|
-
*/
|
|
3389
|
-
function createDefinition(propertyName, type, options, routeId) {
|
|
3390
|
-
/** @type {?} */
|
|
3391
|
-
const opts = Opts.get(options);
|
|
3392
|
-
/** @type {?} */
|
|
3393
|
-
const propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3394
|
-
/** @type {?} */
|
|
3395
|
-
const def = {
|
|
3396
|
-
name: opts.getOptional('as', propertyNameAsString),
|
|
3397
|
-
propertyName: propertyNameAsString,
|
|
3398
|
-
type: assert.notNil(type),
|
|
3399
|
-
sanitiser: opts.getOptional('sanitiser', null),
|
|
3400
|
-
isRouteId: routeId,
|
|
3401
|
-
isArray: false
|
|
3402
|
-
};
|
|
3403
|
-
return def;
|
|
3404
|
-
}
|
|
3405
|
-
/**
|
|
3406
|
-
* @template T
|
|
3407
|
-
* @param {?} propertyName
|
|
3408
|
-
* @param {?} type
|
|
3409
|
-
* @param {?} options
|
|
3410
|
-
* @return {?}
|
|
3411
|
-
*/
|
|
3412
|
-
function createArrayDefinition(propertyName, type, options) {
|
|
3413
|
-
/** @type {?} */
|
|
3414
|
-
const opts = Opts.get(options);
|
|
3415
|
-
/** @type {?} */
|
|
3416
|
-
const propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3417
|
-
/** @type {?} */
|
|
3418
|
-
const def = {
|
|
3419
|
-
name: opts.getOptional('as', propertyNameAsString),
|
|
3420
|
-
propertyName: propertyNameAsString,
|
|
3421
|
-
type: assert.notNil(type),
|
|
3422
|
-
sanitiser: opts.getOptional('sanitiser', null),
|
|
3423
|
-
isRouteId: false,
|
|
3424
|
-
isArray: true
|
|
3425
|
-
};
|
|
3426
|
-
return def;
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
|
-
/**
|
|
3430
|
-
* @fileoverview added by tsickle
|
|
3431
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3432
|
-
*/
|
|
3433
|
-
/**
|
|
3434
|
-
* @record
|
|
3435
|
-
* @template T, S
|
|
3436
|
-
*/
|
|
3437
|
-
function ParameterDefinition() { }
|
|
3438
|
-
if (false) {
|
|
3439
|
-
/** @type {?} */
|
|
3440
|
-
ParameterDefinition.prototype.name;
|
|
3441
|
-
/** @type {?} */
|
|
3442
|
-
ParameterDefinition.prototype.propertyName;
|
|
3443
|
-
/** @type {?} */
|
|
3444
|
-
ParameterDefinition.prototype.type;
|
|
3445
|
-
/** @type {?} */
|
|
3446
|
-
ParameterDefinition.prototype.sanitiser;
|
|
3447
|
-
/** @type {?} */
|
|
3448
|
-
ParameterDefinition.prototype.isRouteId;
|
|
3449
|
-
/** @type {?} */
|
|
3450
|
-
ParameterDefinition.prototype.isArray;
|
|
3451
|
-
}
|
|
3452
3719
|
|
|
3453
3720
|
/**
|
|
3454
3721
|
* @fileoverview added by tsickle
|
|
@@ -3456,31 +3723,18 @@ if (false) {
|
|
|
3456
3723
|
*/
|
|
3457
3724
|
/**
|
|
3458
3725
|
* @record
|
|
3459
|
-
* @template
|
|
3726
|
+
* @template S
|
|
3460
3727
|
*/
|
|
3461
3728
|
function ParameterSanitiser() { }
|
|
3462
3729
|
if (false) {
|
|
3463
3730
|
/**
|
|
3731
|
+
* @param {?} parameterDef
|
|
3464
3732
|
* @param {?} value
|
|
3465
3733
|
* @param {?=} visit
|
|
3466
3734
|
* @return {?}
|
|
3467
3735
|
*/
|
|
3468
|
-
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
3736
|
+
ParameterSanitiser.prototype.sanitise = function (parameterDef, value, visit) { };
|
|
3469
3737
|
}
|
|
3470
|
-
(function (ParameterSanitiser) {
|
|
3471
|
-
/**
|
|
3472
|
-
* @record
|
|
3473
|
-
* @template T
|
|
3474
|
-
*/
|
|
3475
|
-
function Options() { }
|
|
3476
|
-
ParameterSanitiser.Options = Options;
|
|
3477
|
-
if (false) {
|
|
3478
|
-
/** @type {?|undefined} */
|
|
3479
|
-
Options.prototype.remember;
|
|
3480
|
-
/** @type {?|undefined} */
|
|
3481
|
-
Options.prototype.defaultValue;
|
|
3482
|
-
}
|
|
3483
|
-
})(ParameterSanitiser || (ParameterSanitiser = {}));
|
|
3484
3738
|
|
|
3485
3739
|
/**
|
|
3486
3740
|
* @fileoverview added by tsickle
|
|
@@ -3518,7 +3772,7 @@ var ParameterType;
|
|
|
3518
3772
|
* @return {?}
|
|
3519
3773
|
*/
|
|
3520
3774
|
parse(value) {
|
|
3521
|
-
return isNil(value) || isEmpty(value) ? null : +value;
|
|
3775
|
+
return ___default.isNil(value) || ___default.isEmpty(value) ? null : +value;
|
|
3522
3776
|
}
|
|
3523
3777
|
}
|
|
3524
3778
|
class BooleanType {
|
|
@@ -3570,7 +3824,7 @@ class Sanitiser {
|
|
|
3570
3824
|
* @return {?}
|
|
3571
3825
|
*/
|
|
3572
3826
|
get valueChanged() {
|
|
3573
|
-
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3827
|
+
return !___default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3574
3828
|
}
|
|
3575
3829
|
/**
|
|
3576
3830
|
* @return {?}
|
|
@@ -3609,7 +3863,7 @@ class Sanitiser {
|
|
|
3609
3863
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3610
3864
|
if (this.sanitiser) {
|
|
3611
3865
|
this.initialValue = this.readFrom(this.snapshot);
|
|
3612
|
-
this._sanitisedValue = yield this.sanitiser.sanitise(this.initialValue);
|
|
3866
|
+
this._sanitisedValue = yield this.sanitiser.sanitise(null, this.initialValue);
|
|
3613
3867
|
if (this.initialValue !== this._sanitisedValue) {
|
|
3614
3868
|
return false;
|
|
3615
3869
|
}
|
|
@@ -3640,13 +3894,11 @@ class RouteParameterSanitiser {
|
|
|
3640
3894
|
/**
|
|
3641
3895
|
* @param {?} parameterDefs
|
|
3642
3896
|
* @param {?} snapshot
|
|
3643
|
-
* @param {?} placeService
|
|
3644
3897
|
* @param {?} injector
|
|
3645
3898
|
*/
|
|
3646
|
-
constructor(parameterDefs, snapshot,
|
|
3899
|
+
constructor(parameterDefs, snapshot, injector) {
|
|
3647
3900
|
this.parameterDefs = parameterDefs;
|
|
3648
3901
|
this.snapshot = snapshot;
|
|
3649
|
-
this.placeService = placeService;
|
|
3650
3902
|
this.injector = injector;
|
|
3651
3903
|
this.parameterSanitisers = [];
|
|
3652
3904
|
/** @type {?} */
|
|
@@ -3700,17 +3952,7 @@ class RouteParameterSanitiser {
|
|
|
3700
3952
|
* @return {?}
|
|
3701
3953
|
*/
|
|
3702
3954
|
getSanitiser(def) {
|
|
3703
|
-
|
|
3704
|
-
if (this.isSanitiserContructor(def.sanitiser)) {
|
|
3705
|
-
return this.injector.get(def.sanitiser, new def.sanitiser());
|
|
3706
|
-
}
|
|
3707
|
-
else {
|
|
3708
|
-
return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3711
|
-
else {
|
|
3712
|
-
return null;
|
|
3713
|
-
}
|
|
3955
|
+
return def.getSanitiser(this.injector);
|
|
3714
3956
|
}
|
|
3715
3957
|
/**
|
|
3716
3958
|
* @return {?}
|
|
@@ -3744,13 +3986,13 @@ class RouteParameterSanitiser {
|
|
|
3744
3986
|
* @return {?}
|
|
3745
3987
|
*/
|
|
3746
3988
|
isSanitiserContructor(value) {
|
|
3747
|
-
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3989
|
+
return ___default.isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3748
3990
|
}
|
|
3749
3991
|
}
|
|
3750
3992
|
__decorate([
|
|
3751
|
-
Memoize(),
|
|
3993
|
+
Memoize$1(),
|
|
3752
3994
|
__metadata("design:type", Function),
|
|
3753
|
-
__metadata("design:paramtypes", [
|
|
3995
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
3754
3996
|
__metadata("design:returntype", Object)
|
|
3755
3997
|
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
3756
3998
|
__decorate([
|
|
@@ -3775,8 +4017,6 @@ if (false) {
|
|
|
3775
4017
|
/** @type {?} */
|
|
3776
4018
|
RouteParameterSanitiser.prototype.snapshot;
|
|
3777
4019
|
/** @type {?} */
|
|
3778
|
-
RouteParameterSanitiser.prototype.placeService;
|
|
3779
|
-
/** @type {?} */
|
|
3780
4020
|
RouteParameterSanitiser.prototype.injector;
|
|
3781
4021
|
}
|
|
3782
4022
|
(function (Sanitiser) {
|
|
@@ -3872,5 +4112,5 @@ if (false) {
|
|
|
3872
4112
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3873
4113
|
*/
|
|
3874
4114
|
|
|
3875
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY,
|
|
4115
|
+
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 };
|
|
3876
4116
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|