@coolon/angular-ui-powerups 0.0.37 → 0.0.41
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 +1787 -1051
- 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 -14
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +16 -14
- package/esm2015/index.js +2 -2
- package/esm2015/lib/angular-ui-powerups.module.js +8 -8
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +1 -2
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +1 -2
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +75 -0
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +47 -0
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +110 -16
- package/esm2015/lib/place/components/place-outlet/route-animations.js +12 -5
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +5 -39
- package/esm2015/lib/place/guards/leave-place.guard.js +20 -3
- package/esm2015/lib/place/guards/place-route.guard.js +29 -37
- package/esm2015/lib/place/index.js +11 -9
- package/esm2015/lib/place/nav-item.js +23 -0
- package/esm2015/lib/place/place-component-like.js +17 -0
- package/esm2015/lib/place/place-component.js +119 -20
- package/esm2015/lib/place/place-updates-service.js +16 -0
- package/esm2015/lib/place/place.decorator.js +1 -1
- package/esm2015/lib/place/place.module.js +6 -3
- package/esm2015/lib/place/place.service.js +28 -26
- package/esm2015/lib/place/route/default-parameter-sanitiser.js +78 -0
- package/esm2015/lib/place/route/parameter-decorators.js +15 -7
- package/esm2015/lib/place/route/parameter-definition.class.js +2 -2
- package/esm2015/lib/place/route/parameter-sanitiser.js +17 -2
- package/esm2015/lib/place/route/parameter-snapshot.js +382 -0
- package/esm2015/lib/place/route/parameter-type.js +3 -2
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +73 -38
- package/esm2015/lib/place/visit.js +22 -0
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +16 -14
- package/esm5/index.js +2 -2
- package/esm5/lib/angular-ui-powerups.module.js +8 -8
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +1 -2
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +1 -2
- package/esm5/lib/place/components/abstract-place-navigation.component.js +86 -0
- package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +61 -0
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +141 -20
- package/esm5/lib/place/components/place-outlet/route-animations.js +12 -5
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +6 -43
- package/esm5/lib/place/guards/leave-place.guard.js +20 -3
- package/esm5/lib/place/guards/place-route.guard.js +28 -37
- package/esm5/lib/place/index.js +11 -9
- package/esm5/lib/place/nav-item.js +23 -0
- package/esm5/lib/place/place-component-like.js +17 -0
- package/esm5/lib/place/place-component.js +137 -22
- package/esm5/lib/place/place-updates-service.js +16 -0
- package/esm5/lib/place/place.decorator.js +1 -1
- package/esm5/lib/place/place.module.js +6 -3
- package/esm5/lib/place/place.service.js +48 -29
- package/esm5/lib/place/route/default-parameter-sanitiser.js +85 -0
- package/esm5/lib/place/route/parameter-decorators.js +15 -7
- package/esm5/lib/place/route/parameter-definition.class.js +2 -2
- package/esm5/lib/place/route/parameter-sanitiser.js +17 -2
- package/esm5/lib/place/route/parameter-snapshot.js +474 -0
- package/esm5/lib/place/route/parameter-type.js +3 -2
- package/esm5/lib/place/route/route-parameter-sanitiser.js +100 -45
- package/esm5/lib/place/visit.js +22 -0
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +1244 -673
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1750 -1021
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/components/abstract-place-navigation.component.d.ts +13 -0
- package/lib/place/components/list-place-nav/list-place-nav.component.d.ts +8 -0
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +16 -8
- package/lib/place/components/place-outlet/route-animations.d.ts +1 -0
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -9
- package/lib/place/guards/place-route.guard.d.ts +4 -4
- package/lib/place/index.d.ts +8 -6
- package/lib/place/nav-item.d.ts +5 -0
- package/lib/place/{i-place-component.d.ts → place-component-like.d.ts} +1 -1
- package/lib/place/place-component.d.ts +19 -8
- package/lib/place/place-updates-service.d.ts +10 -0
- package/lib/place/place.service.d.ts +11 -8
- package/lib/place/route/default-parameter-sanitiser.d.ts +13 -0
- package/lib/place/route/parameter-decorators.d.ts +6 -2
- package/lib/place/route/parameter-definition.class.d.ts +3 -3
- package/lib/place/route/parameter-sanitiser.d.ts +8 -1
- package/lib/place/route/parameter-snapshot.d.ts +46 -0
- package/lib/place/route/route-parameter-sanitiser.d.ts +13 -9
- package/lib/place/visit.d.ts +6 -0
- package/package.json +1 -1
- package/schematics/place-routes/index.js +8 -95
- package/schematics/place-routes/index.js.map +1 -1
- package/schematics/place-routes/place-builder.d.ts +19 -0
- package/schematics/place-routes/place-builder.js +109 -0
- package/schematics/place-routes/place-builder.js.map +1 -0
- package/schematics/place-routes/{scanner.d.ts → place-class-scanner.d.ts} +10 -6
- package/schematics/place-routes/{scanner.js → place-class-scanner.js} +43 -18
- package/schematics/place-routes/place-class-scanner.js.map +1 -0
- package/schematics/place-routes/place-def.d.ts +19 -4
- package/schematics/place-routes/place-def.js +54 -4
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/place-routes/templates/{place-routes.ts.template → places.ts.template} +14 -11
- package/esm2015/lib/place/i-place-component.js +0 -17
- package/esm2015/lib/place/i-place-service.js +0 -16
- package/esm2015/lib/place/route/resolved-parameter.js +0 -16
- package/esm2015/lib/place/route/resolved-route-parameter-snapshot.js +0 -106
- package/esm2015/lib/place/route/route-parameter-bindings.js +0 -150
- package/esm2015/lib/place/route/visit-snapshot.js +0 -7
- package/esm5/lib/place/i-place-component.js +0 -17
- package/esm5/lib/place/i-place-service.js +0 -16
- package/esm5/lib/place/route/resolved-parameter.js +0 -16
- package/esm5/lib/place/route/resolved-route-parameter-snapshot.js +0 -129
- package/esm5/lib/place/route/route-parameter-bindings.js +0 -167
- package/esm5/lib/place/route/visit-snapshot.js +0 -11
- package/lib/place/i-place-service.d.ts +0 -10
- package/lib/place/route/resolved-parameter.d.ts +0 -5
- package/lib/place/route/resolved-route-parameter-snapshot.d.ts +0 -12
- package/lib/place/route/route-parameter-bindings.d.ts +0 -17
- package/lib/place/route/visit-snapshot.d.ts +0 -2
- package/schematics/place-routes/scanner.js.map +0 -1
- package/schematics/place-routes/templates/place-router.ts.template +0 -33
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
2
|
-
import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule, INJECTOR } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule, HostBinding, INJECTOR } from '@angular/core';
|
|
3
3
|
import { FormsModule } from '@angular/forms';
|
|
4
4
|
import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgressSpinnerModule, MatInputModule, MatFormFieldModule, MatSelectModule } from '@angular/material';
|
|
5
|
-
import {
|
|
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, assert, UnaryCommand, lang, Dsl, Logger,
|
|
8
|
+
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, Trace, MutableListModel, StoreInValueModel, MutableValueModel, Binding, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
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';
|
|
12
12
|
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
|
-
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
16
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
17
|
-
import { Router,
|
|
18
|
-
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
19
|
-
import {
|
|
16
|
+
import { Router, ActivatedRoute, RouterOutlet, RouterModule, PRIMARY_OUTLET } from '@angular/router';
|
|
17
|
+
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
18
|
+
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
|
|
19
|
+
import { isNil, isEqual, isEmpty, isFunction } from 'lodash';
|
|
20
20
|
import 'reflect-metadata';
|
|
21
21
|
import { style, query, group, animate, trigger, transition } from '@angular/animations';
|
|
22
22
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
23
|
-
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* @fileoverview added by tsickle
|
|
@@ -237,6 +236,110 @@ NumberInputComponent.decorators = [
|
|
|
237
236
|
/** @nocollapse */
|
|
238
237
|
NumberInputComponent.ctorParameters = () => [];
|
|
239
238
|
|
|
239
|
+
/**
|
|
240
|
+
* @fileoverview added by tsickle
|
|
241
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
242
|
+
*/
|
|
243
|
+
class PasswordInputComponent extends AbstractInputComponent {
|
|
244
|
+
constructor() {
|
|
245
|
+
super();
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @return {?}
|
|
249
|
+
*/
|
|
250
|
+
ngOnInit() {
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
PasswordInputComponent.decorators = [
|
|
254
|
+
{ type: Component, args: [{
|
|
255
|
+
selector: 'angular-ui-powerups-password-input',
|
|
256
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
257
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
258
|
+
}] }
|
|
259
|
+
];
|
|
260
|
+
/** @nocollapse */
|
|
261
|
+
PasswordInputComponent.ctorParameters = () => [];
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @fileoverview added by tsickle
|
|
265
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
268
|
+
* @template T
|
|
269
|
+
*/
|
|
270
|
+
class SelectInputComponent extends AbstractInputComponent {
|
|
271
|
+
constructor() {
|
|
272
|
+
super();
|
|
273
|
+
this.optionLabelFormat = (/**
|
|
274
|
+
* @param {?} option
|
|
275
|
+
* @return {?}
|
|
276
|
+
*/
|
|
277
|
+
(option) => (option && this.optionLabel) ? option[this.optionLabel] : option);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* @return {?}
|
|
281
|
+
*/
|
|
282
|
+
ngOnInit() {
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
SelectInputComponent.decorators = [
|
|
286
|
+
{ type: Component, args: [{
|
|
287
|
+
selector: 'angular-ui-powerups-select-input',
|
|
288
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
289
|
+
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
290
|
+
}] }
|
|
291
|
+
];
|
|
292
|
+
/** @nocollapse */
|
|
293
|
+
SelectInputComponent.ctorParameters = () => [];
|
|
294
|
+
SelectInputComponent.propDecorators = {
|
|
295
|
+
optionsModel: [{ type: Input }],
|
|
296
|
+
options: [{ type: Input }],
|
|
297
|
+
optionLabel: [{ type: Input }],
|
|
298
|
+
optionLabelFormat: [{ type: Input }]
|
|
299
|
+
};
|
|
300
|
+
__decorate([
|
|
301
|
+
UseDelegate(),
|
|
302
|
+
__metadata("design:type", ListModel)
|
|
303
|
+
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
StoreInListModel('optionsModel'),
|
|
306
|
+
__metadata("design:type", Array)
|
|
307
|
+
], SelectInputComponent.prototype, "options", void 0);
|
|
308
|
+
if (false) {
|
|
309
|
+
/** @type {?} */
|
|
310
|
+
SelectInputComponent.prototype.optionsModel;
|
|
311
|
+
/** @type {?} */
|
|
312
|
+
SelectInputComponent.prototype.options;
|
|
313
|
+
/** @type {?} */
|
|
314
|
+
SelectInputComponent.prototype.optionLabel;
|
|
315
|
+
/** @type {?} */
|
|
316
|
+
SelectInputComponent.prototype.optionLabelFormat;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @fileoverview added by tsickle
|
|
321
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
322
|
+
*/
|
|
323
|
+
class StringInputComponent extends AbstractInputComponent {
|
|
324
|
+
constructor() {
|
|
325
|
+
super();
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* @return {?}
|
|
329
|
+
*/
|
|
330
|
+
ngOnInit() {
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
StringInputComponent.decorators = [
|
|
334
|
+
{ type: Component, args: [{
|
|
335
|
+
selector: 'angular-ui-powerups-string-input',
|
|
336
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
337
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
338
|
+
}] }
|
|
339
|
+
];
|
|
340
|
+
/** @nocollapse */
|
|
341
|
+
StringInputComponent.ctorParameters = () => [];
|
|
342
|
+
|
|
240
343
|
/**
|
|
241
344
|
* @fileoverview added by tsickle
|
|
242
345
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -545,110 +648,6 @@ if (false) {
|
|
|
545
648
|
FocusBindingDirective.prototype.ngZone;
|
|
546
649
|
}
|
|
547
650
|
|
|
548
|
-
/**
|
|
549
|
-
* @fileoverview added by tsickle
|
|
550
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
551
|
-
*/
|
|
552
|
-
class StringInputComponent extends AbstractInputComponent {
|
|
553
|
-
constructor() {
|
|
554
|
-
super();
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* @return {?}
|
|
558
|
-
*/
|
|
559
|
-
ngOnInit() {
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
StringInputComponent.decorators = [
|
|
563
|
-
{ type: Component, args: [{
|
|
564
|
-
selector: 'angular-ui-powerups-string-input',
|
|
565
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
566
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
567
|
-
}] }
|
|
568
|
-
];
|
|
569
|
-
/** @nocollapse */
|
|
570
|
-
StringInputComponent.ctorParameters = () => [];
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* @fileoverview added by tsickle
|
|
574
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
575
|
-
*/
|
|
576
|
-
class PasswordInputComponent extends AbstractInputComponent {
|
|
577
|
-
constructor() {
|
|
578
|
-
super();
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* @return {?}
|
|
582
|
-
*/
|
|
583
|
-
ngOnInit() {
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
PasswordInputComponent.decorators = [
|
|
587
|
-
{ type: Component, args: [{
|
|
588
|
-
selector: 'angular-ui-powerups-password-input',
|
|
589
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
590
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
591
|
-
}] }
|
|
592
|
-
];
|
|
593
|
-
/** @nocollapse */
|
|
594
|
-
PasswordInputComponent.ctorParameters = () => [];
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* @fileoverview added by tsickle
|
|
598
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
599
|
-
*/
|
|
600
|
-
/**
|
|
601
|
-
* @template T
|
|
602
|
-
*/
|
|
603
|
-
class SelectInputComponent extends AbstractInputComponent {
|
|
604
|
-
constructor() {
|
|
605
|
-
super();
|
|
606
|
-
this.optionLabelFormat = (/**
|
|
607
|
-
* @param {?} option
|
|
608
|
-
* @return {?}
|
|
609
|
-
*/
|
|
610
|
-
(option) => (option && this.optionLabel) ? option[this.optionLabel] : option);
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* @return {?}
|
|
614
|
-
*/
|
|
615
|
-
ngOnInit() {
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
SelectInputComponent.decorators = [
|
|
619
|
-
{ type: Component, args: [{
|
|
620
|
-
selector: 'angular-ui-powerups-select-input',
|
|
621
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
622
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
623
|
-
}] }
|
|
624
|
-
];
|
|
625
|
-
/** @nocollapse */
|
|
626
|
-
SelectInputComponent.ctorParameters = () => [];
|
|
627
|
-
SelectInputComponent.propDecorators = {
|
|
628
|
-
optionsModel: [{ type: Input }],
|
|
629
|
-
options: [{ type: Input }],
|
|
630
|
-
optionLabel: [{ type: Input }],
|
|
631
|
-
optionLabelFormat: [{ type: Input }]
|
|
632
|
-
};
|
|
633
|
-
__decorate([
|
|
634
|
-
UseDelegate(),
|
|
635
|
-
__metadata("design:type", ListModel)
|
|
636
|
-
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
637
|
-
__decorate([
|
|
638
|
-
StoreInListModel('optionsModel'),
|
|
639
|
-
__metadata("design:type", Array)
|
|
640
|
-
], SelectInputComponent.prototype, "options", void 0);
|
|
641
|
-
if (false) {
|
|
642
|
-
/** @type {?} */
|
|
643
|
-
SelectInputComponent.prototype.optionsModel;
|
|
644
|
-
/** @type {?} */
|
|
645
|
-
SelectInputComponent.prototype.options;
|
|
646
|
-
/** @type {?} */
|
|
647
|
-
SelectInputComponent.prototype.optionLabel;
|
|
648
|
-
/** @type {?} */
|
|
649
|
-
SelectInputComponent.prototype.optionLabelFormat;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
651
|
/**
|
|
653
652
|
* @fileoverview added by tsickle
|
|
654
653
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -1066,7 +1065,6 @@ class ConfirmationDialogComponent extends AbstractActivity {
|
|
|
1066
1065
|
super();
|
|
1067
1066
|
this.confirm = confirm;
|
|
1068
1067
|
assert.notNil(confirm);
|
|
1069
|
-
console.log(confirm);
|
|
1070
1068
|
}
|
|
1071
1069
|
/**
|
|
1072
1070
|
* @return {?}
|
|
@@ -1177,7 +1175,6 @@ class ActivityContainerComponent extends DisposableComponent {
|
|
|
1177
1175
|
* @return {?}
|
|
1178
1176
|
*/
|
|
1179
1177
|
onAnimationFinished() {
|
|
1180
|
-
// TODO: notify selected tab they are ready. activty.afterAnimationComplete
|
|
1181
1178
|
this.activityTabs.value = this.activityTabs.value.filter((/**
|
|
1182
1179
|
* @param {?} tab
|
|
1183
1180
|
* @return {?}
|
|
@@ -1449,166 +1446,414 @@ EmptyStateComponent.decorators = [
|
|
|
1449
1446
|
/** @nocollapse */
|
|
1450
1447
|
EmptyStateComponent.ctorParameters = () => [];
|
|
1451
1448
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1449
|
+
var _a;
|
|
1450
|
+
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
1451
|
+
// Id snapshot are repesented by 2 url segments
|
|
1452
|
+
// ID => [{'/basePath', params}, {'id', params}]
|
|
1453
|
+
// NO ID => [{'/basePath', params}]
|
|
1454
|
+
class ParameterSnapshot {
|
|
1457
1455
|
/**
|
|
1458
|
-
* @param {?}
|
|
1456
|
+
* @param {?} placeDefinition
|
|
1457
|
+
* @param {?} resolved
|
|
1459
1458
|
*/
|
|
1460
|
-
constructor(
|
|
1461
|
-
this.
|
|
1459
|
+
constructor(placeDefinition, resolved) {
|
|
1460
|
+
this.placeDefinition = placeDefinition;
|
|
1461
|
+
this.resolved = resolved;
|
|
1462
1462
|
}
|
|
1463
1463
|
/**
|
|
1464
|
-
* @
|
|
1465
|
-
* @param {?} parameter
|
|
1464
|
+
* @param {?} other
|
|
1466
1465
|
* @return {?}
|
|
1467
1466
|
*/
|
|
1468
|
-
|
|
1467
|
+
hasChanged(other) {
|
|
1469
1468
|
/** @type {?} */
|
|
1470
|
-
const
|
|
1471
|
-
* @param {?}
|
|
1469
|
+
const changed = this.resolved.find((/**
|
|
1470
|
+
* @param {?} r
|
|
1472
1471
|
* @return {?}
|
|
1473
1472
|
*/
|
|
1474
|
-
|
|
1475
|
-
|
|
1473
|
+
(r) => {
|
|
1474
|
+
return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
|
|
1475
|
+
}));
|
|
1476
|
+
if (changed) {
|
|
1477
|
+
console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
|
|
1478
|
+
}
|
|
1479
|
+
return !!changed;
|
|
1476
1480
|
}
|
|
1477
1481
|
/**
|
|
1478
|
-
* @
|
|
1479
|
-
* @param {?} parameter
|
|
1480
|
-
* @param {?} value
|
|
1482
|
+
* @param {?} other
|
|
1481
1483
|
* @return {?}
|
|
1482
1484
|
*/
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1485
|
+
asUrlSegment(other) {
|
|
1486
|
+
assert.isTruthy(this.hasChanged(other));
|
|
1487
|
+
/** @type {?} */
|
|
1488
|
+
const routeParts = [];
|
|
1489
|
+
/** @type {?} */
|
|
1490
|
+
const gainedId = this.getFormattedRouteId() && !other.getFormattedRouteId();
|
|
1491
|
+
/** @type {?} */
|
|
1492
|
+
const sameId = this.getFormattedRouteId() === other.getFormattedRouteId();
|
|
1493
|
+
/** @type {?} */
|
|
1494
|
+
const lostId = (!this.getFormattedRouteId() && other.getFormattedRouteId());
|
|
1495
|
+
/** @type {?} */
|
|
1496
|
+
const changedId = (this.getFormattedRouteId() !== other.getFormattedRouteId());
|
|
1497
|
+
if (lostId || changedId) {
|
|
1498
|
+
routeParts.push('..');
|
|
1499
|
+
if (changedId) {
|
|
1500
|
+
routeParts.push(this.getFormattedRouteId());
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
else {
|
|
1504
|
+
routeParts.push('.');
|
|
1505
|
+
}
|
|
1506
|
+
routeParts.push(this.getFormattedParameters());
|
|
1507
|
+
return routeParts;
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* @template T, S
|
|
1511
|
+
* @param {?} parameterDef
|
|
1512
|
+
* @return {?}
|
|
1513
|
+
*/
|
|
1514
|
+
getResolvedParameter(parameterDef) {
|
|
1515
|
+
return this.resolved.find((/**
|
|
1516
|
+
* @param {?} r
|
|
1486
1517
|
* @return {?}
|
|
1487
1518
|
*/
|
|
1488
|
-
|
|
1489
|
-
parameterDef: parameter,
|
|
1490
|
-
resolvedValue: value
|
|
1491
|
-
}));
|
|
1519
|
+
r => r.parameterDef === parameterDef));
|
|
1492
1520
|
}
|
|
1493
1521
|
/**
|
|
1522
|
+
* @template T, S
|
|
1523
|
+
* @param {?} parameterDef
|
|
1494
1524
|
* @return {?}
|
|
1495
1525
|
*/
|
|
1496
|
-
|
|
1526
|
+
getResolvedParameterValue(parameterDef) {
|
|
1497
1527
|
/** @type {?} */
|
|
1498
|
-
const
|
|
1499
|
-
return
|
|
1528
|
+
const resolvedParameter = this.getResolvedParameter(parameterDef);
|
|
1529
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
1500
1530
|
}
|
|
1501
1531
|
/**
|
|
1502
|
-
* @private
|
|
1503
1532
|
* @return {?}
|
|
1504
1533
|
*/
|
|
1505
|
-
|
|
1506
|
-
return this.
|
|
1507
|
-
|
|
1534
|
+
getRouteId() {
|
|
1535
|
+
return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* @param {?} name
|
|
1539
|
+
* @return {?}
|
|
1540
|
+
*/
|
|
1541
|
+
getRouteParameter(name) {
|
|
1542
|
+
/** @type {?} */
|
|
1543
|
+
const resolvedParameter = this.resolved.find((/**
|
|
1544
|
+
* @param {?} r
|
|
1508
1545
|
* @return {?}
|
|
1509
1546
|
*/
|
|
1510
|
-
|
|
1547
|
+
r => r.parameterDef.name === name));
|
|
1548
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
1511
1549
|
}
|
|
1512
1550
|
/**
|
|
1551
|
+
* @private
|
|
1513
1552
|
* @return {?}
|
|
1514
1553
|
*/
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
/** @type {?} */
|
|
1519
|
-
const routeIdParam = this.parameters.filter((/**
|
|
1554
|
+
getResolvedRouteId() {
|
|
1555
|
+
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
1556
|
+
// capture this in the type system though
|
|
1557
|
+
return (/** @type {?} */ (this.resolved.find((/**
|
|
1520
1558
|
* @param {?} p
|
|
1521
1559
|
* @return {?}
|
|
1522
1560
|
*/
|
|
1523
|
-
p =>
|
|
1561
|
+
p => p.parameterDef.isRouteId))));
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* @return {?}
|
|
1565
|
+
*/
|
|
1566
|
+
hasRouteId() {
|
|
1567
|
+
return !!this.getResolvedRouteId();
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1570
|
+
* @return {?}
|
|
1571
|
+
*/
|
|
1572
|
+
getFormattedRouteId() {
|
|
1573
|
+
/** @type {?} */
|
|
1574
|
+
const routeIdParam = this.getResolvedRouteId();
|
|
1575
|
+
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* @return {?}
|
|
1579
|
+
*/
|
|
1580
|
+
getFormattedParameters() {
|
|
1581
|
+
/** @type {?} */
|
|
1582
|
+
const params = {};
|
|
1583
|
+
/** @type {?} */
|
|
1584
|
+
const routeIdParam = this.resolved.filter((/**
|
|
1585
|
+
* @param {?} p
|
|
1586
|
+
* @return {?}
|
|
1587
|
+
*/
|
|
1588
|
+
p => !p.parameterDef.isRouteId)).forEach((/**
|
|
1524
1589
|
* @param {?} p
|
|
1525
1590
|
* @return {?}
|
|
1526
1591
|
*/
|
|
1527
1592
|
p => {
|
|
1528
|
-
params[p.parameterDef.name] = p.
|
|
1593
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
1529
1594
|
}));
|
|
1530
1595
|
return params;
|
|
1531
1596
|
}
|
|
1532
1597
|
/**
|
|
1598
|
+
* @template T, S
|
|
1599
|
+
* @param {?} parameter
|
|
1600
|
+
* @param {?} value
|
|
1533
1601
|
* @return {?}
|
|
1534
1602
|
*/
|
|
1535
|
-
|
|
1536
|
-
return
|
|
1603
|
+
replace(parameter, value) {
|
|
1604
|
+
return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
|
|
1605
|
+
* @param {?} p
|
|
1606
|
+
* @return {?}
|
|
1607
|
+
*/
|
|
1608
|
+
p => {
|
|
1609
|
+
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
1610
|
+
})));
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* @param {?} url
|
|
1614
|
+
* @return {?}
|
|
1615
|
+
*/
|
|
1616
|
+
updateUrl(url) {
|
|
1617
|
+
return url;
|
|
1537
1618
|
}
|
|
1538
1619
|
}
|
|
1539
1620
|
__decorate([
|
|
1540
|
-
|
|
1621
|
+
Memoize(),
|
|
1541
1622
|
__metadata("design:type", Function),
|
|
1542
|
-
__metadata("design:paramtypes", []),
|
|
1543
|
-
__metadata("design:returntype",
|
|
1544
|
-
],
|
|
1623
|
+
__metadata("design:paramtypes", [Object]),
|
|
1624
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
1625
|
+
], ParameterSnapshot.prototype, "getResolvedParameter", null);
|
|
1545
1626
|
__decorate([
|
|
1546
|
-
|
|
1627
|
+
Memoize(),
|
|
1628
|
+
__metadata("design:type", Function),
|
|
1629
|
+
__metadata("design:paramtypes", [Object]),
|
|
1630
|
+
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
1631
|
+
], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
|
|
1632
|
+
__decorate([
|
|
1633
|
+
Memoize(),
|
|
1634
|
+
__metadata("design:type", Function),
|
|
1635
|
+
__metadata("design:paramtypes", [String]),
|
|
1636
|
+
__metadata("design:returntype", Object)
|
|
1637
|
+
], ParameterSnapshot.prototype, "getRouteParameter", null);
|
|
1638
|
+
__decorate([
|
|
1639
|
+
Memoize(),
|
|
1547
1640
|
__metadata("design:type", Function),
|
|
1548
1641
|
__metadata("design:paramtypes", []),
|
|
1549
|
-
__metadata("design:returntype",
|
|
1550
|
-
],
|
|
1642
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
1643
|
+
], ParameterSnapshot.prototype, "getResolvedRouteId", null);
|
|
1551
1644
|
if (false) {
|
|
1552
1645
|
/** @type {?} */
|
|
1553
|
-
|
|
1646
|
+
ParameterSnapshot.prototype.placeDefinition;
|
|
1647
|
+
/**
|
|
1648
|
+
* @type {?}
|
|
1649
|
+
* @private
|
|
1650
|
+
*/
|
|
1651
|
+
ParameterSnapshot.prototype.resolved;
|
|
1554
1652
|
}
|
|
1653
|
+
(function (ParameterSnapshot) {
|
|
1654
|
+
/**
|
|
1655
|
+
* @param {?} placeDef
|
|
1656
|
+
* @param {?} paramMap
|
|
1657
|
+
* @return {?}
|
|
1658
|
+
*/
|
|
1659
|
+
function create(placeDef, paramMap) {
|
|
1660
|
+
/** @type {?} */
|
|
1661
|
+
const resolvedParameters = placeDef.getRouteParameters()
|
|
1662
|
+
.map((/**
|
|
1663
|
+
* @param {?} def
|
|
1664
|
+
* @return {?}
|
|
1665
|
+
*/
|
|
1666
|
+
def => {
|
|
1667
|
+
if (def.isArray) {
|
|
1668
|
+
/** @type {?} */
|
|
1669
|
+
const value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
|
|
1670
|
+
* @param {?} raw
|
|
1671
|
+
* @return {?}
|
|
1672
|
+
*/
|
|
1673
|
+
raw => def.type.parse(raw))) : null;
|
|
1674
|
+
return new ResolvedArrayParameter(def, value);
|
|
1675
|
+
}
|
|
1676
|
+
else {
|
|
1677
|
+
/** @type {?} */
|
|
1678
|
+
const value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
1679
|
+
return new ResolvedValueParameter(def, value);
|
|
1680
|
+
}
|
|
1681
|
+
}));
|
|
1682
|
+
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
1683
|
+
}
|
|
1684
|
+
ParameterSnapshot.create = create;
|
|
1685
|
+
/**
|
|
1686
|
+
* @abstract
|
|
1687
|
+
* @template T, S
|
|
1688
|
+
*/
|
|
1689
|
+
class ResolvedParameter {
|
|
1690
|
+
/**
|
|
1691
|
+
* @param {?} parameterDef
|
|
1692
|
+
* @param {?} value
|
|
1693
|
+
*/
|
|
1694
|
+
constructor(parameterDef, value) {
|
|
1695
|
+
this.parameterDef = parameterDef;
|
|
1696
|
+
this.value = value;
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* @return {?}
|
|
1700
|
+
*/
|
|
1701
|
+
isRouteId() {
|
|
1702
|
+
return this.parameterDef.isRouteId;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
1706
|
+
if (false) {
|
|
1707
|
+
/** @type {?} */
|
|
1708
|
+
ResolvedParameter.prototype.parameterDef;
|
|
1709
|
+
/** @type {?} */
|
|
1710
|
+
ResolvedParameter.prototype.value;
|
|
1711
|
+
/**
|
|
1712
|
+
* @abstract
|
|
1713
|
+
* @param {?} dest
|
|
1714
|
+
* @return {?}
|
|
1715
|
+
*/
|
|
1716
|
+
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
1717
|
+
/**
|
|
1718
|
+
* @abstract
|
|
1719
|
+
* @param {?} otherValue
|
|
1720
|
+
* @return {?}
|
|
1721
|
+
*/
|
|
1722
|
+
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
1723
|
+
/**
|
|
1724
|
+
* @abstract
|
|
1725
|
+
* @return {?}
|
|
1726
|
+
*/
|
|
1727
|
+
ResolvedParameter.prototype.formattedValue = function () { };
|
|
1728
|
+
/**
|
|
1729
|
+
* @abstract
|
|
1730
|
+
* @param {?} value
|
|
1731
|
+
* @return {?}
|
|
1732
|
+
*/
|
|
1733
|
+
ResolvedParameter.prototype.replace = function (value) { };
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* @template T
|
|
1737
|
+
*/
|
|
1738
|
+
class ResolvedValueParameter extends ResolvedParameter {
|
|
1739
|
+
/**
|
|
1740
|
+
* @param {?} otherValue
|
|
1741
|
+
* @return {?}
|
|
1742
|
+
*/
|
|
1743
|
+
isSame(otherValue) {
|
|
1744
|
+
return this.value === otherValue;
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* @param {?} dest
|
|
1748
|
+
* @return {?}
|
|
1749
|
+
*/
|
|
1750
|
+
injectRouteParam(dest) {
|
|
1751
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* @param {?} value
|
|
1755
|
+
* @return {?}
|
|
1756
|
+
*/
|
|
1757
|
+
replace(value) {
|
|
1758
|
+
return new ResolvedValueParameter(this.parameterDef, value);
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* @return {?}
|
|
1762
|
+
*/
|
|
1763
|
+
formattedValue() {
|
|
1764
|
+
return !isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
__decorate([
|
|
1768
|
+
Trace(),
|
|
1769
|
+
__metadata("design:type", Function),
|
|
1770
|
+
__metadata("design:paramtypes", [Object]),
|
|
1771
|
+
__metadata("design:returntype", Boolean)
|
|
1772
|
+
], ResolvedValueParameter.prototype, "isSame", null);
|
|
1773
|
+
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
1774
|
+
/**
|
|
1775
|
+
* @template T
|
|
1776
|
+
*/
|
|
1777
|
+
class ResolvedArrayParameter extends ResolvedParameter {
|
|
1778
|
+
/**
|
|
1779
|
+
* @param {?} otherValue
|
|
1780
|
+
* @return {?}
|
|
1781
|
+
*/
|
|
1782
|
+
isSame(otherValue) {
|
|
1783
|
+
return isEqual(this.value, otherValue);
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* @param {?} dest
|
|
1787
|
+
* @return {?}
|
|
1788
|
+
*/
|
|
1789
|
+
injectRouteParam(dest) {
|
|
1790
|
+
dest[this.parameterDef.name] = this.value.map((/**
|
|
1791
|
+
* @param {?} v
|
|
1792
|
+
* @return {?}
|
|
1793
|
+
*/
|
|
1794
|
+
v => this.parameterDef.type.format(v)));
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* @param {?} value
|
|
1798
|
+
* @return {?}
|
|
1799
|
+
*/
|
|
1800
|
+
replace(value) {
|
|
1801
|
+
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* @return {?}
|
|
1805
|
+
*/
|
|
1806
|
+
formattedValue() {
|
|
1807
|
+
return this.value ? this.value.map((/**
|
|
1808
|
+
* @param {?} v
|
|
1809
|
+
* @return {?}
|
|
1810
|
+
*/
|
|
1811
|
+
v => this.parameterDef.type.format(v))) : [];
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
__decorate([
|
|
1815
|
+
Trace(),
|
|
1816
|
+
__metadata("design:type", Function),
|
|
1817
|
+
__metadata("design:paramtypes", [Array]),
|
|
1818
|
+
__metadata("design:returntype", Boolean)
|
|
1819
|
+
], ResolvedArrayParameter.prototype, "isSame", null);
|
|
1820
|
+
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
1821
|
+
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
1555
1822
|
|
|
1556
1823
|
/**
|
|
1557
1824
|
* @fileoverview added by tsickle
|
|
1558
1825
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1559
1826
|
*/
|
|
1560
|
-
|
|
1827
|
+
// RAKE: making this Symbol(...) broke things.
|
|
1828
|
+
/** @type {?} */
|
|
1829
|
+
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
1830
|
+
// this one seems ok.
|
|
1831
|
+
/** @type {?} */
|
|
1832
|
+
const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
1833
|
+
class PlaceComponent extends DisposableComponent {
|
|
1561
1834
|
/**
|
|
1562
|
-
* @param {?}
|
|
1835
|
+
* @param {?} activatedRoute
|
|
1563
1836
|
* @param {?} placeService
|
|
1564
1837
|
*/
|
|
1565
|
-
constructor(
|
|
1838
|
+
constructor(activatedRoute, placeService) {
|
|
1566
1839
|
super();
|
|
1567
|
-
this.
|
|
1840
|
+
this.activatedRoute = activatedRoute;
|
|
1568
1841
|
this._incomingRouteChange = new MutableValueModel(false);
|
|
1569
1842
|
this.resolvedParameters = new MutableValueModel();
|
|
1570
|
-
const { chain, valueOf, before, when, after, observe } = Dsl.disposeWith(this);
|
|
1571
|
-
this.
|
|
1572
|
-
|
|
1573
|
-
/** @type {?} */
|
|
1574
|
-
const routeParameterDefs = Klass.get(component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
|
|
1575
|
-
routeParameterDefs.forEach((/**
|
|
1576
|
-
* @param {?} parameter
|
|
1843
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1844
|
+
this.placeDefinition.getRouteParameters().forEach((/**
|
|
1845
|
+
* @param {?} p
|
|
1577
1846
|
* @return {?}
|
|
1578
1847
|
*/
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
const incomingResolvedRouteParameters = observe.valuesFrom(component.activatedRoute.paramMap)
|
|
1848
|
+
p => this.installBinding(p)));
|
|
1849
|
+
observe.valuesFrom(activatedRoute.paramMap)
|
|
1582
1850
|
.last()
|
|
1583
1851
|
.map((/**
|
|
1584
1852
|
* @param {?} params
|
|
1585
1853
|
* @return {?}
|
|
1586
1854
|
*/
|
|
1587
|
-
params =>
|
|
1588
|
-
/**
|
|
1589
|
-
const result = [];
|
|
1590
|
-
routeParameterDefs.forEach((/**
|
|
1591
|
-
* @param {?} parameterDef
|
|
1592
|
-
* @return {?}
|
|
1593
|
-
*/
|
|
1594
|
-
parameterDef => {
|
|
1595
|
-
/** @type {?} */
|
|
1596
|
-
let resolvedValue;
|
|
1597
|
-
if (parameterDef.isArray) {
|
|
1598
|
-
resolvedValue = params.getAll(parameterDef.name).map((/**
|
|
1599
|
-
* @param {?} v
|
|
1600
|
-
* @return {?}
|
|
1601
|
-
*/
|
|
1602
|
-
v => parameterDef.type.parse(v)));
|
|
1603
|
-
}
|
|
1604
|
-
else {
|
|
1605
|
-
resolvedValue = parameterDef.type.parse(params.get(parameterDef.name));
|
|
1606
|
-
}
|
|
1607
|
-
result.push({ parameterDef: parameterDef, resolvedValue: resolvedValue });
|
|
1608
|
-
}));
|
|
1609
|
-
return new ResolvedRouteParameterSnapshot(result);
|
|
1610
|
-
}));
|
|
1611
|
-
incomingResolvedRouteParameters.subscribe((/**
|
|
1855
|
+
params => ParameterSnapshot.create(this.placeDefinition, params)))
|
|
1856
|
+
.subscribe((/**
|
|
1612
1857
|
* @param {?} resolvedParameters
|
|
1613
1858
|
* @return {?}
|
|
1614
1859
|
*/
|
|
@@ -1624,14 +1869,12 @@ class RouteParameterBindings extends GarbageCollector {
|
|
|
1624
1869
|
*/
|
|
1625
1870
|
(params, previous) => {
|
|
1626
1871
|
placeService.notifyRouteParametersChanged({
|
|
1627
|
-
|
|
1872
|
+
activatedRoute: this.activatedRoute,
|
|
1628
1873
|
next: params,
|
|
1629
1874
|
previous: previous,
|
|
1630
1875
|
updateRoute: !this.incomingRouteChange.value // we update the route if it's a component triggered change.
|
|
1631
1876
|
});
|
|
1632
1877
|
}));
|
|
1633
|
-
this.txo.observe('incomingResolvedRouteParameters', incomingResolvedRouteParameters);
|
|
1634
|
-
this.txo.observe('this.routeIsChanging', this.incomingRouteChange);
|
|
1635
1878
|
}
|
|
1636
1879
|
/**
|
|
1637
1880
|
* @return {?}
|
|
@@ -1640,22 +1883,22 @@ class RouteParameterBindings extends GarbageCollector {
|
|
|
1640
1883
|
return this._incomingRouteChange.readonly;
|
|
1641
1884
|
}
|
|
1642
1885
|
/**
|
|
1643
|
-
* @
|
|
1644
|
-
* @template T
|
|
1645
|
-
* @param {?}
|
|
1886
|
+
* @private
|
|
1887
|
+
* @template T, S
|
|
1888
|
+
* @param {?} parameterDef
|
|
1646
1889
|
* @return {?}
|
|
1647
1890
|
*/
|
|
1648
|
-
installBinding(
|
|
1891
|
+
installBinding(parameterDef) {
|
|
1649
1892
|
/** @type {?} */
|
|
1650
|
-
const model = this.
|
|
1651
|
-
// this.txo.observe(
|
|
1893
|
+
const model = (/** @type {?} */ (this[parameterDef.propertyName]));
|
|
1894
|
+
// this.txo.observe(parameterDef.propertyName, model);
|
|
1652
1895
|
this.registerDisposable(new Binding(this.resolvedParameters, model, {
|
|
1653
1896
|
/**
|
|
1654
1897
|
* @param {?} parameters
|
|
1655
1898
|
* @return {?}
|
|
1656
1899
|
*/
|
|
1657
1900
|
toRight(parameters) {
|
|
1658
|
-
return parameters.
|
|
1901
|
+
return parameters.getResolvedParameterValue(parameterDef);
|
|
1659
1902
|
},
|
|
1660
1903
|
/**
|
|
1661
1904
|
* @param {?} value
|
|
@@ -1663,64 +1906,14 @@ class RouteParameterBindings extends GarbageCollector {
|
|
|
1663
1906
|
* @return {?}
|
|
1664
1907
|
*/
|
|
1665
1908
|
toLeft(value, currentParameters) {
|
|
1666
|
-
return currentParameters.replace(
|
|
1909
|
+
return currentParameters.replace(parameterDef, value);
|
|
1667
1910
|
}
|
|
1668
1911
|
}));
|
|
1669
1912
|
}
|
|
1670
|
-
/**
|
|
1671
|
-
* @private
|
|
1672
|
-
* @template T
|
|
1673
|
-
* @param {?} parameter
|
|
1674
|
-
* @return {?}
|
|
1675
|
-
*/
|
|
1676
|
-
getModelFor(parameter) {
|
|
1677
|
-
return this.component[parameter.propertyName];
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
if (false) {
|
|
1681
|
-
/** @type {?} */
|
|
1682
|
-
RouteParameterBindings.prototype._incomingRouteChange;
|
|
1683
|
-
/**
|
|
1684
|
-
* @type {?}
|
|
1685
|
-
* @private
|
|
1686
|
-
*/
|
|
1687
|
-
RouteParameterBindings.prototype.txo;
|
|
1688
|
-
/**
|
|
1689
|
-
* @type {?}
|
|
1690
|
-
* @private
|
|
1691
|
-
*/
|
|
1692
|
-
RouteParameterBindings.prototype.resolvedParameters;
|
|
1693
|
-
/**
|
|
1694
|
-
* @type {?}
|
|
1695
|
-
* @private
|
|
1696
|
-
*/
|
|
1697
|
-
RouteParameterBindings.prototype.component;
|
|
1698
|
-
}
|
|
1699
|
-
(function (RouteParameterBindings) {
|
|
1700
|
-
RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
1701
|
-
})(RouteParameterBindings || (RouteParameterBindings = {}));
|
|
1702
|
-
|
|
1703
|
-
/**
|
|
1704
|
-
* @fileoverview added by tsickle
|
|
1705
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1706
|
-
*/
|
|
1707
|
-
// RAKE: making this Symbol(...) broke things.
|
|
1708
|
-
/** @type {?} */
|
|
1709
|
-
const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
1710
|
-
class PlaceComponent extends DisposableComponent {
|
|
1711
|
-
/**
|
|
1712
|
-
* @param {?} activatedRoute
|
|
1713
|
-
* @param {?} placeService
|
|
1714
|
-
*/
|
|
1715
|
-
constructor(activatedRoute, placeService) {
|
|
1716
|
-
super();
|
|
1717
|
-
this.activatedRoute = activatedRoute;
|
|
1718
|
-
this.routeBindingMediator = this.registerDisposable(new RouteParameterBindings(this, placeService));
|
|
1719
|
-
}
|
|
1720
1913
|
/**
|
|
1721
1914
|
* @return {?}
|
|
1722
1915
|
*/
|
|
1723
|
-
get
|
|
1916
|
+
get placeDefinition() {
|
|
1724
1917
|
return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
|
|
1725
1918
|
}
|
|
1726
1919
|
/**
|
|
@@ -1729,6 +1922,7 @@ class PlaceComponent extends DisposableComponent {
|
|
|
1729
1922
|
canDeactivate() {
|
|
1730
1923
|
return true;
|
|
1731
1924
|
}
|
|
1925
|
+
// @Trace()
|
|
1732
1926
|
/**
|
|
1733
1927
|
* @return {?}
|
|
1734
1928
|
*/
|
|
@@ -1736,22 +1930,18 @@ class PlaceComponent extends DisposableComponent {
|
|
|
1736
1930
|
}
|
|
1737
1931
|
}
|
|
1738
1932
|
__decorate([
|
|
1739
|
-
Memoize(),
|
|
1933
|
+
Memoize$1(),
|
|
1740
1934
|
__metadata("design:type", PlaceComponent.Definition),
|
|
1741
1935
|
__metadata("design:paramtypes", [])
|
|
1742
|
-
], PlaceComponent.prototype, "
|
|
1743
|
-
__decorate([
|
|
1744
|
-
Trace(),
|
|
1745
|
-
__metadata("design:type", Function),
|
|
1746
|
-
__metadata("design:paramtypes", []),
|
|
1747
|
-
__metadata("design:returntype", void 0)
|
|
1748
|
-
], PlaceComponent.prototype, "onPlaceReady", null);
|
|
1936
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
1749
1937
|
if (false) {
|
|
1938
|
+
/** @type {?} */
|
|
1939
|
+
PlaceComponent.prototype._incomingRouteChange;
|
|
1750
1940
|
/**
|
|
1751
1941
|
* @type {?}
|
|
1752
1942
|
* @private
|
|
1753
1943
|
*/
|
|
1754
|
-
PlaceComponent.prototype.
|
|
1944
|
+
PlaceComponent.prototype.resolvedParameters;
|
|
1755
1945
|
/** @type {?} */
|
|
1756
1946
|
PlaceComponent.prototype.activatedRoute;
|
|
1757
1947
|
}
|
|
@@ -1768,13 +1958,24 @@ if (false) {
|
|
|
1768
1958
|
this.order = options.order;
|
|
1769
1959
|
this.data = options.data;
|
|
1770
1960
|
this.authenticate = isNil(options.authenticate) || options.authenticate;
|
|
1961
|
+
this.children = (options.children || []).map((/**
|
|
1962
|
+
* @param {?} c
|
|
1963
|
+
* @return {?}
|
|
1964
|
+
*/
|
|
1965
|
+
c => PlaceComponent.getDefinition(c).component));
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* @return {?}
|
|
1969
|
+
*/
|
|
1970
|
+
getRouteParameters() {
|
|
1971
|
+
return Klass.get(this.component).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
1771
1972
|
}
|
|
1772
1973
|
/**
|
|
1773
|
-
* @param {?}
|
|
1974
|
+
* @param {?} constructable
|
|
1774
1975
|
* @return {?}
|
|
1775
1976
|
*/
|
|
1776
|
-
isDescriptorForType(
|
|
1777
|
-
return lang.constructorChain(
|
|
1977
|
+
isDescriptorForType(constructable) {
|
|
1978
|
+
return lang.constructorChain(constructable).includes(PlaceComponent);
|
|
1778
1979
|
}
|
|
1779
1980
|
/**
|
|
1780
1981
|
* @param {?} placeComponent
|
|
@@ -1815,6 +2016,12 @@ if (false) {
|
|
|
1815
2016
|
}
|
|
1816
2017
|
}
|
|
1817
2018
|
}
|
|
2019
|
+
__decorate([
|
|
2020
|
+
Memoize$1(),
|
|
2021
|
+
__metadata("design:type", Function),
|
|
2022
|
+
__metadata("design:paramtypes", []),
|
|
2023
|
+
__metadata("design:returntype", Array)
|
|
2024
|
+
], Definition.prototype, "getRouteParameters", null);
|
|
1818
2025
|
PlaceComponent.Definition = Definition;
|
|
1819
2026
|
if (false) {
|
|
1820
2027
|
/** @type {?} */
|
|
@@ -1826,6 +2033,8 @@ if (false) {
|
|
|
1826
2033
|
/** @type {?} */
|
|
1827
2034
|
Definition.prototype.data;
|
|
1828
2035
|
/** @type {?} */
|
|
2036
|
+
Definition.prototype.children;
|
|
2037
|
+
/** @type {?} */
|
|
1829
2038
|
Definition.prototype.component;
|
|
1830
2039
|
}
|
|
1831
2040
|
/**
|
|
@@ -1842,15 +2051,24 @@ if (false) {
|
|
|
1842
2051
|
Options.prototype.data;
|
|
1843
2052
|
/** @type {?|undefined} */
|
|
1844
2053
|
Options.prototype.authenticate;
|
|
2054
|
+
/** @type {?|undefined} */
|
|
2055
|
+
Options.prototype.children;
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* @record
|
|
2059
|
+
*/
|
|
2060
|
+
function ChildOptions() { }
|
|
2061
|
+
PlaceComponent.ChildOptions = ChildOptions;
|
|
2062
|
+
if (false) {
|
|
2063
|
+
/** @type {?} */
|
|
2064
|
+
ChildOptions.prototype.parent;
|
|
1845
2065
|
}
|
|
1846
2066
|
/**
|
|
1847
2067
|
* @param {?} klass
|
|
1848
2068
|
* @return {?}
|
|
1849
2069
|
*/
|
|
1850
2070
|
function getDefinition(klass) {
|
|
1851
|
-
|
|
1852
|
-
const placeOptions = Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
1853
|
-
return new Definition(klass, placeOptions);
|
|
2071
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
1854
2072
|
}
|
|
1855
2073
|
PlaceComponent.getDefinition = getDefinition;
|
|
1856
2074
|
/**
|
|
@@ -1859,7 +2077,7 @@ if (false) {
|
|
|
1859
2077
|
* @return {?}
|
|
1860
2078
|
*/
|
|
1861
2079
|
function injectDefinition(klass, options) {
|
|
1862
|
-
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, options, klass);
|
|
2080
|
+
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, new Definition(klass, options), klass);
|
|
1863
2081
|
}
|
|
1864
2082
|
PlaceComponent.injectDefinition = injectDefinition;
|
|
1865
2083
|
})(PlaceComponent || (PlaceComponent = {}));
|
|
@@ -1868,13 +2086,129 @@ if (false) {
|
|
|
1868
2086
|
* @fileoverview added by tsickle
|
|
1869
2087
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1870
2088
|
*/
|
|
1871
|
-
class
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
2089
|
+
class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
2090
|
+
constructor() {
|
|
2091
|
+
super();
|
|
2092
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2093
|
+
this.placeDefinitions = chain(this.placesModel).map((/**
|
|
2094
|
+
* @param {?} c
|
|
2095
|
+
* @return {?}
|
|
2096
|
+
*/
|
|
2097
|
+
c => PlaceComponent.getDefinition(c)));
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* @param {?} placeDef
|
|
2101
|
+
* @return {?}
|
|
2102
|
+
*/
|
|
2103
|
+
getNav(placeDef) {
|
|
2104
|
+
/** @type {?} */
|
|
2105
|
+
const navItem = (/** @type {?} */ (placeDef.getData('nav')));
|
|
2106
|
+
return {
|
|
2107
|
+
title: (/**
|
|
2108
|
+
* @return {?}
|
|
2109
|
+
*/
|
|
2110
|
+
() => navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title'])),
|
|
2111
|
+
tooltip: (/**
|
|
2112
|
+
* @return {?}
|
|
2113
|
+
*/
|
|
2114
|
+
() => navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null)),
|
|
2115
|
+
icon: (/**
|
|
2116
|
+
* @return {?}
|
|
2117
|
+
*/
|
|
2118
|
+
() => navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null))
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2121
|
+
/**
|
|
2122
|
+
* @return {?}
|
|
2123
|
+
*/
|
|
2124
|
+
ngOnInit() {
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
2128
|
+
places: [{ type: Input }],
|
|
2129
|
+
placesModel: [{ type: Input }]
|
|
2130
|
+
};
|
|
2131
|
+
__decorate([
|
|
2132
|
+
StoreInListModel('placesModel'),
|
|
2133
|
+
__metadata("design:type", Array)
|
|
2134
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
2135
|
+
__decorate([
|
|
2136
|
+
UseDelegate(),
|
|
2137
|
+
__metadata("design:type", ListModel)
|
|
2138
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2139
|
+
__decorate([
|
|
2140
|
+
Memoize(),
|
|
2141
|
+
__metadata("design:type", Function),
|
|
2142
|
+
__metadata("design:paramtypes", [PlaceComponent.Definition]),
|
|
2143
|
+
__metadata("design:returntype", Object)
|
|
2144
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
2145
|
+
if (false) {
|
|
2146
|
+
/** @type {?} */
|
|
2147
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
2148
|
+
/** @type {?} */
|
|
2149
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
2150
|
+
/** @type {?} */
|
|
2151
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
/**
|
|
2155
|
+
* @fileoverview added by tsickle
|
|
2156
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2157
|
+
*/
|
|
2158
|
+
class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
2159
|
+
constructor() {
|
|
2160
|
+
super();
|
|
2161
|
+
this.expanded = true;
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* @return {?}
|
|
2165
|
+
*/
|
|
2166
|
+
expandMenu() {
|
|
2167
|
+
this.expanded = true;
|
|
2168
|
+
}
|
|
2169
|
+
/**
|
|
2170
|
+
* @return {?}
|
|
2171
|
+
*/
|
|
2172
|
+
collapseMenu() {
|
|
2173
|
+
this.expanded = false;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* @return {?}
|
|
2177
|
+
*/
|
|
2178
|
+
toggleMenu() {
|
|
2179
|
+
this.expanded = !this.expanded;
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
ListPlaceNavComponent.decorators = [
|
|
2183
|
+
{ type: Component, args: [{
|
|
2184
|
+
selector: 'angular-ui-powerups-list-place-nav',
|
|
2185
|
+
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",
|
|
2186
|
+
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}"]
|
|
2187
|
+
}] }
|
|
2188
|
+
];
|
|
2189
|
+
/** @nocollapse */
|
|
2190
|
+
ListPlaceNavComponent.ctorParameters = () => [];
|
|
2191
|
+
ListPlaceNavComponent.propDecorators = {
|
|
2192
|
+
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
2193
|
+
};
|
|
2194
|
+
if (false) {
|
|
2195
|
+
/** @type {?} */
|
|
2196
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* @fileoverview added by tsickle
|
|
2201
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2202
|
+
*/
|
|
2203
|
+
class PlaceService extends GarbageCollector {
|
|
2204
|
+
/**
|
|
2205
|
+
* @param {?} router
|
|
2206
|
+
* @param {?} injector
|
|
2207
|
+
*/
|
|
2208
|
+
constructor(router, injector) {
|
|
1876
2209
|
super();
|
|
1877
2210
|
this.router = router;
|
|
2211
|
+
this.injector = injector;
|
|
1878
2212
|
this._activePlaces = new MutableListModel();
|
|
1879
2213
|
}
|
|
1880
2214
|
/**
|
|
@@ -1883,6 +2217,7 @@ class PlaceService extends GarbageCollector {
|
|
|
1883
2217
|
get activePlaces() {
|
|
1884
2218
|
return this._activePlaces.readonly;
|
|
1885
2219
|
}
|
|
2220
|
+
// @Trace()
|
|
1886
2221
|
/**
|
|
1887
2222
|
* @param {?} place
|
|
1888
2223
|
* @return {?}
|
|
@@ -1890,6 +2225,7 @@ class PlaceService extends GarbageCollector {
|
|
|
1890
2225
|
onActivate(place) {
|
|
1891
2226
|
this._activePlaces.push(place);
|
|
1892
2227
|
}
|
|
2228
|
+
// @Trace()
|
|
1893
2229
|
/**
|
|
1894
2230
|
* @param {?} place
|
|
1895
2231
|
* @return {?}
|
|
@@ -1897,6 +2233,7 @@ class PlaceService extends GarbageCollector {
|
|
|
1897
2233
|
onDeactivate(place) {
|
|
1898
2234
|
this._activePlaces.remove(place);
|
|
1899
2235
|
}
|
|
2236
|
+
// @Trace()
|
|
1900
2237
|
/**
|
|
1901
2238
|
* @param {?} params
|
|
1902
2239
|
* @return {?}
|
|
@@ -1911,10 +2248,20 @@ class PlaceService extends GarbageCollector {
|
|
|
1911
2248
|
/** @type {?} */
|
|
1912
2249
|
const path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
|
|
1913
2250
|
this.router.navigate(path, {
|
|
1914
|
-
relativeTo: params.
|
|
2251
|
+
relativeTo: params.activatedRoute
|
|
1915
2252
|
});
|
|
1916
2253
|
}
|
|
1917
2254
|
}
|
|
2255
|
+
// @Trace()
|
|
2256
|
+
/**
|
|
2257
|
+
* @param {?} snapshot
|
|
2258
|
+
* @return {?}
|
|
2259
|
+
*/
|
|
2260
|
+
sanitise(snapshot) {
|
|
2261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2262
|
+
return snapshot;
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
1918
2265
|
}
|
|
1919
2266
|
PlaceService.decorators = [
|
|
1920
2267
|
{ type: Injectable, args: [{
|
|
@@ -1923,27 +2270,10 @@ PlaceService.decorators = [
|
|
|
1923
2270
|
];
|
|
1924
2271
|
/** @nocollapse */
|
|
1925
2272
|
PlaceService.ctorParameters = () => [
|
|
1926
|
-
{ type: Router }
|
|
2273
|
+
{ type: Router },
|
|
2274
|
+
{ type: Injector }
|
|
1927
2275
|
];
|
|
1928
|
-
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router)); }, token: PlaceService, providedIn: "root" });
|
|
1929
|
-
__decorate([
|
|
1930
|
-
Trace(),
|
|
1931
|
-
__metadata("design:type", Function),
|
|
1932
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
1933
|
-
__metadata("design:returntype", void 0)
|
|
1934
|
-
], PlaceService.prototype, "onActivate", null);
|
|
1935
|
-
__decorate([
|
|
1936
|
-
Trace(),
|
|
1937
|
-
__metadata("design:type", Function),
|
|
1938
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
1939
|
-
__metadata("design:returntype", void 0)
|
|
1940
|
-
], PlaceService.prototype, "onDeactivate", null);
|
|
1941
|
-
__decorate([
|
|
1942
|
-
Trace(),
|
|
1943
|
-
__metadata("design:type", Function),
|
|
1944
|
-
__metadata("design:paramtypes", [Object]),
|
|
1945
|
-
__metadata("design:returntype", void 0)
|
|
1946
|
-
], PlaceService.prototype, "notifyRouteParametersChanged", null);
|
|
2276
|
+
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
|
|
1947
2277
|
if (false) {
|
|
1948
2278
|
/**
|
|
1949
2279
|
* @type {?}
|
|
@@ -1955,6 +2285,11 @@ if (false) {
|
|
|
1955
2285
|
* @protected
|
|
1956
2286
|
*/
|
|
1957
2287
|
PlaceService.prototype.router;
|
|
2288
|
+
/**
|
|
2289
|
+
* @type {?}
|
|
2290
|
+
* @protected
|
|
2291
|
+
*/
|
|
2292
|
+
PlaceService.prototype.injector;
|
|
1958
2293
|
}
|
|
1959
2294
|
|
|
1960
2295
|
/**
|
|
@@ -1997,45 +2332,114 @@ const right = [
|
|
|
1997
2332
|
})
|
|
1998
2333
|
])
|
|
1999
2334
|
];
|
|
2335
|
+
/**
|
|
2336
|
+
* @param {?} duration
|
|
2337
|
+
* @return {?}
|
|
2338
|
+
*/
|
|
2339
|
+
function leftRightPlaceAnimation(duration) {
|
|
2340
|
+
return trigger('routeAnimations', [
|
|
2341
|
+
transition(':increment', right, { params: { duration: duration } }),
|
|
2342
|
+
transition(':decrement', left, { params: { duration: duration } })
|
|
2343
|
+
]);
|
|
2344
|
+
}
|
|
2000
2345
|
/** @type {?} */
|
|
2001
|
-
const LEFT_RIGHT_PLACE_ANIMATION =
|
|
2002
|
-
transition(':increment', right, { params: { duration: '.3s' } }),
|
|
2003
|
-
transition(':decrement', left, { params: { duration: '.3s' } })
|
|
2004
|
-
]);
|
|
2346
|
+
const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
|
|
2005
2347
|
|
|
2006
2348
|
/**
|
|
2007
2349
|
* @fileoverview added by tsickle
|
|
2008
2350
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2009
2351
|
*/
|
|
2010
|
-
class PlaceOutletComponent {
|
|
2352
|
+
class PlaceOutletComponent extends DisposableComponent {
|
|
2011
2353
|
/**
|
|
2012
2354
|
* @param {?} placeService
|
|
2355
|
+
* @param {?} activatedRoute
|
|
2013
2356
|
*/
|
|
2014
|
-
constructor(placeService) {
|
|
2357
|
+
constructor(placeService, activatedRoute) {
|
|
2358
|
+
super();
|
|
2015
2359
|
this.placeService = placeService;
|
|
2360
|
+
this.activatedRoute = activatedRoute;
|
|
2016
2361
|
this.animate = true;
|
|
2362
|
+
this.outletUrlSegment = new MutableListModel();
|
|
2363
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2364
|
+
this.myPath = observe.listsFrom(activatedRoute.url).last().map((/**
|
|
2365
|
+
* @param {?} s
|
|
2366
|
+
* @return {?}
|
|
2367
|
+
*/
|
|
2368
|
+
s => s.toString())).reduce((/**
|
|
2369
|
+
* @param {?} bits
|
|
2370
|
+
* @return {?}
|
|
2371
|
+
*/
|
|
2372
|
+
bits => bits.join(',')));
|
|
2373
|
+
console.log(`new outlet@(${this.myPath.value})`);
|
|
2374
|
+
this.outletChildPath = chain(this.outletUrlSegment).map((/**
|
|
2375
|
+
* @param {?} s
|
|
2376
|
+
* @return {?}
|
|
2377
|
+
*/
|
|
2378
|
+
s => s.toString())).reduce((/**
|
|
2379
|
+
* @param {?} bits
|
|
2380
|
+
* @return {?}
|
|
2381
|
+
*/
|
|
2382
|
+
bits => bits.join(",")));
|
|
2383
|
+
this.state = chain(this.myPath).map((/**
|
|
2384
|
+
* @param {?} path
|
|
2385
|
+
* @return {?}
|
|
2386
|
+
*/
|
|
2387
|
+
path => {
|
|
2388
|
+
return `outlet@(${path}), child path->${this.outletChildPath.value}`;
|
|
2389
|
+
}), { dependsOn: this.outletChildPath });
|
|
2390
|
+
when.valueOf(this.state).changes((/**
|
|
2391
|
+
* @param {?} debug
|
|
2392
|
+
* @return {?}
|
|
2393
|
+
*/
|
|
2394
|
+
debug => {
|
|
2395
|
+
console.log(`Outlet Changed -> ${debug}`);
|
|
2396
|
+
}));
|
|
2017
2397
|
}
|
|
2018
2398
|
/**
|
|
2019
2399
|
* @return {?}
|
|
2020
2400
|
*/
|
|
2021
2401
|
ngOnInit() {
|
|
2022
2402
|
}
|
|
2403
|
+
/**
|
|
2404
|
+
* @return {?}
|
|
2405
|
+
*/
|
|
2406
|
+
ngAfterViewInit() {
|
|
2407
|
+
// this.routerOutLetQuery.changes.subscribe(() => {
|
|
2408
|
+
// this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2409
|
+
// });
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* @return {?}
|
|
2413
|
+
*/
|
|
2414
|
+
ngAfterViewChecked() {
|
|
2415
|
+
// console.log(`@AfterViewChecked: ${this.state.value}`);
|
|
2416
|
+
this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2417
|
+
}
|
|
2418
|
+
// @Trace()
|
|
2419
|
+
// ngOnDestroy(): void {
|
|
2420
|
+
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2421
|
+
// console.log('mySegments', this.myPath.value);
|
|
2422
|
+
// super.ngOnDestroy();
|
|
2423
|
+
// }
|
|
2424
|
+
// @Trace()
|
|
2023
2425
|
/**
|
|
2024
2426
|
* @param {?} $event
|
|
2025
2427
|
* @return {?}
|
|
2026
2428
|
*/
|
|
2027
|
-
|
|
2429
|
+
onOutletActivated($event) {
|
|
2430
|
+
// console.log(this.routerOutLet.activatedRoute.snapshot.url);
|
|
2028
2431
|
this.currentPlace = $event;
|
|
2029
2432
|
this.placeService.onActivate($event);
|
|
2030
2433
|
if (!this.animate) {
|
|
2031
|
-
|
|
2434
|
+
// we're not animating so trigger any post animation callbacks now.
|
|
2435
|
+
this.animationDone();
|
|
2032
2436
|
}
|
|
2033
2437
|
}
|
|
2034
2438
|
/**
|
|
2035
2439
|
* @param {?} $event
|
|
2036
2440
|
* @return {?}
|
|
2037
2441
|
*/
|
|
2038
|
-
|
|
2442
|
+
onOutletDeactivated($event) {
|
|
2039
2443
|
this.currentPlace = null;
|
|
2040
2444
|
this.placeService.onDeactivate($event);
|
|
2041
2445
|
}
|
|
@@ -2050,100 +2454,99 @@ class PlaceOutletComponent {
|
|
|
2050
2454
|
* @return {?}
|
|
2051
2455
|
*/
|
|
2052
2456
|
animationDone() {
|
|
2053
|
-
this.
|
|
2457
|
+
if (this.currentPlace) {
|
|
2458
|
+
this.currentPlace.onPlaceReady();
|
|
2459
|
+
}
|
|
2054
2460
|
}
|
|
2461
|
+
// @Trace()
|
|
2055
2462
|
/**
|
|
2056
2463
|
* @private
|
|
2464
|
+
* @param {?} first
|
|
2057
2465
|
* @return {?}
|
|
2058
2466
|
*/
|
|
2059
|
-
|
|
2060
|
-
if (
|
|
2061
|
-
this.
|
|
2467
|
+
updateRouterOutlet(first) {
|
|
2468
|
+
if (first.isActivated) {
|
|
2469
|
+
this.outletUrlSegment.value = first.activatedRoute.snapshot.url;
|
|
2062
2470
|
}
|
|
2063
2471
|
}
|
|
2064
2472
|
}
|
|
2065
2473
|
PlaceOutletComponent.decorators = [
|
|
2066
2474
|
{ type: Component, args: [{
|
|
2067
2475
|
selector: 'angular-ui-powerups-place-outlet',
|
|
2068
|
-
template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"
|
|
2476
|
+
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",
|
|
2069
2477
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
2070
2478
|
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}"]
|
|
2071
2479
|
}] }
|
|
2072
2480
|
];
|
|
2073
2481
|
/** @nocollapse */
|
|
2074
2482
|
PlaceOutletComponent.ctorParameters = () => [
|
|
2075
|
-
{ type: PlaceService }
|
|
2483
|
+
{ type: PlaceService },
|
|
2484
|
+
{ type: ActivatedRoute }
|
|
2076
2485
|
];
|
|
2077
2486
|
PlaceOutletComponent.propDecorators = {
|
|
2078
2487
|
animate: [{ type: Input }],
|
|
2079
|
-
|
|
2488
|
+
routerOutLetQuery: [{ type: ViewChildren, args: [RouterOutlet,] }]
|
|
2080
2489
|
};
|
|
2081
2490
|
if (false) {
|
|
2082
2491
|
/** @type {?} */
|
|
2083
2492
|
PlaceOutletComponent.prototype.animate;
|
|
2084
2493
|
/** @type {?} */
|
|
2085
|
-
PlaceOutletComponent.prototype.
|
|
2494
|
+
PlaceOutletComponent.prototype.routerOutLetQuery;
|
|
2086
2495
|
/**
|
|
2087
2496
|
* @type {?}
|
|
2088
2497
|
* @private
|
|
2089
2498
|
*/
|
|
2090
2499
|
PlaceOutletComponent.prototype.currentPlace;
|
|
2500
|
+
/**
|
|
2501
|
+
* @type {?}
|
|
2502
|
+
* @private
|
|
2503
|
+
*/
|
|
2504
|
+
PlaceOutletComponent.prototype.myPath;
|
|
2505
|
+
/**
|
|
2506
|
+
* @type {?}
|
|
2507
|
+
* @private
|
|
2508
|
+
*/
|
|
2509
|
+
PlaceOutletComponent.prototype.outletUrlSegment;
|
|
2510
|
+
/**
|
|
2511
|
+
* @type {?}
|
|
2512
|
+
* @private
|
|
2513
|
+
*/
|
|
2514
|
+
PlaceOutletComponent.prototype.outletChildPath;
|
|
2515
|
+
/**
|
|
2516
|
+
* @type {?}
|
|
2517
|
+
* @private
|
|
2518
|
+
*/
|
|
2519
|
+
PlaceOutletComponent.prototype.state;
|
|
2091
2520
|
/**
|
|
2092
2521
|
* @type {?}
|
|
2093
2522
|
* @private
|
|
2094
2523
|
*/
|
|
2095
2524
|
PlaceOutletComponent.prototype.placeService;
|
|
2525
|
+
/**
|
|
2526
|
+
* @type {?}
|
|
2527
|
+
* @private
|
|
2528
|
+
*/
|
|
2529
|
+
PlaceOutletComponent.prototype.activatedRoute;
|
|
2096
2530
|
}
|
|
2097
2531
|
|
|
2098
2532
|
/**
|
|
2099
2533
|
* @fileoverview added by tsickle
|
|
2100
2534
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2101
2535
|
*/
|
|
2102
|
-
class TabbedPlaceNavigationComponent extends
|
|
2536
|
+
class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
2103
2537
|
constructor() {
|
|
2104
2538
|
super();
|
|
2105
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2106
|
-
this.orderedPlaces = chain(this.placesModel).map((/**
|
|
2107
|
-
* @param {?} c
|
|
2108
|
-
* @return {?}
|
|
2109
|
-
*/
|
|
2110
|
-
c => PlaceComponent.getDefinition(c))).sortBy('order');
|
|
2111
|
-
}
|
|
2112
|
-
/**
|
|
2113
|
-
* @return {?}
|
|
2114
|
-
*/
|
|
2115
|
-
ngOnInit() {
|
|
2116
2539
|
}
|
|
2117
2540
|
}
|
|
2118
2541
|
TabbedPlaceNavigationComponent.decorators = [
|
|
2119
2542
|
{ type: Component, args: [{
|
|
2120
2543
|
selector: 'angular-ui-powerups-tabbed-place-navigation',
|
|
2121
|
-
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let
|
|
2544
|
+
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span>{{getNav(place).title()}}</span>\n </a>\n</nav>\n",
|
|
2122
2545
|
styles: [""]
|
|
2123
2546
|
}] }
|
|
2124
2547
|
];
|
|
2125
2548
|
/** @nocollapse */
|
|
2126
2549
|
TabbedPlaceNavigationComponent.ctorParameters = () => [];
|
|
2127
|
-
TabbedPlaceNavigationComponent.propDecorators = {
|
|
2128
|
-
places: [{ type: Input }],
|
|
2129
|
-
placesModel: [{ type: Input }]
|
|
2130
|
-
};
|
|
2131
|
-
__decorate([
|
|
2132
|
-
StoreInListModel('placesModel'),
|
|
2133
|
-
__metadata("design:type", Array)
|
|
2134
|
-
], TabbedPlaceNavigationComponent.prototype, "places", void 0);
|
|
2135
|
-
__decorate([
|
|
2136
|
-
UseDelegate(),
|
|
2137
|
-
__metadata("design:type", ListModel)
|
|
2138
|
-
], TabbedPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2139
|
-
if (false) {
|
|
2140
|
-
/** @type {?} */
|
|
2141
|
-
TabbedPlaceNavigationComponent.prototype.places;
|
|
2142
|
-
/** @type {?} */
|
|
2143
|
-
TabbedPlaceNavigationComponent.prototype.placesModel;
|
|
2144
|
-
/** @type {?} */
|
|
2145
|
-
TabbedPlaceNavigationComponent.prototype.orderedPlaces;
|
|
2146
|
-
}
|
|
2147
2550
|
|
|
2148
2551
|
/**
|
|
2149
2552
|
* @fileoverview added by tsickle
|
|
@@ -2167,14 +2570,16 @@ PlaceModule.decorators = [
|
|
|
2167
2570
|
EmptyStateComponent,
|
|
2168
2571
|
BusyOverlayComponent,
|
|
2169
2572
|
PlaceOutletComponent,
|
|
2170
|
-
TabbedPlaceNavigationComponent
|
|
2573
|
+
TabbedPlaceNavigationComponent,
|
|
2574
|
+
ListPlaceNavComponent
|
|
2171
2575
|
],
|
|
2172
2576
|
entryComponents: [BusyOverlayComponent],
|
|
2173
2577
|
exports: [
|
|
2174
2578
|
BusyOverlayComponent,
|
|
2175
2579
|
PlaceOutletComponent,
|
|
2176
2580
|
EmptyStateComponent,
|
|
2177
|
-
TabbedPlaceNavigationComponent
|
|
2581
|
+
TabbedPlaceNavigationComponent,
|
|
2582
|
+
ListPlaceNavComponent
|
|
2178
2583
|
],
|
|
2179
2584
|
providers: [
|
|
2180
2585
|
PlaceService
|
|
@@ -2196,16 +2601,16 @@ AngularUiPowerupsModule.decorators = [
|
|
|
2196
2601
|
NumberInputComponent,
|
|
2197
2602
|
StringInputComponent,
|
|
2198
2603
|
PasswordInputComponent,
|
|
2199
|
-
SelectInputComponent
|
|
2604
|
+
SelectInputComponent
|
|
2200
2605
|
],
|
|
2201
2606
|
imports: [
|
|
2202
2607
|
CommonModule,
|
|
2203
|
-
BrowserModule,
|
|
2204
2608
|
BrowserAnimationsModule,
|
|
2205
2609
|
FormsModule,
|
|
2206
2610
|
MatInputModule,
|
|
2207
2611
|
MatFormFieldModule,
|
|
2208
2612
|
MatSelectModule,
|
|
2613
|
+
MatTabsModule$1,
|
|
2209
2614
|
PlaceModule,
|
|
2210
2615
|
InteractionModule
|
|
2211
2616
|
],
|
|
@@ -2217,7 +2622,7 @@ AngularUiPowerupsModule.decorators = [
|
|
|
2217
2622
|
PasswordInputComponent,
|
|
2218
2623
|
SelectInputComponent,
|
|
2219
2624
|
InteractionModule,
|
|
2220
|
-
PlaceModule
|
|
2625
|
+
PlaceModule
|
|
2221
2626
|
]
|
|
2222
2627
|
},] }
|
|
2223
2628
|
];
|
|
@@ -2566,14 +2971,37 @@ if (false) {
|
|
|
2566
2971
|
/**
|
|
2567
2972
|
* @record
|
|
2568
2973
|
*/
|
|
2569
|
-
function
|
|
2974
|
+
function NavItem() { }
|
|
2975
|
+
if (false) {
|
|
2976
|
+
/**
|
|
2977
|
+
* @return {?}
|
|
2978
|
+
*/
|
|
2979
|
+
NavItem.prototype.title = function () { };
|
|
2980
|
+
/**
|
|
2981
|
+
* @return {?}
|
|
2982
|
+
*/
|
|
2983
|
+
NavItem.prototype.icon = function () { };
|
|
2984
|
+
/**
|
|
2985
|
+
* @return {?}
|
|
2986
|
+
*/
|
|
2987
|
+
NavItem.prototype.tooltip = function () { };
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
/**
|
|
2991
|
+
* @fileoverview added by tsickle
|
|
2992
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2993
|
+
*/
|
|
2994
|
+
/**
|
|
2995
|
+
* @record
|
|
2996
|
+
*/
|
|
2997
|
+
function PlaceComponentLike() { }
|
|
2570
2998
|
if (false) {
|
|
2571
2999
|
/** @type {?} */
|
|
2572
|
-
|
|
3000
|
+
PlaceComponentLike.prototype.activatedRoute;
|
|
2573
3001
|
/**
|
|
2574
3002
|
* @return {?}
|
|
2575
3003
|
*/
|
|
2576
|
-
|
|
3004
|
+
PlaceComponentLike.prototype.onPlaceReady = function () { };
|
|
2577
3005
|
}
|
|
2578
3006
|
|
|
2579
3007
|
/**
|
|
@@ -2583,13 +3011,13 @@ if (false) {
|
|
|
2583
3011
|
/**
|
|
2584
3012
|
* @record
|
|
2585
3013
|
*/
|
|
2586
|
-
function
|
|
3014
|
+
function PlaceUpdatesService() { }
|
|
2587
3015
|
if (false) {
|
|
2588
3016
|
/**
|
|
2589
3017
|
* @param {?} params
|
|
2590
3018
|
* @return {?}
|
|
2591
3019
|
*/
|
|
2592
|
-
|
|
3020
|
+
PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
|
|
2593
3021
|
}
|
|
2594
3022
|
|
|
2595
3023
|
/**
|
|
@@ -2613,6 +3041,28 @@ function Place(options) {
|
|
|
2613
3041
|
});
|
|
2614
3042
|
}
|
|
2615
3043
|
|
|
3044
|
+
/**
|
|
3045
|
+
* @fileoverview added by tsickle
|
|
3046
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3047
|
+
*/
|
|
3048
|
+
/**
|
|
3049
|
+
* @record
|
|
3050
|
+
*/
|
|
3051
|
+
function Visit() { }
|
|
3052
|
+
if (false) {
|
|
3053
|
+
/** @type {?} */
|
|
3054
|
+
Visit.prototype.placeDefinition;
|
|
3055
|
+
/**
|
|
3056
|
+
* @return {?}
|
|
3057
|
+
*/
|
|
3058
|
+
Visit.prototype.getRouteId = function () { };
|
|
3059
|
+
/**
|
|
3060
|
+
* @param {?} name
|
|
3061
|
+
* @return {?}
|
|
3062
|
+
*/
|
|
3063
|
+
Visit.prototype.getRouteParameter = function (name) { };
|
|
3064
|
+
}
|
|
3065
|
+
|
|
2616
3066
|
/**
|
|
2617
3067
|
* @fileoverview added by tsickle
|
|
2618
3068
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -2634,7 +3084,24 @@ class LeavePlaceGuard {
|
|
|
2634
3084
|
* @return {?}
|
|
2635
3085
|
*/
|
|
2636
3086
|
canDeactivate(component, currentRoute, currentState, nextState) {
|
|
2637
|
-
|
|
3087
|
+
// HACK: this will break with child routes...
|
|
3088
|
+
/** @type {?} */
|
|
3089
|
+
const path = `/${component.placeDefinition.path}`;
|
|
3090
|
+
console.log({
|
|
3091
|
+
placePath: path,
|
|
3092
|
+
currentRoute: currentRoute.toString(),
|
|
3093
|
+
currentStateUrl: currentState.url,
|
|
3094
|
+
nextStateUrl: nextState.url,
|
|
3095
|
+
currentStateUrlTree: this.router.parseUrl(currentState.url).root.children[PRIMARY_OUTLET].segments,
|
|
3096
|
+
nextStateUrlTree: this.router.parseUrl(nextState.url).root.children[PRIMARY_OUTLET].segments
|
|
3097
|
+
});
|
|
3098
|
+
// nextState is the full path...
|
|
3099
|
+
if (!nextState.url.startsWith(path)) {
|
|
3100
|
+
return component.canDeactivate();
|
|
3101
|
+
}
|
|
3102
|
+
else {
|
|
3103
|
+
return true;
|
|
3104
|
+
}
|
|
2638
3105
|
}
|
|
2639
3106
|
}
|
|
2640
3107
|
LeavePlaceGuard.decorators = [
|
|
@@ -2665,342 +3132,136 @@ if (false) {
|
|
|
2665
3132
|
* @fileoverview added by tsickle
|
|
2666
3133
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2667
3134
|
*/
|
|
2668
|
-
|
|
2669
|
-
* @abstract
|
|
2670
|
-
* @template T, S
|
|
2671
|
-
*/
|
|
2672
|
-
class Sanitiser {
|
|
3135
|
+
class PlaceRouteGuard {
|
|
2673
3136
|
/**
|
|
2674
|
-
* @param {?}
|
|
2675
|
-
* @param {?}
|
|
2676
|
-
* @param {?} sanitiser
|
|
3137
|
+
* @param {?} placeService
|
|
3138
|
+
* @param {?} router
|
|
2677
3139
|
*/
|
|
2678
|
-
constructor(
|
|
2679
|
-
this.
|
|
2680
|
-
this.
|
|
2681
|
-
this.sanitiser = sanitiser;
|
|
3140
|
+
constructor(placeService, router) {
|
|
3141
|
+
this.placeService = placeService;
|
|
3142
|
+
this.router = router;
|
|
2682
3143
|
}
|
|
2683
3144
|
/**
|
|
3145
|
+
* @param {?} route
|
|
3146
|
+
* @param {?} state
|
|
2684
3147
|
* @return {?}
|
|
2685
3148
|
*/
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
* @return {?}
|
|
2703
|
-
*/
|
|
2704
|
-
sanitize() {
|
|
2705
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2706
|
-
if (this.sanitiser) {
|
|
2707
|
-
this.initialValue = this.readFrom(this.snapshot);
|
|
2708
|
-
this._sanitisedValue = yield this.sanitiser.sanitise(this.initialValue);
|
|
2709
|
-
if (this.initialValue !== this._sanitisedValue) {
|
|
2710
|
-
return false;
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
return true;
|
|
2714
|
-
});
|
|
3149
|
+
canActivate(route, state) {
|
|
3150
|
+
// Implement this when adding child routes.
|
|
3151
|
+
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
3152
|
+
// Id snapshot are repesented by 2 url segments
|
|
3153
|
+
// ID => [{'/basePath', params}, {'id', params}]
|
|
3154
|
+
// NO ID => [{'/basePath', params}]
|
|
3155
|
+
// console.log({urlSegments: route.url});
|
|
3156
|
+
// const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
|
|
3157
|
+
// return this.placeService.sanitise(snapshot).then(sanitised => {
|
|
3158
|
+
// if (sanitised.hasChanged(snapshot)) {
|
|
3159
|
+
// return this.router.createUrlTree(snapshot.updateUrl(route.url))
|
|
3160
|
+
// } else {
|
|
3161
|
+
// return true;
|
|
3162
|
+
// }
|
|
3163
|
+
// });
|
|
3164
|
+
return true;
|
|
2715
3165
|
}
|
|
2716
3166
|
}
|
|
3167
|
+
PlaceRouteGuard.decorators = [
|
|
3168
|
+
{ type: Injectable, args: [{
|
|
3169
|
+
providedIn: 'root'
|
|
3170
|
+
},] }
|
|
3171
|
+
];
|
|
3172
|
+
/** @nocollapse */
|
|
3173
|
+
PlaceRouteGuard.ctorParameters = () => [
|
|
3174
|
+
{ type: PlaceService },
|
|
3175
|
+
{ type: Router }
|
|
3176
|
+
];
|
|
3177
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceService), ɵɵinject(Router)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
2717
3178
|
if (false) {
|
|
2718
3179
|
/**
|
|
2719
3180
|
* @type {?}
|
|
2720
3181
|
* @private
|
|
2721
3182
|
*/
|
|
2722
|
-
|
|
3183
|
+
PlaceRouteGuard.prototype.placeService;
|
|
2723
3184
|
/**
|
|
2724
3185
|
* @type {?}
|
|
2725
3186
|
* @private
|
|
2726
3187
|
*/
|
|
2727
|
-
|
|
2728
|
-
/** @type {?} */
|
|
2729
|
-
Sanitiser.prototype.parameterDef;
|
|
2730
|
-
/** @type {?} */
|
|
2731
|
-
Sanitiser.prototype.snapshot;
|
|
2732
|
-
/** @type {?} */
|
|
2733
|
-
Sanitiser.prototype.sanitiser;
|
|
2734
|
-
/**
|
|
2735
|
-
* @abstract
|
|
2736
|
-
* @protected
|
|
2737
|
-
* @param {?} snapshot
|
|
2738
|
-
* @return {?}
|
|
2739
|
-
*/
|
|
2740
|
-
Sanitiser.prototype.readFrom = function (snapshot) { };
|
|
2741
|
-
/**
|
|
2742
|
-
* @abstract
|
|
2743
|
-
* @protected
|
|
2744
|
-
* @param {?} initialValue
|
|
2745
|
-
* @param {?} sanitisedValue
|
|
2746
|
-
* @return {?}
|
|
2747
|
-
*/
|
|
2748
|
-
Sanitiser.prototype.hasChanged = function (initialValue, sanitisedValue) { };
|
|
2749
|
-
/**
|
|
2750
|
-
* @abstract
|
|
2751
|
-
* @param {?} dest
|
|
2752
|
-
* @return {?}
|
|
2753
|
-
*/
|
|
2754
|
-
Sanitiser.prototype.injectRouteParam = function (dest) { };
|
|
3188
|
+
PlaceRouteGuard.prototype.router;
|
|
2755
3189
|
}
|
|
2756
|
-
|
|
3190
|
+
|
|
3191
|
+
/**
|
|
3192
|
+
* @fileoverview added by tsickle
|
|
3193
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3194
|
+
*/
|
|
3195
|
+
/**
|
|
3196
|
+
* @template T, S
|
|
3197
|
+
*/
|
|
3198
|
+
class DefaultParameterSanitiser {
|
|
2757
3199
|
/**
|
|
2758
|
-
* @param {?}
|
|
2759
|
-
* @param {?}
|
|
2760
|
-
* @param {?}
|
|
3200
|
+
* @param {?} def
|
|
3201
|
+
* @param {?} placeService
|
|
3202
|
+
* @param {?} options
|
|
2761
3203
|
*/
|
|
2762
|
-
constructor(
|
|
2763
|
-
this.
|
|
2764
|
-
this.
|
|
2765
|
-
this.
|
|
2766
|
-
this.
|
|
2767
|
-
/** @type {?} */
|
|
2768
|
-
const sanitisers = parameterDefs.map((/**
|
|
2769
|
-
* @param {?} def
|
|
2770
|
-
* @return {?}
|
|
2771
|
-
*/
|
|
2772
|
-
def => {
|
|
2773
|
-
return def.isArray ?
|
|
2774
|
-
new Sanitiser.Array(def, snapshot, this.getSanitiser(def)) :
|
|
2775
|
-
new Sanitiser.Value(def, snapshot, this.getSanitiser(def));
|
|
2776
|
-
}));
|
|
2777
|
-
this.routeIdSanitiser = sanitisers.find((/**
|
|
2778
|
-
* @param {?} p
|
|
2779
|
-
* @return {?}
|
|
2780
|
-
*/
|
|
2781
|
-
p => p.isRouteId()));
|
|
2782
|
-
this.parameterSanitisers = sanitisers.filter((/**
|
|
2783
|
-
* @param {?} p
|
|
2784
|
-
* @return {?}
|
|
2785
|
-
*/
|
|
2786
|
-
p => !p.isRouteId()));
|
|
3204
|
+
constructor(def, placeService, options) {
|
|
3205
|
+
this.def = def;
|
|
3206
|
+
this.placeService = placeService;
|
|
3207
|
+
this.remember = isNil(options.remember) ? false : options.remember;
|
|
3208
|
+
this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
|
|
2787
3209
|
}
|
|
2788
3210
|
/**
|
|
3211
|
+
* @param {?} value
|
|
3212
|
+
* @param {?} visit
|
|
2789
3213
|
* @return {?}
|
|
2790
3214
|
*/
|
|
2791
|
-
sanitise() {
|
|
2792
|
-
|
|
2793
|
-
if (this.
|
|
2794
|
-
|
|
2795
|
-
if (this.routeIdSanitiser.valueChanged) {
|
|
2796
|
-
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
2797
|
-
// context of the route id.
|
|
2798
|
-
return false;
|
|
2799
|
-
}
|
|
2800
|
-
}
|
|
2801
|
-
for (const sanitiser of this.parameterSanitisers) {
|
|
2802
|
-
yield sanitiser.sanitize();
|
|
3215
|
+
sanitise(value, visit) {
|
|
3216
|
+
if (this.isBlank(value)) {
|
|
3217
|
+
if (this.remember) {
|
|
3218
|
+
// value = null;
|
|
2803
3219
|
}
|
|
2804
|
-
return !this.
|
|
2805
|
-
* @param {?} s
|
|
2806
|
-
* @return {?}
|
|
2807
|
-
*/
|
|
2808
|
-
s => s.valueChanged));
|
|
2809
|
-
});
|
|
2810
|
-
}
|
|
2811
|
-
/**
|
|
2812
|
-
* @param {?} router
|
|
2813
|
-
* @return {?}
|
|
2814
|
-
*/
|
|
2815
|
-
redirect(router) {
|
|
2816
|
-
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
2817
|
-
if (this.routeIdSanitiser.valueChanged) {
|
|
2818
|
-
return router.navigate(['..', this.routeIdSanitiser.sanitisedValue]);
|
|
3220
|
+
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
2819
3221
|
}
|
|
2820
3222
|
else {
|
|
2821
|
-
|
|
2822
|
-
const routeParams = {};
|
|
2823
|
-
this.parameterSanitisers.forEach((/**
|
|
2824
|
-
* @param {?} s
|
|
2825
|
-
* @return {?}
|
|
2826
|
-
*/
|
|
2827
|
-
s => s.injectRouteParam(routeParams)));
|
|
2828
|
-
return router.navigate(['.', routeParams]);
|
|
3223
|
+
return value;
|
|
2829
3224
|
}
|
|
2830
3225
|
}
|
|
2831
3226
|
/**
|
|
2832
3227
|
* @private
|
|
2833
|
-
* @
|
|
2834
|
-
* @param {?} def
|
|
3228
|
+
* @param {?} value
|
|
2835
3229
|
* @return {?}
|
|
2836
3230
|
*/
|
|
2837
|
-
|
|
2838
|
-
|
|
3231
|
+
isBlank(value) {
|
|
3232
|
+
/** @type {?} */
|
|
3233
|
+
const isNil$1 = isNil(value);
|
|
3234
|
+
return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
|
|
2839
3235
|
}
|
|
2840
3236
|
}
|
|
2841
3237
|
__decorate([
|
|
2842
|
-
|
|
3238
|
+
Trace(),
|
|
2843
3239
|
__metadata("design:type", Function),
|
|
2844
|
-
__metadata("design:paramtypes", [Object]),
|
|
3240
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2845
3241
|
__metadata("design:returntype", Object)
|
|
2846
|
-
],
|
|
3242
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
2847
3243
|
if (false) {
|
|
2848
3244
|
/**
|
|
2849
3245
|
* @type {?}
|
|
2850
3246
|
* @private
|
|
2851
3247
|
*/
|
|
2852
|
-
|
|
3248
|
+
DefaultParameterSanitiser.prototype.remember;
|
|
2853
3249
|
/**
|
|
2854
3250
|
* @type {?}
|
|
2855
3251
|
* @private
|
|
2856
3252
|
*/
|
|
2857
|
-
|
|
2858
|
-
/** @type {?} */
|
|
2859
|
-
RouteParameterSanitiser.prototype.parameterDefs;
|
|
2860
|
-
/** @type {?} */
|
|
2861
|
-
RouteParameterSanitiser.prototype.snapshot;
|
|
2862
|
-
/** @type {?} */
|
|
2863
|
-
RouteParameterSanitiser.prototype.injector;
|
|
2864
|
-
}
|
|
2865
|
-
(function (Sanitiser) {
|
|
3253
|
+
DefaultParameterSanitiser.prototype.defaultValue;
|
|
2866
3254
|
/**
|
|
2867
|
-
* @
|
|
3255
|
+
* @type {?}
|
|
3256
|
+
* @private
|
|
2868
3257
|
*/
|
|
2869
|
-
|
|
2870
|
-
/**
|
|
2871
|
-
* @param {?} snapshot
|
|
2872
|
-
* @return {?}
|
|
2873
|
-
*/
|
|
2874
|
-
readFrom(snapshot) {
|
|
2875
|
-
/** @type {?} */
|
|
2876
|
-
const rawValue = this.parameterDef.isRouteId ?
|
|
2877
|
-
snapshot.paramMap.get(this.parameterDef.name) :
|
|
2878
|
-
snapshot.queryParamMap.get(this.parameterDef.name);
|
|
2879
|
-
return this.parameterDef.type.parse(rawValue);
|
|
2880
|
-
}
|
|
2881
|
-
/**
|
|
2882
|
-
* @protected
|
|
2883
|
-
* @param {?} initialValue
|
|
2884
|
-
* @param {?} sanitisedValue
|
|
2885
|
-
* @return {?}
|
|
2886
|
-
*/
|
|
2887
|
-
hasChanged(initialValue, sanitisedValue) {
|
|
2888
|
-
return initialValue !== sanitisedValue;
|
|
2889
|
-
}
|
|
2890
|
-
/**
|
|
2891
|
-
* @param {?} dest
|
|
2892
|
-
* @return {?}
|
|
2893
|
-
*/
|
|
2894
|
-
injectRouteParam(dest) {
|
|
2895
|
-
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
2896
|
-
}
|
|
2897
|
-
}
|
|
2898
|
-
Sanitiser.Value = Value;
|
|
3258
|
+
DefaultParameterSanitiser.prototype.def;
|
|
2899
3259
|
/**
|
|
2900
|
-
* @
|
|
3260
|
+
* @type {?}
|
|
3261
|
+
* @private
|
|
2901
3262
|
*/
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
* @param {?} snapshot
|
|
2905
|
-
* @return {?}
|
|
2906
|
-
*/
|
|
2907
|
-
readFrom(snapshot) {
|
|
2908
|
-
/** @type {?} */
|
|
2909
|
-
const rawValues = snapshot.queryParamMap.getAll(this.parameterDef.name);
|
|
2910
|
-
return rawValues.map((/**
|
|
2911
|
-
* @param {?} value
|
|
2912
|
-
* @return {?}
|
|
2913
|
-
*/
|
|
2914
|
-
value => this.parameterDef.type.parse(value)));
|
|
2915
|
-
}
|
|
2916
|
-
/**
|
|
2917
|
-
* @protected
|
|
2918
|
-
* @param {?} initialValue
|
|
2919
|
-
* @param {?} sanitisedValue
|
|
2920
|
-
* @return {?}
|
|
2921
|
-
*/
|
|
2922
|
-
hasChanged(initialValue, sanitisedValue) {
|
|
2923
|
-
return initialValue !== sanitisedValue;
|
|
2924
|
-
}
|
|
2925
|
-
/**
|
|
2926
|
-
* @param {?} dest
|
|
2927
|
-
* @return {?}
|
|
2928
|
-
*/
|
|
2929
|
-
injectRouteParam(dest) {
|
|
2930
|
-
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
2931
|
-
* @param {?} v
|
|
2932
|
-
* @return {?}
|
|
2933
|
-
*/
|
|
2934
|
-
v => this.parameterDef.type.format(v)));
|
|
2935
|
-
}
|
|
2936
|
-
}
|
|
2937
|
-
Sanitiser.Array = Array;
|
|
2938
|
-
})(Sanitiser || (Sanitiser = {}));
|
|
2939
|
-
|
|
2940
|
-
/**
|
|
2941
|
-
* @fileoverview added by tsickle
|
|
2942
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2943
|
-
*/
|
|
2944
|
-
class PlaceRouteGuard {
|
|
2945
|
-
/**
|
|
2946
|
-
* @param {?} router
|
|
2947
|
-
* @param {?} injector
|
|
2948
|
-
*/
|
|
2949
|
-
constructor(router, injector) {
|
|
2950
|
-
this.router = router;
|
|
2951
|
-
this.injector = injector;
|
|
2952
|
-
}
|
|
2953
|
-
/**
|
|
2954
|
-
* @param {?} route
|
|
2955
|
-
* @param {?} state
|
|
2956
|
-
* @return {?}
|
|
2957
|
-
*/
|
|
2958
|
-
canActivate(route, state) {
|
|
2959
|
-
/** @type {?} */
|
|
2960
|
-
const routeParameters = Klass.get(route.component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
|
|
2961
|
-
/** @type {?} */
|
|
2962
|
-
const sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
|
|
2963
|
-
return sanitiser.sanitise().then((/**
|
|
2964
|
-
* @param {?} proceed
|
|
2965
|
-
* @return {?}
|
|
2966
|
-
*/
|
|
2967
|
-
proceed => {
|
|
2968
|
-
if (!proceed) {
|
|
2969
|
-
sanitiser.redirect(this.router);
|
|
2970
|
-
}
|
|
2971
|
-
return proceed;
|
|
2972
|
-
}));
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
PlaceRouteGuard.decorators = [
|
|
2976
|
-
{ type: Injectable, args: [{
|
|
2977
|
-
providedIn: 'root'
|
|
2978
|
-
},] }
|
|
2979
|
-
];
|
|
2980
|
-
/** @nocollapse */
|
|
2981
|
-
PlaceRouteGuard.ctorParameters = () => [
|
|
2982
|
-
{ type: Router },
|
|
2983
|
-
{ type: Injector }
|
|
2984
|
-
];
|
|
2985
|
-
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
2986
|
-
__decorate([
|
|
2987
|
-
Trace(),
|
|
2988
|
-
__metadata("design:type", Function),
|
|
2989
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot]),
|
|
2990
|
-
__metadata("design:returntype", Object)
|
|
2991
|
-
], PlaceRouteGuard.prototype, "canActivate", null);
|
|
2992
|
-
if (false) {
|
|
2993
|
-
/**
|
|
2994
|
-
* @type {?}
|
|
2995
|
-
* @private
|
|
2996
|
-
*/
|
|
2997
|
-
PlaceRouteGuard.prototype.router;
|
|
2998
|
-
/**
|
|
2999
|
-
* @type {?}
|
|
3000
|
-
* @private
|
|
3001
|
-
*/
|
|
3002
|
-
PlaceRouteGuard.prototype.injector;
|
|
3003
|
-
}
|
|
3263
|
+
DefaultParameterSanitiser.prototype.placeService;
|
|
3264
|
+
}
|
|
3004
3265
|
|
|
3005
3266
|
/**
|
|
3006
3267
|
* @fileoverview added by tsickle
|
|
@@ -3030,6 +3291,10 @@ if (false) {
|
|
|
3030
3291
|
/** @type {?|undefined} */
|
|
3031
3292
|
ParameterOptions.prototype.optional;
|
|
3032
3293
|
/** @type {?|undefined} */
|
|
3294
|
+
ParameterOptions.prototype.remember;
|
|
3295
|
+
/** @type {?|undefined} */
|
|
3296
|
+
ParameterOptions.prototype.defaultValue;
|
|
3297
|
+
/** @type {?|undefined} */
|
|
3033
3298
|
ParameterOptions.prototype.sanitiser;
|
|
3034
3299
|
}
|
|
3035
3300
|
/**
|
|
@@ -3043,7 +3308,11 @@ if (false) {
|
|
|
3043
3308
|
/** @type {?|undefined} */
|
|
3044
3309
|
ListParameterOptions.prototype.optional;
|
|
3045
3310
|
/** @type {?|undefined} */
|
|
3046
|
-
ListParameterOptions.prototype.
|
|
3311
|
+
ListParameterOptions.prototype.remember;
|
|
3312
|
+
/** @type {?|undefined} */
|
|
3313
|
+
ListParameterOptions.prototype.defaultValue;
|
|
3314
|
+
/** @type {?|undefined} */
|
|
3315
|
+
ListParameterOptions.prototype.sanitiser;
|
|
3047
3316
|
}
|
|
3048
3317
|
/**
|
|
3049
3318
|
* @template T
|
|
@@ -3061,7 +3330,7 @@ function RouteId(type, options) {
|
|
|
3061
3330
|
(prototype, propertyKey) => {
|
|
3062
3331
|
/** @type {?} */
|
|
3063
3332
|
const param = createDefinition(propertyKey, type, options, true);
|
|
3064
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3333
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3065
3334
|
UseDelegate()(prototype, propertyKey);
|
|
3066
3335
|
});
|
|
3067
3336
|
}
|
|
@@ -3081,7 +3350,7 @@ function RouteParameter(type, options) {
|
|
|
3081
3350
|
(prototype, propertyKey) => {
|
|
3082
3351
|
/** @type {?} */
|
|
3083
3352
|
const param = createDefinition(propertyKey, type, options, false);
|
|
3084
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3353
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3085
3354
|
UseDelegate()(prototype, propertyKey);
|
|
3086
3355
|
});
|
|
3087
3356
|
}
|
|
@@ -3101,7 +3370,7 @@ function RouteParameterList(elementType, options) {
|
|
|
3101
3370
|
(prototype, propertyKey) => {
|
|
3102
3371
|
/** @type {?} */
|
|
3103
3372
|
const param = createArrayDefinition(propertyKey, elementType, options);
|
|
3104
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3373
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3105
3374
|
UseDelegate()(prototype, propertyKey);
|
|
3106
3375
|
});
|
|
3107
3376
|
}
|
|
@@ -3146,7 +3415,7 @@ function createArrayDefinition(propertyName, type, options) {
|
|
|
3146
3415
|
name: opts.getOptional('as', propertyNameAsString),
|
|
3147
3416
|
propertyName: propertyNameAsString,
|
|
3148
3417
|
type: assert.notNil(type),
|
|
3149
|
-
sanitiser: opts.getOptional('
|
|
3418
|
+
sanitiser: opts.getOptional('sanitiser', null),
|
|
3150
3419
|
isRouteId: false,
|
|
3151
3420
|
isArray: true
|
|
3152
3421
|
};
|
|
@@ -3159,7 +3428,7 @@ function createArrayDefinition(propertyName, type, options) {
|
|
|
3159
3428
|
*/
|
|
3160
3429
|
/**
|
|
3161
3430
|
* @record
|
|
3162
|
-
* @template
|
|
3431
|
+
* @template T, S
|
|
3163
3432
|
*/
|
|
3164
3433
|
function ParameterDefinition() { }
|
|
3165
3434
|
if (false) {
|
|
@@ -3189,10 +3458,25 @@ function ParameterSanitiser() { }
|
|
|
3189
3458
|
if (false) {
|
|
3190
3459
|
/**
|
|
3191
3460
|
* @param {?} value
|
|
3461
|
+
* @param {?=} visit
|
|
3192
3462
|
* @return {?}
|
|
3193
3463
|
*/
|
|
3194
|
-
ParameterSanitiser.prototype.sanitise = function (value) { };
|
|
3464
|
+
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
3195
3465
|
}
|
|
3466
|
+
(function (ParameterSanitiser) {
|
|
3467
|
+
/**
|
|
3468
|
+
* @record
|
|
3469
|
+
* @template T
|
|
3470
|
+
*/
|
|
3471
|
+
function Options() { }
|
|
3472
|
+
ParameterSanitiser.Options = Options;
|
|
3473
|
+
if (false) {
|
|
3474
|
+
/** @type {?|undefined} */
|
|
3475
|
+
Options.prototype.remember;
|
|
3476
|
+
/** @type {?|undefined} */
|
|
3477
|
+
Options.prototype.defaultValue;
|
|
3478
|
+
}
|
|
3479
|
+
})(ParameterSanitiser || (ParameterSanitiser = {}));
|
|
3196
3480
|
|
|
3197
3481
|
/**
|
|
3198
3482
|
* @fileoverview added by tsickle
|
|
@@ -3230,7 +3514,7 @@ var ParameterType;
|
|
|
3230
3514
|
* @return {?}
|
|
3231
3515
|
*/
|
|
3232
3516
|
parse(value) {
|
|
3233
|
-
return +value;
|
|
3517
|
+
return isNil(value) || isEmpty(value) ? null : +value;
|
|
3234
3518
|
}
|
|
3235
3519
|
}
|
|
3236
3520
|
class BooleanType {
|
|
@@ -3259,23 +3543,310 @@ var ParameterType;
|
|
|
3259
3543
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3260
3544
|
*/
|
|
3261
3545
|
/**
|
|
3262
|
-
* @
|
|
3263
|
-
* @template T
|
|
3546
|
+
* @template T, S
|
|
3264
3547
|
*/
|
|
3265
|
-
|
|
3548
|
+
class Sanitiser {
|
|
3549
|
+
/**
|
|
3550
|
+
* @param {?} parameterDef
|
|
3551
|
+
* @param {?} snapshot
|
|
3552
|
+
* @param {?} sanitiser
|
|
3553
|
+
*/
|
|
3554
|
+
constructor(parameterDef, snapshot, sanitiser) {
|
|
3555
|
+
this.parameterDef = parameterDef;
|
|
3556
|
+
this.snapshot = snapshot;
|
|
3557
|
+
this.sanitiser = sanitiser;
|
|
3558
|
+
}
|
|
3559
|
+
/**
|
|
3560
|
+
* @return {?}
|
|
3561
|
+
*/
|
|
3562
|
+
isRouteId() {
|
|
3563
|
+
return this.parameterDef.isRouteId;
|
|
3564
|
+
}
|
|
3565
|
+
/**
|
|
3566
|
+
* @return {?}
|
|
3567
|
+
*/
|
|
3568
|
+
get valueChanged() {
|
|
3569
|
+
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3570
|
+
}
|
|
3571
|
+
/**
|
|
3572
|
+
* @return {?}
|
|
3573
|
+
*/
|
|
3574
|
+
get sanitisedValue() {
|
|
3575
|
+
return this._sanitisedValue;
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* @protected
|
|
3579
|
+
* @param {?} snapshot
|
|
3580
|
+
* @return {?}
|
|
3581
|
+
*/
|
|
3582
|
+
readFrom(snapshot) {
|
|
3583
|
+
return lang.abstractMethod(this.constructor);
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* @protected
|
|
3587
|
+
* @param {?} initialValue
|
|
3588
|
+
* @param {?} sanitisedValue
|
|
3589
|
+
* @return {?}
|
|
3590
|
+
*/
|
|
3591
|
+
hasChanged(initialValue, sanitisedValue) {
|
|
3592
|
+
return lang.abstractMethod(this.constructor);
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* @param {?} dest
|
|
3596
|
+
* @return {?}
|
|
3597
|
+
*/
|
|
3598
|
+
injectRouteParam(dest) {
|
|
3599
|
+
lang.abstractMethod(this.constructor);
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* @return {?}
|
|
3603
|
+
*/
|
|
3604
|
+
sanitize() {
|
|
3605
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3606
|
+
if (this.sanitiser) {
|
|
3607
|
+
this.initialValue = this.readFrom(this.snapshot);
|
|
3608
|
+
this._sanitisedValue = yield this.sanitiser.sanitise(this.initialValue);
|
|
3609
|
+
if (this.initialValue !== this._sanitisedValue) {
|
|
3610
|
+
return false;
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
return true;
|
|
3614
|
+
});
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3266
3617
|
if (false) {
|
|
3618
|
+
/**
|
|
3619
|
+
* @type {?}
|
|
3620
|
+
* @private
|
|
3621
|
+
*/
|
|
3622
|
+
Sanitiser.prototype.initialValue;
|
|
3623
|
+
/**
|
|
3624
|
+
* @type {?}
|
|
3625
|
+
* @private
|
|
3626
|
+
*/
|
|
3627
|
+
Sanitiser.prototype._sanitisedValue;
|
|
3628
|
+
/** @type {?} */
|
|
3629
|
+
Sanitiser.prototype.parameterDef;
|
|
3267
3630
|
/** @type {?} */
|
|
3268
|
-
|
|
3631
|
+
Sanitiser.prototype.snapshot;
|
|
3269
3632
|
/** @type {?} */
|
|
3270
|
-
|
|
3633
|
+
Sanitiser.prototype.sanitiser;
|
|
3271
3634
|
}
|
|
3272
|
-
|
|
3273
|
-
/**
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3635
|
+
class RouteParameterSanitiser {
|
|
3636
|
+
/**
|
|
3637
|
+
* @param {?} parameterDefs
|
|
3638
|
+
* @param {?} snapshot
|
|
3639
|
+
* @param {?} placeService
|
|
3640
|
+
* @param {?} injector
|
|
3641
|
+
*/
|
|
3642
|
+
constructor(parameterDefs, snapshot, placeService, injector) {
|
|
3643
|
+
this.parameterDefs = parameterDefs;
|
|
3644
|
+
this.snapshot = snapshot;
|
|
3645
|
+
this.placeService = placeService;
|
|
3646
|
+
this.injector = injector;
|
|
3647
|
+
this.parameterSanitisers = [];
|
|
3648
|
+
/** @type {?} */
|
|
3649
|
+
const sanitisers = parameterDefs.map((/**
|
|
3650
|
+
* @param {?} def
|
|
3651
|
+
* @return {?}
|
|
3652
|
+
*/
|
|
3653
|
+
def => {
|
|
3654
|
+
return def.isArray ?
|
|
3655
|
+
new Sanitiser.Array(def, snapshot, this.getSanitiser(def)) :
|
|
3656
|
+
new Sanitiser.Value(def, snapshot, this.getSanitiser(def));
|
|
3657
|
+
}));
|
|
3658
|
+
this.routeIdSanitiser = sanitisers.find((/**
|
|
3659
|
+
* @param {?} p
|
|
3660
|
+
* @return {?}
|
|
3661
|
+
*/
|
|
3662
|
+
p => p.isRouteId()));
|
|
3663
|
+
this.parameterSanitisers = sanitisers.filter((/**
|
|
3664
|
+
* @param {?} p
|
|
3665
|
+
* @return {?}
|
|
3666
|
+
*/
|
|
3667
|
+
p => !p.isRouteId()));
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* @return {?}
|
|
3671
|
+
*/
|
|
3672
|
+
sanitise() {
|
|
3673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3674
|
+
if (this.routeIdSanitiser) {
|
|
3675
|
+
yield this.routeIdSanitiser.sanitize();
|
|
3676
|
+
if (this.routeIdSanitiser.valueChanged) {
|
|
3677
|
+
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
3678
|
+
// context of the route id.
|
|
3679
|
+
return false;
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
for (const sanitiser of this.parameterSanitisers) {
|
|
3683
|
+
yield sanitiser.sanitize();
|
|
3684
|
+
}
|
|
3685
|
+
return !this.parameterSanitisers.find((/**
|
|
3686
|
+
* @param {?} s
|
|
3687
|
+
* @return {?}
|
|
3688
|
+
*/
|
|
3689
|
+
s => s.valueChanged));
|
|
3690
|
+
});
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* @private
|
|
3694
|
+
* @template T, S
|
|
3695
|
+
* @param {?} def
|
|
3696
|
+
* @return {?}
|
|
3697
|
+
*/
|
|
3698
|
+
getSanitiser(def) {
|
|
3699
|
+
if (def.sanitiser) {
|
|
3700
|
+
if (this.isSanitiserContructor(def.sanitiser)) {
|
|
3701
|
+
return this.injector.get(def.sanitiser, new def.sanitiser());
|
|
3702
|
+
}
|
|
3703
|
+
else {
|
|
3704
|
+
return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
else {
|
|
3708
|
+
return null;
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* @return {?}
|
|
3713
|
+
*/
|
|
3714
|
+
routeIdHasChanged() {
|
|
3715
|
+
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
3716
|
+
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
3717
|
+
}
|
|
3718
|
+
/**
|
|
3719
|
+
* @return {?}
|
|
3720
|
+
*/
|
|
3721
|
+
getRedirectParams() {
|
|
3722
|
+
if (this.routeIdHasChanged()) {
|
|
3723
|
+
return [this.routeIdSanitiser.sanitisedValue];
|
|
3724
|
+
}
|
|
3725
|
+
else {
|
|
3726
|
+
/** @type {?} */
|
|
3727
|
+
const routeParams = {};
|
|
3728
|
+
this.parameterSanitisers.forEach((/**
|
|
3729
|
+
* @param {?} s
|
|
3730
|
+
* @return {?}
|
|
3731
|
+
*/
|
|
3732
|
+
s => s.injectRouteParam(routeParams)));
|
|
3733
|
+
return [routeParams];
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3737
|
+
* @private
|
|
3738
|
+
* @template S
|
|
3739
|
+
* @param {?} value
|
|
3740
|
+
* @return {?}
|
|
3741
|
+
*/
|
|
3742
|
+
isSanitiserContructor(value) {
|
|
3743
|
+
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3744
|
+
}
|
|
3745
|
+
}
|
|
3746
|
+
__decorate([
|
|
3747
|
+
Memoize(),
|
|
3748
|
+
__metadata("design:type", Function),
|
|
3749
|
+
__metadata("design:paramtypes", [Object]),
|
|
3750
|
+
__metadata("design:returntype", Object)
|
|
3751
|
+
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
3752
|
+
__decorate([
|
|
3753
|
+
Trace(),
|
|
3754
|
+
__metadata("design:type", Function),
|
|
3755
|
+
__metadata("design:paramtypes", []),
|
|
3756
|
+
__metadata("design:returntype", Array)
|
|
3757
|
+
], RouteParameterSanitiser.prototype, "getRedirectParams", null);
|
|
3758
|
+
if (false) {
|
|
3759
|
+
/**
|
|
3760
|
+
* @type {?}
|
|
3761
|
+
* @private
|
|
3762
|
+
*/
|
|
3763
|
+
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
3764
|
+
/**
|
|
3765
|
+
* @type {?}
|
|
3766
|
+
* @private
|
|
3767
|
+
*/
|
|
3768
|
+
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
3769
|
+
/** @type {?} */
|
|
3770
|
+
RouteParameterSanitiser.prototype.parameterDefs;
|
|
3771
|
+
/** @type {?} */
|
|
3772
|
+
RouteParameterSanitiser.prototype.snapshot;
|
|
3773
|
+
/** @type {?} */
|
|
3774
|
+
RouteParameterSanitiser.prototype.placeService;
|
|
3775
|
+
/** @type {?} */
|
|
3776
|
+
RouteParameterSanitiser.prototype.injector;
|
|
3278
3777
|
}
|
|
3778
|
+
(function (Sanitiser) {
|
|
3779
|
+
/**
|
|
3780
|
+
* @template T
|
|
3781
|
+
*/
|
|
3782
|
+
class Value extends Sanitiser {
|
|
3783
|
+
/**
|
|
3784
|
+
* @param {?} snapshot
|
|
3785
|
+
* @return {?}
|
|
3786
|
+
*/
|
|
3787
|
+
readFrom(snapshot) {
|
|
3788
|
+
/** @type {?} */
|
|
3789
|
+
const rawValue = snapshot.paramMap.get(this.parameterDef.name);
|
|
3790
|
+
return this.parameterDef.type.parse(rawValue);
|
|
3791
|
+
}
|
|
3792
|
+
/**
|
|
3793
|
+
* @protected
|
|
3794
|
+
* @param {?} initialValue
|
|
3795
|
+
* @param {?} sanitisedValue
|
|
3796
|
+
* @return {?}
|
|
3797
|
+
*/
|
|
3798
|
+
hasChanged(initialValue, sanitisedValue) {
|
|
3799
|
+
return initialValue !== sanitisedValue;
|
|
3800
|
+
}
|
|
3801
|
+
/**
|
|
3802
|
+
* @param {?} dest
|
|
3803
|
+
* @return {?}
|
|
3804
|
+
*/
|
|
3805
|
+
injectRouteParam(dest) {
|
|
3806
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
Sanitiser.Value = Value;
|
|
3810
|
+
/**
|
|
3811
|
+
* @template T
|
|
3812
|
+
*/
|
|
3813
|
+
class Array extends Sanitiser {
|
|
3814
|
+
/**
|
|
3815
|
+
* @param {?} snapshot
|
|
3816
|
+
* @return {?}
|
|
3817
|
+
*/
|
|
3818
|
+
readFrom(snapshot) {
|
|
3819
|
+
/** @type {?} */
|
|
3820
|
+
const rawValues = snapshot.paramMap.getAll(this.parameterDef.name);
|
|
3821
|
+
return rawValues.map((/**
|
|
3822
|
+
* @param {?} value
|
|
3823
|
+
* @return {?}
|
|
3824
|
+
*/
|
|
3825
|
+
value => this.parameterDef.type.parse(value)));
|
|
3826
|
+
}
|
|
3827
|
+
/**
|
|
3828
|
+
* @protected
|
|
3829
|
+
* @param {?} initialValue
|
|
3830
|
+
* @param {?} sanitisedValue
|
|
3831
|
+
* @return {?}
|
|
3832
|
+
*/
|
|
3833
|
+
hasChanged(initialValue, sanitisedValue) {
|
|
3834
|
+
return initialValue !== sanitisedValue;
|
|
3835
|
+
}
|
|
3836
|
+
/**
|
|
3837
|
+
* @param {?} dest
|
|
3838
|
+
* @return {?}
|
|
3839
|
+
*/
|
|
3840
|
+
injectRouteParam(dest) {
|
|
3841
|
+
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
3842
|
+
* @param {?} v
|
|
3843
|
+
* @return {?}
|
|
3844
|
+
*/
|
|
3845
|
+
v => this.parameterDef.type.format(v)));
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
Sanitiser.Array = Array;
|
|
3849
|
+
})(Sanitiser || (Sanitiser = {}));
|
|
3279
3850
|
|
|
3280
3851
|
/**
|
|
3281
3852
|
* @fileoverview added by tsickle
|
|
@@ -3297,5 +3868,5 @@ class VisitSnapshot {
|
|
|
3297
3868
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3298
3869
|
*/
|
|
3299
3870
|
|
|
3300
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point,
|
|
3871
|
+
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DefaultParameterSanitiser, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, DialogInteractionService as ɵbb, InteractionContext as ɵbc, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceService as ɵo, TabbedPlaceNavigationComponent as ɵp, AbstractPlaceNavigationComponent as ɵq, ListPlaceNavComponent as ɵr, InteractionModule as ɵs, ActivityContainerComponent as ɵt, ActivityOutletComponent as ɵu, ConfirmationDialogComponent as ɵv, AbstractActivity as ɵw, ACTIVITY_DATA as ɵx, AlertDialogComponent as ɵz };
|
|
3301
3872
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|