@coolon/angular-ui-powerups 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/coolon-angular-ui-powerups.umd.js +1173 -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 +12 -12
- 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 +3 -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 +132 -86
- 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 -5
- package/esm2015/lib/place/nav-item.js +1 -1
- package/esm2015/lib/place/place-component.js +38 -168
- package/esm2015/lib/place/place-definition.js +79 -0
- package/esm2015/lib/place/place-history.js +54 -0
- package/esm2015/lib/place/place-router.js +83 -0
- package/esm2015/lib/place/place.decorator.js +30 -3
- package/esm2015/lib/place/place.module.js +2 -5
- package/esm2015/lib/place/route/default-parameter-sanitiser.js +10 -22
- 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 +103 -8
- package/esm2015/lib/place/route/parameter-sanitiser.js +1 -15
- package/esm2015/lib/place/route/parameter-snapshot.js +13 -55
- package/esm2015/lib/place/route/parameter-type.js +2 -2
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +6 -20
- package/esm2015/lib/place/visit.js +1 -1
- 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 +12 -12
- 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 +3 -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 +150 -115
- 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 -5
- package/esm5/lib/place/nav-item.js +1 -1
- package/esm5/lib/place/place-component.js +52 -198
- package/esm5/lib/place/place-definition.js +88 -0
- package/esm5/lib/place/place-history.js +57 -0
- package/esm5/lib/place/place-router.js +101 -0
- package/esm5/lib/place/place.decorator.js +30 -3
- package/esm5/lib/place/place.module.js +2 -5
- package/esm5/lib/place/route/default-parameter-sanitiser.js +8 -20
- 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 +131 -8
- package/esm5/lib/place/route/parameter-sanitiser.js +1 -15
- package/esm5/lib/place/route/parameter-snapshot.js +25 -63
- package/esm5/lib/place/route/parameter-type.js +2 -2
- package/esm5/lib/place/route/route-parameter-sanitiser.js +6 -19
- package/esm5/lib/place/visit.js +1 -1
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +955 -969
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1158 -1177
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/index.d.ts +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -2
- 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 +31 -19
- package/lib/place/guards/place-route.guard.d.ts +7 -6
- package/lib/place/index.d.ts +3 -3
- 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 +10 -0
- package/lib/place/place-router.d.ts +9 -0
- package/lib/place/place.decorator.d.ts +13 -1
- package/lib/place/route/default-parameter-sanitiser.d.ts +3 -5
- package/lib/place/route/parameter-decorators.d.ts +0 -4
- package/lib/place/route/parameter-definition.class.d.ts +29 -6
- package/lib/place/route/parameter-sanitiser.d.ts +0 -6
- package/lib/place/route/parameter-snapshot.d.ts +7 -7
- package/lib/place/route/route-parameter-sanitiser.d.ts +1 -3
- package/lib/place/visit.d.ts +2 -2
- 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/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/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
|
@@ -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, 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
|
];
|
|
@@ -1101,10 +1106,10 @@ if (false) {
|
|
|
1101
1106
|
class ActivityContainerComponent extends DisposableComponent {
|
|
1102
1107
|
constructor() {
|
|
1103
1108
|
super();
|
|
1104
|
-
this.
|
|
1109
|
+
this.activityOutletTabs = new MutableListModel();
|
|
1105
1110
|
this.obsoleteTabs = [];
|
|
1106
1111
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1107
|
-
this.lastActivityTab = chain(this.
|
|
1112
|
+
this.lastActivityTab = chain(this.activityOutletTabs).last().otherwise(this.initialActivityOutlet);
|
|
1108
1113
|
}
|
|
1109
1114
|
/**
|
|
1110
1115
|
* @return {?}
|
|
@@ -1127,7 +1132,7 @@ class ActivityContainerComponent extends DisposableComponent {
|
|
|
1127
1132
|
* @return {?}
|
|
1128
1133
|
*/
|
|
1129
1134
|
initialise(options) {
|
|
1130
|
-
this.
|
|
1135
|
+
this.initialActivityOutlet = Object.assign({}, options, { interactionContext: this });
|
|
1131
1136
|
}
|
|
1132
1137
|
/**
|
|
1133
1138
|
* @template D, R, E
|
|
@@ -1146,14 +1151,14 @@ class ActivityContainerComponent extends DisposableComponent {
|
|
|
1146
1151
|
onDone: deferred.resolve,
|
|
1147
1152
|
onCancel: deferred.reject
|
|
1148
1153
|
};
|
|
1149
|
-
this.
|
|
1150
|
-
this.tabs.selectedIndex = this.
|
|
1154
|
+
this.activityOutletTabs.push(context);
|
|
1155
|
+
this.tabs.selectedIndex = this.activityOutletTabs.length;
|
|
1151
1156
|
return deferred.promise.finally((/**
|
|
1152
1157
|
* @return {?}
|
|
1153
1158
|
*/
|
|
1154
1159
|
() => {
|
|
1155
1160
|
this.obsoleteTabs.push(context);
|
|
1156
|
-
this.tabs.selectedIndex = this.
|
|
1161
|
+
this.tabs.selectedIndex = this.activityOutletTabs.length - 1;
|
|
1157
1162
|
}));
|
|
1158
1163
|
}
|
|
1159
1164
|
/**
|
|
@@ -1175,7 +1180,7 @@ class ActivityContainerComponent extends DisposableComponent {
|
|
|
1175
1180
|
* @return {?}
|
|
1176
1181
|
*/
|
|
1177
1182
|
onAnimationFinished() {
|
|
1178
|
-
this.
|
|
1183
|
+
this.activityOutletTabs.value = this.activityOutletTabs.value.filter((/**
|
|
1179
1184
|
* @param {?} tab
|
|
1180
1185
|
* @return {?}
|
|
1181
1186
|
*/
|
|
@@ -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
|
];
|
|
@@ -1196,7 +1201,7 @@ ActivityContainerComponent.decorators = [
|
|
|
1196
1201
|
ActivityContainerComponent.ctorParameters = () => [];
|
|
1197
1202
|
ActivityContainerComponent.propDecorators = {
|
|
1198
1203
|
parentInteractionContext: [{ type: Input }],
|
|
1199
|
-
|
|
1204
|
+
initialActivityOutlet: [{ type: Input }],
|
|
1200
1205
|
tabs: [{ type: ViewChild, args: ['tabs', { static: true },] }],
|
|
1201
1206
|
outlets: [{ type: ViewChildren, args: [ActivityOutletComponent,] }]
|
|
1202
1207
|
};
|
|
@@ -1204,13 +1209,13 @@ if (false) {
|
|
|
1204
1209
|
/** @type {?} */
|
|
1205
1210
|
ActivityContainerComponent.prototype.parentInteractionContext;
|
|
1206
1211
|
/** @type {?} */
|
|
1207
|
-
ActivityContainerComponent.prototype.
|
|
1212
|
+
ActivityContainerComponent.prototype.initialActivityOutlet;
|
|
1208
1213
|
/** @type {?} */
|
|
1209
1214
|
ActivityContainerComponent.prototype.tabs;
|
|
1210
1215
|
/** @type {?} */
|
|
1211
1216
|
ActivityContainerComponent.prototype.outlets;
|
|
1212
1217
|
/** @type {?} */
|
|
1213
|
-
ActivityContainerComponent.prototype.
|
|
1218
|
+
ActivityContainerComponent.prototype.activityOutletTabs;
|
|
1214
1219
|
/**
|
|
1215
1220
|
* @type {?}
|
|
1216
1221
|
* @private
|
|
@@ -1369,6 +1374,7 @@ InteractionModule.decorators = [
|
|
|
1369
1374
|
],
|
|
1370
1375
|
exports: [
|
|
1371
1376
|
ActivityContainerComponent,
|
|
1377
|
+
ActivityOutletComponent
|
|
1372
1378
|
],
|
|
1373
1379
|
entryComponents: [
|
|
1374
1380
|
ActivityContainerComponent,
|
|
@@ -1449,851 +1455,907 @@ EmptyStateComponent.decorators = [
|
|
|
1449
1455
|
/** @nocollapse */
|
|
1450
1456
|
EmptyStateComponent.ctorParameters = () => [];
|
|
1451
1457
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
class ParameterSnapshot {
|
|
1458
|
+
/**
|
|
1459
|
+
* @fileoverview added by tsickle
|
|
1460
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1461
|
+
*/
|
|
1462
|
+
class PlaceDefinition {
|
|
1458
1463
|
/**
|
|
1459
|
-
* @param {?}
|
|
1460
|
-
* @param {?}
|
|
1464
|
+
* @param {?} component
|
|
1465
|
+
* @param {?} path
|
|
1466
|
+
* @param {?} authenticate
|
|
1467
|
+
* @param {?} order
|
|
1468
|
+
* @param {?} data
|
|
1469
|
+
* @param {?} routeParameters
|
|
1470
|
+
* @param {?} children
|
|
1461
1471
|
*/
|
|
1462
|
-
constructor(
|
|
1463
|
-
this.
|
|
1464
|
-
this.
|
|
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;
|
|
1465
1480
|
}
|
|
1466
1481
|
/**
|
|
1467
|
-
* @param {?} other
|
|
1468
1482
|
* @return {?}
|
|
1469
1483
|
*/
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
const changed = this.resolved.find((/**
|
|
1473
|
-
* @param {?} r
|
|
1474
|
-
* @return {?}
|
|
1475
|
-
*/
|
|
1476
|
-
(r) => {
|
|
1477
|
-
return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
|
|
1478
|
-
}));
|
|
1479
|
-
if (changed) {
|
|
1480
|
-
console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
|
|
1481
|
-
}
|
|
1482
|
-
return !!changed;
|
|
1484
|
+
getRouteParameters() {
|
|
1485
|
+
return this.routeParameters;
|
|
1483
1486
|
}
|
|
1484
1487
|
/**
|
|
1485
|
-
* @
|
|
1488
|
+
* @template T
|
|
1489
|
+
* @param {?} key
|
|
1490
|
+
* @param {?=} defaultValue
|
|
1486
1491
|
* @return {?}
|
|
1487
1492
|
*/
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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;
|
|
1505
1513
|
}
|
|
1506
1514
|
else {
|
|
1507
|
-
|
|
1515
|
+
return defaultValue;
|
|
1508
1516
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
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();
|
|
1511
1549
|
}
|
|
1512
1550
|
/**
|
|
1513
|
-
* @
|
|
1514
|
-
* @param {?} parameterDef
|
|
1551
|
+
* @param {?} resolvedParameters
|
|
1515
1552
|
* @return {?}
|
|
1516
1553
|
*/
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1554
|
+
initialiseBindings(resolvedParameters) {
|
|
1555
|
+
assert.isNil(this.resolvedParameters);
|
|
1556
|
+
this.resolvedParameters = resolvedParameters;
|
|
1557
|
+
this.placeDefinition.getRouteParameters().forEach((/**
|
|
1558
|
+
* @param {?} parameterDef
|
|
1520
1559
|
* @return {?}
|
|
1521
1560
|
*/
|
|
1522
|
-
|
|
1561
|
+
parameterDef => {
|
|
1562
|
+
this.installBinding(parameterDef);
|
|
1563
|
+
}));
|
|
1523
1564
|
}
|
|
1524
1565
|
/**
|
|
1566
|
+
* @private
|
|
1525
1567
|
* @template T, S
|
|
1526
1568
|
* @param {?} parameterDef
|
|
1527
1569
|
* @return {?}
|
|
1528
1570
|
*/
|
|
1529
|
-
|
|
1571
|
+
installBinding(parameterDef) {
|
|
1530
1572
|
/** @type {?} */
|
|
1531
|
-
const
|
|
1532
|
-
|
|
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.getResolvedParameterValue(parameterDef);
|
|
1582
|
+
},
|
|
1583
|
+
/**
|
|
1584
|
+
* @param {?} value
|
|
1585
|
+
* @param {?=} currentParameters
|
|
1586
|
+
* @return {?}
|
|
1587
|
+
*/
|
|
1588
|
+
toLeft(value, currentParameters) {
|
|
1589
|
+
return currentParameters.replace(parameterDef, value);
|
|
1590
|
+
}
|
|
1591
|
+
}));
|
|
1533
1592
|
}
|
|
1534
1593
|
/**
|
|
1535
1594
|
* @return {?}
|
|
1536
1595
|
*/
|
|
1537
|
-
|
|
1538
|
-
return
|
|
1596
|
+
get placeDefinition() {
|
|
1597
|
+
return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
|
|
1539
1598
|
}
|
|
1540
1599
|
/**
|
|
1541
|
-
* @param {?} name
|
|
1542
1600
|
* @return {?}
|
|
1543
1601
|
*/
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
|
|
1547
|
-
* @param {?} r
|
|
1602
|
+
get childPlaces() {
|
|
1603
|
+
return this.placeDefinition.children.map((/**
|
|
1604
|
+
* @param {?} d
|
|
1548
1605
|
* @return {?}
|
|
1549
1606
|
*/
|
|
1550
|
-
|
|
1551
|
-
|
|
1607
|
+
d => d.component));
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* @return {?}
|
|
1611
|
+
*/
|
|
1612
|
+
canDeactivate() {
|
|
1613
|
+
return true;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* @return {?}
|
|
1617
|
+
*/
|
|
1618
|
+
onPlaceReady() {
|
|
1552
1619
|
}
|
|
1620
|
+
}
|
|
1621
|
+
__decorate([
|
|
1622
|
+
Memoize(),
|
|
1623
|
+
__metadata("design:type", PlaceDefinition),
|
|
1624
|
+
__metadata("design:paramtypes", [])
|
|
1625
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
1626
|
+
if (false) {
|
|
1553
1627
|
/**
|
|
1628
|
+
* @type {?}
|
|
1554
1629
|
* @private
|
|
1630
|
+
*/
|
|
1631
|
+
PlaceComponent.prototype.resolvedParameters;
|
|
1632
|
+
}
|
|
1633
|
+
(function (PlaceComponent) {
|
|
1634
|
+
/**
|
|
1635
|
+
* @param {?} target
|
|
1555
1636
|
* @return {?}
|
|
1556
1637
|
*/
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
// capture this in the type system though
|
|
1560
|
-
return (/** @type {?} */ (this.resolved.find((/**
|
|
1561
|
-
* @param {?} p
|
|
1562
|
-
* @return {?}
|
|
1563
|
-
*/
|
|
1564
|
-
p => p.parameterDef.isRouteId))));
|
|
1638
|
+
function isPlaceComponentConstructor(target) {
|
|
1639
|
+
return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
|
|
1565
1640
|
}
|
|
1641
|
+
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
1566
1642
|
/**
|
|
1643
|
+
* @param {?} klass
|
|
1567
1644
|
* @return {?}
|
|
1568
1645
|
*/
|
|
1569
|
-
|
|
1570
|
-
return
|
|
1646
|
+
function getRouteParameters(klass) {
|
|
1647
|
+
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
1571
1648
|
}
|
|
1649
|
+
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
1572
1650
|
/**
|
|
1651
|
+
* @param {?} klass
|
|
1573
1652
|
* @return {?}
|
|
1574
1653
|
*/
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
const routeIdParam = this.getResolvedRouteId();
|
|
1578
|
-
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
1654
|
+
function getDefinition(klass) {
|
|
1655
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
1579
1656
|
}
|
|
1657
|
+
PlaceComponent.getDefinition = getDefinition;
|
|
1580
1658
|
/**
|
|
1659
|
+
* @param {?} klass
|
|
1660
|
+
* @param {?} definition
|
|
1581
1661
|
* @return {?}
|
|
1582
1662
|
*/
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
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
|
|
1593
1679
|
* @return {?}
|
|
1594
1680
|
*/
|
|
1595
|
-
|
|
1596
|
-
params[p.parameterDef.name] = p.formattedValue();
|
|
1597
|
-
}));
|
|
1598
|
-
return params;
|
|
1681
|
+
c => PlaceComponent.getDefinition(c)));
|
|
1599
1682
|
}
|
|
1600
1683
|
/**
|
|
1601
|
-
* @
|
|
1602
|
-
* @param {?} parameter
|
|
1603
|
-
* @param {?} value
|
|
1684
|
+
* @param {?} placeDef
|
|
1604
1685
|
* @return {?}
|
|
1605
1686
|
*/
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
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
|
+
};
|
|
1614
1704
|
}
|
|
1615
1705
|
/**
|
|
1616
|
-
* @param {?} url
|
|
1617
1706
|
* @return {?}
|
|
1618
1707
|
*/
|
|
1619
|
-
|
|
1620
|
-
return url;
|
|
1708
|
+
ngOnInit() {
|
|
1621
1709
|
}
|
|
1622
1710
|
}
|
|
1711
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
1712
|
+
places: [{ type: Input }],
|
|
1713
|
+
placesModel: [{ type: Input }]
|
|
1714
|
+
};
|
|
1623
1715
|
__decorate([
|
|
1624
|
-
|
|
1625
|
-
__metadata("design:type",
|
|
1626
|
-
|
|
1627
|
-
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
1628
|
-
], ParameterSnapshot.prototype, "getResolvedParameter", null);
|
|
1716
|
+
StoreInListModel('placesModel'),
|
|
1717
|
+
__metadata("design:type", Array)
|
|
1718
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
1629
1719
|
__decorate([
|
|
1630
|
-
|
|
1631
|
-
__metadata("design:type",
|
|
1632
|
-
|
|
1633
|
-
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
1634
|
-
], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
|
|
1720
|
+
UseDelegate(),
|
|
1721
|
+
__metadata("design:type", ListModel)
|
|
1722
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
1635
1723
|
__decorate([
|
|
1636
|
-
Memoize(),
|
|
1724
|
+
Memoize$1(),
|
|
1637
1725
|
__metadata("design:type", Function),
|
|
1638
|
-
__metadata("design:paramtypes", [
|
|
1726
|
+
__metadata("design:paramtypes", [PlaceDefinition]),
|
|
1639
1727
|
__metadata("design:returntype", Object)
|
|
1640
|
-
],
|
|
1641
|
-
__decorate([
|
|
1642
|
-
Memoize(),
|
|
1643
|
-
__metadata("design:type", Function),
|
|
1644
|
-
__metadata("design:paramtypes", []),
|
|
1645
|
-
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
1646
|
-
], ParameterSnapshot.prototype, "getResolvedRouteId", null);
|
|
1728
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
1647
1729
|
if (false) {
|
|
1648
1730
|
/** @type {?} */
|
|
1649
|
-
|
|
1650
|
-
/**
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
ParameterSnapshot.prototype.resolved;
|
|
1731
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
1732
|
+
/** @type {?} */
|
|
1733
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
1734
|
+
/** @type {?} */
|
|
1735
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
1655
1736
|
}
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
.map((/**
|
|
1666
|
-
* @param {?} def
|
|
1667
|
-
* @return {?}
|
|
1668
|
-
*/
|
|
1669
|
-
def => {
|
|
1670
|
-
if (def.isArray) {
|
|
1671
|
-
/** @type {?} */
|
|
1672
|
-
const value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
|
|
1673
|
-
* @param {?} raw
|
|
1674
|
-
* @return {?}
|
|
1675
|
-
*/
|
|
1676
|
-
raw => def.type.parse(raw))) : null;
|
|
1677
|
-
return new ResolvedArrayParameter(def, value);
|
|
1678
|
-
}
|
|
1679
|
-
else {
|
|
1680
|
-
/** @type {?} */
|
|
1681
|
-
const value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
1682
|
-
return new ResolvedValueParameter(def, value);
|
|
1683
|
-
}
|
|
1684
|
-
}));
|
|
1685
|
-
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
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;
|
|
1686
1746
|
}
|
|
1687
|
-
ParameterSnapshot.create = create;
|
|
1688
1747
|
/**
|
|
1689
|
-
* @
|
|
1690
|
-
* @template T, S
|
|
1748
|
+
* @return {?}
|
|
1691
1749
|
*/
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
* @param {?} parameterDef
|
|
1695
|
-
* @param {?} value
|
|
1696
|
-
*/
|
|
1697
|
-
constructor(parameterDef, value) {
|
|
1698
|
-
this.parameterDef = parameterDef;
|
|
1699
|
-
this.value = value;
|
|
1700
|
-
}
|
|
1701
|
-
/**
|
|
1702
|
-
* @return {?}
|
|
1703
|
-
*/
|
|
1704
|
-
isRouteId() {
|
|
1705
|
-
return this.parameterDef.isRouteId;
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
1709
|
-
if (false) {
|
|
1710
|
-
/** @type {?} */
|
|
1711
|
-
ResolvedParameter.prototype.parameterDef;
|
|
1712
|
-
/** @type {?} */
|
|
1713
|
-
ResolvedParameter.prototype.value;
|
|
1714
|
-
/**
|
|
1715
|
-
* @abstract
|
|
1716
|
-
* @param {?} dest
|
|
1717
|
-
* @return {?}
|
|
1718
|
-
*/
|
|
1719
|
-
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
1720
|
-
/**
|
|
1721
|
-
* @abstract
|
|
1722
|
-
* @param {?} otherValue
|
|
1723
|
-
* @return {?}
|
|
1724
|
-
*/
|
|
1725
|
-
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
1726
|
-
/**
|
|
1727
|
-
* @abstract
|
|
1728
|
-
* @return {?}
|
|
1729
|
-
*/
|
|
1730
|
-
ResolvedParameter.prototype.formattedValue = function () { };
|
|
1731
|
-
/**
|
|
1732
|
-
* @abstract
|
|
1733
|
-
* @param {?} value
|
|
1734
|
-
* @return {?}
|
|
1735
|
-
*/
|
|
1736
|
-
ResolvedParameter.prototype.replace = function (value) { };
|
|
1750
|
+
expandMenu() {
|
|
1751
|
+
this.expanded = true;
|
|
1737
1752
|
}
|
|
1738
1753
|
/**
|
|
1739
|
-
* @
|
|
1754
|
+
* @return {?}
|
|
1740
1755
|
*/
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
* @param {?} otherValue
|
|
1744
|
-
* @return {?}
|
|
1745
|
-
*/
|
|
1746
|
-
isSame(otherValue) {
|
|
1747
|
-
return this.value === otherValue;
|
|
1748
|
-
}
|
|
1749
|
-
/**
|
|
1750
|
-
* @param {?} dest
|
|
1751
|
-
* @return {?}
|
|
1752
|
-
*/
|
|
1753
|
-
injectRouteParam(dest) {
|
|
1754
|
-
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
1755
|
-
}
|
|
1756
|
-
/**
|
|
1757
|
-
* @param {?} value
|
|
1758
|
-
* @return {?}
|
|
1759
|
-
*/
|
|
1760
|
-
replace(value) {
|
|
1761
|
-
return new ResolvedValueParameter(this.parameterDef, value);
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* @return {?}
|
|
1765
|
-
*/
|
|
1766
|
-
formattedValue() {
|
|
1767
|
-
return !isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
1768
|
-
}
|
|
1756
|
+
collapseMenu() {
|
|
1757
|
+
this.expanded = false;
|
|
1769
1758
|
}
|
|
1770
|
-
__decorate([
|
|
1771
|
-
Trace(),
|
|
1772
|
-
__metadata("design:type", Function),
|
|
1773
|
-
__metadata("design:paramtypes", [Object]),
|
|
1774
|
-
__metadata("design:returntype", Boolean)
|
|
1775
|
-
], ResolvedValueParameter.prototype, "isSame", null);
|
|
1776
|
-
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
1777
1759
|
/**
|
|
1778
|
-
* @
|
|
1760
|
+
* @return {?}
|
|
1779
1761
|
*/
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
* @param {?} otherValue
|
|
1783
|
-
* @return {?}
|
|
1784
|
-
*/
|
|
1785
|
-
isSame(otherValue) {
|
|
1786
|
-
return isEqual(this.value, otherValue);
|
|
1787
|
-
}
|
|
1788
|
-
/**
|
|
1789
|
-
* @param {?} dest
|
|
1790
|
-
* @return {?}
|
|
1791
|
-
*/
|
|
1792
|
-
injectRouteParam(dest) {
|
|
1793
|
-
dest[this.parameterDef.name] = this.value.map((/**
|
|
1794
|
-
* @param {?} v
|
|
1795
|
-
* @return {?}
|
|
1796
|
-
*/
|
|
1797
|
-
v => this.parameterDef.type.format(v)));
|
|
1798
|
-
}
|
|
1799
|
-
/**
|
|
1800
|
-
* @param {?} value
|
|
1801
|
-
* @return {?}
|
|
1802
|
-
*/
|
|
1803
|
-
replace(value) {
|
|
1804
|
-
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
1805
|
-
}
|
|
1806
|
-
/**
|
|
1807
|
-
* @return {?}
|
|
1808
|
-
*/
|
|
1809
|
-
formattedValue() {
|
|
1810
|
-
return this.value ? this.value.map((/**
|
|
1811
|
-
* @param {?} v
|
|
1812
|
-
* @return {?}
|
|
1813
|
-
*/
|
|
1814
|
-
v => this.parameterDef.type.format(v))) : [];
|
|
1815
|
-
}
|
|
1762
|
+
toggleMenu() {
|
|
1763
|
+
this.expanded = !this.expanded;
|
|
1816
1764
|
}
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
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
|
+
}
|
|
1825
1782
|
|
|
1826
1783
|
/**
|
|
1827
1784
|
* @fileoverview added by tsickle
|
|
1828
1785
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1829
1786
|
*/
|
|
1830
|
-
|
|
1831
|
-
/** @type {?} */
|
|
1832
|
-
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
1833
|
-
// this one seems ok.
|
|
1834
|
-
/** @type {?} */
|
|
1835
|
-
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
1836
|
-
class PlaceComponent extends DisposableComponent {
|
|
1787
|
+
class PlaceHistory {
|
|
1837
1788
|
/**
|
|
1838
|
-
* @param {?}
|
|
1839
|
-
* @param {?} placeService
|
|
1789
|
+
* @param {?} router
|
|
1840
1790
|
*/
|
|
1841
|
-
constructor(
|
|
1842
|
-
|
|
1843
|
-
this.
|
|
1844
|
-
this._incomingRouteChange = new MutableValueModel(false);
|
|
1845
|
-
this.resolvedParameters = new MutableValueModel();
|
|
1846
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1847
|
-
this.placeDefinition.getRouteParameters().forEach((/**
|
|
1848
|
-
* @param {?} p
|
|
1849
|
-
* @return {?}
|
|
1850
|
-
*/
|
|
1851
|
-
p => this.installBinding(p)));
|
|
1852
|
-
observe.valuesFrom(activatedRoute.paramMap)
|
|
1853
|
-
.last()
|
|
1854
|
-
.map((/**
|
|
1855
|
-
* @param {?} params
|
|
1856
|
-
* @return {?}
|
|
1857
|
-
*/
|
|
1858
|
-
params => ParameterSnapshot.create(this.placeDefinition, params)))
|
|
1859
|
-
.subscribe((/**
|
|
1860
|
-
* @param {?} resolvedParameters
|
|
1861
|
-
* @return {?}
|
|
1862
|
-
*/
|
|
1863
|
-
resolvedParameters => {
|
|
1864
|
-
this._incomingRouteChange.value = true;
|
|
1865
|
-
this.resolvedParameters.value = resolvedParameters;
|
|
1866
|
-
this._incomingRouteChange.value = false;
|
|
1867
|
-
}));
|
|
1868
|
-
when.valueOf(this.resolvedParameters).changes((/**
|
|
1869
|
-
* @param {?} params
|
|
1870
|
-
* @param {?} previous
|
|
1871
|
-
* @return {?}
|
|
1872
|
-
*/
|
|
1873
|
-
(params, previous) => {
|
|
1874
|
-
placeService.notifyRouteParametersChanged({
|
|
1875
|
-
activatedRoute: this.activatedRoute,
|
|
1876
|
-
next: params,
|
|
1877
|
-
previous: previous,
|
|
1878
|
-
updateRoute: !this.incomingRouteChange.value // we update the route if it's a component triggered change.
|
|
1879
|
-
});
|
|
1880
|
-
}));
|
|
1791
|
+
constructor(router) {
|
|
1792
|
+
this.router = router;
|
|
1793
|
+
this._history = [];
|
|
1881
1794
|
}
|
|
1882
1795
|
/**
|
|
1796
|
+
* @param {?} state
|
|
1883
1797
|
* @return {?}
|
|
1884
1798
|
*/
|
|
1885
|
-
|
|
1886
|
-
|
|
1799
|
+
add(state) {
|
|
1800
|
+
/** @type {?} */
|
|
1801
|
+
const previousState = ___default.last(this._history);
|
|
1802
|
+
if (!previousState || state.hasChanged(previousState)) {
|
|
1803
|
+
this._history.push(state);
|
|
1804
|
+
// limit our history to 100 visits
|
|
1805
|
+
this._history = this._history.slice(-100);
|
|
1806
|
+
}
|
|
1887
1807
|
}
|
|
1808
|
+
}
|
|
1809
|
+
PlaceHistory.decorators = [
|
|
1810
|
+
{ type: Injectable, args: [{
|
|
1811
|
+
providedIn: 'root'
|
|
1812
|
+
},] }
|
|
1813
|
+
];
|
|
1814
|
+
/** @nocollapse */
|
|
1815
|
+
PlaceHistory.ctorParameters = () => [
|
|
1816
|
+
{ type: Router }
|
|
1817
|
+
];
|
|
1818
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
1819
|
+
if (false) {
|
|
1888
1820
|
/**
|
|
1821
|
+
* @type {?}
|
|
1889
1822
|
* @private
|
|
1890
|
-
* @template T, S
|
|
1891
|
-
* @param {?} parameterDef
|
|
1892
|
-
* @return {?}
|
|
1893
1823
|
*/
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
return currentParameters.replace(parameterDef, value);
|
|
1913
|
-
}
|
|
1914
|
-
}));
|
|
1824
|
+
PlaceHistory.prototype._history;
|
|
1825
|
+
/**
|
|
1826
|
+
* @type {?}
|
|
1827
|
+
* @private
|
|
1828
|
+
*/
|
|
1829
|
+
PlaceHistory.prototype.router;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* @fileoverview added by tsickle
|
|
1834
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1835
|
+
*/
|
|
1836
|
+
class PlaceRouter {
|
|
1837
|
+
/**
|
|
1838
|
+
* @param {?} router
|
|
1839
|
+
*/
|
|
1840
|
+
constructor(router) {
|
|
1841
|
+
this.router = router;
|
|
1915
1842
|
}
|
|
1916
1843
|
/**
|
|
1844
|
+
* @param {?} activatedRoute
|
|
1845
|
+
* @param {?} previous
|
|
1846
|
+
* @param {?} next
|
|
1917
1847
|
* @return {?}
|
|
1918
1848
|
*/
|
|
1919
|
-
|
|
1920
|
-
|
|
1849
|
+
pushParameterChangesToRoute(activatedRoute, previous, next) {
|
|
1850
|
+
this.router.navigate(this.redirect(activatedRoute.snapshot, previous, next), {
|
|
1851
|
+
relativeTo: activatedRoute
|
|
1852
|
+
});
|
|
1921
1853
|
}
|
|
1922
1854
|
/**
|
|
1855
|
+
* @param {?} activatedRoute
|
|
1856
|
+
* @param {?} sanitised
|
|
1857
|
+
* @param {?} snapshot
|
|
1923
1858
|
* @return {?}
|
|
1924
1859
|
*/
|
|
1925
|
-
|
|
1926
|
-
return
|
|
1860
|
+
createUrlTree(activatedRoute, sanitised, snapshot) {
|
|
1861
|
+
return this.router.createUrlTree(this.redirect(activatedRoute, snapshot, sanitised));
|
|
1927
1862
|
}
|
|
1928
|
-
// @Trace()
|
|
1929
1863
|
/**
|
|
1864
|
+
* @protected
|
|
1865
|
+
* @param {?} activatedRoute
|
|
1866
|
+
* @param {?} previous
|
|
1867
|
+
* @param {?} next
|
|
1930
1868
|
* @return {?}
|
|
1931
1869
|
*/
|
|
1932
|
-
|
|
1870
|
+
redirect(activatedRoute, previous, next) {
|
|
1871
|
+
/** @type {?} */
|
|
1872
|
+
const childSegments = ___default.flatten(activatedRoute.children.map((/**
|
|
1873
|
+
* @param {?} child
|
|
1874
|
+
* @return {?}
|
|
1875
|
+
*/
|
|
1876
|
+
child => child.url)));
|
|
1877
|
+
/** @type {?} */
|
|
1878
|
+
const relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
1879
|
+
/** @type {?} */
|
|
1880
|
+
const routeId = next.getFormattedRouteId();
|
|
1881
|
+
/** @type {?} */
|
|
1882
|
+
const path = routeId ?
|
|
1883
|
+
[relativePath, routeId, next.getFormattedParameters()] :
|
|
1884
|
+
[relativePath, next.getFormattedParameters()];
|
|
1885
|
+
return path.concat(childSegments.map((/**
|
|
1886
|
+
* @param {?} s
|
|
1887
|
+
* @return {?}
|
|
1888
|
+
*/
|
|
1889
|
+
s => s.path)));
|
|
1933
1890
|
}
|
|
1934
1891
|
}
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
]
|
|
1892
|
+
PlaceRouter.decorators = [
|
|
1893
|
+
{ type: Injectable, args: [{
|
|
1894
|
+
providedIn: 'root'
|
|
1895
|
+
},] }
|
|
1896
|
+
];
|
|
1897
|
+
/** @nocollapse */
|
|
1898
|
+
PlaceRouter.ctorParameters = () => [
|
|
1899
|
+
{ type: Router }
|
|
1900
|
+
];
|
|
1901
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
1940
1902
|
if (false) {
|
|
1941
|
-
/** @type {?} */
|
|
1942
|
-
PlaceComponent.prototype._incomingRouteChange;
|
|
1943
1903
|
/**
|
|
1944
1904
|
* @type {?}
|
|
1945
1905
|
* @private
|
|
1946
1906
|
*/
|
|
1947
|
-
|
|
1907
|
+
PlaceRouter.prototype.router;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* @fileoverview added by tsickle
|
|
1912
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1913
|
+
*/
|
|
1914
|
+
/**
|
|
1915
|
+
* @abstract
|
|
1916
|
+
* @template T, S
|
|
1917
|
+
*/
|
|
1918
|
+
class ParameterDefinition {
|
|
1919
|
+
/**
|
|
1920
|
+
* @param {?} propertyName
|
|
1921
|
+
* @param {?} type
|
|
1922
|
+
* @param {?} options
|
|
1923
|
+
*/
|
|
1924
|
+
constructor(propertyName, type, options) {
|
|
1925
|
+
this.propertyName = propertyName;
|
|
1926
|
+
this.type = type;
|
|
1927
|
+
/** @type {?} */
|
|
1928
|
+
const opts = Opts.get(options);
|
|
1929
|
+
this.name = opts.getOptional('as', propertyName);
|
|
1930
|
+
// this.sanitiser = new DefaultParameterSanitiser(
|
|
1931
|
+
// this,
|
|
1932
|
+
// opts.getOptional('remember', false),
|
|
1933
|
+
// opts.getOptional('defaultValue', null)
|
|
1934
|
+
// );
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* @param {?} injector
|
|
1938
|
+
* @return {?}
|
|
1939
|
+
*/
|
|
1940
|
+
getSanitiser(injector) {
|
|
1941
|
+
return this.sanitiser;
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
if (false) {
|
|
1945
|
+
/** @type {?} */
|
|
1946
|
+
ParameterDefinition.prototype.isRouteId;
|
|
1947
|
+
/** @type {?} */
|
|
1948
|
+
ParameterDefinition.prototype.isArray;
|
|
1949
|
+
/** @type {?} */
|
|
1950
|
+
ParameterDefinition.prototype.name;
|
|
1948
1951
|
/** @type {?} */
|
|
1949
|
-
|
|
1952
|
+
ParameterDefinition.prototype.sanitiser;
|
|
1953
|
+
/** @type {?} */
|
|
1954
|
+
ParameterDefinition.prototype.propertyName;
|
|
1955
|
+
/** @type {?} */
|
|
1956
|
+
ParameterDefinition.prototype.type;
|
|
1950
1957
|
}
|
|
1951
|
-
(function (
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
/**
|
|
1977
|
-
* @param {?} constructable
|
|
1978
|
-
* @return {?}
|
|
1979
|
-
*/
|
|
1980
|
-
isDescriptorForType(constructable) {
|
|
1981
|
-
return lang.constructorChain(constructable).includes(PlaceComponent);
|
|
1982
|
-
}
|
|
1983
|
-
/**
|
|
1984
|
-
* @param {?} placeComponent
|
|
1985
|
-
* @return {?}
|
|
1986
|
-
*/
|
|
1987
|
-
isDescriptorFor(placeComponent) {
|
|
1988
|
-
return placeComponent.constructor === this.component;
|
|
1989
|
-
}
|
|
1990
|
-
/**
|
|
1991
|
-
* @template T
|
|
1992
|
-
* @param {?} key
|
|
1993
|
-
* @param {?=} defaultValue
|
|
1994
|
-
* @return {?}
|
|
1995
|
-
*/
|
|
1996
|
-
getData(key, defaultValue) {
|
|
1997
|
-
return this.data ?
|
|
1998
|
-
isNil(this.data[key]) ? defaultValue : this.data[key] :
|
|
1999
|
-
defaultValue;
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* @template T
|
|
2003
|
-
* @param {?} keys
|
|
2004
|
-
* @param {?=} defaultValue
|
|
2005
|
-
* @return {?}
|
|
2006
|
-
*/
|
|
2007
|
-
searchData(keys, defaultValue) {
|
|
2008
|
-
if (this.data) {
|
|
2009
|
-
/** @type {?} */
|
|
2010
|
-
const found = keys.find((/**
|
|
2011
|
-
* @param {?} key
|
|
2012
|
-
* @return {?}
|
|
2013
|
-
*/
|
|
2014
|
-
key => !isNil(this.data[key])));
|
|
2015
|
-
return found ? this.data[found] : defaultValue;
|
|
2016
|
-
}
|
|
2017
|
-
else {
|
|
2018
|
-
return defaultValue;
|
|
2019
|
-
}
|
|
1958
|
+
(function (ParameterDefinition) {
|
|
1959
|
+
/**
|
|
1960
|
+
* @record
|
|
1961
|
+
* @template T
|
|
1962
|
+
*/
|
|
1963
|
+
function Options() { }
|
|
1964
|
+
ParameterDefinition.Options = Options;
|
|
1965
|
+
if (false) {
|
|
1966
|
+
/** @type {?|undefined} */
|
|
1967
|
+
Options.prototype.as;
|
|
1968
|
+
/** @type {?|undefined} */
|
|
1969
|
+
Options.prototype.optional;
|
|
1970
|
+
/** @type {?|undefined} */
|
|
1971
|
+
Options.prototype.remember;
|
|
1972
|
+
/** @type {?|undefined} */
|
|
1973
|
+
Options.prototype.defaultValue;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* @template T
|
|
1977
|
+
*/
|
|
1978
|
+
class RouteId extends ParameterDefinition {
|
|
1979
|
+
constructor() {
|
|
1980
|
+
super(...arguments);
|
|
1981
|
+
this.isRouteId = true;
|
|
1982
|
+
this.isArray = false;
|
|
2020
1983
|
}
|
|
2021
1984
|
}
|
|
2022
|
-
|
|
2023
|
-
Memoize$1(),
|
|
2024
|
-
__metadata("design:type", Function),
|
|
2025
|
-
__metadata("design:paramtypes", []),
|
|
2026
|
-
__metadata("design:returntype", Array)
|
|
2027
|
-
], Definition.prototype, "getRouteParameters", null);
|
|
2028
|
-
PlaceComponent.Definition = Definition;
|
|
1985
|
+
ParameterDefinition.RouteId = RouteId;
|
|
2029
1986
|
if (false) {
|
|
2030
1987
|
/** @type {?} */
|
|
2031
|
-
|
|
2032
|
-
/** @type {?} */
|
|
2033
|
-
Definition.prototype.authenticate;
|
|
2034
|
-
/** @type {?} */
|
|
2035
|
-
Definition.prototype.order;
|
|
2036
|
-
/** @type {?} */
|
|
2037
|
-
Definition.prototype.data;
|
|
2038
|
-
/** @type {?} */
|
|
2039
|
-
Definition.prototype.children;
|
|
1988
|
+
RouteId.prototype.isRouteId;
|
|
2040
1989
|
/** @type {?} */
|
|
2041
|
-
|
|
1990
|
+
RouteId.prototype.isArray;
|
|
2042
1991
|
}
|
|
2043
1992
|
/**
|
|
2044
|
-
* @
|
|
1993
|
+
* @template T
|
|
2045
1994
|
*/
|
|
2046
|
-
|
|
2047
|
-
|
|
1995
|
+
class ValueParameter extends ParameterDefinition {
|
|
1996
|
+
constructor() {
|
|
1997
|
+
super(...arguments);
|
|
1998
|
+
this.isRouteId = false;
|
|
1999
|
+
this.isArray = false;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
ParameterDefinition.ValueParameter = ValueParameter;
|
|
2048
2003
|
if (false) {
|
|
2049
2004
|
/** @type {?} */
|
|
2050
|
-
|
|
2005
|
+
ValueParameter.prototype.isRouteId;
|
|
2051
2006
|
/** @type {?} */
|
|
2052
|
-
|
|
2053
|
-
/** @type {?|undefined} */
|
|
2054
|
-
Options.prototype.data;
|
|
2055
|
-
/** @type {?|undefined} */
|
|
2056
|
-
Options.prototype.authenticate;
|
|
2057
|
-
/** @type {?|undefined} */
|
|
2058
|
-
Options.prototype.children;
|
|
2007
|
+
ValueParameter.prototype.isArray;
|
|
2059
2008
|
}
|
|
2060
2009
|
/**
|
|
2061
|
-
* @
|
|
2010
|
+
* @template T
|
|
2062
2011
|
*/
|
|
2063
|
-
|
|
2064
|
-
|
|
2012
|
+
class ArrayParameter extends ParameterDefinition {
|
|
2013
|
+
constructor() {
|
|
2014
|
+
super(...arguments);
|
|
2015
|
+
this.isRouteId = false;
|
|
2016
|
+
this.isArray = true;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
ParameterDefinition.ArrayParameter = ArrayParameter;
|
|
2065
2020
|
if (false) {
|
|
2066
2021
|
/** @type {?} */
|
|
2067
|
-
|
|
2022
|
+
ArrayParameter.prototype.isRouteId;
|
|
2023
|
+
/** @type {?} */
|
|
2024
|
+
ArrayParameter.prototype.isArray;
|
|
2068
2025
|
}
|
|
2026
|
+
})(ParameterDefinition || (ParameterDefinition = {}));
|
|
2027
|
+
|
|
2028
|
+
var _a;
|
|
2029
|
+
class ParameterSnapshot {
|
|
2069
2030
|
/**
|
|
2070
|
-
* @param {?}
|
|
2071
|
-
* @
|
|
2031
|
+
* @param {?} placeDefinition
|
|
2032
|
+
* @param {?} resolved
|
|
2072
2033
|
*/
|
|
2073
|
-
|
|
2074
|
-
|
|
2034
|
+
constructor(placeDefinition, resolved) {
|
|
2035
|
+
this.placeDefinition = placeDefinition;
|
|
2036
|
+
this.resolved = resolved;
|
|
2075
2037
|
}
|
|
2076
|
-
PlaceComponent.getDefinition = getDefinition;
|
|
2077
2038
|
/**
|
|
2078
|
-
* @param {?}
|
|
2079
|
-
* @param {?} options
|
|
2039
|
+
* @param {?} other
|
|
2080
2040
|
* @return {?}
|
|
2081
2041
|
*/
|
|
2082
|
-
|
|
2083
|
-
|
|
2042
|
+
hasChanged(other) {
|
|
2043
|
+
/** @type {?} */
|
|
2044
|
+
const changed = this.resolved.find((/**
|
|
2045
|
+
* @param {?} r
|
|
2046
|
+
* @return {?}
|
|
2047
|
+
*/
|
|
2048
|
+
(r) => {
|
|
2049
|
+
return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
|
|
2050
|
+
}));
|
|
2051
|
+
// if (changed) {
|
|
2052
|
+
// console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
|
|
2053
|
+
// }
|
|
2054
|
+
return !!changed;
|
|
2084
2055
|
}
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
constructor() {
|
|
2094
|
-
super();
|
|
2095
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2096
|
-
this.placeDefinitions = chain(this.placesModel).map((/**
|
|
2097
|
-
* @param {?} c
|
|
2056
|
+
/**
|
|
2057
|
+
* @template T, S
|
|
2058
|
+
* @param {?} parameterDef
|
|
2059
|
+
* @return {?}
|
|
2060
|
+
*/
|
|
2061
|
+
getResolvedParameter(parameterDef) {
|
|
2062
|
+
return this.resolved.find((/**
|
|
2063
|
+
* @param {?} r
|
|
2098
2064
|
* @return {?}
|
|
2099
2065
|
*/
|
|
2100
|
-
|
|
2066
|
+
r => r.parameterDef === parameterDef));
|
|
2101
2067
|
}
|
|
2102
2068
|
/**
|
|
2103
|
-
* @
|
|
2069
|
+
* @template T, S
|
|
2070
|
+
* @param {?} parameterDef
|
|
2104
2071
|
* @return {?}
|
|
2105
2072
|
*/
|
|
2106
|
-
|
|
2073
|
+
getResolvedParameterValue(parameterDef) {
|
|
2107
2074
|
/** @type {?} */
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2110
|
-
title: (/**
|
|
2111
|
-
* @return {?}
|
|
2112
|
-
*/
|
|
2113
|
-
() => navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title'])),
|
|
2114
|
-
tooltip: (/**
|
|
2115
|
-
* @return {?}
|
|
2116
|
-
*/
|
|
2117
|
-
() => navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null)),
|
|
2118
|
-
icon: (/**
|
|
2119
|
-
* @return {?}
|
|
2120
|
-
*/
|
|
2121
|
-
() => navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null))
|
|
2122
|
-
};
|
|
2075
|
+
const resolvedParameter = this.getResolvedParameter(parameterDef);
|
|
2076
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
2123
2077
|
}
|
|
2124
2078
|
/**
|
|
2125
2079
|
* @return {?}
|
|
2126
2080
|
*/
|
|
2127
|
-
|
|
2081
|
+
getRouteId() {
|
|
2082
|
+
return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
|
|
2128
2083
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
/**
|
|
2158
|
-
* @fileoverview added by tsickle
|
|
2159
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2160
|
-
*/
|
|
2161
|
-
class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
2162
|
-
constructor() {
|
|
2163
|
-
super();
|
|
2164
|
-
this.expanded = true;
|
|
2084
|
+
/**
|
|
2085
|
+
* @param {?} name
|
|
2086
|
+
* @return {?}
|
|
2087
|
+
*/
|
|
2088
|
+
getRouteParameter(name) {
|
|
2089
|
+
/** @type {?} */
|
|
2090
|
+
const resolvedParameter = this.resolved.find((/**
|
|
2091
|
+
* @param {?} r
|
|
2092
|
+
* @return {?}
|
|
2093
|
+
*/
|
|
2094
|
+
r => r.parameterDef.name === name));
|
|
2095
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* @private
|
|
2099
|
+
* @return {?}
|
|
2100
|
+
*/
|
|
2101
|
+
getResolvedRouteId() {
|
|
2102
|
+
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
2103
|
+
// capture this in the type system though
|
|
2104
|
+
return (/** @type {?} */ (this.resolved.find((/**
|
|
2105
|
+
* @param {?} p
|
|
2106
|
+
* @return {?}
|
|
2107
|
+
*/
|
|
2108
|
+
p => p.parameterDef.isRouteId))));
|
|
2165
2109
|
}
|
|
2166
2110
|
/**
|
|
2167
2111
|
* @return {?}
|
|
2168
2112
|
*/
|
|
2169
|
-
|
|
2170
|
-
this.
|
|
2113
|
+
hasRouteId() {
|
|
2114
|
+
return !!this.getResolvedRouteId();
|
|
2171
2115
|
}
|
|
2172
2116
|
/**
|
|
2173
2117
|
* @return {?}
|
|
2174
2118
|
*/
|
|
2175
|
-
|
|
2176
|
-
|
|
2119
|
+
getFormattedRouteId() {
|
|
2120
|
+
/** @type {?} */
|
|
2121
|
+
const routeIdParam = this.getResolvedRouteId();
|
|
2122
|
+
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
2177
2123
|
}
|
|
2178
2124
|
/**
|
|
2179
2125
|
* @return {?}
|
|
2180
2126
|
*/
|
|
2181
|
-
|
|
2182
|
-
|
|
2127
|
+
getFormattedParameters() {
|
|
2128
|
+
/** @type {?} */
|
|
2129
|
+
const params = {};
|
|
2130
|
+
/** @type {?} */
|
|
2131
|
+
const routeIdParam = this.resolved.filter((/**
|
|
2132
|
+
* @param {?} p
|
|
2133
|
+
* @return {?}
|
|
2134
|
+
*/
|
|
2135
|
+
p => !p.parameterDef.isRouteId)).forEach((/**
|
|
2136
|
+
* @param {?} p
|
|
2137
|
+
* @return {?}
|
|
2138
|
+
*/
|
|
2139
|
+
p => {
|
|
2140
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
2141
|
+
}));
|
|
2142
|
+
return params;
|
|
2183
2143
|
}
|
|
2184
|
-
}
|
|
2185
|
-
ListPlaceNavComponent.decorators = [
|
|
2186
|
-
{ type: Component, args: [{
|
|
2187
|
-
selector: 'angular-ui-powerups-list-place-nav',
|
|
2188
|
-
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",
|
|
2189
|
-
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}"]
|
|
2190
|
-
}] }
|
|
2191
|
-
];
|
|
2192
|
-
/** @nocollapse */
|
|
2193
|
-
ListPlaceNavComponent.ctorParameters = () => [];
|
|
2194
|
-
ListPlaceNavComponent.propDecorators = {
|
|
2195
|
-
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
2196
|
-
};
|
|
2197
|
-
if (false) {
|
|
2198
|
-
/** @type {?} */
|
|
2199
|
-
ListPlaceNavComponent.prototype.expanded;
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
/**
|
|
2203
|
-
* @fileoverview added by tsickle
|
|
2204
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2205
|
-
*/
|
|
2206
|
-
class PlaceService extends GarbageCollector {
|
|
2207
2144
|
/**
|
|
2208
|
-
* @
|
|
2209
|
-
* @param {?}
|
|
2145
|
+
* @template T, S
|
|
2146
|
+
* @param {?} parameter
|
|
2147
|
+
* @param {?} value
|
|
2148
|
+
* @return {?}
|
|
2210
2149
|
*/
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2150
|
+
replace(parameter, value) {
|
|
2151
|
+
return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
|
|
2152
|
+
* @param {?} p
|
|
2153
|
+
* @return {?}
|
|
2154
|
+
*/
|
|
2155
|
+
p => {
|
|
2156
|
+
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2157
|
+
})));
|
|
2216
2158
|
}
|
|
2217
2159
|
/**
|
|
2160
|
+
* @param {?} injector
|
|
2218
2161
|
* @return {?}
|
|
2219
2162
|
*/
|
|
2220
|
-
|
|
2221
|
-
return this
|
|
2163
|
+
sanitise(injector) {
|
|
2164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2165
|
+
return this;
|
|
2166
|
+
});
|
|
2222
2167
|
}
|
|
2223
|
-
|
|
2168
|
+
}
|
|
2169
|
+
__decorate([
|
|
2170
|
+
Memoize$1(),
|
|
2171
|
+
__metadata("design:type", Function),
|
|
2172
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
2173
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
2174
|
+
], ParameterSnapshot.prototype, "getResolvedParameter", null);
|
|
2175
|
+
__decorate([
|
|
2176
|
+
Memoize$1(),
|
|
2177
|
+
__metadata("design:type", Function),
|
|
2178
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
2179
|
+
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
2180
|
+
], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
|
|
2181
|
+
__decorate([
|
|
2182
|
+
Memoize$1(),
|
|
2183
|
+
__metadata("design:type", Function),
|
|
2184
|
+
__metadata("design:paramtypes", [String]),
|
|
2185
|
+
__metadata("design:returntype", Object)
|
|
2186
|
+
], ParameterSnapshot.prototype, "getRouteParameter", null);
|
|
2187
|
+
__decorate([
|
|
2188
|
+
Memoize$1(),
|
|
2189
|
+
__metadata("design:type", Function),
|
|
2190
|
+
__metadata("design:paramtypes", []),
|
|
2191
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
2192
|
+
], ParameterSnapshot.prototype, "getResolvedRouteId", null);
|
|
2193
|
+
if (false) {
|
|
2194
|
+
/** @type {?} */
|
|
2195
|
+
ParameterSnapshot.prototype.placeDefinition;
|
|
2224
2196
|
/**
|
|
2225
|
-
* @
|
|
2197
|
+
* @type {?}
|
|
2198
|
+
* @private
|
|
2199
|
+
*/
|
|
2200
|
+
ParameterSnapshot.prototype.resolved;
|
|
2201
|
+
}
|
|
2202
|
+
(function (ParameterSnapshot) {
|
|
2203
|
+
/**
|
|
2204
|
+
* @param {?} placeDef
|
|
2205
|
+
* @param {?} paramMap
|
|
2226
2206
|
* @return {?}
|
|
2227
2207
|
*/
|
|
2228
|
-
|
|
2229
|
-
|
|
2208
|
+
function create(placeDef, paramMap) {
|
|
2209
|
+
/** @type {?} */
|
|
2210
|
+
const resolvedParameters = placeDef.getRouteParameters()
|
|
2211
|
+
.map((/**
|
|
2212
|
+
* @param {?} def
|
|
2213
|
+
* @return {?}
|
|
2214
|
+
*/
|
|
2215
|
+
def => {
|
|
2216
|
+
if (def.isArray) {
|
|
2217
|
+
/** @type {?} */
|
|
2218
|
+
const value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
|
|
2219
|
+
* @param {?} raw
|
|
2220
|
+
* @return {?}
|
|
2221
|
+
*/
|
|
2222
|
+
raw => def.type.parse(raw))) : null;
|
|
2223
|
+
return new ResolvedArrayParameter(def, value);
|
|
2224
|
+
}
|
|
2225
|
+
else {
|
|
2226
|
+
/** @type {?} */
|
|
2227
|
+
const value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
2228
|
+
return new ResolvedValueParameter(def, value);
|
|
2229
|
+
}
|
|
2230
|
+
}));
|
|
2231
|
+
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
2230
2232
|
}
|
|
2231
|
-
|
|
2233
|
+
ParameterSnapshot.create = create;
|
|
2232
2234
|
/**
|
|
2233
|
-
* @
|
|
2234
|
-
* @
|
|
2235
|
+
* @abstract
|
|
2236
|
+
* @template T, S
|
|
2235
2237
|
*/
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
+
class ResolvedParameter {
|
|
2239
|
+
/**
|
|
2240
|
+
* @param {?} parameterDef
|
|
2241
|
+
* @param {?} value
|
|
2242
|
+
*/
|
|
2243
|
+
constructor(parameterDef, value) {
|
|
2244
|
+
this.parameterDef = parameterDef;
|
|
2245
|
+
this.value = value;
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* @return {?}
|
|
2249
|
+
*/
|
|
2250
|
+
isRouteId() {
|
|
2251
|
+
return this.parameterDef.isRouteId;
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
2255
|
+
if (false) {
|
|
2256
|
+
/** @type {?} */
|
|
2257
|
+
ResolvedParameter.prototype.parameterDef;
|
|
2258
|
+
/** @type {?} */
|
|
2259
|
+
ResolvedParameter.prototype.value;
|
|
2260
|
+
/**
|
|
2261
|
+
* @abstract
|
|
2262
|
+
* @param {?} dest
|
|
2263
|
+
* @return {?}
|
|
2264
|
+
*/
|
|
2265
|
+
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
2266
|
+
/**
|
|
2267
|
+
* @abstract
|
|
2268
|
+
* @param {?} otherValue
|
|
2269
|
+
* @return {?}
|
|
2270
|
+
*/
|
|
2271
|
+
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
2272
|
+
/**
|
|
2273
|
+
* @abstract
|
|
2274
|
+
* @return {?}
|
|
2275
|
+
*/
|
|
2276
|
+
ResolvedParameter.prototype.formattedValue = function () { };
|
|
2277
|
+
/**
|
|
2278
|
+
* @abstract
|
|
2279
|
+
* @param {?} value
|
|
2280
|
+
* @return {?}
|
|
2281
|
+
*/
|
|
2282
|
+
ResolvedParameter.prototype.replace = function (value) { };
|
|
2238
2283
|
}
|
|
2239
|
-
// @Trace()
|
|
2240
2284
|
/**
|
|
2241
|
-
* @
|
|
2242
|
-
* @return {?}
|
|
2285
|
+
* @template T
|
|
2243
2286
|
*/
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2287
|
+
class ResolvedValueParameter extends ResolvedParameter {
|
|
2288
|
+
/**
|
|
2289
|
+
* @param {?} otherValue
|
|
2290
|
+
* @return {?}
|
|
2291
|
+
*/
|
|
2292
|
+
isSame(otherValue) {
|
|
2293
|
+
return this.value === otherValue;
|
|
2294
|
+
}
|
|
2295
|
+
/**
|
|
2296
|
+
* @param {?} dest
|
|
2297
|
+
* @return {?}
|
|
2298
|
+
*/
|
|
2299
|
+
injectRouteParam(dest) {
|
|
2300
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* @param {?} value
|
|
2304
|
+
* @return {?}
|
|
2305
|
+
*/
|
|
2306
|
+
replace(value) {
|
|
2307
|
+
return new ResolvedValueParameter(this.parameterDef, value);
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* @return {?}
|
|
2311
|
+
*/
|
|
2312
|
+
formattedValue() {
|
|
2313
|
+
return !___default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
2256
2314
|
}
|
|
2257
2315
|
}
|
|
2258
|
-
|
|
2316
|
+
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
2259
2317
|
/**
|
|
2260
|
-
* @
|
|
2261
|
-
* @return {?}
|
|
2318
|
+
* @template T
|
|
2262
2319
|
*/
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2320
|
+
class ResolvedArrayParameter extends ResolvedParameter {
|
|
2321
|
+
/**
|
|
2322
|
+
* @param {?} otherValue
|
|
2323
|
+
* @return {?}
|
|
2324
|
+
*/
|
|
2325
|
+
isSame(otherValue) {
|
|
2326
|
+
return ___default.isEqual(this.value, otherValue);
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* @param {?} dest
|
|
2330
|
+
* @return {?}
|
|
2331
|
+
*/
|
|
2332
|
+
injectRouteParam(dest) {
|
|
2333
|
+
dest[this.parameterDef.name] = this.value.map((/**
|
|
2334
|
+
* @param {?} v
|
|
2335
|
+
* @return {?}
|
|
2336
|
+
*/
|
|
2337
|
+
v => this.parameterDef.type.format(v)));
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* @param {?} value
|
|
2341
|
+
* @return {?}
|
|
2342
|
+
*/
|
|
2343
|
+
replace(value) {
|
|
2344
|
+
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
2345
|
+
}
|
|
2346
|
+
/**
|
|
2347
|
+
* @return {?}
|
|
2348
|
+
*/
|
|
2349
|
+
formattedValue() {
|
|
2350
|
+
return this.value ? this.value.map((/**
|
|
2351
|
+
* @param {?} v
|
|
2352
|
+
* @return {?}
|
|
2353
|
+
*/
|
|
2354
|
+
v => this.parameterDef.type.format(v))) : [];
|
|
2355
|
+
}
|
|
2267
2356
|
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
{ type: Injectable, args: [{
|
|
2271
|
-
providedIn: 'root'
|
|
2272
|
-
},] }
|
|
2273
|
-
];
|
|
2274
|
-
/** @nocollapse */
|
|
2275
|
-
PlaceService.ctorParameters = () => [
|
|
2276
|
-
{ type: Router },
|
|
2277
|
-
{ type: Injector }
|
|
2278
|
-
];
|
|
2279
|
-
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
|
|
2280
|
-
if (false) {
|
|
2281
|
-
/**
|
|
2282
|
-
* @type {?}
|
|
2283
|
-
* @private
|
|
2284
|
-
*/
|
|
2285
|
-
PlaceService.prototype._activePlaces;
|
|
2286
|
-
/**
|
|
2287
|
-
* @type {?}
|
|
2288
|
-
* @protected
|
|
2289
|
-
*/
|
|
2290
|
-
PlaceService.prototype.router;
|
|
2291
|
-
/**
|
|
2292
|
-
* @type {?}
|
|
2293
|
-
* @protected
|
|
2294
|
-
*/
|
|
2295
|
-
PlaceService.prototype.injector;
|
|
2296
|
-
}
|
|
2357
|
+
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
2358
|
+
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
2297
2359
|
|
|
2298
2360
|
/**
|
|
2299
2361
|
* @fileoverview added by tsickle
|
|
@@ -2346,105 +2408,130 @@ function leftRightPlaceAnimation(duration) {
|
|
|
2346
2408
|
]);
|
|
2347
2409
|
}
|
|
2348
2410
|
/** @type {?} */
|
|
2349
|
-
const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation(
|
|
2411
|
+
const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation('0.3s');
|
|
2350
2412
|
|
|
2351
2413
|
/**
|
|
2352
2414
|
* @fileoverview added by tsickle
|
|
2353
2415
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2354
2416
|
*/
|
|
2417
|
+
/**
|
|
2418
|
+
* @record
|
|
2419
|
+
*/
|
|
2420
|
+
function PlaceRef() { }
|
|
2421
|
+
if (false) {
|
|
2422
|
+
/** @type {?} */
|
|
2423
|
+
PlaceRef.prototype.placeDefinition;
|
|
2424
|
+
/**
|
|
2425
|
+
* @param {?} param
|
|
2426
|
+
* @return {?}
|
|
2427
|
+
*/
|
|
2428
|
+
PlaceRef.prototype.initialiseBindings = function (param) { };
|
|
2429
|
+
/**
|
|
2430
|
+
* @return {?}
|
|
2431
|
+
*/
|
|
2432
|
+
PlaceRef.prototype.onPlaceReady = function () { };
|
|
2433
|
+
}
|
|
2355
2434
|
class PlaceOutletComponent extends DisposableComponent {
|
|
2356
2435
|
/**
|
|
2357
|
-
* @param {?}
|
|
2358
|
-
* @param {?}
|
|
2436
|
+
* @param {?} router
|
|
2437
|
+
* @param {?} placeHistory
|
|
2359
2438
|
*/
|
|
2360
|
-
constructor(
|
|
2439
|
+
constructor(router, placeHistory) {
|
|
2361
2440
|
super();
|
|
2362
|
-
this.
|
|
2363
|
-
this.
|
|
2441
|
+
this.router = router;
|
|
2442
|
+
this.placeHistory = placeHistory;
|
|
2364
2443
|
this.animate = true;
|
|
2365
|
-
this.
|
|
2444
|
+
this._incomingRouteChange = new Guard();
|
|
2445
|
+
this._inOutletUpdate = new Guard();
|
|
2446
|
+
this._activatedRouteModel = new MutableValueModel();
|
|
2447
|
+
this._placeDefinition = new MutableValueModel();
|
|
2448
|
+
this._resolvedParameters = new MutableValueModel();
|
|
2366
2449
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2367
|
-
this.
|
|
2368
|
-
* @param {?}
|
|
2369
|
-
* @return {?}
|
|
2370
|
-
*/
|
|
2371
|
-
s => s.toString())).reduce((/**
|
|
2372
|
-
* @param {?} bits
|
|
2373
|
-
* @return {?}
|
|
2374
|
-
*/
|
|
2375
|
-
bits => bits.join(',')));
|
|
2376
|
-
console.log(`new outlet@(${this.myPath.value})`);
|
|
2377
|
-
this.outletChildPath = chain(this.outletUrlSegment).map((/**
|
|
2378
|
-
* @param {?} s
|
|
2450
|
+
this._paramMap = chain(this._activatedRouteModel).pullObservableValue((/**
|
|
2451
|
+
* @param {?} ar
|
|
2379
2452
|
* @return {?}
|
|
2380
2453
|
*/
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
bits => bits.join(",")));
|
|
2386
|
-
this.state = chain(this.myPath).map((/**
|
|
2387
|
-
* @param {?} path
|
|
2454
|
+
ar => ar.paramMap));
|
|
2455
|
+
this.placeConfigured = valueOf.all(chain(this._inOutletUpdate).isFalsey(), this._placeDefinition, this._paramMap).areTruthy();
|
|
2456
|
+
when.valueOf(this._paramMap).changes((/**
|
|
2457
|
+
* @param {?} params
|
|
2388
2458
|
* @return {?}
|
|
2389
2459
|
*/
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2460
|
+
(params) => {
|
|
2461
|
+
/** @type {?} */
|
|
2462
|
+
const snapshot = ParameterSnapshot.create(this._placeDefinition.value, params);
|
|
2463
|
+
this._incomingRouteChange.whileTrue((/**
|
|
2464
|
+
* @return {?}
|
|
2465
|
+
*/
|
|
2466
|
+
() => {
|
|
2467
|
+
this._resolvedParameters.value = snapshot;
|
|
2468
|
+
this.placeHistory.add(snapshot);
|
|
2469
|
+
}));
|
|
2470
|
+
}), {
|
|
2471
|
+
postponeUntil: this.placeConfigured
|
|
2472
|
+
});
|
|
2473
|
+
when.valueOf(this._resolvedParameters).changes((/**
|
|
2474
|
+
* @param {?} next
|
|
2475
|
+
* @param {?} previous
|
|
2395
2476
|
* @return {?}
|
|
2396
2477
|
*/
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
*/
|
|
2404
|
-
ngOnInit() {
|
|
2478
|
+
(next, previous) => {
|
|
2479
|
+
this.pushChangesToRoute(next, previous);
|
|
2480
|
+
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.
|
|
2481
|
+
}), {
|
|
2482
|
+
unless: this.incomingRouteChange
|
|
2483
|
+
});
|
|
2405
2484
|
}
|
|
2406
2485
|
/**
|
|
2407
2486
|
* @return {?}
|
|
2408
2487
|
*/
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
// this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2412
|
-
// });
|
|
2488
|
+
get incomingRouteChange() {
|
|
2489
|
+
return this._incomingRouteChange;
|
|
2413
2490
|
}
|
|
2414
2491
|
/**
|
|
2415
2492
|
* @return {?}
|
|
2416
2493
|
*/
|
|
2417
|
-
|
|
2418
|
-
// console.log(`@AfterViewChecked: ${this.state.value}`);
|
|
2419
|
-
this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2494
|
+
ngOnInit() {
|
|
2420
2495
|
}
|
|
2421
|
-
// @Trace()
|
|
2422
|
-
// ngOnDestroy(): void {
|
|
2423
|
-
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2424
|
-
// console.log('mySegments', this.myPath.value);
|
|
2425
|
-
// super.ngOnDestroy();
|
|
2426
|
-
// }
|
|
2427
|
-
// @Trace()
|
|
2428
2496
|
/**
|
|
2429
|
-
* @param {?}
|
|
2497
|
+
* @param {?} routerOutlet
|
|
2498
|
+
* @param {?} place
|
|
2430
2499
|
* @return {?}
|
|
2431
2500
|
*/
|
|
2432
|
-
onOutletActivated(
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2501
|
+
onOutletActivated(routerOutlet, place) {
|
|
2502
|
+
this._inOutletUpdate.whileTrue((/**
|
|
2503
|
+
* @return {?}
|
|
2504
|
+
*/
|
|
2505
|
+
() => {
|
|
2506
|
+
try {
|
|
2507
|
+
this._currentPlace = place;
|
|
2508
|
+
this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
2509
|
+
this._placeDefinition.value = place.placeDefinition;
|
|
2510
|
+
place.initialiseBindings(this._resolvedParameters);
|
|
2511
|
+
}
|
|
2512
|
+
catch (error) {
|
|
2513
|
+
console.error(error);
|
|
2514
|
+
}
|
|
2515
|
+
}));
|
|
2436
2516
|
if (!this.animate) {
|
|
2437
2517
|
// we're not animating so trigger any post animation callbacks now.
|
|
2438
2518
|
this.animationDone();
|
|
2439
2519
|
}
|
|
2440
2520
|
}
|
|
2441
2521
|
/**
|
|
2522
|
+
* @param {?} routerOutlet
|
|
2442
2523
|
* @param {?} $event
|
|
2443
2524
|
* @return {?}
|
|
2444
2525
|
*/
|
|
2445
|
-
onOutletDeactivated($event) {
|
|
2446
|
-
this.
|
|
2447
|
-
|
|
2526
|
+
onOutletDeactivated(routerOutlet, $event) {
|
|
2527
|
+
this._inOutletUpdate.whileTrue((/**
|
|
2528
|
+
* @return {?}
|
|
2529
|
+
*/
|
|
2530
|
+
() => {
|
|
2531
|
+
this._currentPlace = null;
|
|
2532
|
+
this._activatedRouteModel.value = null;
|
|
2533
|
+
this._placeDefinition.value = null;
|
|
2534
|
+
}));
|
|
2448
2535
|
}
|
|
2449
2536
|
/**
|
|
2450
2537
|
* @param {?} outlet
|
|
@@ -2457,79 +2544,98 @@ class PlaceOutletComponent extends DisposableComponent {
|
|
|
2457
2544
|
* @return {?}
|
|
2458
2545
|
*/
|
|
2459
2546
|
animationDone() {
|
|
2460
|
-
if (this.
|
|
2461
|
-
this.
|
|
2547
|
+
if (this._currentPlace) {
|
|
2548
|
+
this._currentPlace.onPlaceReady();
|
|
2462
2549
|
}
|
|
2463
2550
|
}
|
|
2464
|
-
// @Trace()
|
|
2465
2551
|
/**
|
|
2466
|
-
* @
|
|
2467
|
-
* @param {?}
|
|
2552
|
+
* @param {?} next
|
|
2553
|
+
* @param {?} previous
|
|
2468
2554
|
* @return {?}
|
|
2469
2555
|
*/
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2556
|
+
pushChangesToRoute(next, previous) {
|
|
2557
|
+
/** @type {?} */
|
|
2558
|
+
const activatedRoute = this._activatedRouteModel.value;
|
|
2559
|
+
this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* @param {?} snapshot
|
|
2563
|
+
* @param {?} callback
|
|
2564
|
+
* @return {?}
|
|
2565
|
+
*/
|
|
2566
|
+
sanitise(snapshot, callback) {
|
|
2567
|
+
return snapshot;
|
|
2474
2568
|
}
|
|
2475
2569
|
}
|
|
2476
2570
|
PlaceOutletComponent.decorators = [
|
|
2477
2571
|
{ type: Component, args: [{
|
|
2478
2572
|
selector: 'angular-ui-powerups-place-outlet',
|
|
2479
|
-
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",
|
|
2573
|
+
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",
|
|
2480
2574
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
2481
2575
|
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}"]
|
|
2482
2576
|
}] }
|
|
2483
2577
|
];
|
|
2484
2578
|
/** @nocollapse */
|
|
2485
2579
|
PlaceOutletComponent.ctorParameters = () => [
|
|
2486
|
-
{ type:
|
|
2487
|
-
{ type:
|
|
2580
|
+
{ type: PlaceRouter },
|
|
2581
|
+
{ type: PlaceHistory }
|
|
2488
2582
|
];
|
|
2489
2583
|
PlaceOutletComponent.propDecorators = {
|
|
2490
2584
|
animate: [{ type: Input }],
|
|
2491
|
-
|
|
2585
|
+
routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
2492
2586
|
};
|
|
2493
2587
|
if (false) {
|
|
2494
2588
|
/** @type {?} */
|
|
2495
2589
|
PlaceOutletComponent.prototype.animate;
|
|
2496
2590
|
/** @type {?} */
|
|
2497
|
-
PlaceOutletComponent.prototype.
|
|
2591
|
+
PlaceOutletComponent.prototype.routerOut;
|
|
2592
|
+
/**
|
|
2593
|
+
* @type {?}
|
|
2594
|
+
* @private
|
|
2595
|
+
*/
|
|
2596
|
+
PlaceOutletComponent.prototype._currentPlace;
|
|
2597
|
+
/**
|
|
2598
|
+
* @type {?}
|
|
2599
|
+
* @private
|
|
2600
|
+
*/
|
|
2601
|
+
PlaceOutletComponent.prototype._incomingRouteChange;
|
|
2498
2602
|
/**
|
|
2499
2603
|
* @type {?}
|
|
2500
2604
|
* @private
|
|
2501
2605
|
*/
|
|
2502
|
-
PlaceOutletComponent.prototype.
|
|
2606
|
+
PlaceOutletComponent.prototype._inOutletUpdate;
|
|
2503
2607
|
/**
|
|
2504
2608
|
* @type {?}
|
|
2505
2609
|
* @private
|
|
2506
2610
|
*/
|
|
2507
|
-
PlaceOutletComponent.prototype.
|
|
2611
|
+
PlaceOutletComponent.prototype._activatedRouteModel;
|
|
2508
2612
|
/**
|
|
2509
2613
|
* @type {?}
|
|
2510
2614
|
* @private
|
|
2511
2615
|
*/
|
|
2512
|
-
PlaceOutletComponent.prototype.
|
|
2616
|
+
PlaceOutletComponent.prototype._placeDefinition;
|
|
2513
2617
|
/**
|
|
2514
2618
|
* @type {?}
|
|
2515
2619
|
* @private
|
|
2516
2620
|
*/
|
|
2517
|
-
PlaceOutletComponent.prototype.
|
|
2621
|
+
PlaceOutletComponent.prototype._paramMap;
|
|
2622
|
+
/** @type {?} */
|
|
2623
|
+
PlaceOutletComponent.prototype._resolvedParameters;
|
|
2518
2624
|
/**
|
|
2519
2625
|
* @type {?}
|
|
2520
2626
|
* @private
|
|
2521
2627
|
*/
|
|
2522
|
-
PlaceOutletComponent.prototype.
|
|
2628
|
+
PlaceOutletComponent.prototype.placeConfigured;
|
|
2523
2629
|
/**
|
|
2524
2630
|
* @type {?}
|
|
2525
2631
|
* @private
|
|
2526
2632
|
*/
|
|
2527
|
-
PlaceOutletComponent.prototype.
|
|
2633
|
+
PlaceOutletComponent.prototype.router;
|
|
2528
2634
|
/**
|
|
2529
2635
|
* @type {?}
|
|
2530
2636
|
* @private
|
|
2531
2637
|
*/
|
|
2532
|
-
PlaceOutletComponent.prototype.
|
|
2638
|
+
PlaceOutletComponent.prototype.placeHistory;
|
|
2533
2639
|
}
|
|
2534
2640
|
|
|
2535
2641
|
/**
|
|
@@ -2584,9 +2690,7 @@ PlaceModule.decorators = [
|
|
|
2584
2690
|
TabbedPlaceNavigationComponent,
|
|
2585
2691
|
ListPlaceNavComponent
|
|
2586
2692
|
],
|
|
2587
|
-
providers: [
|
|
2588
|
-
PlaceService
|
|
2589
|
-
]
|
|
2693
|
+
providers: []
|
|
2590
2694
|
},] }
|
|
2591
2695
|
];
|
|
2592
2696
|
|
|
@@ -2990,39 +3094,6 @@ if (false) {
|
|
|
2990
3094
|
NavItem.prototype.tooltip = function () { };
|
|
2991
3095
|
}
|
|
2992
3096
|
|
|
2993
|
-
/**
|
|
2994
|
-
* @fileoverview added by tsickle
|
|
2995
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2996
|
-
*/
|
|
2997
|
-
/**
|
|
2998
|
-
* @record
|
|
2999
|
-
*/
|
|
3000
|
-
function PlaceComponentLike() { }
|
|
3001
|
-
if (false) {
|
|
3002
|
-
/** @type {?} */
|
|
3003
|
-
PlaceComponentLike.prototype.activatedRoute;
|
|
3004
|
-
/**
|
|
3005
|
-
* @return {?}
|
|
3006
|
-
*/
|
|
3007
|
-
PlaceComponentLike.prototype.onPlaceReady = function () { };
|
|
3008
|
-
}
|
|
3009
|
-
|
|
3010
|
-
/**
|
|
3011
|
-
* @fileoverview added by tsickle
|
|
3012
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3013
|
-
*/
|
|
3014
|
-
/**
|
|
3015
|
-
* @record
|
|
3016
|
-
*/
|
|
3017
|
-
function PlaceUpdatesService() { }
|
|
3018
|
-
if (false) {
|
|
3019
|
-
/**
|
|
3020
|
-
* @param {?} params
|
|
3021
|
-
* @return {?}
|
|
3022
|
-
*/
|
|
3023
|
-
PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
|
|
3024
|
-
}
|
|
3025
|
-
|
|
3026
3097
|
/**
|
|
3027
3098
|
* @fileoverview added by tsickle
|
|
3028
3099
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3037,12 +3108,37 @@ function Place(options) {
|
|
|
3037
3108
|
* @return {?}
|
|
3038
3109
|
*/
|
|
3039
3110
|
(target) => {
|
|
3040
|
-
if (
|
|
3111
|
+
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
3112
|
+
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
|
|
3113
|
+
* @param {?} c
|
|
3114
|
+
* @return {?}
|
|
3115
|
+
*/
|
|
3116
|
+
c => PlaceComponent.getDefinition(c)))));
|
|
3117
|
+
}
|
|
3118
|
+
else {
|
|
3041
3119
|
lang.illegalState(`${target} must extend PlaceComponent to use the @Place decorator`);
|
|
3042
3120
|
}
|
|
3043
|
-
PlaceComponent.injectDefinition((/** @type {?} */ (target)), options);
|
|
3044
3121
|
});
|
|
3045
3122
|
}
|
|
3123
|
+
(function (Place) {
|
|
3124
|
+
/**
|
|
3125
|
+
* @record
|
|
3126
|
+
*/
|
|
3127
|
+
function Options() { }
|
|
3128
|
+
Place.Options = Options;
|
|
3129
|
+
if (false) {
|
|
3130
|
+
/** @type {?} */
|
|
3131
|
+
Options.prototype.path;
|
|
3132
|
+
/** @type {?} */
|
|
3133
|
+
Options.prototype.order;
|
|
3134
|
+
/** @type {?|undefined} */
|
|
3135
|
+
Options.prototype.data;
|
|
3136
|
+
/** @type {?|undefined} */
|
|
3137
|
+
Options.prototype.authenticate;
|
|
3138
|
+
/** @type {?|undefined} */
|
|
3139
|
+
Options.prototype.children;
|
|
3140
|
+
}
|
|
3141
|
+
})(Place || (Place = {}));
|
|
3046
3142
|
|
|
3047
3143
|
/**
|
|
3048
3144
|
* @fileoverview added by tsickle
|
|
@@ -3090,14 +3186,16 @@ class LeavePlaceGuard {
|
|
|
3090
3186
|
// HACK: this will break with child routes...
|
|
3091
3187
|
/** @type {?} */
|
|
3092
3188
|
const path = `/${component.placeDefinition.path}`;
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3189
|
+
// let thisTree = this.router.parseUrl(currentState.url);
|
|
3190
|
+
// let nextTree = this.router.parseUrl(nextState.url);
|
|
3191
|
+
// console.log({
|
|
3192
|
+
// placePath: path,
|
|
3193
|
+
// currentRoute: currentRoute.toString(),
|
|
3194
|
+
// currentStateUrl: currentState.url,
|
|
3195
|
+
// nextStateUrl: nextState.url,
|
|
3196
|
+
// currentStateUrlTree: thisTree.root.children[PRIMARY_OUTLET].segments,
|
|
3197
|
+
// nextStateUrlTree: nextTree.root.children[PRIMARY_OUTLET].segments
|
|
3198
|
+
// });
|
|
3101
3199
|
// nextState is the full path...
|
|
3102
3200
|
if (!nextState.url.startsWith(path)) {
|
|
3103
3201
|
return component.canDeactivate();
|
|
@@ -3137,34 +3235,40 @@ if (false) {
|
|
|
3137
3235
|
*/
|
|
3138
3236
|
class PlaceRouteGuard {
|
|
3139
3237
|
/**
|
|
3140
|
-
* @param {?}
|
|
3141
|
-
* @param {?}
|
|
3238
|
+
* @param {?} placeRouter
|
|
3239
|
+
* @param {?} injector
|
|
3142
3240
|
*/
|
|
3143
|
-
constructor(
|
|
3144
|
-
this.
|
|
3145
|
-
this.
|
|
3241
|
+
constructor(placeRouter, injector) {
|
|
3242
|
+
this.placeRouter = placeRouter;
|
|
3243
|
+
this.injector = injector;
|
|
3146
3244
|
}
|
|
3147
3245
|
/**
|
|
3148
|
-
* @param {?}
|
|
3246
|
+
* @param {?} activatedRoute
|
|
3149
3247
|
* @param {?} state
|
|
3150
3248
|
* @return {?}
|
|
3151
3249
|
*/
|
|
3152
|
-
canActivate(
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3250
|
+
canActivate(activatedRoute, state) {
|
|
3251
|
+
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
3252
|
+
/** @type {?} */
|
|
3253
|
+
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
3254
|
+
/** @type {?} */
|
|
3255
|
+
const snapshot = ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap);
|
|
3256
|
+
return snapshot.sanitise(this.injector).then((/**
|
|
3257
|
+
* @param {?} sanitised
|
|
3258
|
+
* @return {?}
|
|
3259
|
+
*/
|
|
3260
|
+
sanitised => {
|
|
3261
|
+
if (sanitised.hasChanged(snapshot)) {
|
|
3262
|
+
return this.placeRouter.createUrlTree(activatedRoute, snapshot, sanitised);
|
|
3263
|
+
}
|
|
3264
|
+
else {
|
|
3265
|
+
return true;
|
|
3266
|
+
}
|
|
3267
|
+
}));
|
|
3268
|
+
}
|
|
3269
|
+
else {
|
|
3270
|
+
return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);
|
|
3271
|
+
}
|
|
3168
3272
|
}
|
|
3169
3273
|
}
|
|
3170
3274
|
PlaceRouteGuard.decorators = [
|
|
@@ -3174,21 +3278,21 @@ PlaceRouteGuard.decorators = [
|
|
|
3174
3278
|
];
|
|
3175
3279
|
/** @nocollapse */
|
|
3176
3280
|
PlaceRouteGuard.ctorParameters = () => [
|
|
3177
|
-
{ type:
|
|
3178
|
-
{ type:
|
|
3281
|
+
{ type: PlaceRouter },
|
|
3282
|
+
{ type: Injector }
|
|
3179
3283
|
];
|
|
3180
|
-
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(
|
|
3284
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceRouter), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3181
3285
|
if (false) {
|
|
3182
3286
|
/**
|
|
3183
3287
|
* @type {?}
|
|
3184
3288
|
* @private
|
|
3185
3289
|
*/
|
|
3186
|
-
PlaceRouteGuard.prototype.
|
|
3290
|
+
PlaceRouteGuard.prototype.placeRouter;
|
|
3187
3291
|
/**
|
|
3188
3292
|
* @type {?}
|
|
3189
3293
|
* @private
|
|
3190
3294
|
*/
|
|
3191
|
-
PlaceRouteGuard.prototype.
|
|
3295
|
+
PlaceRouteGuard.prototype.injector;
|
|
3192
3296
|
}
|
|
3193
3297
|
|
|
3194
3298
|
/**
|
|
@@ -3201,14 +3305,13 @@ if (false) {
|
|
|
3201
3305
|
class DefaultParameterSanitiser {
|
|
3202
3306
|
/**
|
|
3203
3307
|
* @param {?} def
|
|
3204
|
-
* @param {?}
|
|
3205
|
-
* @param {?}
|
|
3308
|
+
* @param {?} remember
|
|
3309
|
+
* @param {?} defaultValue
|
|
3206
3310
|
*/
|
|
3207
|
-
constructor(def,
|
|
3311
|
+
constructor(def, remember, defaultValue) {
|
|
3208
3312
|
this.def = def;
|
|
3209
|
-
this.
|
|
3210
|
-
this.
|
|
3211
|
-
this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
|
|
3313
|
+
this.remember = remember;
|
|
3314
|
+
this.defaultValue = defaultValue;
|
|
3212
3315
|
}
|
|
3213
3316
|
/**
|
|
3214
3317
|
* @param {?} value
|
|
@@ -3220,7 +3323,7 @@ class DefaultParameterSanitiser {
|
|
|
3220
3323
|
if (this.remember) {
|
|
3221
3324
|
// value = null;
|
|
3222
3325
|
}
|
|
3223
|
-
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3326
|
+
return this.isBlank(value) && !___default.isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3224
3327
|
}
|
|
3225
3328
|
else {
|
|
3226
3329
|
return value;
|
|
@@ -3233,8 +3336,8 @@ class DefaultParameterSanitiser {
|
|
|
3233
3336
|
*/
|
|
3234
3337
|
isBlank(value) {
|
|
3235
3338
|
/** @type {?} */
|
|
3236
|
-
const isNil
|
|
3237
|
-
return this.def.isArray ? !isNil
|
|
3339
|
+
const isNil = ___default.isNil(value);
|
|
3340
|
+
return this.def.isArray ? !isNil || value['length'] < 1 : isNil;
|
|
3238
3341
|
}
|
|
3239
3342
|
}
|
|
3240
3343
|
__decorate([
|
|
@@ -3248,22 +3351,11 @@ if (false) {
|
|
|
3248
3351
|
* @type {?}
|
|
3249
3352
|
* @private
|
|
3250
3353
|
*/
|
|
3354
|
+
DefaultParameterSanitiser.prototype.def;
|
|
3355
|
+
/** @type {?} */
|
|
3251
3356
|
DefaultParameterSanitiser.prototype.remember;
|
|
3252
|
-
/**
|
|
3253
|
-
* @type {?}
|
|
3254
|
-
* @private
|
|
3255
|
-
*/
|
|
3357
|
+
/** @type {?} */
|
|
3256
3358
|
DefaultParameterSanitiser.prototype.defaultValue;
|
|
3257
|
-
/**
|
|
3258
|
-
* @type {?}
|
|
3259
|
-
* @private
|
|
3260
|
-
*/
|
|
3261
|
-
DefaultParameterSanitiser.prototype.def;
|
|
3262
|
-
/**
|
|
3263
|
-
* @type {?}
|
|
3264
|
-
* @private
|
|
3265
|
-
*/
|
|
3266
|
-
DefaultParameterSanitiser.prototype.placeService;
|
|
3267
3359
|
}
|
|
3268
3360
|
|
|
3269
3361
|
/**
|
|
@@ -3297,8 +3389,6 @@ if (false) {
|
|
|
3297
3389
|
ParameterOptions.prototype.remember;
|
|
3298
3390
|
/** @type {?|undefined} */
|
|
3299
3391
|
ParameterOptions.prototype.defaultValue;
|
|
3300
|
-
/** @type {?|undefined} */
|
|
3301
|
-
ParameterOptions.prototype.sanitiser;
|
|
3302
3392
|
}
|
|
3303
3393
|
/**
|
|
3304
3394
|
* @record
|
|
@@ -3314,8 +3404,6 @@ if (false) {
|
|
|
3314
3404
|
ListParameterOptions.prototype.remember;
|
|
3315
3405
|
/** @type {?|undefined} */
|
|
3316
3406
|
ListParameterOptions.prototype.defaultValue;
|
|
3317
|
-
/** @type {?|undefined} */
|
|
3318
|
-
ListParameterOptions.prototype.sanitiser;
|
|
3319
3407
|
}
|
|
3320
3408
|
/**
|
|
3321
3409
|
* @template T
|
|
@@ -3324,7 +3412,6 @@ if (false) {
|
|
|
3324
3412
|
* @return {?}
|
|
3325
3413
|
*/
|
|
3326
3414
|
function RouteId(type, options) {
|
|
3327
|
-
// assert.isTruthy(type.isValid());
|
|
3328
3415
|
return (/**
|
|
3329
3416
|
* @param {?} prototype
|
|
3330
3417
|
* @param {?} propertyKey
|
|
@@ -3332,7 +3419,7 @@ function RouteId(type, options) {
|
|
|
3332
3419
|
*/
|
|
3333
3420
|
(prototype, propertyKey) => {
|
|
3334
3421
|
/** @type {?} */
|
|
3335
|
-
const param =
|
|
3422
|
+
const param = new ParameterDefinition.RouteId(propertyKey.toString(), type, options);
|
|
3336
3423
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3337
3424
|
UseDelegate()(prototype, propertyKey);
|
|
3338
3425
|
});
|
|
@@ -3344,7 +3431,6 @@ function RouteId(type, options) {
|
|
|
3344
3431
|
* @return {?}
|
|
3345
3432
|
*/
|
|
3346
3433
|
function RouteParameter(type, options) {
|
|
3347
|
-
// assert.isTruthy(type.isValid());
|
|
3348
3434
|
return (/**
|
|
3349
3435
|
* @param {?} prototype
|
|
3350
3436
|
* @param {?} propertyKey
|
|
@@ -3352,7 +3438,7 @@ function RouteParameter(type, options) {
|
|
|
3352
3438
|
*/
|
|
3353
3439
|
(prototype, propertyKey) => {
|
|
3354
3440
|
/** @type {?} */
|
|
3355
|
-
const param =
|
|
3441
|
+
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
|
|
3356
3442
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3357
3443
|
UseDelegate()(prototype, propertyKey);
|
|
3358
3444
|
});
|
|
@@ -3364,7 +3450,6 @@ function RouteParameter(type, options) {
|
|
|
3364
3450
|
* @return {?}
|
|
3365
3451
|
*/
|
|
3366
3452
|
function RouteParameterList(elementType, options) {
|
|
3367
|
-
// assert.isTruthy(type.isValid());
|
|
3368
3453
|
return (/**
|
|
3369
3454
|
* @param {?} prototype
|
|
3370
3455
|
* @param {?} propertyKey
|
|
@@ -3372,82 +3457,11 @@ function RouteParameterList(elementType, options) {
|
|
|
3372
3457
|
*/
|
|
3373
3458
|
(prototype, propertyKey) => {
|
|
3374
3459
|
/** @type {?} */
|
|
3375
|
-
const param =
|
|
3460
|
+
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
|
|
3376
3461
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3377
3462
|
UseDelegate()(prototype, propertyKey);
|
|
3378
3463
|
});
|
|
3379
3464
|
}
|
|
3380
|
-
/**
|
|
3381
|
-
* @template T
|
|
3382
|
-
* @param {?} propertyName
|
|
3383
|
-
* @param {?} type
|
|
3384
|
-
* @param {?} options
|
|
3385
|
-
* @param {?} routeId
|
|
3386
|
-
* @return {?}
|
|
3387
|
-
*/
|
|
3388
|
-
function createDefinition(propertyName, type, options, routeId) {
|
|
3389
|
-
/** @type {?} */
|
|
3390
|
-
const opts = Opts.get(options);
|
|
3391
|
-
/** @type {?} */
|
|
3392
|
-
const propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3393
|
-
/** @type {?} */
|
|
3394
|
-
const def = {
|
|
3395
|
-
name: opts.getOptional('as', propertyNameAsString),
|
|
3396
|
-
propertyName: propertyNameAsString,
|
|
3397
|
-
type: assert.notNil(type),
|
|
3398
|
-
sanitiser: opts.getOptional('sanitiser', null),
|
|
3399
|
-
isRouteId: routeId,
|
|
3400
|
-
isArray: false
|
|
3401
|
-
};
|
|
3402
|
-
return def;
|
|
3403
|
-
}
|
|
3404
|
-
/**
|
|
3405
|
-
* @template T
|
|
3406
|
-
* @param {?} propertyName
|
|
3407
|
-
* @param {?} type
|
|
3408
|
-
* @param {?} options
|
|
3409
|
-
* @return {?}
|
|
3410
|
-
*/
|
|
3411
|
-
function createArrayDefinition(propertyName, type, options) {
|
|
3412
|
-
/** @type {?} */
|
|
3413
|
-
const opts = Opts.get(options);
|
|
3414
|
-
/** @type {?} */
|
|
3415
|
-
const propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3416
|
-
/** @type {?} */
|
|
3417
|
-
const def = {
|
|
3418
|
-
name: opts.getOptional('as', propertyNameAsString),
|
|
3419
|
-
propertyName: propertyNameAsString,
|
|
3420
|
-
type: assert.notNil(type),
|
|
3421
|
-
sanitiser: opts.getOptional('sanitiser', null),
|
|
3422
|
-
isRouteId: false,
|
|
3423
|
-
isArray: true
|
|
3424
|
-
};
|
|
3425
|
-
return def;
|
|
3426
|
-
}
|
|
3427
|
-
|
|
3428
|
-
/**
|
|
3429
|
-
* @fileoverview added by tsickle
|
|
3430
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3431
|
-
*/
|
|
3432
|
-
/**
|
|
3433
|
-
* @record
|
|
3434
|
-
* @template T, S
|
|
3435
|
-
*/
|
|
3436
|
-
function ParameterDefinition() { }
|
|
3437
|
-
if (false) {
|
|
3438
|
-
/** @type {?} */
|
|
3439
|
-
ParameterDefinition.prototype.name;
|
|
3440
|
-
/** @type {?} */
|
|
3441
|
-
ParameterDefinition.prototype.propertyName;
|
|
3442
|
-
/** @type {?} */
|
|
3443
|
-
ParameterDefinition.prototype.type;
|
|
3444
|
-
/** @type {?} */
|
|
3445
|
-
ParameterDefinition.prototype.sanitiser;
|
|
3446
|
-
/** @type {?} */
|
|
3447
|
-
ParameterDefinition.prototype.isRouteId;
|
|
3448
|
-
/** @type {?} */
|
|
3449
|
-
ParameterDefinition.prototype.isArray;
|
|
3450
|
-
}
|
|
3451
3465
|
|
|
3452
3466
|
/**
|
|
3453
3467
|
* @fileoverview added by tsickle
|
|
@@ -3466,20 +3480,6 @@ if (false) {
|
|
|
3466
3480
|
*/
|
|
3467
3481
|
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
3468
3482
|
}
|
|
3469
|
-
(function (ParameterSanitiser) {
|
|
3470
|
-
/**
|
|
3471
|
-
* @record
|
|
3472
|
-
* @template T
|
|
3473
|
-
*/
|
|
3474
|
-
function Options() { }
|
|
3475
|
-
ParameterSanitiser.Options = Options;
|
|
3476
|
-
if (false) {
|
|
3477
|
-
/** @type {?|undefined} */
|
|
3478
|
-
Options.prototype.remember;
|
|
3479
|
-
/** @type {?|undefined} */
|
|
3480
|
-
Options.prototype.defaultValue;
|
|
3481
|
-
}
|
|
3482
|
-
})(ParameterSanitiser || (ParameterSanitiser = {}));
|
|
3483
3483
|
|
|
3484
3484
|
/**
|
|
3485
3485
|
* @fileoverview added by tsickle
|
|
@@ -3517,7 +3517,7 @@ var ParameterType;
|
|
|
3517
3517
|
* @return {?}
|
|
3518
3518
|
*/
|
|
3519
3519
|
parse(value) {
|
|
3520
|
-
return isNil(value) || isEmpty(value) ? null : +value;
|
|
3520
|
+
return ___default.isNil(value) || ___default.isEmpty(value) ? null : +value;
|
|
3521
3521
|
}
|
|
3522
3522
|
}
|
|
3523
3523
|
class BooleanType {
|
|
@@ -3569,7 +3569,7 @@ class Sanitiser {
|
|
|
3569
3569
|
* @return {?}
|
|
3570
3570
|
*/
|
|
3571
3571
|
get valueChanged() {
|
|
3572
|
-
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3572
|
+
return !___default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* @return {?}
|
|
@@ -3639,13 +3639,11 @@ class RouteParameterSanitiser {
|
|
|
3639
3639
|
/**
|
|
3640
3640
|
* @param {?} parameterDefs
|
|
3641
3641
|
* @param {?} snapshot
|
|
3642
|
-
* @param {?} placeService
|
|
3643
3642
|
* @param {?} injector
|
|
3644
3643
|
*/
|
|
3645
|
-
constructor(parameterDefs, snapshot,
|
|
3644
|
+
constructor(parameterDefs, snapshot, injector) {
|
|
3646
3645
|
this.parameterDefs = parameterDefs;
|
|
3647
3646
|
this.snapshot = snapshot;
|
|
3648
|
-
this.placeService = placeService;
|
|
3649
3647
|
this.injector = injector;
|
|
3650
3648
|
this.parameterSanitisers = [];
|
|
3651
3649
|
/** @type {?} */
|
|
@@ -3699,17 +3697,7 @@ class RouteParameterSanitiser {
|
|
|
3699
3697
|
* @return {?}
|
|
3700
3698
|
*/
|
|
3701
3699
|
getSanitiser(def) {
|
|
3702
|
-
|
|
3703
|
-
if (this.isSanitiserContructor(def.sanitiser)) {
|
|
3704
|
-
return this.injector.get(def.sanitiser, new def.sanitiser());
|
|
3705
|
-
}
|
|
3706
|
-
else {
|
|
3707
|
-
return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
|
|
3708
|
-
}
|
|
3709
|
-
}
|
|
3710
|
-
else {
|
|
3711
|
-
return null;
|
|
3712
|
-
}
|
|
3700
|
+
return def.getSanitiser(this.injector);
|
|
3713
3701
|
}
|
|
3714
3702
|
/**
|
|
3715
3703
|
* @return {?}
|
|
@@ -3743,13 +3731,13 @@ class RouteParameterSanitiser {
|
|
|
3743
3731
|
* @return {?}
|
|
3744
3732
|
*/
|
|
3745
3733
|
isSanitiserContructor(value) {
|
|
3746
|
-
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3734
|
+
return ___default.isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3747
3735
|
}
|
|
3748
3736
|
}
|
|
3749
3737
|
__decorate([
|
|
3750
|
-
Memoize(),
|
|
3738
|
+
Memoize$1(),
|
|
3751
3739
|
__metadata("design:type", Function),
|
|
3752
|
-
__metadata("design:paramtypes", [
|
|
3740
|
+
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
3753
3741
|
__metadata("design:returntype", Object)
|
|
3754
3742
|
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
3755
3743
|
__decorate([
|
|
@@ -3774,8 +3762,6 @@ if (false) {
|
|
|
3774
3762
|
/** @type {?} */
|
|
3775
3763
|
RouteParameterSanitiser.prototype.snapshot;
|
|
3776
3764
|
/** @type {?} */
|
|
3777
|
-
RouteParameterSanitiser.prototype.placeService;
|
|
3778
|
-
/** @type {?} */
|
|
3779
3765
|
RouteParameterSanitiser.prototype.injector;
|
|
3780
3766
|
}
|
|
3781
3767
|
(function (Sanitiser) {
|
|
@@ -3871,5 +3857,5 @@ if (false) {
|
|
|
3871
3857
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3872
3858
|
*/
|
|
3873
3859
|
|
|
3874
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DefaultParameterSanitiser, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard,
|
|
3860
|
+
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DefaultParameterSanitiser, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterDefinition, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, AlertDialogComponent as ɵba, DialogInteractionService as ɵbc, InteractionContext as ɵbd, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceRouter as ɵo, PlaceHistory as ɵp, TabbedPlaceNavigationComponent as ɵq, AbstractPlaceNavigationComponent as ɵr, ListPlaceNavComponent as ɵs, InteractionModule as ɵt, ActivityContainerComponent as ɵu, ActivityOutletComponent as ɵv, ConfirmationDialogComponent as ɵw, AbstractActivity as ɵx, ACTIVITY_DATA as ɵy };
|
|
3875
3861
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|