@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 { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } 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
|
|
@@ -298,6 +297,126 @@ var NumberInputComponent = /** @class */ (function (_super) {
|
|
|
298
297
|
return NumberInputComponent;
|
|
299
298
|
}(AbstractInputComponent));
|
|
300
299
|
|
|
300
|
+
/**
|
|
301
|
+
* @fileoverview added by tsickle
|
|
302
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
303
|
+
*/
|
|
304
|
+
var PasswordInputComponent = /** @class */ (function (_super) {
|
|
305
|
+
__extends(PasswordInputComponent, _super);
|
|
306
|
+
function PasswordInputComponent() {
|
|
307
|
+
return _super.call(this) || this;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* @return {?}
|
|
311
|
+
*/
|
|
312
|
+
PasswordInputComponent.prototype.ngOnInit = /**
|
|
313
|
+
* @return {?}
|
|
314
|
+
*/
|
|
315
|
+
function () {
|
|
316
|
+
};
|
|
317
|
+
PasswordInputComponent.decorators = [
|
|
318
|
+
{ type: Component, args: [{
|
|
319
|
+
selector: 'angular-ui-powerups-password-input',
|
|
320
|
+
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",
|
|
321
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
322
|
+
}] }
|
|
323
|
+
];
|
|
324
|
+
/** @nocollapse */
|
|
325
|
+
PasswordInputComponent.ctorParameters = function () { return []; };
|
|
326
|
+
return PasswordInputComponent;
|
|
327
|
+
}(AbstractInputComponent));
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @fileoverview added by tsickle
|
|
331
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
332
|
+
*/
|
|
333
|
+
/**
|
|
334
|
+
* @template T
|
|
335
|
+
*/
|
|
336
|
+
var SelectInputComponent = /** @class */ (function (_super) {
|
|
337
|
+
__extends(SelectInputComponent, _super);
|
|
338
|
+
function SelectInputComponent() {
|
|
339
|
+
var _this = _super.call(this) || this;
|
|
340
|
+
_this.optionLabelFormat = (/**
|
|
341
|
+
* @param {?} option
|
|
342
|
+
* @return {?}
|
|
343
|
+
*/
|
|
344
|
+
function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; });
|
|
345
|
+
return _this;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* @return {?}
|
|
349
|
+
*/
|
|
350
|
+
SelectInputComponent.prototype.ngOnInit = /**
|
|
351
|
+
* @return {?}
|
|
352
|
+
*/
|
|
353
|
+
function () {
|
|
354
|
+
};
|
|
355
|
+
SelectInputComponent.decorators = [
|
|
356
|
+
{ type: Component, args: [{
|
|
357
|
+
selector: 'angular-ui-powerups-select-input',
|
|
358
|
+
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",
|
|
359
|
+
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
360
|
+
}] }
|
|
361
|
+
];
|
|
362
|
+
/** @nocollapse */
|
|
363
|
+
SelectInputComponent.ctorParameters = function () { return []; };
|
|
364
|
+
SelectInputComponent.propDecorators = {
|
|
365
|
+
optionsModel: [{ type: Input }],
|
|
366
|
+
options: [{ type: Input }],
|
|
367
|
+
optionLabel: [{ type: Input }],
|
|
368
|
+
optionLabelFormat: [{ type: Input }]
|
|
369
|
+
};
|
|
370
|
+
__decorate([
|
|
371
|
+
UseDelegate(),
|
|
372
|
+
__metadata("design:type", ListModel)
|
|
373
|
+
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
StoreInListModel('optionsModel'),
|
|
376
|
+
__metadata("design:type", Array)
|
|
377
|
+
], SelectInputComponent.prototype, "options", void 0);
|
|
378
|
+
return SelectInputComponent;
|
|
379
|
+
}(AbstractInputComponent));
|
|
380
|
+
if (false) {
|
|
381
|
+
/** @type {?} */
|
|
382
|
+
SelectInputComponent.prototype.optionsModel;
|
|
383
|
+
/** @type {?} */
|
|
384
|
+
SelectInputComponent.prototype.options;
|
|
385
|
+
/** @type {?} */
|
|
386
|
+
SelectInputComponent.prototype.optionLabel;
|
|
387
|
+
/** @type {?} */
|
|
388
|
+
SelectInputComponent.prototype.optionLabelFormat;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @fileoverview added by tsickle
|
|
393
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
394
|
+
*/
|
|
395
|
+
var StringInputComponent = /** @class */ (function (_super) {
|
|
396
|
+
__extends(StringInputComponent, _super);
|
|
397
|
+
function StringInputComponent() {
|
|
398
|
+
return _super.call(this) || this;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* @return {?}
|
|
402
|
+
*/
|
|
403
|
+
StringInputComponent.prototype.ngOnInit = /**
|
|
404
|
+
* @return {?}
|
|
405
|
+
*/
|
|
406
|
+
function () {
|
|
407
|
+
};
|
|
408
|
+
StringInputComponent.decorators = [
|
|
409
|
+
{ type: Component, args: [{
|
|
410
|
+
selector: 'angular-ui-powerups-string-input',
|
|
411
|
+
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",
|
|
412
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
413
|
+
}] }
|
|
414
|
+
];
|
|
415
|
+
/** @nocollapse */
|
|
416
|
+
StringInputComponent.ctorParameters = function () { return []; };
|
|
417
|
+
return StringInputComponent;
|
|
418
|
+
}(AbstractInputComponent));
|
|
419
|
+
|
|
301
420
|
/**
|
|
302
421
|
* @fileoverview added by tsickle
|
|
303
422
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -674,126 +793,6 @@ if (false) {
|
|
|
674
793
|
FocusBindingDirective.prototype.ngZone;
|
|
675
794
|
}
|
|
676
795
|
|
|
677
|
-
/**
|
|
678
|
-
* @fileoverview added by tsickle
|
|
679
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
680
|
-
*/
|
|
681
|
-
var StringInputComponent = /** @class */ (function (_super) {
|
|
682
|
-
__extends(StringInputComponent, _super);
|
|
683
|
-
function StringInputComponent() {
|
|
684
|
-
return _super.call(this) || this;
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* @return {?}
|
|
688
|
-
*/
|
|
689
|
-
StringInputComponent.prototype.ngOnInit = /**
|
|
690
|
-
* @return {?}
|
|
691
|
-
*/
|
|
692
|
-
function () {
|
|
693
|
-
};
|
|
694
|
-
StringInputComponent.decorators = [
|
|
695
|
-
{ type: Component, args: [{
|
|
696
|
-
selector: 'angular-ui-powerups-string-input',
|
|
697
|
-
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",
|
|
698
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
699
|
-
}] }
|
|
700
|
-
];
|
|
701
|
-
/** @nocollapse */
|
|
702
|
-
StringInputComponent.ctorParameters = function () { return []; };
|
|
703
|
-
return StringInputComponent;
|
|
704
|
-
}(AbstractInputComponent));
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* @fileoverview added by tsickle
|
|
708
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
709
|
-
*/
|
|
710
|
-
var PasswordInputComponent = /** @class */ (function (_super) {
|
|
711
|
-
__extends(PasswordInputComponent, _super);
|
|
712
|
-
function PasswordInputComponent() {
|
|
713
|
-
return _super.call(this) || this;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* @return {?}
|
|
717
|
-
*/
|
|
718
|
-
PasswordInputComponent.prototype.ngOnInit = /**
|
|
719
|
-
* @return {?}
|
|
720
|
-
*/
|
|
721
|
-
function () {
|
|
722
|
-
};
|
|
723
|
-
PasswordInputComponent.decorators = [
|
|
724
|
-
{ type: Component, args: [{
|
|
725
|
-
selector: 'angular-ui-powerups-password-input',
|
|
726
|
-
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",
|
|
727
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
728
|
-
}] }
|
|
729
|
-
];
|
|
730
|
-
/** @nocollapse */
|
|
731
|
-
PasswordInputComponent.ctorParameters = function () { return []; };
|
|
732
|
-
return PasswordInputComponent;
|
|
733
|
-
}(AbstractInputComponent));
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* @fileoverview added by tsickle
|
|
737
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
738
|
-
*/
|
|
739
|
-
/**
|
|
740
|
-
* @template T
|
|
741
|
-
*/
|
|
742
|
-
var SelectInputComponent = /** @class */ (function (_super) {
|
|
743
|
-
__extends(SelectInputComponent, _super);
|
|
744
|
-
function SelectInputComponent() {
|
|
745
|
-
var _this = _super.call(this) || this;
|
|
746
|
-
_this.optionLabelFormat = (/**
|
|
747
|
-
* @param {?} option
|
|
748
|
-
* @return {?}
|
|
749
|
-
*/
|
|
750
|
-
function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; });
|
|
751
|
-
return _this;
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* @return {?}
|
|
755
|
-
*/
|
|
756
|
-
SelectInputComponent.prototype.ngOnInit = /**
|
|
757
|
-
* @return {?}
|
|
758
|
-
*/
|
|
759
|
-
function () {
|
|
760
|
-
};
|
|
761
|
-
SelectInputComponent.decorators = [
|
|
762
|
-
{ type: Component, args: [{
|
|
763
|
-
selector: 'angular-ui-powerups-select-input',
|
|
764
|
-
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",
|
|
765
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
766
|
-
}] }
|
|
767
|
-
];
|
|
768
|
-
/** @nocollapse */
|
|
769
|
-
SelectInputComponent.ctorParameters = function () { return []; };
|
|
770
|
-
SelectInputComponent.propDecorators = {
|
|
771
|
-
optionsModel: [{ type: Input }],
|
|
772
|
-
options: [{ type: Input }],
|
|
773
|
-
optionLabel: [{ type: Input }],
|
|
774
|
-
optionLabelFormat: [{ type: Input }]
|
|
775
|
-
};
|
|
776
|
-
__decorate([
|
|
777
|
-
UseDelegate(),
|
|
778
|
-
__metadata("design:type", ListModel)
|
|
779
|
-
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
780
|
-
__decorate([
|
|
781
|
-
StoreInListModel('optionsModel'),
|
|
782
|
-
__metadata("design:type", Array)
|
|
783
|
-
], SelectInputComponent.prototype, "options", void 0);
|
|
784
|
-
return SelectInputComponent;
|
|
785
|
-
}(AbstractInputComponent));
|
|
786
|
-
if (false) {
|
|
787
|
-
/** @type {?} */
|
|
788
|
-
SelectInputComponent.prototype.optionsModel;
|
|
789
|
-
/** @type {?} */
|
|
790
|
-
SelectInputComponent.prototype.options;
|
|
791
|
-
/** @type {?} */
|
|
792
|
-
SelectInputComponent.prototype.optionLabel;
|
|
793
|
-
/** @type {?} */
|
|
794
|
-
SelectInputComponent.prototype.optionLabelFormat;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
796
|
/**
|
|
798
797
|
* @fileoverview added by tsickle
|
|
799
798
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -1296,7 +1295,6 @@ var ConfirmationDialogComponent = /** @class */ (function (_super) {
|
|
|
1296
1295
|
var _this = _super.call(this) || this;
|
|
1297
1296
|
_this.confirm = confirm;
|
|
1298
1297
|
assert.notNil(confirm);
|
|
1299
|
-
console.log(confirm);
|
|
1300
1298
|
return _this;
|
|
1301
1299
|
}
|
|
1302
1300
|
/**
|
|
@@ -1449,7 +1447,6 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
|
1449
1447
|
*/
|
|
1450
1448
|
function () {
|
|
1451
1449
|
var _this = this;
|
|
1452
|
-
// TODO: notify selected tab they are ready. activty.afterAnimationComplete
|
|
1453
1450
|
this.activityTabs.value = this.activityTabs.value.filter((/**
|
|
1454
1451
|
* @param {?} tab
|
|
1455
1452
|
* @return {?}
|
|
@@ -1757,88 +1754,175 @@ var EmptyStateComponent = /** @class */ (function () {
|
|
|
1757
1754
|
* @fileoverview added by tsickle
|
|
1758
1755
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1759
1756
|
*/
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1757
|
+
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
1758
|
+
// Id snapshot are repesented by 2 url segments
|
|
1759
|
+
// ID => [{'/basePath', params}, {'id', params}]
|
|
1760
|
+
// NO ID => [{'/basePath', params}]
|
|
1761
|
+
var ParameterSnapshot = /** @class */ (function () {
|
|
1762
|
+
function ParameterSnapshot(placeDefinition, resolved) {
|
|
1763
|
+
this.placeDefinition = placeDefinition;
|
|
1764
|
+
this.resolved = resolved;
|
|
1763
1765
|
}
|
|
1764
1766
|
/**
|
|
1765
|
-
* @
|
|
1766
|
-
* @param {?} parameter
|
|
1767
|
+
* @param {?} other
|
|
1767
1768
|
* @return {?}
|
|
1768
1769
|
*/
|
|
1769
|
-
|
|
1770
|
-
* @
|
|
1771
|
-
* @param {?} parameter
|
|
1770
|
+
ParameterSnapshot.prototype.hasChanged = /**
|
|
1771
|
+
* @param {?} other
|
|
1772
1772
|
* @return {?}
|
|
1773
1773
|
*/
|
|
1774
|
-
function (
|
|
1774
|
+
function (other) {
|
|
1775
1775
|
/** @type {?} */
|
|
1776
|
-
var
|
|
1777
|
-
* @param {?}
|
|
1776
|
+
var changed = this.resolved.find((/**
|
|
1777
|
+
* @param {?} r
|
|
1778
1778
|
* @return {?}
|
|
1779
1779
|
*/
|
|
1780
|
-
function (
|
|
1781
|
-
|
|
1780
|
+
function (r) {
|
|
1781
|
+
return !r.isSame(other.getResolvedParameterValue(r.parameterDef));
|
|
1782
|
+
}));
|
|
1783
|
+
if (changed) {
|
|
1784
|
+
console.log({ mine: changed, theirs: other.getResolvedParameter(changed.parameterDef) });
|
|
1785
|
+
}
|
|
1786
|
+
return !!changed;
|
|
1782
1787
|
};
|
|
1783
1788
|
/**
|
|
1784
|
-
* @
|
|
1785
|
-
* @param {?} parameter
|
|
1786
|
-
* @param {?} value
|
|
1789
|
+
* @param {?} other
|
|
1787
1790
|
* @return {?}
|
|
1788
1791
|
*/
|
|
1789
|
-
|
|
1790
|
-
* @
|
|
1791
|
-
* @param {?} parameter
|
|
1792
|
-
* @param {?} value
|
|
1792
|
+
ParameterSnapshot.prototype.asUrlSegment = /**
|
|
1793
|
+
* @param {?} other
|
|
1793
1794
|
* @return {?}
|
|
1794
1795
|
*/
|
|
1795
|
-
function (
|
|
1796
|
-
|
|
1797
|
-
|
|
1796
|
+
function (other) {
|
|
1797
|
+
assert.isTruthy(this.hasChanged(other));
|
|
1798
|
+
/** @type {?} */
|
|
1799
|
+
var routeParts = [];
|
|
1800
|
+
/** @type {?} */
|
|
1801
|
+
var gainedId = this.getFormattedRouteId() && !other.getFormattedRouteId();
|
|
1802
|
+
/** @type {?} */
|
|
1803
|
+
var sameId = this.getFormattedRouteId() === other.getFormattedRouteId();
|
|
1804
|
+
/** @type {?} */
|
|
1805
|
+
var lostId = (!this.getFormattedRouteId() && other.getFormattedRouteId());
|
|
1806
|
+
/** @type {?} */
|
|
1807
|
+
var changedId = (this.getFormattedRouteId() !== other.getFormattedRouteId());
|
|
1808
|
+
if (lostId || changedId) {
|
|
1809
|
+
routeParts.push('..');
|
|
1810
|
+
if (changedId) {
|
|
1811
|
+
routeParts.push(this.getFormattedRouteId());
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
else {
|
|
1815
|
+
routeParts.push('.');
|
|
1816
|
+
}
|
|
1817
|
+
routeParts.push(this.getFormattedParameters());
|
|
1818
|
+
return routeParts;
|
|
1819
|
+
};
|
|
1820
|
+
/**
|
|
1821
|
+
* @template T, S
|
|
1822
|
+
* @param {?} parameterDef
|
|
1823
|
+
* @return {?}
|
|
1824
|
+
*/
|
|
1825
|
+
ParameterSnapshot.prototype.getResolvedParameter = /**
|
|
1826
|
+
* @template T, S
|
|
1827
|
+
* @param {?} parameterDef
|
|
1828
|
+
* @return {?}
|
|
1829
|
+
*/
|
|
1830
|
+
function (parameterDef) {
|
|
1831
|
+
return this.resolved.find((/**
|
|
1832
|
+
* @param {?} r
|
|
1798
1833
|
* @return {?}
|
|
1799
1834
|
*/
|
|
1800
|
-
function (
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1835
|
+
function (r) { return r.parameterDef === parameterDef; }));
|
|
1836
|
+
};
|
|
1837
|
+
/**
|
|
1838
|
+
* @template T, S
|
|
1839
|
+
* @param {?} parameterDef
|
|
1840
|
+
* @return {?}
|
|
1841
|
+
*/
|
|
1842
|
+
ParameterSnapshot.prototype.getResolvedParameterValue = /**
|
|
1843
|
+
* @template T, S
|
|
1844
|
+
* @param {?} parameterDef
|
|
1845
|
+
* @return {?}
|
|
1846
|
+
*/
|
|
1847
|
+
function (parameterDef) {
|
|
1848
|
+
/** @type {?} */
|
|
1849
|
+
var resolvedParameter = this.getResolvedParameter(parameterDef);
|
|
1850
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
1804
1851
|
};
|
|
1805
1852
|
/**
|
|
1806
1853
|
* @return {?}
|
|
1807
1854
|
*/
|
|
1808
|
-
|
|
1855
|
+
ParameterSnapshot.prototype.getRouteId = /**
|
|
1809
1856
|
* @return {?}
|
|
1810
1857
|
*/
|
|
1811
1858
|
function () {
|
|
1859
|
+
return this.getResolvedRouteId() ? this.getResolvedRouteId().value : null;
|
|
1860
|
+
};
|
|
1861
|
+
/**
|
|
1862
|
+
* @param {?} name
|
|
1863
|
+
* @return {?}
|
|
1864
|
+
*/
|
|
1865
|
+
ParameterSnapshot.prototype.getRouteParameter = /**
|
|
1866
|
+
* @param {?} name
|
|
1867
|
+
* @return {?}
|
|
1868
|
+
*/
|
|
1869
|
+
function (name) {
|
|
1812
1870
|
/** @type {?} */
|
|
1813
|
-
var
|
|
1814
|
-
|
|
1871
|
+
var resolvedParameter = this.resolved.find((/**
|
|
1872
|
+
* @param {?} r
|
|
1873
|
+
* @return {?}
|
|
1874
|
+
*/
|
|
1875
|
+
function (r) { return r.parameterDef.name === name; }));
|
|
1876
|
+
return resolvedParameter ? resolvedParameter.value : null;
|
|
1815
1877
|
};
|
|
1816
1878
|
/**
|
|
1817
1879
|
* @private
|
|
1818
1880
|
* @return {?}
|
|
1819
1881
|
*/
|
|
1820
|
-
|
|
1882
|
+
ParameterSnapshot.prototype.getResolvedRouteId = /**
|
|
1821
1883
|
* @private
|
|
1822
1884
|
* @return {?}
|
|
1823
1885
|
*/
|
|
1824
1886
|
function () {
|
|
1825
|
-
|
|
1887
|
+
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
1888
|
+
// capture this in the type system though
|
|
1889
|
+
return (/** @type {?} */ (this.resolved.find((/**
|
|
1826
1890
|
* @param {?} p
|
|
1827
1891
|
* @return {?}
|
|
1828
1892
|
*/
|
|
1829
|
-
function (p) { return p.parameterDef.isRouteId; }));
|
|
1893
|
+
function (p) { return p.parameterDef.isRouteId; }))));
|
|
1894
|
+
};
|
|
1895
|
+
/**
|
|
1896
|
+
* @return {?}
|
|
1897
|
+
*/
|
|
1898
|
+
ParameterSnapshot.prototype.hasRouteId = /**
|
|
1899
|
+
* @return {?}
|
|
1900
|
+
*/
|
|
1901
|
+
function () {
|
|
1902
|
+
return !!this.getResolvedRouteId();
|
|
1903
|
+
};
|
|
1904
|
+
/**
|
|
1905
|
+
* @return {?}
|
|
1906
|
+
*/
|
|
1907
|
+
ParameterSnapshot.prototype.getFormattedRouteId = /**
|
|
1908
|
+
* @return {?}
|
|
1909
|
+
*/
|
|
1910
|
+
function () {
|
|
1911
|
+
/** @type {?} */
|
|
1912
|
+
var routeIdParam = this.getResolvedRouteId();
|
|
1913
|
+
return routeIdParam ? routeIdParam.formattedValue() : null;
|
|
1830
1914
|
};
|
|
1831
1915
|
/**
|
|
1832
1916
|
* @return {?}
|
|
1833
1917
|
*/
|
|
1834
|
-
|
|
1918
|
+
ParameterSnapshot.prototype.getFormattedParameters = /**
|
|
1835
1919
|
* @return {?}
|
|
1836
1920
|
*/
|
|
1837
1921
|
function () {
|
|
1838
1922
|
/** @type {?} */
|
|
1839
1923
|
var params = {};
|
|
1840
1924
|
/** @type {?} */
|
|
1841
|
-
var routeIdParam = this.
|
|
1925
|
+
var routeIdParam = this.resolved.filter((/**
|
|
1842
1926
|
* @param {?} p
|
|
1843
1927
|
* @return {?}
|
|
1844
1928
|
*/
|
|
@@ -1847,91 +1931,325 @@ var ResolvedRouteParameterSnapshot = /** @class */ (function () {
|
|
|
1847
1931
|
* @return {?}
|
|
1848
1932
|
*/
|
|
1849
1933
|
function (p) {
|
|
1850
|
-
params[p.parameterDef.name] = p.
|
|
1934
|
+
params[p.parameterDef.name] = p.formattedValue();
|
|
1851
1935
|
}));
|
|
1852
1936
|
return params;
|
|
1853
1937
|
};
|
|
1854
1938
|
/**
|
|
1939
|
+
* @template T, S
|
|
1940
|
+
* @param {?} parameter
|
|
1941
|
+
* @param {?} value
|
|
1855
1942
|
* @return {?}
|
|
1856
1943
|
*/
|
|
1857
|
-
|
|
1944
|
+
ParameterSnapshot.prototype.replace = /**
|
|
1945
|
+
* @template T, S
|
|
1946
|
+
* @param {?} parameter
|
|
1947
|
+
* @param {?} value
|
|
1858
1948
|
* @return {?}
|
|
1859
1949
|
*/
|
|
1860
|
-
function () {
|
|
1861
|
-
return
|
|
1950
|
+
function (parameter, value) {
|
|
1951
|
+
return new ParameterSnapshot(this.placeDefinition, this.resolved.map((/**
|
|
1952
|
+
* @param {?} p
|
|
1953
|
+
* @return {?}
|
|
1954
|
+
*/
|
|
1955
|
+
function (p) {
|
|
1956
|
+
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
1957
|
+
})));
|
|
1958
|
+
};
|
|
1959
|
+
/**
|
|
1960
|
+
* @param {?} url
|
|
1961
|
+
* @return {?}
|
|
1962
|
+
*/
|
|
1963
|
+
ParameterSnapshot.prototype.updateUrl = /**
|
|
1964
|
+
* @param {?} url
|
|
1965
|
+
* @return {?}
|
|
1966
|
+
*/
|
|
1967
|
+
function (url) {
|
|
1968
|
+
return url;
|
|
1862
1969
|
};
|
|
1970
|
+
var _a;
|
|
1863
1971
|
__decorate([
|
|
1864
|
-
|
|
1972
|
+
Memoize(),
|
|
1865
1973
|
__metadata("design:type", Function),
|
|
1866
|
-
__metadata("design:paramtypes", []),
|
|
1867
|
-
__metadata("design:returntype",
|
|
1868
|
-
],
|
|
1974
|
+
__metadata("design:paramtypes", [Object]),
|
|
1975
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedParameter)
|
|
1976
|
+
], ParameterSnapshot.prototype, "getResolvedParameter", null);
|
|
1869
1977
|
__decorate([
|
|
1870
|
-
|
|
1978
|
+
Memoize(),
|
|
1979
|
+
__metadata("design:type", Function),
|
|
1980
|
+
__metadata("design:paramtypes", [Object]),
|
|
1981
|
+
__metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
|
|
1982
|
+
], ParameterSnapshot.prototype, "getResolvedParameterValue", null);
|
|
1983
|
+
__decorate([
|
|
1984
|
+
Memoize(),
|
|
1985
|
+
__metadata("design:type", Function),
|
|
1986
|
+
__metadata("design:paramtypes", [String]),
|
|
1987
|
+
__metadata("design:returntype", Object)
|
|
1988
|
+
], ParameterSnapshot.prototype, "getRouteParameter", null);
|
|
1989
|
+
__decorate([
|
|
1990
|
+
Memoize(),
|
|
1871
1991
|
__metadata("design:type", Function),
|
|
1872
1992
|
__metadata("design:paramtypes", []),
|
|
1873
|
-
__metadata("design:returntype",
|
|
1874
|
-
],
|
|
1875
|
-
return
|
|
1993
|
+
__metadata("design:returntype", ParameterSnapshot.ResolvedValueParameter)
|
|
1994
|
+
], ParameterSnapshot.prototype, "getResolvedRouteId", null);
|
|
1995
|
+
return ParameterSnapshot;
|
|
1876
1996
|
}());
|
|
1877
1997
|
if (false) {
|
|
1878
1998
|
/** @type {?} */
|
|
1879
|
-
|
|
1999
|
+
ParameterSnapshot.prototype.placeDefinition;
|
|
2000
|
+
/**
|
|
2001
|
+
* @type {?}
|
|
2002
|
+
* @private
|
|
2003
|
+
*/
|
|
2004
|
+
ParameterSnapshot.prototype.resolved;
|
|
1880
2005
|
}
|
|
2006
|
+
(function (ParameterSnapshot) {
|
|
2007
|
+
/**
|
|
2008
|
+
* @param {?} placeDef
|
|
2009
|
+
* @param {?} paramMap
|
|
2010
|
+
* @return {?}
|
|
2011
|
+
*/
|
|
2012
|
+
function create(placeDef, paramMap) {
|
|
2013
|
+
/** @type {?} */
|
|
2014
|
+
var resolvedParameters = placeDef.getRouteParameters()
|
|
2015
|
+
.map((/**
|
|
2016
|
+
* @param {?} def
|
|
2017
|
+
* @return {?}
|
|
2018
|
+
*/
|
|
2019
|
+
function (def) {
|
|
2020
|
+
if (def.isArray) {
|
|
2021
|
+
/** @type {?} */
|
|
2022
|
+
var value = paramMap.has(def.name) ? paramMap.getAll(def.name).map((/**
|
|
2023
|
+
* @param {?} raw
|
|
2024
|
+
* @return {?}
|
|
2025
|
+
*/
|
|
2026
|
+
function (raw) { return def.type.parse(raw); })) : null;
|
|
2027
|
+
return new ResolvedArrayParameter(def, value);
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
/** @type {?} */
|
|
2031
|
+
var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
2032
|
+
return new ResolvedValueParameter(def, value);
|
|
2033
|
+
}
|
|
2034
|
+
}));
|
|
2035
|
+
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
2036
|
+
}
|
|
2037
|
+
ParameterSnapshot.create = create;
|
|
2038
|
+
/**
|
|
2039
|
+
* @abstract
|
|
2040
|
+
* @template T, S
|
|
2041
|
+
*/
|
|
2042
|
+
var /**
|
|
2043
|
+
* @abstract
|
|
2044
|
+
* @template T, S
|
|
2045
|
+
*/
|
|
2046
|
+
ResolvedParameter = /** @class */ (function () {
|
|
2047
|
+
function ResolvedParameter(parameterDef, value) {
|
|
2048
|
+
this.parameterDef = parameterDef;
|
|
2049
|
+
this.value = value;
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* @return {?}
|
|
2053
|
+
*/
|
|
2054
|
+
ResolvedParameter.prototype.isRouteId = /**
|
|
2055
|
+
* @return {?}
|
|
2056
|
+
*/
|
|
2057
|
+
function () {
|
|
2058
|
+
return this.parameterDef.isRouteId;
|
|
2059
|
+
};
|
|
2060
|
+
return ResolvedParameter;
|
|
2061
|
+
}());
|
|
2062
|
+
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
2063
|
+
if (false) {
|
|
2064
|
+
/** @type {?} */
|
|
2065
|
+
ResolvedParameter.prototype.parameterDef;
|
|
2066
|
+
/** @type {?} */
|
|
2067
|
+
ResolvedParameter.prototype.value;
|
|
2068
|
+
/**
|
|
2069
|
+
* @abstract
|
|
2070
|
+
* @param {?} dest
|
|
2071
|
+
* @return {?}
|
|
2072
|
+
*/
|
|
2073
|
+
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
2074
|
+
/**
|
|
2075
|
+
* @abstract
|
|
2076
|
+
* @param {?} otherValue
|
|
2077
|
+
* @return {?}
|
|
2078
|
+
*/
|
|
2079
|
+
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
2080
|
+
/**
|
|
2081
|
+
* @abstract
|
|
2082
|
+
* @return {?}
|
|
2083
|
+
*/
|
|
2084
|
+
ResolvedParameter.prototype.formattedValue = function () { };
|
|
2085
|
+
/**
|
|
2086
|
+
* @abstract
|
|
2087
|
+
* @param {?} value
|
|
2088
|
+
* @return {?}
|
|
2089
|
+
*/
|
|
2090
|
+
ResolvedParameter.prototype.replace = function (value) { };
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* @template T
|
|
2094
|
+
*/
|
|
2095
|
+
var ResolvedValueParameter = /** @class */ (function (_super) {
|
|
2096
|
+
__extends(ResolvedValueParameter, _super);
|
|
2097
|
+
function ResolvedValueParameter() {
|
|
2098
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* @param {?} otherValue
|
|
2102
|
+
* @return {?}
|
|
2103
|
+
*/
|
|
2104
|
+
ResolvedValueParameter.prototype.isSame = /**
|
|
2105
|
+
* @param {?} otherValue
|
|
2106
|
+
* @return {?}
|
|
2107
|
+
*/
|
|
2108
|
+
function (otherValue) {
|
|
2109
|
+
return this.value === otherValue;
|
|
2110
|
+
};
|
|
2111
|
+
/**
|
|
2112
|
+
* @param {?} dest
|
|
2113
|
+
* @return {?}
|
|
2114
|
+
*/
|
|
2115
|
+
ResolvedValueParameter.prototype.injectRouteParam = /**
|
|
2116
|
+
* @param {?} dest
|
|
2117
|
+
* @return {?}
|
|
2118
|
+
*/
|
|
2119
|
+
function (dest) {
|
|
2120
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
2121
|
+
};
|
|
2122
|
+
/**
|
|
2123
|
+
* @param {?} value
|
|
2124
|
+
* @return {?}
|
|
2125
|
+
*/
|
|
2126
|
+
ResolvedValueParameter.prototype.replace = /**
|
|
2127
|
+
* @param {?} value
|
|
2128
|
+
* @return {?}
|
|
2129
|
+
*/
|
|
2130
|
+
function (value) {
|
|
2131
|
+
return new ResolvedValueParameter(this.parameterDef, value);
|
|
2132
|
+
};
|
|
2133
|
+
/**
|
|
2134
|
+
* @return {?}
|
|
2135
|
+
*/
|
|
2136
|
+
ResolvedValueParameter.prototype.formattedValue = /**
|
|
2137
|
+
* @return {?}
|
|
2138
|
+
*/
|
|
2139
|
+
function () {
|
|
2140
|
+
return !isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
2141
|
+
};
|
|
2142
|
+
__decorate([
|
|
2143
|
+
Trace(),
|
|
2144
|
+
__metadata("design:type", Function),
|
|
2145
|
+
__metadata("design:paramtypes", [Object]),
|
|
2146
|
+
__metadata("design:returntype", Boolean)
|
|
2147
|
+
], ResolvedValueParameter.prototype, "isSame", null);
|
|
2148
|
+
return ResolvedValueParameter;
|
|
2149
|
+
}(ResolvedParameter));
|
|
2150
|
+
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
2151
|
+
/**
|
|
2152
|
+
* @template T
|
|
2153
|
+
*/
|
|
2154
|
+
var ResolvedArrayParameter = /** @class */ (function (_super) {
|
|
2155
|
+
__extends(ResolvedArrayParameter, _super);
|
|
2156
|
+
function ResolvedArrayParameter() {
|
|
2157
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2158
|
+
}
|
|
2159
|
+
/**
|
|
2160
|
+
* @param {?} otherValue
|
|
2161
|
+
* @return {?}
|
|
2162
|
+
*/
|
|
2163
|
+
ResolvedArrayParameter.prototype.isSame = /**
|
|
2164
|
+
* @param {?} otherValue
|
|
2165
|
+
* @return {?}
|
|
2166
|
+
*/
|
|
2167
|
+
function (otherValue) {
|
|
2168
|
+
return isEqual(this.value, otherValue);
|
|
2169
|
+
};
|
|
2170
|
+
/**
|
|
2171
|
+
* @param {?} dest
|
|
2172
|
+
* @return {?}
|
|
2173
|
+
*/
|
|
2174
|
+
ResolvedArrayParameter.prototype.injectRouteParam = /**
|
|
2175
|
+
* @param {?} dest
|
|
2176
|
+
* @return {?}
|
|
2177
|
+
*/
|
|
2178
|
+
function (dest) {
|
|
2179
|
+
var _this = this;
|
|
2180
|
+
dest[this.parameterDef.name] = this.value.map((/**
|
|
2181
|
+
* @param {?} v
|
|
2182
|
+
* @return {?}
|
|
2183
|
+
*/
|
|
2184
|
+
function (v) { return _this.parameterDef.type.format(v); }));
|
|
2185
|
+
};
|
|
2186
|
+
/**
|
|
2187
|
+
* @param {?} value
|
|
2188
|
+
* @return {?}
|
|
2189
|
+
*/
|
|
2190
|
+
ResolvedArrayParameter.prototype.replace = /**
|
|
2191
|
+
* @param {?} value
|
|
2192
|
+
* @return {?}
|
|
2193
|
+
*/
|
|
2194
|
+
function (value) {
|
|
2195
|
+
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
2196
|
+
};
|
|
2197
|
+
/**
|
|
2198
|
+
* @return {?}
|
|
2199
|
+
*/
|
|
2200
|
+
ResolvedArrayParameter.prototype.formattedValue = /**
|
|
2201
|
+
* @return {?}
|
|
2202
|
+
*/
|
|
2203
|
+
function () {
|
|
2204
|
+
var _this = this;
|
|
2205
|
+
return this.value ? this.value.map((/**
|
|
2206
|
+
* @param {?} v
|
|
2207
|
+
* @return {?}
|
|
2208
|
+
*/
|
|
2209
|
+
function (v) { return _this.parameterDef.type.format(v); })) : [];
|
|
2210
|
+
};
|
|
2211
|
+
__decorate([
|
|
2212
|
+
Trace(),
|
|
2213
|
+
__metadata("design:type", Function),
|
|
2214
|
+
__metadata("design:paramtypes", [Array]),
|
|
2215
|
+
__metadata("design:returntype", Boolean)
|
|
2216
|
+
], ResolvedArrayParameter.prototype, "isSame", null);
|
|
2217
|
+
return ResolvedArrayParameter;
|
|
2218
|
+
}(ResolvedParameter));
|
|
2219
|
+
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
2220
|
+
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
1881
2221
|
|
|
1882
2222
|
/**
|
|
1883
2223
|
* @fileoverview added by tsickle
|
|
1884
2224
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1885
2225
|
*/
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
2226
|
+
// RAKE: making this Symbol(...) broke things.
|
|
2227
|
+
/** @type {?} */
|
|
2228
|
+
var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
2229
|
+
// this one seems ok.
|
|
2230
|
+
/** @type {?} */
|
|
2231
|
+
var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
2232
|
+
var PlaceComponent = /** @class */ (function (_super) {
|
|
2233
|
+
__extends(PlaceComponent, _super);
|
|
2234
|
+
function PlaceComponent(activatedRoute, placeService) {
|
|
1889
2235
|
var _this = _super.call(this) || this;
|
|
1890
|
-
_this.
|
|
2236
|
+
_this.activatedRoute = activatedRoute;
|
|
1891
2237
|
_this._incomingRouteChange = new MutableValueModel(false);
|
|
1892
2238
|
_this.resolvedParameters = new MutableValueModel();
|
|
1893
|
-
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe;
|
|
1894
|
-
_this.
|
|
1895
|
-
|
|
1896
|
-
/** @type {?} */
|
|
1897
|
-
var routeParameterDefs = Klass.get(component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
|
|
1898
|
-
routeParameterDefs.forEach((/**
|
|
1899
|
-
* @param {?} parameter
|
|
2239
|
+
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2240
|
+
_this.placeDefinition.getRouteParameters().forEach((/**
|
|
2241
|
+
* @param {?} p
|
|
1900
2242
|
* @return {?}
|
|
1901
2243
|
*/
|
|
1902
|
-
function (
|
|
1903
|
-
|
|
1904
|
-
var incomingResolvedRouteParameters = observe.valuesFrom(component.activatedRoute.paramMap)
|
|
2244
|
+
function (p) { return _this.installBinding(p); }));
|
|
2245
|
+
observe.valuesFrom(activatedRoute.paramMap)
|
|
1905
2246
|
.last()
|
|
1906
2247
|
.map((/**
|
|
1907
2248
|
* @param {?} params
|
|
1908
2249
|
* @return {?}
|
|
1909
2250
|
*/
|
|
1910
|
-
function (params) {
|
|
1911
|
-
/**
|
|
1912
|
-
var result = [];
|
|
1913
|
-
routeParameterDefs.forEach((/**
|
|
1914
|
-
* @param {?} parameterDef
|
|
1915
|
-
* @return {?}
|
|
1916
|
-
*/
|
|
1917
|
-
function (parameterDef) {
|
|
1918
|
-
/** @type {?} */
|
|
1919
|
-
var resolvedValue;
|
|
1920
|
-
if (parameterDef.isArray) {
|
|
1921
|
-
resolvedValue = params.getAll(parameterDef.name).map((/**
|
|
1922
|
-
* @param {?} v
|
|
1923
|
-
* @return {?}
|
|
1924
|
-
*/
|
|
1925
|
-
function (v) { return parameterDef.type.parse(v); }));
|
|
1926
|
-
}
|
|
1927
|
-
else {
|
|
1928
|
-
resolvedValue = parameterDef.type.parse(params.get(parameterDef.name));
|
|
1929
|
-
}
|
|
1930
|
-
result.push({ parameterDef: parameterDef, resolvedValue: resolvedValue });
|
|
1931
|
-
}));
|
|
1932
|
-
return new ResolvedRouteParameterSnapshot(result);
|
|
1933
|
-
}));
|
|
1934
|
-
incomingResolvedRouteParameters.subscribe((/**
|
|
2251
|
+
function (params) { return ParameterSnapshot.create(_this.placeDefinition, params); }))
|
|
2252
|
+
.subscribe((/**
|
|
1935
2253
|
* @param {?} resolvedParameters
|
|
1936
2254
|
* @return {?}
|
|
1937
2255
|
*/
|
|
@@ -1947,17 +2265,15 @@ var RouteParameterBindings = /** @class */ (function (_super) {
|
|
|
1947
2265
|
*/
|
|
1948
2266
|
function (params, previous) {
|
|
1949
2267
|
placeService.notifyRouteParametersChanged({
|
|
1950
|
-
|
|
2268
|
+
activatedRoute: _this.activatedRoute,
|
|
1951
2269
|
next: params,
|
|
1952
2270
|
previous: previous,
|
|
1953
2271
|
updateRoute: !_this.incomingRouteChange.value // we update the route if it's a component triggered change.
|
|
1954
2272
|
});
|
|
1955
2273
|
}));
|
|
1956
|
-
_this.txo.observe('incomingResolvedRouteParameters', incomingResolvedRouteParameters);
|
|
1957
|
-
_this.txo.observe('this.routeIsChanging', _this.incomingRouteChange);
|
|
1958
2274
|
return _this;
|
|
1959
2275
|
}
|
|
1960
|
-
Object.defineProperty(
|
|
2276
|
+
Object.defineProperty(PlaceComponent.prototype, "incomingRouteChange", {
|
|
1961
2277
|
get: /**
|
|
1962
2278
|
* @return {?}
|
|
1963
2279
|
*/
|
|
@@ -1968,28 +2284,28 @@ var RouteParameterBindings = /** @class */ (function (_super) {
|
|
|
1968
2284
|
configurable: true
|
|
1969
2285
|
});
|
|
1970
2286
|
/**
|
|
1971
|
-
* @
|
|
1972
|
-
* @template T
|
|
1973
|
-
* @param {?}
|
|
2287
|
+
* @private
|
|
2288
|
+
* @template T, S
|
|
2289
|
+
* @param {?} parameterDef
|
|
1974
2290
|
* @return {?}
|
|
1975
2291
|
*/
|
|
1976
|
-
|
|
1977
|
-
* @
|
|
1978
|
-
* @template T
|
|
1979
|
-
* @param {?}
|
|
2292
|
+
PlaceComponent.prototype.installBinding = /**
|
|
2293
|
+
* @private
|
|
2294
|
+
* @template T, S
|
|
2295
|
+
* @param {?} parameterDef
|
|
1980
2296
|
* @return {?}
|
|
1981
2297
|
*/
|
|
1982
|
-
function (
|
|
2298
|
+
function (parameterDef) {
|
|
1983
2299
|
/** @type {?} */
|
|
1984
|
-
var model = this.
|
|
1985
|
-
// this.txo.observe(
|
|
2300
|
+
var model = (/** @type {?} */ (this[parameterDef.propertyName]));
|
|
2301
|
+
// this.txo.observe(parameterDef.propertyName, model);
|
|
1986
2302
|
this.registerDisposable(new Binding(this.resolvedParameters, model, {
|
|
1987
2303
|
toRight: /**
|
|
1988
2304
|
* @param {?} parameters
|
|
1989
2305
|
* @return {?}
|
|
1990
2306
|
*/
|
|
1991
2307
|
function (parameters) {
|
|
1992
|
-
return parameters.
|
|
2308
|
+
return parameters.getResolvedParameterValue(parameterDef);
|
|
1993
2309
|
},
|
|
1994
2310
|
toLeft: /**
|
|
1995
2311
|
* @param {?} value
|
|
@@ -1997,66 +2313,11 @@ var RouteParameterBindings = /** @class */ (function (_super) {
|
|
|
1997
2313
|
* @return {?}
|
|
1998
2314
|
*/
|
|
1999
2315
|
function (value, currentParameters) {
|
|
2000
|
-
return currentParameters.replace(
|
|
2316
|
+
return currentParameters.replace(parameterDef, value);
|
|
2001
2317
|
}
|
|
2002
2318
|
}));
|
|
2003
2319
|
};
|
|
2004
|
-
|
|
2005
|
-
* @private
|
|
2006
|
-
* @template T
|
|
2007
|
-
* @param {?} parameter
|
|
2008
|
-
* @return {?}
|
|
2009
|
-
*/
|
|
2010
|
-
RouteParameterBindings.prototype.getModelFor = /**
|
|
2011
|
-
* @private
|
|
2012
|
-
* @template T
|
|
2013
|
-
* @param {?} parameter
|
|
2014
|
-
* @return {?}
|
|
2015
|
-
*/
|
|
2016
|
-
function (parameter) {
|
|
2017
|
-
return this.component[parameter.propertyName];
|
|
2018
|
-
};
|
|
2019
|
-
return RouteParameterBindings;
|
|
2020
|
-
}(GarbageCollector));
|
|
2021
|
-
if (false) {
|
|
2022
|
-
/** @type {?} */
|
|
2023
|
-
RouteParameterBindings.prototype._incomingRouteChange;
|
|
2024
|
-
/**
|
|
2025
|
-
* @type {?}
|
|
2026
|
-
* @private
|
|
2027
|
-
*/
|
|
2028
|
-
RouteParameterBindings.prototype.txo;
|
|
2029
|
-
/**
|
|
2030
|
-
* @type {?}
|
|
2031
|
-
* @private
|
|
2032
|
-
*/
|
|
2033
|
-
RouteParameterBindings.prototype.resolvedParameters;
|
|
2034
|
-
/**
|
|
2035
|
-
* @type {?}
|
|
2036
|
-
* @private
|
|
2037
|
-
*/
|
|
2038
|
-
RouteParameterBindings.prototype.component;
|
|
2039
|
-
}
|
|
2040
|
-
(function (RouteParameterBindings) {
|
|
2041
|
-
RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
2042
|
-
})(RouteParameterBindings || (RouteParameterBindings = {}));
|
|
2043
|
-
|
|
2044
|
-
/**
|
|
2045
|
-
* @fileoverview added by tsickle
|
|
2046
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2047
|
-
*/
|
|
2048
|
-
// RAKE: making this Symbol(...) broke things.
|
|
2049
|
-
/** @type {?} */
|
|
2050
|
-
var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
2051
|
-
var PlaceComponent = /** @class */ (function (_super) {
|
|
2052
|
-
__extends(PlaceComponent, _super);
|
|
2053
|
-
function PlaceComponent(activatedRoute, placeService) {
|
|
2054
|
-
var _this = _super.call(this) || this;
|
|
2055
|
-
_this.activatedRoute = activatedRoute;
|
|
2056
|
-
_this.routeBindingMediator = _this.registerDisposable(new RouteParameterBindings(_this, placeService));
|
|
2057
|
-
return _this;
|
|
2058
|
-
}
|
|
2059
|
-
Object.defineProperty(PlaceComponent.prototype, "placeConfig", {
|
|
2320
|
+
Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
|
|
2060
2321
|
get: /**
|
|
2061
2322
|
* @return {?}
|
|
2062
2323
|
*/
|
|
@@ -2075,33 +2336,33 @@ var PlaceComponent = /** @class */ (function (_super) {
|
|
|
2075
2336
|
function () {
|
|
2076
2337
|
return true;
|
|
2077
2338
|
};
|
|
2339
|
+
// @Trace()
|
|
2340
|
+
// @Trace()
|
|
2078
2341
|
/**
|
|
2079
2342
|
* @return {?}
|
|
2080
2343
|
*/
|
|
2081
|
-
PlaceComponent.prototype.onPlaceReady =
|
|
2344
|
+
PlaceComponent.prototype.onPlaceReady =
|
|
2345
|
+
// @Trace()
|
|
2346
|
+
/**
|
|
2082
2347
|
* @return {?}
|
|
2083
2348
|
*/
|
|
2084
2349
|
function () {
|
|
2085
2350
|
};
|
|
2086
2351
|
__decorate([
|
|
2087
|
-
Memoize(),
|
|
2352
|
+
Memoize$1(),
|
|
2088
2353
|
__metadata("design:type", PlaceComponent.Definition),
|
|
2089
2354
|
__metadata("design:paramtypes", [])
|
|
2090
|
-
], PlaceComponent.prototype, "
|
|
2091
|
-
__decorate([
|
|
2092
|
-
Trace(),
|
|
2093
|
-
__metadata("design:type", Function),
|
|
2094
|
-
__metadata("design:paramtypes", []),
|
|
2095
|
-
__metadata("design:returntype", void 0)
|
|
2096
|
-
], PlaceComponent.prototype, "onPlaceReady", null);
|
|
2355
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
2097
2356
|
return PlaceComponent;
|
|
2098
2357
|
}(DisposableComponent));
|
|
2099
2358
|
if (false) {
|
|
2359
|
+
/** @type {?} */
|
|
2360
|
+
PlaceComponent.prototype._incomingRouteChange;
|
|
2100
2361
|
/**
|
|
2101
2362
|
* @type {?}
|
|
2102
2363
|
* @private
|
|
2103
2364
|
*/
|
|
2104
|
-
PlaceComponent.prototype.
|
|
2365
|
+
PlaceComponent.prototype.resolvedParameters;
|
|
2105
2366
|
/** @type {?} */
|
|
2106
2367
|
PlaceComponent.prototype.activatedRoute;
|
|
2107
2368
|
}
|
|
@@ -2114,17 +2375,31 @@ if (false) {
|
|
|
2114
2375
|
this.order = options.order;
|
|
2115
2376
|
this.data = options.data;
|
|
2116
2377
|
this.authenticate = isNil(options.authenticate) || options.authenticate;
|
|
2378
|
+
this.children = (options.children || []).map((/**
|
|
2379
|
+
* @param {?} c
|
|
2380
|
+
* @return {?}
|
|
2381
|
+
*/
|
|
2382
|
+
function (c) { return PlaceComponent.getDefinition(c).component; }));
|
|
2117
2383
|
}
|
|
2118
2384
|
/**
|
|
2119
|
-
* @
|
|
2385
|
+
* @return {?}
|
|
2386
|
+
*/
|
|
2387
|
+
Definition.prototype.getRouteParameters = /**
|
|
2388
|
+
* @return {?}
|
|
2389
|
+
*/
|
|
2390
|
+
function () {
|
|
2391
|
+
return Klass.get(this.component).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
2392
|
+
};
|
|
2393
|
+
/**
|
|
2394
|
+
* @param {?} constructable
|
|
2120
2395
|
* @return {?}
|
|
2121
2396
|
*/
|
|
2122
2397
|
Definition.prototype.isDescriptorForType = /**
|
|
2123
|
-
* @param {?}
|
|
2398
|
+
* @param {?} constructable
|
|
2124
2399
|
* @return {?}
|
|
2125
2400
|
*/
|
|
2126
|
-
function (
|
|
2127
|
-
return lang.constructorChain(
|
|
2401
|
+
function (constructable) {
|
|
2402
|
+
return lang.constructorChain(constructable).includes(PlaceComponent);
|
|
2128
2403
|
};
|
|
2129
2404
|
/**
|
|
2130
2405
|
* @param {?} placeComponent
|
|
@@ -2181,6 +2456,12 @@ if (false) {
|
|
|
2181
2456
|
return defaultValue;
|
|
2182
2457
|
}
|
|
2183
2458
|
};
|
|
2459
|
+
__decorate([
|
|
2460
|
+
Memoize$1(),
|
|
2461
|
+
__metadata("design:type", Function),
|
|
2462
|
+
__metadata("design:paramtypes", []),
|
|
2463
|
+
__metadata("design:returntype", Array)
|
|
2464
|
+
], Definition.prototype, "getRouteParameters", null);
|
|
2184
2465
|
return Definition;
|
|
2185
2466
|
}());
|
|
2186
2467
|
PlaceComponent.Definition = Definition;
|
|
@@ -2194,6 +2475,8 @@ if (false) {
|
|
|
2194
2475
|
/** @type {?} */
|
|
2195
2476
|
Definition.prototype.data;
|
|
2196
2477
|
/** @type {?} */
|
|
2478
|
+
Definition.prototype.children;
|
|
2479
|
+
/** @type {?} */
|
|
2197
2480
|
Definition.prototype.component;
|
|
2198
2481
|
}
|
|
2199
2482
|
/**
|
|
@@ -2210,15 +2493,24 @@ if (false) {
|
|
|
2210
2493
|
Options.prototype.data;
|
|
2211
2494
|
/** @type {?|undefined} */
|
|
2212
2495
|
Options.prototype.authenticate;
|
|
2496
|
+
/** @type {?|undefined} */
|
|
2497
|
+
Options.prototype.children;
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* @record
|
|
2501
|
+
*/
|
|
2502
|
+
function ChildOptions() { }
|
|
2503
|
+
PlaceComponent.ChildOptions = ChildOptions;
|
|
2504
|
+
if (false) {
|
|
2505
|
+
/** @type {?} */
|
|
2506
|
+
ChildOptions.prototype.parent;
|
|
2213
2507
|
}
|
|
2214
2508
|
/**
|
|
2215
2509
|
* @param {?} klass
|
|
2216
2510
|
* @return {?}
|
|
2217
2511
|
*/
|
|
2218
2512
|
function getDefinition(klass) {
|
|
2219
|
-
|
|
2220
|
-
var placeOptions = Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
2221
|
-
return new Definition(klass, placeOptions);
|
|
2513
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
2222
2514
|
}
|
|
2223
2515
|
PlaceComponent.getDefinition = getDefinition;
|
|
2224
2516
|
/**
|
|
@@ -2227,20 +2519,157 @@ if (false) {
|
|
|
2227
2519
|
* @return {?}
|
|
2228
2520
|
*/
|
|
2229
2521
|
function injectDefinition(klass, options) {
|
|
2230
|
-
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, options, klass);
|
|
2522
|
+
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, new Definition(klass, options), klass);
|
|
2231
2523
|
}
|
|
2232
2524
|
PlaceComponent.injectDefinition = injectDefinition;
|
|
2233
2525
|
})(PlaceComponent || (PlaceComponent = {}));
|
|
2234
2526
|
|
|
2527
|
+
/**
|
|
2528
|
+
* @fileoverview added by tsickle
|
|
2529
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2530
|
+
*/
|
|
2531
|
+
var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
2532
|
+
__extends(AbstractPlaceNavigationComponent, _super);
|
|
2533
|
+
function AbstractPlaceNavigationComponent() {
|
|
2534
|
+
var _this = _super.call(this) || this;
|
|
2535
|
+
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2536
|
+
_this.placeDefinitions = chain(_this.placesModel).map((/**
|
|
2537
|
+
* @param {?} c
|
|
2538
|
+
* @return {?}
|
|
2539
|
+
*/
|
|
2540
|
+
function (c) { return PlaceComponent.getDefinition(c); }));
|
|
2541
|
+
return _this;
|
|
2542
|
+
}
|
|
2543
|
+
/**
|
|
2544
|
+
* @param {?} placeDef
|
|
2545
|
+
* @return {?}
|
|
2546
|
+
*/
|
|
2547
|
+
AbstractPlaceNavigationComponent.prototype.getNav = /**
|
|
2548
|
+
* @param {?} placeDef
|
|
2549
|
+
* @return {?}
|
|
2550
|
+
*/
|
|
2551
|
+
function (placeDef) {
|
|
2552
|
+
/** @type {?} */
|
|
2553
|
+
var navItem = (/** @type {?} */ (placeDef.getData('nav')));
|
|
2554
|
+
return {
|
|
2555
|
+
title: (/**
|
|
2556
|
+
* @return {?}
|
|
2557
|
+
*/
|
|
2558
|
+
function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
|
|
2559
|
+
tooltip: (/**
|
|
2560
|
+
* @return {?}
|
|
2561
|
+
*/
|
|
2562
|
+
function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
|
|
2563
|
+
icon: (/**
|
|
2564
|
+
* @return {?}
|
|
2565
|
+
*/
|
|
2566
|
+
function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
|
|
2567
|
+
};
|
|
2568
|
+
};
|
|
2569
|
+
/**
|
|
2570
|
+
* @return {?}
|
|
2571
|
+
*/
|
|
2572
|
+
AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
2573
|
+
* @return {?}
|
|
2574
|
+
*/
|
|
2575
|
+
function () {
|
|
2576
|
+
};
|
|
2577
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
2578
|
+
places: [{ type: Input }],
|
|
2579
|
+
placesModel: [{ type: Input }]
|
|
2580
|
+
};
|
|
2581
|
+
__decorate([
|
|
2582
|
+
StoreInListModel('placesModel'),
|
|
2583
|
+
__metadata("design:type", Array)
|
|
2584
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
2585
|
+
__decorate([
|
|
2586
|
+
UseDelegate(),
|
|
2587
|
+
__metadata("design:type", ListModel)
|
|
2588
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2589
|
+
__decorate([
|
|
2590
|
+
Memoize(),
|
|
2591
|
+
__metadata("design:type", Function),
|
|
2592
|
+
__metadata("design:paramtypes", [PlaceComponent.Definition]),
|
|
2593
|
+
__metadata("design:returntype", Object)
|
|
2594
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
2595
|
+
return AbstractPlaceNavigationComponent;
|
|
2596
|
+
}(DisposableComponent));
|
|
2597
|
+
if (false) {
|
|
2598
|
+
/** @type {?} */
|
|
2599
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
2600
|
+
/** @type {?} */
|
|
2601
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
2602
|
+
/** @type {?} */
|
|
2603
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
/**
|
|
2607
|
+
* @fileoverview added by tsickle
|
|
2608
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2609
|
+
*/
|
|
2610
|
+
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
2611
|
+
__extends(ListPlaceNavComponent, _super);
|
|
2612
|
+
function ListPlaceNavComponent() {
|
|
2613
|
+
var _this = _super.call(this) || this;
|
|
2614
|
+
_this.expanded = true;
|
|
2615
|
+
return _this;
|
|
2616
|
+
}
|
|
2617
|
+
/**
|
|
2618
|
+
* @return {?}
|
|
2619
|
+
*/
|
|
2620
|
+
ListPlaceNavComponent.prototype.expandMenu = /**
|
|
2621
|
+
* @return {?}
|
|
2622
|
+
*/
|
|
2623
|
+
function () {
|
|
2624
|
+
this.expanded = true;
|
|
2625
|
+
};
|
|
2626
|
+
/**
|
|
2627
|
+
* @return {?}
|
|
2628
|
+
*/
|
|
2629
|
+
ListPlaceNavComponent.prototype.collapseMenu = /**
|
|
2630
|
+
* @return {?}
|
|
2631
|
+
*/
|
|
2632
|
+
function () {
|
|
2633
|
+
this.expanded = false;
|
|
2634
|
+
};
|
|
2635
|
+
/**
|
|
2636
|
+
* @return {?}
|
|
2637
|
+
*/
|
|
2638
|
+
ListPlaceNavComponent.prototype.toggleMenu = /**
|
|
2639
|
+
* @return {?}
|
|
2640
|
+
*/
|
|
2641
|
+
function () {
|
|
2642
|
+
this.expanded = !this.expanded;
|
|
2643
|
+
};
|
|
2644
|
+
ListPlaceNavComponent.decorators = [
|
|
2645
|
+
{ type: Component, args: [{
|
|
2646
|
+
selector: 'angular-ui-powerups-list-place-nav',
|
|
2647
|
+
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",
|
|
2648
|
+
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}"]
|
|
2649
|
+
}] }
|
|
2650
|
+
];
|
|
2651
|
+
/** @nocollapse */
|
|
2652
|
+
ListPlaceNavComponent.ctorParameters = function () { return []; };
|
|
2653
|
+
ListPlaceNavComponent.propDecorators = {
|
|
2654
|
+
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
2655
|
+
};
|
|
2656
|
+
return ListPlaceNavComponent;
|
|
2657
|
+
}(AbstractPlaceNavigationComponent));
|
|
2658
|
+
if (false) {
|
|
2659
|
+
/** @type {?} */
|
|
2660
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2235
2663
|
/**
|
|
2236
2664
|
* @fileoverview added by tsickle
|
|
2237
2665
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2238
2666
|
*/
|
|
2239
2667
|
var PlaceService = /** @class */ (function (_super) {
|
|
2240
2668
|
__extends(PlaceService, _super);
|
|
2241
|
-
function PlaceService(router) {
|
|
2669
|
+
function PlaceService(router, injector) {
|
|
2242
2670
|
var _this = _super.call(this) || this;
|
|
2243
2671
|
_this.router = router;
|
|
2672
|
+
_this.injector = injector;
|
|
2244
2673
|
_this._activePlaces = new MutableListModel();
|
|
2245
2674
|
return _this;
|
|
2246
2675
|
}
|
|
@@ -2254,33 +2683,45 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2254
2683
|
enumerable: true,
|
|
2255
2684
|
configurable: true
|
|
2256
2685
|
});
|
|
2686
|
+
// @Trace()
|
|
2687
|
+
// @Trace()
|
|
2257
2688
|
/**
|
|
2258
2689
|
* @param {?} place
|
|
2259
2690
|
* @return {?}
|
|
2260
2691
|
*/
|
|
2261
|
-
PlaceService.prototype.onActivate =
|
|
2692
|
+
PlaceService.prototype.onActivate =
|
|
2693
|
+
// @Trace()
|
|
2694
|
+
/**
|
|
2262
2695
|
* @param {?} place
|
|
2263
2696
|
* @return {?}
|
|
2264
2697
|
*/
|
|
2265
2698
|
function (place) {
|
|
2266
2699
|
this._activePlaces.push(place);
|
|
2267
2700
|
};
|
|
2701
|
+
// @Trace()
|
|
2702
|
+
// @Trace()
|
|
2268
2703
|
/**
|
|
2269
2704
|
* @param {?} place
|
|
2270
2705
|
* @return {?}
|
|
2271
2706
|
*/
|
|
2272
|
-
PlaceService.prototype.onDeactivate =
|
|
2707
|
+
PlaceService.prototype.onDeactivate =
|
|
2708
|
+
// @Trace()
|
|
2709
|
+
/**
|
|
2273
2710
|
* @param {?} place
|
|
2274
2711
|
* @return {?}
|
|
2275
2712
|
*/
|
|
2276
2713
|
function (place) {
|
|
2277
2714
|
this._activePlaces.remove(place);
|
|
2278
2715
|
};
|
|
2716
|
+
// @Trace()
|
|
2717
|
+
// @Trace()
|
|
2279
2718
|
/**
|
|
2280
2719
|
* @param {?} params
|
|
2281
2720
|
* @return {?}
|
|
2282
2721
|
*/
|
|
2283
|
-
PlaceService.prototype.notifyRouteParametersChanged =
|
|
2722
|
+
PlaceService.prototype.notifyRouteParametersChanged =
|
|
2723
|
+
// @Trace()
|
|
2724
|
+
/**
|
|
2284
2725
|
* @param {?} params
|
|
2285
2726
|
* @return {?}
|
|
2286
2727
|
*/
|
|
@@ -2294,10 +2735,29 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2294
2735
|
/** @type {?} */
|
|
2295
2736
|
var path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
|
|
2296
2737
|
this.router.navigate(path, {
|
|
2297
|
-
relativeTo: params.
|
|
2738
|
+
relativeTo: params.activatedRoute
|
|
2298
2739
|
});
|
|
2299
2740
|
}
|
|
2300
2741
|
};
|
|
2742
|
+
// @Trace()
|
|
2743
|
+
// @Trace()
|
|
2744
|
+
/**
|
|
2745
|
+
* @param {?} snapshot
|
|
2746
|
+
* @return {?}
|
|
2747
|
+
*/
|
|
2748
|
+
PlaceService.prototype.sanitise =
|
|
2749
|
+
// @Trace()
|
|
2750
|
+
/**
|
|
2751
|
+
* @param {?} snapshot
|
|
2752
|
+
* @return {?}
|
|
2753
|
+
*/
|
|
2754
|
+
function (snapshot) {
|
|
2755
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2756
|
+
return __generator(this, function (_a) {
|
|
2757
|
+
return [2 /*return*/, snapshot];
|
|
2758
|
+
});
|
|
2759
|
+
});
|
|
2760
|
+
};
|
|
2301
2761
|
PlaceService.decorators = [
|
|
2302
2762
|
{ type: Injectable, args: [{
|
|
2303
2763
|
providedIn: 'root'
|
|
@@ -2305,27 +2765,10 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2305
2765
|
];
|
|
2306
2766
|
/** @nocollapse */
|
|
2307
2767
|
PlaceService.ctorParameters = function () { return [
|
|
2308
|
-
{ type: Router }
|
|
2768
|
+
{ type: Router },
|
|
2769
|
+
{ type: Injector }
|
|
2309
2770
|
]; };
|
|
2310
|
-
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router)); }, token: PlaceService, providedIn: "root" });
|
|
2311
|
-
__decorate([
|
|
2312
|
-
Trace(),
|
|
2313
|
-
__metadata("design:type", Function),
|
|
2314
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
2315
|
-
__metadata("design:returntype", void 0)
|
|
2316
|
-
], PlaceService.prototype, "onActivate", null);
|
|
2317
|
-
__decorate([
|
|
2318
|
-
Trace(),
|
|
2319
|
-
__metadata("design:type", Function),
|
|
2320
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
2321
|
-
__metadata("design:returntype", void 0)
|
|
2322
|
-
], PlaceService.prototype, "onDeactivate", null);
|
|
2323
|
-
__decorate([
|
|
2324
|
-
Trace(),
|
|
2325
|
-
__metadata("design:type", Function),
|
|
2326
|
-
__metadata("design:paramtypes", [Object]),
|
|
2327
|
-
__metadata("design:returntype", void 0)
|
|
2328
|
-
], PlaceService.prototype, "notifyRouteParametersChanged", null);
|
|
2771
|
+
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
|
|
2329
2772
|
return PlaceService;
|
|
2330
2773
|
}(GarbageCollector));
|
|
2331
2774
|
if (false) {
|
|
@@ -2339,6 +2782,11 @@ if (false) {
|
|
|
2339
2782
|
* @protected
|
|
2340
2783
|
*/
|
|
2341
2784
|
PlaceService.prototype.router;
|
|
2785
|
+
/**
|
|
2786
|
+
* @type {?}
|
|
2787
|
+
* @protected
|
|
2788
|
+
*/
|
|
2789
|
+
PlaceService.prototype.injector;
|
|
2342
2790
|
}
|
|
2343
2791
|
|
|
2344
2792
|
/**
|
|
@@ -2381,20 +2829,66 @@ var right = [
|
|
|
2381
2829
|
})
|
|
2382
2830
|
])
|
|
2383
2831
|
];
|
|
2832
|
+
/**
|
|
2833
|
+
* @param {?} duration
|
|
2834
|
+
* @return {?}
|
|
2835
|
+
*/
|
|
2836
|
+
function leftRightPlaceAnimation(duration) {
|
|
2837
|
+
return trigger('routeAnimations', [
|
|
2838
|
+
transition(':increment', right, { params: { duration: duration } }),
|
|
2839
|
+
transition(':decrement', left, { params: { duration: duration } })
|
|
2840
|
+
]);
|
|
2841
|
+
}
|
|
2384
2842
|
/** @type {?} */
|
|
2385
|
-
var LEFT_RIGHT_PLACE_ANIMATION =
|
|
2386
|
-
transition(':increment', right, { params: { duration: '.3s' } }),
|
|
2387
|
-
transition(':decrement', left, { params: { duration: '.3s' } })
|
|
2388
|
-
]);
|
|
2843
|
+
var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
|
|
2389
2844
|
|
|
2390
2845
|
/**
|
|
2391
2846
|
* @fileoverview added by tsickle
|
|
2392
2847
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2393
2848
|
*/
|
|
2394
|
-
var PlaceOutletComponent = /** @class */ (function () {
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2849
|
+
var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
2850
|
+
__extends(PlaceOutletComponent, _super);
|
|
2851
|
+
function PlaceOutletComponent(placeService, activatedRoute) {
|
|
2852
|
+
var _this = _super.call(this) || this;
|
|
2853
|
+
_this.placeService = placeService;
|
|
2854
|
+
_this.activatedRoute = activatedRoute;
|
|
2855
|
+
_this.animate = true;
|
|
2856
|
+
_this.outletUrlSegment = new MutableListModel();
|
|
2857
|
+
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2858
|
+
_this.myPath = observe.listsFrom(activatedRoute.url).last().map((/**
|
|
2859
|
+
* @param {?} s
|
|
2860
|
+
* @return {?}
|
|
2861
|
+
*/
|
|
2862
|
+
function (s) { return s.toString(); })).reduce((/**
|
|
2863
|
+
* @param {?} bits
|
|
2864
|
+
* @return {?}
|
|
2865
|
+
*/
|
|
2866
|
+
function (bits) { return bits.join(','); }));
|
|
2867
|
+
console.log("new outlet@(" + _this.myPath.value + ")");
|
|
2868
|
+
_this.outletChildPath = chain(_this.outletUrlSegment).map((/**
|
|
2869
|
+
* @param {?} s
|
|
2870
|
+
* @return {?}
|
|
2871
|
+
*/
|
|
2872
|
+
function (s) { return s.toString(); })).reduce((/**
|
|
2873
|
+
* @param {?} bits
|
|
2874
|
+
* @return {?}
|
|
2875
|
+
*/
|
|
2876
|
+
function (bits) { return bits.join(","); }));
|
|
2877
|
+
_this.state = chain(_this.myPath).map((/**
|
|
2878
|
+
* @param {?} path
|
|
2879
|
+
* @return {?}
|
|
2880
|
+
*/
|
|
2881
|
+
function (path) {
|
|
2882
|
+
return "outlet@(" + path + "), child path->" + _this.outletChildPath.value;
|
|
2883
|
+
}), { dependsOn: _this.outletChildPath });
|
|
2884
|
+
when.valueOf(_this.state).changes((/**
|
|
2885
|
+
* @param {?} debug
|
|
2886
|
+
* @return {?}
|
|
2887
|
+
*/
|
|
2888
|
+
function (debug) {
|
|
2889
|
+
console.log("Outlet Changed -> " + debug);
|
|
2890
|
+
}));
|
|
2891
|
+
return _this;
|
|
2398
2892
|
}
|
|
2399
2893
|
/**
|
|
2400
2894
|
* @return {?}
|
|
@@ -2404,26 +2898,71 @@ var PlaceOutletComponent = /** @class */ (function () {
|
|
|
2404
2898
|
*/
|
|
2405
2899
|
function () {
|
|
2406
2900
|
};
|
|
2901
|
+
/**
|
|
2902
|
+
* @return {?}
|
|
2903
|
+
*/
|
|
2904
|
+
PlaceOutletComponent.prototype.ngAfterViewInit = /**
|
|
2905
|
+
* @return {?}
|
|
2906
|
+
*/
|
|
2907
|
+
function () {
|
|
2908
|
+
// this.routerOutLetQuery.changes.subscribe(() => {
|
|
2909
|
+
// this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2910
|
+
// });
|
|
2911
|
+
};
|
|
2912
|
+
/**
|
|
2913
|
+
* @return {?}
|
|
2914
|
+
*/
|
|
2915
|
+
PlaceOutletComponent.prototype.ngAfterViewChecked = /**
|
|
2916
|
+
* @return {?}
|
|
2917
|
+
*/
|
|
2918
|
+
function () {
|
|
2919
|
+
// console.log(`@AfterViewChecked: ${this.state.value}`);
|
|
2920
|
+
this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2921
|
+
};
|
|
2922
|
+
// @Trace()
|
|
2923
|
+
// ngOnDestroy(): void {
|
|
2924
|
+
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2925
|
+
// console.log('mySegments', this.myPath.value);
|
|
2926
|
+
// super.ngOnDestroy();
|
|
2927
|
+
// }
|
|
2928
|
+
// @Trace()
|
|
2929
|
+
// @Trace()
|
|
2930
|
+
// ngOnDestroy(): void {
|
|
2931
|
+
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2932
|
+
// console.log('mySegments', this.myPath.value);
|
|
2933
|
+
// super.ngOnDestroy();
|
|
2934
|
+
// }
|
|
2935
|
+
// @Trace()
|
|
2407
2936
|
/**
|
|
2408
2937
|
* @param {?} $event
|
|
2409
2938
|
* @return {?}
|
|
2410
2939
|
*/
|
|
2411
|
-
PlaceOutletComponent.prototype.
|
|
2940
|
+
PlaceOutletComponent.prototype.onOutletActivated =
|
|
2941
|
+
// @Trace()
|
|
2942
|
+
// ngOnDestroy(): void {
|
|
2943
|
+
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2944
|
+
// console.log('mySegments', this.myPath.value);
|
|
2945
|
+
// super.ngOnDestroy();
|
|
2946
|
+
// }
|
|
2947
|
+
// @Trace()
|
|
2948
|
+
/**
|
|
2412
2949
|
* @param {?} $event
|
|
2413
2950
|
* @return {?}
|
|
2414
2951
|
*/
|
|
2415
2952
|
function ($event) {
|
|
2953
|
+
// console.log(this.routerOutLet.activatedRoute.snapshot.url);
|
|
2416
2954
|
this.currentPlace = $event;
|
|
2417
2955
|
this.placeService.onActivate($event);
|
|
2418
2956
|
if (!this.animate) {
|
|
2419
|
-
|
|
2957
|
+
// we're not animating so trigger any post animation callbacks now.
|
|
2958
|
+
this.animationDone();
|
|
2420
2959
|
}
|
|
2421
2960
|
};
|
|
2422
2961
|
/**
|
|
2423
2962
|
* @param {?} $event
|
|
2424
2963
|
* @return {?}
|
|
2425
2964
|
*/
|
|
2426
|
-
PlaceOutletComponent.prototype.
|
|
2965
|
+
PlaceOutletComponent.prototype.onOutletDeactivated = /**
|
|
2427
2966
|
* @param {?} $event
|
|
2428
2967
|
* @return {?}
|
|
2429
2968
|
*/
|
|
@@ -2449,44 +2988,53 @@ var PlaceOutletComponent = /** @class */ (function () {
|
|
|
2449
2988
|
* @return {?}
|
|
2450
2989
|
*/
|
|
2451
2990
|
function () {
|
|
2452
|
-
this.
|
|
2991
|
+
if (this.currentPlace) {
|
|
2992
|
+
this.currentPlace.onPlaceReady();
|
|
2993
|
+
}
|
|
2453
2994
|
};
|
|
2995
|
+
// @Trace()
|
|
2996
|
+
// @Trace()
|
|
2454
2997
|
/**
|
|
2455
2998
|
* @private
|
|
2999
|
+
* @param {?} first
|
|
2456
3000
|
* @return {?}
|
|
2457
3001
|
*/
|
|
2458
|
-
PlaceOutletComponent.prototype.
|
|
3002
|
+
PlaceOutletComponent.prototype.updateRouterOutlet =
|
|
3003
|
+
// @Trace()
|
|
3004
|
+
/**
|
|
2459
3005
|
* @private
|
|
3006
|
+
* @param {?} first
|
|
2460
3007
|
* @return {?}
|
|
2461
3008
|
*/
|
|
2462
|
-
function () {
|
|
2463
|
-
if (
|
|
2464
|
-
this.
|
|
3009
|
+
function (first) {
|
|
3010
|
+
if (first.isActivated) {
|
|
3011
|
+
this.outletUrlSegment.value = first.activatedRoute.snapshot.url;
|
|
2465
3012
|
}
|
|
2466
3013
|
};
|
|
2467
3014
|
PlaceOutletComponent.decorators = [
|
|
2468
3015
|
{ type: Component, args: [{
|
|
2469
3016
|
selector: 'angular-ui-powerups-place-outlet',
|
|
2470
|
-
template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"
|
|
3017
|
+
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",
|
|
2471
3018
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
2472
3019
|
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}"]
|
|
2473
3020
|
}] }
|
|
2474
3021
|
];
|
|
2475
3022
|
/** @nocollapse */
|
|
2476
3023
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
2477
|
-
{ type: PlaceService }
|
|
3024
|
+
{ type: PlaceService },
|
|
3025
|
+
{ type: ActivatedRoute }
|
|
2478
3026
|
]; };
|
|
2479
3027
|
PlaceOutletComponent.propDecorators = {
|
|
2480
3028
|
animate: [{ type: Input }],
|
|
2481
|
-
|
|
3029
|
+
routerOutLetQuery: [{ type: ViewChildren, args: [RouterOutlet,] }]
|
|
2482
3030
|
};
|
|
2483
3031
|
return PlaceOutletComponent;
|
|
2484
|
-
}());
|
|
3032
|
+
}(DisposableComponent));
|
|
2485
3033
|
if (false) {
|
|
2486
3034
|
/** @type {?} */
|
|
2487
3035
|
PlaceOutletComponent.prototype.animate;
|
|
2488
3036
|
/** @type {?} */
|
|
2489
|
-
PlaceOutletComponent.prototype.
|
|
3037
|
+
PlaceOutletComponent.prototype.routerOutLetQuery;
|
|
2490
3038
|
/**
|
|
2491
3039
|
* @type {?}
|
|
2492
3040
|
* @private
|
|
@@ -2496,64 +3044,54 @@ if (false) {
|
|
|
2496
3044
|
* @type {?}
|
|
2497
3045
|
* @private
|
|
2498
3046
|
*/
|
|
2499
|
-
PlaceOutletComponent.prototype.
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
/**
|
|
2503
|
-
* @fileoverview added by tsickle
|
|
2504
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2505
|
-
*/
|
|
2506
|
-
var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
2507
|
-
__extends(TabbedPlaceNavigationComponent, _super);
|
|
2508
|
-
function TabbedPlaceNavigationComponent() {
|
|
2509
|
-
var _this = _super.call(this) || this;
|
|
2510
|
-
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
2511
|
-
_this.orderedPlaces = chain(_this.placesModel).map((/**
|
|
2512
|
-
* @param {?} c
|
|
2513
|
-
* @return {?}
|
|
2514
|
-
*/
|
|
2515
|
-
function (c) { return PlaceComponent.getDefinition(c); })).sortBy('order');
|
|
2516
|
-
return _this;
|
|
2517
|
-
}
|
|
3047
|
+
PlaceOutletComponent.prototype.myPath;
|
|
2518
3048
|
/**
|
|
2519
|
-
* @
|
|
3049
|
+
* @type {?}
|
|
3050
|
+
* @private
|
|
2520
3051
|
*/
|
|
2521
|
-
|
|
2522
|
-
|
|
3052
|
+
PlaceOutletComponent.prototype.outletUrlSegment;
|
|
3053
|
+
/**
|
|
3054
|
+
* @type {?}
|
|
3055
|
+
* @private
|
|
2523
3056
|
*/
|
|
2524
|
-
|
|
2525
|
-
|
|
3057
|
+
PlaceOutletComponent.prototype.outletChildPath;
|
|
3058
|
+
/**
|
|
3059
|
+
* @type {?}
|
|
3060
|
+
* @private
|
|
3061
|
+
*/
|
|
3062
|
+
PlaceOutletComponent.prototype.state;
|
|
3063
|
+
/**
|
|
3064
|
+
* @type {?}
|
|
3065
|
+
* @private
|
|
3066
|
+
*/
|
|
3067
|
+
PlaceOutletComponent.prototype.placeService;
|
|
3068
|
+
/**
|
|
3069
|
+
* @type {?}
|
|
3070
|
+
* @private
|
|
3071
|
+
*/
|
|
3072
|
+
PlaceOutletComponent.prototype.activatedRoute;
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* @fileoverview added by tsickle
|
|
3077
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3078
|
+
*/
|
|
3079
|
+
var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
3080
|
+
__extends(TabbedPlaceNavigationComponent, _super);
|
|
3081
|
+
function TabbedPlaceNavigationComponent() {
|
|
3082
|
+
return _super.call(this) || this;
|
|
3083
|
+
}
|
|
2526
3084
|
TabbedPlaceNavigationComponent.decorators = [
|
|
2527
3085
|
{ type: Component, args: [{
|
|
2528
3086
|
selector: 'angular-ui-powerups-tabbed-place-navigation',
|
|
2529
|
-
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let
|
|
3087
|
+
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",
|
|
2530
3088
|
styles: [""]
|
|
2531
3089
|
}] }
|
|
2532
3090
|
];
|
|
2533
3091
|
/** @nocollapse */
|
|
2534
3092
|
TabbedPlaceNavigationComponent.ctorParameters = function () { return []; };
|
|
2535
|
-
TabbedPlaceNavigationComponent.propDecorators = {
|
|
2536
|
-
places: [{ type: Input }],
|
|
2537
|
-
placesModel: [{ type: Input }]
|
|
2538
|
-
};
|
|
2539
|
-
__decorate([
|
|
2540
|
-
StoreInListModel('placesModel'),
|
|
2541
|
-
__metadata("design:type", Array)
|
|
2542
|
-
], TabbedPlaceNavigationComponent.prototype, "places", void 0);
|
|
2543
|
-
__decorate([
|
|
2544
|
-
UseDelegate(),
|
|
2545
|
-
__metadata("design:type", ListModel)
|
|
2546
|
-
], TabbedPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2547
3093
|
return TabbedPlaceNavigationComponent;
|
|
2548
|
-
}(
|
|
2549
|
-
if (false) {
|
|
2550
|
-
/** @type {?} */
|
|
2551
|
-
TabbedPlaceNavigationComponent.prototype.places;
|
|
2552
|
-
/** @type {?} */
|
|
2553
|
-
TabbedPlaceNavigationComponent.prototype.placesModel;
|
|
2554
|
-
/** @type {?} */
|
|
2555
|
-
TabbedPlaceNavigationComponent.prototype.orderedPlaces;
|
|
2556
|
-
}
|
|
3094
|
+
}(AbstractPlaceNavigationComponent));
|
|
2557
3095
|
|
|
2558
3096
|
/**
|
|
2559
3097
|
* @fileoverview added by tsickle
|
|
@@ -2578,14 +3116,16 @@ var PlaceModule = /** @class */ (function () {
|
|
|
2578
3116
|
EmptyStateComponent,
|
|
2579
3117
|
BusyOverlayComponent,
|
|
2580
3118
|
PlaceOutletComponent,
|
|
2581
|
-
TabbedPlaceNavigationComponent
|
|
3119
|
+
TabbedPlaceNavigationComponent,
|
|
3120
|
+
ListPlaceNavComponent
|
|
2582
3121
|
],
|
|
2583
3122
|
entryComponents: [BusyOverlayComponent],
|
|
2584
3123
|
exports: [
|
|
2585
3124
|
BusyOverlayComponent,
|
|
2586
3125
|
PlaceOutletComponent,
|
|
2587
3126
|
EmptyStateComponent,
|
|
2588
|
-
TabbedPlaceNavigationComponent
|
|
3127
|
+
TabbedPlaceNavigationComponent,
|
|
3128
|
+
ListPlaceNavComponent
|
|
2589
3129
|
],
|
|
2590
3130
|
providers: [
|
|
2591
3131
|
PlaceService
|
|
@@ -2610,16 +3150,16 @@ var AngularUiPowerupsModule = /** @class */ (function () {
|
|
|
2610
3150
|
NumberInputComponent,
|
|
2611
3151
|
StringInputComponent,
|
|
2612
3152
|
PasswordInputComponent,
|
|
2613
|
-
SelectInputComponent
|
|
3153
|
+
SelectInputComponent
|
|
2614
3154
|
],
|
|
2615
3155
|
imports: [
|
|
2616
3156
|
CommonModule,
|
|
2617
|
-
BrowserModule,
|
|
2618
3157
|
BrowserAnimationsModule,
|
|
2619
3158
|
FormsModule,
|
|
2620
3159
|
MatInputModule,
|
|
2621
3160
|
MatFormFieldModule,
|
|
2622
3161
|
MatSelectModule,
|
|
3162
|
+
MatTabsModule$1,
|
|
2623
3163
|
PlaceModule,
|
|
2624
3164
|
InteractionModule
|
|
2625
3165
|
],
|
|
@@ -2631,7 +3171,7 @@ var AngularUiPowerupsModule = /** @class */ (function () {
|
|
|
2631
3171
|
PasswordInputComponent,
|
|
2632
3172
|
SelectInputComponent,
|
|
2633
3173
|
InteractionModule,
|
|
2634
|
-
PlaceModule
|
|
3174
|
+
PlaceModule
|
|
2635
3175
|
]
|
|
2636
3176
|
},] }
|
|
2637
3177
|
];
|
|
@@ -3012,14 +3552,37 @@ if (false) {
|
|
|
3012
3552
|
/**
|
|
3013
3553
|
* @record
|
|
3014
3554
|
*/
|
|
3015
|
-
function
|
|
3555
|
+
function NavItem() { }
|
|
3556
|
+
if (false) {
|
|
3557
|
+
/**
|
|
3558
|
+
* @return {?}
|
|
3559
|
+
*/
|
|
3560
|
+
NavItem.prototype.title = function () { };
|
|
3561
|
+
/**
|
|
3562
|
+
* @return {?}
|
|
3563
|
+
*/
|
|
3564
|
+
NavItem.prototype.icon = function () { };
|
|
3565
|
+
/**
|
|
3566
|
+
* @return {?}
|
|
3567
|
+
*/
|
|
3568
|
+
NavItem.prototype.tooltip = function () { };
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
/**
|
|
3572
|
+
* @fileoverview added by tsickle
|
|
3573
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3574
|
+
*/
|
|
3575
|
+
/**
|
|
3576
|
+
* @record
|
|
3577
|
+
*/
|
|
3578
|
+
function PlaceComponentLike() { }
|
|
3016
3579
|
if (false) {
|
|
3017
3580
|
/** @type {?} */
|
|
3018
|
-
|
|
3581
|
+
PlaceComponentLike.prototype.activatedRoute;
|
|
3019
3582
|
/**
|
|
3020
3583
|
* @return {?}
|
|
3021
3584
|
*/
|
|
3022
|
-
|
|
3585
|
+
PlaceComponentLike.prototype.onPlaceReady = function () { };
|
|
3023
3586
|
}
|
|
3024
3587
|
|
|
3025
3588
|
/**
|
|
@@ -3029,13 +3592,13 @@ if (false) {
|
|
|
3029
3592
|
/**
|
|
3030
3593
|
* @record
|
|
3031
3594
|
*/
|
|
3032
|
-
function
|
|
3595
|
+
function PlaceUpdatesService() { }
|
|
3033
3596
|
if (false) {
|
|
3034
3597
|
/**
|
|
3035
3598
|
* @param {?} params
|
|
3036
3599
|
* @return {?}
|
|
3037
3600
|
*/
|
|
3038
|
-
|
|
3601
|
+
PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
|
|
3039
3602
|
}
|
|
3040
3603
|
|
|
3041
3604
|
/**
|
|
@@ -3059,6 +3622,28 @@ function Place(options) {
|
|
|
3059
3622
|
});
|
|
3060
3623
|
}
|
|
3061
3624
|
|
|
3625
|
+
/**
|
|
3626
|
+
* @fileoverview added by tsickle
|
|
3627
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3628
|
+
*/
|
|
3629
|
+
/**
|
|
3630
|
+
* @record
|
|
3631
|
+
*/
|
|
3632
|
+
function Visit() { }
|
|
3633
|
+
if (false) {
|
|
3634
|
+
/** @type {?} */
|
|
3635
|
+
Visit.prototype.placeDefinition;
|
|
3636
|
+
/**
|
|
3637
|
+
* @return {?}
|
|
3638
|
+
*/
|
|
3639
|
+
Visit.prototype.getRouteId = function () { };
|
|
3640
|
+
/**
|
|
3641
|
+
* @param {?} name
|
|
3642
|
+
* @return {?}
|
|
3643
|
+
*/
|
|
3644
|
+
Visit.prototype.getRouteParameter = function (name) { };
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3062
3647
|
/**
|
|
3063
3648
|
* @fileoverview added by tsickle
|
|
3064
3649
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3083,7 +3668,24 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
3083
3668
|
* @return {?}
|
|
3084
3669
|
*/
|
|
3085
3670
|
function (component, currentRoute, currentState, nextState) {
|
|
3086
|
-
|
|
3671
|
+
// HACK: this will break with child routes...
|
|
3672
|
+
/** @type {?} */
|
|
3673
|
+
var path = "/" + component.placeDefinition.path;
|
|
3674
|
+
console.log({
|
|
3675
|
+
placePath: path,
|
|
3676
|
+
currentRoute: currentRoute.toString(),
|
|
3677
|
+
currentStateUrl: currentState.url,
|
|
3678
|
+
nextStateUrl: nextState.url,
|
|
3679
|
+
currentStateUrlTree: this.router.parseUrl(currentState.url).root.children[PRIMARY_OUTLET].segments,
|
|
3680
|
+
nextStateUrlTree: this.router.parseUrl(nextState.url).root.children[PRIMARY_OUTLET].segments
|
|
3681
|
+
});
|
|
3682
|
+
// nextState is the full path...
|
|
3683
|
+
if (!nextState.url.startsWith(path)) {
|
|
3684
|
+
return component.canDeactivate();
|
|
3685
|
+
}
|
|
3686
|
+
else {
|
|
3687
|
+
return true;
|
|
3688
|
+
}
|
|
3087
3689
|
};
|
|
3088
3690
|
LeavePlaceGuard.decorators = [
|
|
3089
3691
|
{ type: Injectable, args: [{
|
|
@@ -3115,765 +3717,892 @@ if (false) {
|
|
|
3115
3717
|
* @fileoverview added by tsickle
|
|
3116
3718
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3117
3719
|
*/
|
|
3720
|
+
var PlaceRouteGuard = /** @class */ (function () {
|
|
3721
|
+
function PlaceRouteGuard(placeService, router) {
|
|
3722
|
+
this.placeService = placeService;
|
|
3723
|
+
this.router = router;
|
|
3724
|
+
}
|
|
3725
|
+
/**
|
|
3726
|
+
* @param {?} route
|
|
3727
|
+
* @param {?} state
|
|
3728
|
+
* @return {?}
|
|
3729
|
+
*/
|
|
3730
|
+
PlaceRouteGuard.prototype.canActivate = /**
|
|
3731
|
+
* @param {?} route
|
|
3732
|
+
* @param {?} state
|
|
3733
|
+
* @return {?}
|
|
3734
|
+
*/
|
|
3735
|
+
function (route, state) {
|
|
3736
|
+
// Implement this when adding child routes.
|
|
3737
|
+
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
3738
|
+
// Id snapshot are repesented by 2 url segments
|
|
3739
|
+
// ID => [{'/basePath', params}, {'id', params}]
|
|
3740
|
+
// NO ID => [{'/basePath', params}]
|
|
3741
|
+
// console.log({urlSegments: route.url});
|
|
3742
|
+
// const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
|
|
3743
|
+
// return this.placeService.sanitise(snapshot).then(sanitised => {
|
|
3744
|
+
// if (sanitised.hasChanged(snapshot)) {
|
|
3745
|
+
// return this.router.createUrlTree(snapshot.updateUrl(route.url))
|
|
3746
|
+
// } else {
|
|
3747
|
+
// return true;
|
|
3748
|
+
// }
|
|
3749
|
+
// });
|
|
3750
|
+
return true;
|
|
3751
|
+
};
|
|
3752
|
+
PlaceRouteGuard.decorators = [
|
|
3753
|
+
{ type: Injectable, args: [{
|
|
3754
|
+
providedIn: 'root'
|
|
3755
|
+
},] }
|
|
3756
|
+
];
|
|
3757
|
+
/** @nocollapse */
|
|
3758
|
+
PlaceRouteGuard.ctorParameters = function () { return [
|
|
3759
|
+
{ type: PlaceService },
|
|
3760
|
+
{ type: Router }
|
|
3761
|
+
]; };
|
|
3762
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceService), ɵɵinject(Router)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3763
|
+
return PlaceRouteGuard;
|
|
3764
|
+
}());
|
|
3765
|
+
if (false) {
|
|
3766
|
+
/**
|
|
3767
|
+
* @type {?}
|
|
3768
|
+
* @private
|
|
3769
|
+
*/
|
|
3770
|
+
PlaceRouteGuard.prototype.placeService;
|
|
3771
|
+
/**
|
|
3772
|
+
* @type {?}
|
|
3773
|
+
* @private
|
|
3774
|
+
*/
|
|
3775
|
+
PlaceRouteGuard.prototype.router;
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3118
3778
|
/**
|
|
3119
|
-
* @
|
|
3120
|
-
* @
|
|
3779
|
+
* @fileoverview added by tsickle
|
|
3780
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3121
3781
|
*/
|
|
3122
|
-
|
|
3123
|
-
* @abstract
|
|
3782
|
+
/**
|
|
3124
3783
|
* @template T, S
|
|
3125
3784
|
*/
|
|
3126
|
-
|
|
3127
|
-
function
|
|
3128
|
-
this.
|
|
3129
|
-
this.
|
|
3130
|
-
this.
|
|
3785
|
+
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
3786
|
+
function DefaultParameterSanitiser(def, placeService, options) {
|
|
3787
|
+
this.def = def;
|
|
3788
|
+
this.placeService = placeService;
|
|
3789
|
+
this.remember = isNil(options.remember) ? false : options.remember;
|
|
3790
|
+
this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
|
|
3131
3791
|
}
|
|
3132
3792
|
/**
|
|
3793
|
+
* @param {?} value
|
|
3794
|
+
* @param {?} visit
|
|
3133
3795
|
* @return {?}
|
|
3134
3796
|
*/
|
|
3135
|
-
|
|
3797
|
+
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
3798
|
+
* @param {?} value
|
|
3799
|
+
* @param {?} visit
|
|
3136
3800
|
* @return {?}
|
|
3137
3801
|
*/
|
|
3138
|
-
function () {
|
|
3139
|
-
|
|
3802
|
+
function (value, visit) {
|
|
3803
|
+
if (this.isBlank(value)) {
|
|
3804
|
+
if (this.remember) {
|
|
3805
|
+
// value = null;
|
|
3806
|
+
}
|
|
3807
|
+
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3808
|
+
}
|
|
3809
|
+
else {
|
|
3810
|
+
return value;
|
|
3811
|
+
}
|
|
3140
3812
|
};
|
|
3141
|
-
Object.defineProperty(Sanitiser.prototype, "valueChanged", {
|
|
3142
|
-
get: /**
|
|
3143
|
-
* @return {?}
|
|
3144
|
-
*/
|
|
3145
|
-
function () {
|
|
3146
|
-
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
3147
|
-
},
|
|
3148
|
-
enumerable: true,
|
|
3149
|
-
configurable: true
|
|
3150
|
-
});
|
|
3151
|
-
Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
|
|
3152
|
-
get: /**
|
|
3153
|
-
* @return {?}
|
|
3154
|
-
*/
|
|
3155
|
-
function () {
|
|
3156
|
-
return this._sanitisedValue;
|
|
3157
|
-
},
|
|
3158
|
-
enumerable: true,
|
|
3159
|
-
configurable: true
|
|
3160
|
-
});
|
|
3161
3813
|
/**
|
|
3814
|
+
* @private
|
|
3815
|
+
* @param {?} value
|
|
3162
3816
|
* @return {?}
|
|
3163
3817
|
*/
|
|
3164
|
-
|
|
3818
|
+
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
3819
|
+
* @private
|
|
3820
|
+
* @param {?} value
|
|
3165
3821
|
* @return {?}
|
|
3166
3822
|
*/
|
|
3167
|
-
function () {
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
switch (_b.label) {
|
|
3172
|
-
case 0:
|
|
3173
|
-
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
3174
|
-
this.initialValue = this.readFrom(this.snapshot);
|
|
3175
|
-
_a = this;
|
|
3176
|
-
return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
|
|
3177
|
-
case 1:
|
|
3178
|
-
_a._sanitisedValue = _b.sent();
|
|
3179
|
-
if (this.initialValue !== this._sanitisedValue) {
|
|
3180
|
-
return [2 /*return*/, false];
|
|
3181
|
-
}
|
|
3182
|
-
_b.label = 2;
|
|
3183
|
-
case 2: return [2 /*return*/, true];
|
|
3184
|
-
}
|
|
3185
|
-
});
|
|
3186
|
-
});
|
|
3823
|
+
function (value) {
|
|
3824
|
+
/** @type {?} */
|
|
3825
|
+
var isNil$1 = isNil(value);
|
|
3826
|
+
return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
|
|
3187
3827
|
};
|
|
3188
|
-
|
|
3828
|
+
__decorate([
|
|
3829
|
+
Trace(),
|
|
3830
|
+
__metadata("design:type", Function),
|
|
3831
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
3832
|
+
__metadata("design:returntype", Object)
|
|
3833
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
3834
|
+
return DefaultParameterSanitiser;
|
|
3189
3835
|
}());
|
|
3190
3836
|
if (false) {
|
|
3191
3837
|
/**
|
|
3192
3838
|
* @type {?}
|
|
3193
3839
|
* @private
|
|
3194
3840
|
*/
|
|
3195
|
-
|
|
3841
|
+
DefaultParameterSanitiser.prototype.remember;
|
|
3196
3842
|
/**
|
|
3197
3843
|
* @type {?}
|
|
3198
3844
|
* @private
|
|
3199
3845
|
*/
|
|
3200
|
-
|
|
3201
|
-
/** @type {?} */
|
|
3202
|
-
Sanitiser.prototype.parameterDef;
|
|
3203
|
-
/** @type {?} */
|
|
3204
|
-
Sanitiser.prototype.snapshot;
|
|
3205
|
-
/** @type {?} */
|
|
3206
|
-
Sanitiser.prototype.sanitiser;
|
|
3207
|
-
/**
|
|
3208
|
-
* @abstract
|
|
3209
|
-
* @protected
|
|
3210
|
-
* @param {?} snapshot
|
|
3211
|
-
* @return {?}
|
|
3212
|
-
*/
|
|
3213
|
-
Sanitiser.prototype.readFrom = function (snapshot) { };
|
|
3846
|
+
DefaultParameterSanitiser.prototype.defaultValue;
|
|
3214
3847
|
/**
|
|
3215
|
-
* @
|
|
3216
|
-
* @
|
|
3217
|
-
* @param {?} initialValue
|
|
3218
|
-
* @param {?} sanitisedValue
|
|
3219
|
-
* @return {?}
|
|
3848
|
+
* @type {?}
|
|
3849
|
+
* @private
|
|
3220
3850
|
*/
|
|
3221
|
-
|
|
3851
|
+
DefaultParameterSanitiser.prototype.def;
|
|
3222
3852
|
/**
|
|
3223
|
-
* @
|
|
3224
|
-
* @
|
|
3225
|
-
* @return {?}
|
|
3853
|
+
* @type {?}
|
|
3854
|
+
* @private
|
|
3226
3855
|
*/
|
|
3227
|
-
|
|
3856
|
+
DefaultParameterSanitiser.prototype.placeService;
|
|
3228
3857
|
}
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
/**
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3858
|
+
|
|
3859
|
+
/**
|
|
3860
|
+
* @fileoverview added by tsickle
|
|
3861
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3862
|
+
*/
|
|
3863
|
+
/**
|
|
3864
|
+
* @record
|
|
3865
|
+
*/
|
|
3866
|
+
function JsonArray() { }
|
|
3867
|
+
/**
|
|
3868
|
+
* @record
|
|
3869
|
+
*/
|
|
3870
|
+
function JsonMap() { }
|
|
3871
|
+
|
|
3872
|
+
/**
|
|
3873
|
+
* @fileoverview added by tsickle
|
|
3874
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3875
|
+
*/
|
|
3876
|
+
/**
|
|
3877
|
+
* @record
|
|
3878
|
+
* @template T
|
|
3879
|
+
*/
|
|
3880
|
+
function ParameterOptions() { }
|
|
3881
|
+
if (false) {
|
|
3882
|
+
/** @type {?|undefined} */
|
|
3883
|
+
ParameterOptions.prototype.as;
|
|
3884
|
+
/** @type {?|undefined} */
|
|
3885
|
+
ParameterOptions.prototype.optional;
|
|
3886
|
+
/** @type {?|undefined} */
|
|
3887
|
+
ParameterOptions.prototype.remember;
|
|
3888
|
+
/** @type {?|undefined} */
|
|
3889
|
+
ParameterOptions.prototype.defaultValue;
|
|
3890
|
+
/** @type {?|undefined} */
|
|
3891
|
+
ParameterOptions.prototype.sanitiser;
|
|
3892
|
+
}
|
|
3893
|
+
/**
|
|
3894
|
+
* @record
|
|
3895
|
+
* @template T
|
|
3896
|
+
*/
|
|
3897
|
+
function ListParameterOptions() { }
|
|
3898
|
+
if (false) {
|
|
3899
|
+
/** @type {?|undefined} */
|
|
3900
|
+
ListParameterOptions.prototype.as;
|
|
3901
|
+
/** @type {?|undefined} */
|
|
3902
|
+
ListParameterOptions.prototype.optional;
|
|
3903
|
+
/** @type {?|undefined} */
|
|
3904
|
+
ListParameterOptions.prototype.remember;
|
|
3905
|
+
/** @type {?|undefined} */
|
|
3906
|
+
ListParameterOptions.prototype.defaultValue;
|
|
3907
|
+
/** @type {?|undefined} */
|
|
3908
|
+
ListParameterOptions.prototype.sanitiser;
|
|
3909
|
+
}
|
|
3910
|
+
/**
|
|
3911
|
+
* @template T
|
|
3912
|
+
* @param {?} type
|
|
3913
|
+
* @param {?=} options
|
|
3914
|
+
* @return {?}
|
|
3915
|
+
*/
|
|
3916
|
+
function RouteId(type, options) {
|
|
3917
|
+
// assert.isTruthy(type.isValid());
|
|
3918
|
+
return (/**
|
|
3919
|
+
* @param {?} prototype
|
|
3920
|
+
* @param {?} propertyKey
|
|
3261
3921
|
* @return {?}
|
|
3262
3922
|
*/
|
|
3263
|
-
function () {
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
_b = __values(this.parameterSanitisers), _c = _b.next();
|
|
3282
|
-
_d.label = 3;
|
|
3283
|
-
case 3:
|
|
3284
|
-
if (!!_c.done) return [3 /*break*/, 6];
|
|
3285
|
-
sanitiser = _c.value;
|
|
3286
|
-
return [4 /*yield*/, sanitiser.sanitize()];
|
|
3287
|
-
case 4:
|
|
3288
|
-
_d.sent();
|
|
3289
|
-
_d.label = 5;
|
|
3290
|
-
case 5:
|
|
3291
|
-
_c = _b.next();
|
|
3292
|
-
return [3 /*break*/, 3];
|
|
3293
|
-
case 6: return [3 /*break*/, 9];
|
|
3294
|
-
case 7:
|
|
3295
|
-
e_1_1 = _d.sent();
|
|
3296
|
-
e_1 = { error: e_1_1 };
|
|
3297
|
-
return [3 /*break*/, 9];
|
|
3298
|
-
case 8:
|
|
3299
|
-
try {
|
|
3300
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3301
|
-
}
|
|
3302
|
-
finally { if (e_1) throw e_1.error; }
|
|
3303
|
-
return [7 /*endfinally*/];
|
|
3304
|
-
case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
|
|
3305
|
-
* @param {?} s
|
|
3306
|
-
* @return {?}
|
|
3307
|
-
*/
|
|
3308
|
-
function (s) { return s.valueChanged; }))];
|
|
3309
|
-
}
|
|
3310
|
-
});
|
|
3311
|
-
});
|
|
3312
|
-
};
|
|
3313
|
-
/**
|
|
3314
|
-
* @param {?} router
|
|
3923
|
+
function (prototype, propertyKey) {
|
|
3924
|
+
/** @type {?} */
|
|
3925
|
+
var param = createDefinition(propertyKey, type, options, true);
|
|
3926
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3927
|
+
UseDelegate()(prototype, propertyKey);
|
|
3928
|
+
});
|
|
3929
|
+
}
|
|
3930
|
+
/**
|
|
3931
|
+
* @template T
|
|
3932
|
+
* @param {?} type
|
|
3933
|
+
* @param {?=} options
|
|
3934
|
+
* @return {?}
|
|
3935
|
+
*/
|
|
3936
|
+
function RouteParameter(type, options) {
|
|
3937
|
+
// assert.isTruthy(type.isValid());
|
|
3938
|
+
return (/**
|
|
3939
|
+
* @param {?} prototype
|
|
3940
|
+
* @param {?} propertyKey
|
|
3315
3941
|
* @return {?}
|
|
3316
3942
|
*/
|
|
3317
|
-
|
|
3318
|
-
|
|
3943
|
+
function (prototype, propertyKey) {
|
|
3944
|
+
/** @type {?} */
|
|
3945
|
+
var param = createDefinition(propertyKey, type, options, false);
|
|
3946
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3947
|
+
UseDelegate()(prototype, propertyKey);
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
/**
|
|
3951
|
+
* @template E
|
|
3952
|
+
* @param {?} elementType
|
|
3953
|
+
* @param {?=} options
|
|
3954
|
+
* @return {?}
|
|
3955
|
+
*/
|
|
3956
|
+
function RouteParameterList(elementType, options) {
|
|
3957
|
+
// assert.isTruthy(type.isValid());
|
|
3958
|
+
return (/**
|
|
3959
|
+
* @param {?} prototype
|
|
3960
|
+
* @param {?} propertyKey
|
|
3319
3961
|
* @return {?}
|
|
3320
3962
|
*/
|
|
3321
|
-
function (
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3963
|
+
function (prototype, propertyKey) {
|
|
3964
|
+
/** @type {?} */
|
|
3965
|
+
var param = createArrayDefinition(propertyKey, elementType, options);
|
|
3966
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3967
|
+
UseDelegate()(prototype, propertyKey);
|
|
3968
|
+
});
|
|
3969
|
+
}
|
|
3970
|
+
/**
|
|
3971
|
+
* @template T
|
|
3972
|
+
* @param {?} propertyName
|
|
3973
|
+
* @param {?} type
|
|
3974
|
+
* @param {?} options
|
|
3975
|
+
* @param {?} routeId
|
|
3976
|
+
* @return {?}
|
|
3977
|
+
*/
|
|
3978
|
+
function createDefinition(propertyName, type, options, routeId) {
|
|
3979
|
+
/** @type {?} */
|
|
3980
|
+
var opts = Opts.get(options);
|
|
3981
|
+
/** @type {?} */
|
|
3982
|
+
var propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3983
|
+
/** @type {?} */
|
|
3984
|
+
var def = {
|
|
3985
|
+
name: opts.getOptional('as', propertyNameAsString),
|
|
3986
|
+
propertyName: propertyNameAsString,
|
|
3987
|
+
type: assert.notNil(type),
|
|
3988
|
+
sanitiser: opts.getOptional('sanitiser', null),
|
|
3989
|
+
isRouteId: routeId,
|
|
3990
|
+
isArray: false
|
|
3336
3991
|
};
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3992
|
+
return def;
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* @template T
|
|
3996
|
+
* @param {?} propertyName
|
|
3997
|
+
* @param {?} type
|
|
3998
|
+
* @param {?} options
|
|
3999
|
+
* @return {?}
|
|
4000
|
+
*/
|
|
4001
|
+
function createArrayDefinition(propertyName, type, options) {
|
|
4002
|
+
/** @type {?} */
|
|
4003
|
+
var opts = Opts.get(options);
|
|
4004
|
+
/** @type {?} */
|
|
4005
|
+
var propertyNameAsString = assert.notNil(propertyName).toString();
|
|
4006
|
+
/** @type {?} */
|
|
4007
|
+
var def = {
|
|
4008
|
+
name: opts.getOptional('as', propertyNameAsString),
|
|
4009
|
+
propertyName: propertyNameAsString,
|
|
4010
|
+
type: assert.notNil(type),
|
|
4011
|
+
sanitiser: opts.getOptional('sanitiser', null),
|
|
4012
|
+
isRouteId: false,
|
|
4013
|
+
isArray: true
|
|
3351
4014
|
};
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
4015
|
+
return def;
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
/**
|
|
4019
|
+
* @fileoverview added by tsickle
|
|
4020
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4021
|
+
*/
|
|
4022
|
+
/**
|
|
4023
|
+
* @record
|
|
4024
|
+
* @template T, S
|
|
4025
|
+
*/
|
|
4026
|
+
function ParameterDefinition() { }
|
|
3360
4027
|
if (false) {
|
|
3361
|
-
/**
|
|
3362
|
-
* @type {?}
|
|
3363
|
-
* @private
|
|
3364
|
-
*/
|
|
3365
|
-
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
3366
|
-
/**
|
|
3367
|
-
* @type {?}
|
|
3368
|
-
* @private
|
|
3369
|
-
*/
|
|
3370
|
-
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
3371
4028
|
/** @type {?} */
|
|
3372
|
-
|
|
4029
|
+
ParameterDefinition.prototype.name;
|
|
3373
4030
|
/** @type {?} */
|
|
3374
|
-
|
|
4031
|
+
ParameterDefinition.prototype.propertyName;
|
|
3375
4032
|
/** @type {?} */
|
|
3376
|
-
|
|
4033
|
+
ParameterDefinition.prototype.type;
|
|
4034
|
+
/** @type {?} */
|
|
4035
|
+
ParameterDefinition.prototype.sanitiser;
|
|
4036
|
+
/** @type {?} */
|
|
4037
|
+
ParameterDefinition.prototype.isRouteId;
|
|
4038
|
+
/** @type {?} */
|
|
4039
|
+
ParameterDefinition.prototype.isArray;
|
|
3377
4040
|
}
|
|
3378
|
-
|
|
4041
|
+
|
|
4042
|
+
/**
|
|
4043
|
+
* @fileoverview added by tsickle
|
|
4044
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4045
|
+
*/
|
|
4046
|
+
/**
|
|
4047
|
+
* @record
|
|
4048
|
+
* @template T
|
|
4049
|
+
*/
|
|
4050
|
+
function ParameterSanitiser() { }
|
|
4051
|
+
if (false) {
|
|
3379
4052
|
/**
|
|
3380
|
-
* @
|
|
4053
|
+
* @param {?} value
|
|
4054
|
+
* @param {?=} visit
|
|
4055
|
+
* @return {?}
|
|
3381
4056
|
*/
|
|
3382
|
-
|
|
4057
|
+
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
4058
|
+
}
|
|
4059
|
+
(function (ParameterSanitiser) {
|
|
4060
|
+
/**
|
|
4061
|
+
* @record
|
|
3383
4062
|
* @template T
|
|
3384
4063
|
*/
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
4064
|
+
function Options() { }
|
|
4065
|
+
ParameterSanitiser.Options = Options;
|
|
4066
|
+
if (false) {
|
|
4067
|
+
/** @type {?|undefined} */
|
|
4068
|
+
Options.prototype.remember;
|
|
4069
|
+
/** @type {?|undefined} */
|
|
4070
|
+
Options.prototype.defaultValue;
|
|
4071
|
+
}
|
|
4072
|
+
})(ParameterSanitiser || (ParameterSanitiser = {}));
|
|
4073
|
+
|
|
4074
|
+
/**
|
|
4075
|
+
* @fileoverview added by tsickle
|
|
4076
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4077
|
+
*/
|
|
4078
|
+
// WARNING: interface has both a type and a value, skipping emit
|
|
4079
|
+
var ParameterType;
|
|
4080
|
+
(function (ParameterType) {
|
|
4081
|
+
var StringType = /** @class */ (function () {
|
|
4082
|
+
function StringType() {
|
|
3389
4083
|
}
|
|
3390
4084
|
/**
|
|
3391
|
-
* @param {?}
|
|
4085
|
+
* @param {?} value
|
|
3392
4086
|
* @return {?}
|
|
3393
4087
|
*/
|
|
3394
|
-
|
|
3395
|
-
* @param {?}
|
|
4088
|
+
StringType.prototype.format = /**
|
|
4089
|
+
* @param {?} value
|
|
3396
4090
|
* @return {?}
|
|
3397
4091
|
*/
|
|
3398
|
-
function (
|
|
3399
|
-
|
|
3400
|
-
var rawValue = this.parameterDef.isRouteId ?
|
|
3401
|
-
snapshot.paramMap.get(this.parameterDef.name) :
|
|
3402
|
-
snapshot.queryParamMap.get(this.parameterDef.name);
|
|
3403
|
-
return this.parameterDef.type.parse(rawValue);
|
|
4092
|
+
function (value) {
|
|
4093
|
+
return value;
|
|
3404
4094
|
};
|
|
3405
4095
|
/**
|
|
3406
|
-
* @
|
|
3407
|
-
* @param {?} initialValue
|
|
3408
|
-
* @param {?} sanitisedValue
|
|
4096
|
+
* @param {?} value
|
|
3409
4097
|
* @return {?}
|
|
3410
4098
|
*/
|
|
3411
|
-
|
|
3412
|
-
* @
|
|
3413
|
-
* @param {?} initialValue
|
|
3414
|
-
* @param {?} sanitisedValue
|
|
4099
|
+
StringType.prototype.parse = /**
|
|
4100
|
+
* @param {?} value
|
|
3415
4101
|
* @return {?}
|
|
3416
4102
|
*/
|
|
3417
|
-
function (
|
|
3418
|
-
return
|
|
4103
|
+
function (value) {
|
|
4104
|
+
return value;
|
|
3419
4105
|
};
|
|
4106
|
+
return StringType;
|
|
4107
|
+
}());
|
|
4108
|
+
var NumberType = /** @class */ (function () {
|
|
4109
|
+
function NumberType() {
|
|
4110
|
+
}
|
|
3420
4111
|
/**
|
|
3421
|
-
* @param {?}
|
|
4112
|
+
* @param {?} value
|
|
3422
4113
|
* @return {?}
|
|
3423
4114
|
*/
|
|
3424
|
-
|
|
3425
|
-
* @param {?}
|
|
4115
|
+
NumberType.prototype.format = /**
|
|
4116
|
+
* @param {?} value
|
|
3426
4117
|
* @return {?}
|
|
3427
4118
|
*/
|
|
3428
|
-
function (
|
|
3429
|
-
|
|
4119
|
+
function (value) {
|
|
4120
|
+
return "" + value;
|
|
3430
4121
|
};
|
|
3431
|
-
return Value;
|
|
3432
|
-
}(Sanitiser));
|
|
3433
|
-
Sanitiser.Value = Value;
|
|
3434
|
-
/**
|
|
3435
|
-
* @template T
|
|
3436
|
-
*/
|
|
3437
|
-
var /**
|
|
3438
|
-
* @template T
|
|
3439
|
-
*/
|
|
3440
|
-
Array = /** @class */ (function (_super) {
|
|
3441
|
-
__extends(Array, _super);
|
|
3442
|
-
function Array() {
|
|
3443
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3444
|
-
}
|
|
3445
4122
|
/**
|
|
3446
|
-
* @param {?}
|
|
4123
|
+
* @param {?} value
|
|
3447
4124
|
* @return {?}
|
|
3448
4125
|
*/
|
|
3449
|
-
|
|
3450
|
-
* @param {?}
|
|
4126
|
+
NumberType.prototype.parse = /**
|
|
4127
|
+
* @param {?} value
|
|
3451
4128
|
* @return {?}
|
|
3452
4129
|
*/
|
|
3453
|
-
function (
|
|
3454
|
-
|
|
3455
|
-
/** @type {?} */
|
|
3456
|
-
var rawValues = snapshot.queryParamMap.getAll(this.parameterDef.name);
|
|
3457
|
-
return rawValues.map((/**
|
|
3458
|
-
* @param {?} value
|
|
3459
|
-
* @return {?}
|
|
3460
|
-
*/
|
|
3461
|
-
function (value) { return _this.parameterDef.type.parse(value); }));
|
|
4130
|
+
function (value) {
|
|
4131
|
+
return isNil(value) || isEmpty(value) ? null : +value;
|
|
3462
4132
|
};
|
|
4133
|
+
return NumberType;
|
|
4134
|
+
}());
|
|
4135
|
+
var BooleanType = /** @class */ (function () {
|
|
4136
|
+
function BooleanType() {
|
|
4137
|
+
}
|
|
3463
4138
|
/**
|
|
3464
|
-
* @
|
|
3465
|
-
* @param {?} initialValue
|
|
3466
|
-
* @param {?} sanitisedValue
|
|
4139
|
+
* @param {?} value
|
|
3467
4140
|
* @return {?}
|
|
3468
4141
|
*/
|
|
3469
|
-
|
|
3470
|
-
* @
|
|
3471
|
-
* @param {?} initialValue
|
|
3472
|
-
* @param {?} sanitisedValue
|
|
4142
|
+
BooleanType.prototype.format = /**
|
|
4143
|
+
* @param {?} value
|
|
3473
4144
|
* @return {?}
|
|
3474
4145
|
*/
|
|
3475
|
-
function (
|
|
3476
|
-
return
|
|
4146
|
+
function (value) {
|
|
4147
|
+
return value ? 'true' : 'false';
|
|
3477
4148
|
};
|
|
3478
4149
|
/**
|
|
3479
|
-
* @param {?}
|
|
4150
|
+
* @param {?} value
|
|
4151
|
+
* @return {?}
|
|
4152
|
+
*/
|
|
4153
|
+
BooleanType.prototype.parse = /**
|
|
4154
|
+
* @param {?} value
|
|
4155
|
+
* @return {?}
|
|
4156
|
+
*/
|
|
4157
|
+
function (value) {
|
|
4158
|
+
return value === 'true';
|
|
4159
|
+
};
|
|
4160
|
+
return BooleanType;
|
|
4161
|
+
}());
|
|
4162
|
+
ParameterType.STRING = new StringType();
|
|
4163
|
+
ParameterType.NUMBER = new NumberType();
|
|
4164
|
+
ParameterType.BOOLEAN = new BooleanType();
|
|
4165
|
+
})(ParameterType || (ParameterType = {}));
|
|
4166
|
+
|
|
4167
|
+
/**
|
|
4168
|
+
* @fileoverview added by tsickle
|
|
4169
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4170
|
+
*/
|
|
4171
|
+
/**
|
|
4172
|
+
* @template T, S
|
|
4173
|
+
*/
|
|
4174
|
+
var /**
|
|
4175
|
+
* @template T, S
|
|
4176
|
+
*/
|
|
4177
|
+
Sanitiser = /** @class */ (function () {
|
|
4178
|
+
function Sanitiser(parameterDef, snapshot, sanitiser) {
|
|
4179
|
+
this.parameterDef = parameterDef;
|
|
4180
|
+
this.snapshot = snapshot;
|
|
4181
|
+
this.sanitiser = sanitiser;
|
|
4182
|
+
}
|
|
4183
|
+
/**
|
|
4184
|
+
* @return {?}
|
|
4185
|
+
*/
|
|
4186
|
+
Sanitiser.prototype.isRouteId = /**
|
|
4187
|
+
* @return {?}
|
|
4188
|
+
*/
|
|
4189
|
+
function () {
|
|
4190
|
+
return this.parameterDef.isRouteId;
|
|
4191
|
+
};
|
|
4192
|
+
Object.defineProperty(Sanitiser.prototype, "valueChanged", {
|
|
4193
|
+
get: /**
|
|
4194
|
+
* @return {?}
|
|
4195
|
+
*/
|
|
4196
|
+
function () {
|
|
4197
|
+
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
4198
|
+
},
|
|
4199
|
+
enumerable: true,
|
|
4200
|
+
configurable: true
|
|
4201
|
+
});
|
|
4202
|
+
Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
|
|
4203
|
+
get: /**
|
|
4204
|
+
* @return {?}
|
|
4205
|
+
*/
|
|
4206
|
+
function () {
|
|
4207
|
+
return this._sanitisedValue;
|
|
4208
|
+
},
|
|
4209
|
+
enumerable: true,
|
|
4210
|
+
configurable: true
|
|
4211
|
+
});
|
|
4212
|
+
/**
|
|
4213
|
+
* @protected
|
|
4214
|
+
* @param {?} snapshot
|
|
4215
|
+
* @return {?}
|
|
4216
|
+
*/
|
|
4217
|
+
Sanitiser.prototype.readFrom = /**
|
|
4218
|
+
* @protected
|
|
4219
|
+
* @param {?} snapshot
|
|
4220
|
+
* @return {?}
|
|
4221
|
+
*/
|
|
4222
|
+
function (snapshot) {
|
|
4223
|
+
return lang.abstractMethod(this.constructor);
|
|
4224
|
+
};
|
|
4225
|
+
/**
|
|
4226
|
+
* @protected
|
|
4227
|
+
* @param {?} initialValue
|
|
4228
|
+
* @param {?} sanitisedValue
|
|
4229
|
+
* @return {?}
|
|
4230
|
+
*/
|
|
4231
|
+
Sanitiser.prototype.hasChanged = /**
|
|
4232
|
+
* @protected
|
|
4233
|
+
* @param {?} initialValue
|
|
4234
|
+
* @param {?} sanitisedValue
|
|
4235
|
+
* @return {?}
|
|
4236
|
+
*/
|
|
4237
|
+
function (initialValue, sanitisedValue) {
|
|
4238
|
+
return lang.abstractMethod(this.constructor);
|
|
4239
|
+
};
|
|
4240
|
+
/**
|
|
4241
|
+
* @param {?} dest
|
|
4242
|
+
* @return {?}
|
|
4243
|
+
*/
|
|
4244
|
+
Sanitiser.prototype.injectRouteParam = /**
|
|
4245
|
+
* @param {?} dest
|
|
4246
|
+
* @return {?}
|
|
4247
|
+
*/
|
|
4248
|
+
function (dest) {
|
|
4249
|
+
lang.abstractMethod(this.constructor);
|
|
4250
|
+
};
|
|
4251
|
+
/**
|
|
4252
|
+
* @return {?}
|
|
4253
|
+
*/
|
|
4254
|
+
Sanitiser.prototype.sanitize = /**
|
|
4255
|
+
* @return {?}
|
|
4256
|
+
*/
|
|
4257
|
+
function () {
|
|
4258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4259
|
+
var _a;
|
|
4260
|
+
return __generator(this, function (_b) {
|
|
4261
|
+
switch (_b.label) {
|
|
4262
|
+
case 0:
|
|
4263
|
+
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
4264
|
+
this.initialValue = this.readFrom(this.snapshot);
|
|
4265
|
+
_a = this;
|
|
4266
|
+
return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
|
|
4267
|
+
case 1:
|
|
4268
|
+
_a._sanitisedValue = _b.sent();
|
|
4269
|
+
if (this.initialValue !== this._sanitisedValue) {
|
|
4270
|
+
return [2 /*return*/, false];
|
|
4271
|
+
}
|
|
4272
|
+
_b.label = 2;
|
|
4273
|
+
case 2: return [2 /*return*/, true];
|
|
4274
|
+
}
|
|
4275
|
+
});
|
|
4276
|
+
});
|
|
4277
|
+
};
|
|
4278
|
+
return Sanitiser;
|
|
4279
|
+
}());
|
|
4280
|
+
if (false) {
|
|
4281
|
+
/**
|
|
4282
|
+
* @type {?}
|
|
4283
|
+
* @private
|
|
4284
|
+
*/
|
|
4285
|
+
Sanitiser.prototype.initialValue;
|
|
4286
|
+
/**
|
|
4287
|
+
* @type {?}
|
|
4288
|
+
* @private
|
|
4289
|
+
*/
|
|
4290
|
+
Sanitiser.prototype._sanitisedValue;
|
|
4291
|
+
/** @type {?} */
|
|
4292
|
+
Sanitiser.prototype.parameterDef;
|
|
4293
|
+
/** @type {?} */
|
|
4294
|
+
Sanitiser.prototype.snapshot;
|
|
4295
|
+
/** @type {?} */
|
|
4296
|
+
Sanitiser.prototype.sanitiser;
|
|
4297
|
+
}
|
|
4298
|
+
var RouteParameterSanitiser = /** @class */ (function () {
|
|
4299
|
+
function RouteParameterSanitiser(parameterDefs, snapshot, placeService, injector) {
|
|
4300
|
+
var _this = this;
|
|
4301
|
+
this.parameterDefs = parameterDefs;
|
|
4302
|
+
this.snapshot = snapshot;
|
|
4303
|
+
this.placeService = placeService;
|
|
4304
|
+
this.injector = injector;
|
|
4305
|
+
this.parameterSanitisers = [];
|
|
4306
|
+
/** @type {?} */
|
|
4307
|
+
var sanitisers = parameterDefs.map((/**
|
|
4308
|
+
* @param {?} def
|
|
3480
4309
|
* @return {?}
|
|
3481
4310
|
*/
|
|
3482
|
-
|
|
3483
|
-
|
|
4311
|
+
function (def) {
|
|
4312
|
+
return def.isArray ?
|
|
4313
|
+
new Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
|
|
4314
|
+
new Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
|
|
4315
|
+
}));
|
|
4316
|
+
this.routeIdSanitiser = sanitisers.find((/**
|
|
4317
|
+
* @param {?} p
|
|
3484
4318
|
* @return {?}
|
|
3485
4319
|
*/
|
|
3486
|
-
function (
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
function (v) { return _this.parameterDef.type.format(v); }));
|
|
3493
|
-
};
|
|
3494
|
-
return Array;
|
|
3495
|
-
}(Sanitiser));
|
|
3496
|
-
Sanitiser.Array = Array;
|
|
3497
|
-
})(Sanitiser || (Sanitiser = {}));
|
|
3498
|
-
|
|
3499
|
-
/**
|
|
3500
|
-
* @fileoverview added by tsickle
|
|
3501
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3502
|
-
*/
|
|
3503
|
-
var PlaceRouteGuard = /** @class */ (function () {
|
|
3504
|
-
function PlaceRouteGuard(router, injector) {
|
|
3505
|
-
this.router = router;
|
|
3506
|
-
this.injector = injector;
|
|
4320
|
+
function (p) { return p.isRouteId(); }));
|
|
4321
|
+
this.parameterSanitisers = sanitisers.filter((/**
|
|
4322
|
+
* @param {?} p
|
|
4323
|
+
* @return {?}
|
|
4324
|
+
*/
|
|
4325
|
+
function (p) { return !p.isRouteId(); }));
|
|
3507
4326
|
}
|
|
3508
4327
|
/**
|
|
3509
|
-
* @param {?} route
|
|
3510
|
-
* @param {?} state
|
|
3511
4328
|
* @return {?}
|
|
3512
4329
|
*/
|
|
3513
|
-
|
|
3514
|
-
* @param {?} route
|
|
3515
|
-
* @param {?} state
|
|
4330
|
+
RouteParameterSanitiser.prototype.sanitise = /**
|
|
3516
4331
|
* @return {?}
|
|
3517
4332
|
*/
|
|
3518
|
-
function (
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
4333
|
+
function () {
|
|
4334
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4335
|
+
var e_1, _a, _b, _c, sanitiser, e_1_1;
|
|
4336
|
+
return __generator(this, function (_d) {
|
|
4337
|
+
switch (_d.label) {
|
|
4338
|
+
case 0:
|
|
4339
|
+
if (!this.routeIdSanitiser) return [3 /*break*/, 2];
|
|
4340
|
+
return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
|
|
4341
|
+
case 1:
|
|
4342
|
+
_d.sent();
|
|
4343
|
+
if (this.routeIdSanitiser.valueChanged) {
|
|
4344
|
+
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
4345
|
+
// context of the route id.
|
|
4346
|
+
return [2 /*return*/, false];
|
|
4347
|
+
}
|
|
4348
|
+
_d.label = 2;
|
|
4349
|
+
case 2:
|
|
4350
|
+
_d.trys.push([2, 7, 8, 9]);
|
|
4351
|
+
_b = __values(this.parameterSanitisers), _c = _b.next();
|
|
4352
|
+
_d.label = 3;
|
|
4353
|
+
case 3:
|
|
4354
|
+
if (!!_c.done) return [3 /*break*/, 6];
|
|
4355
|
+
sanitiser = _c.value;
|
|
4356
|
+
return [4 /*yield*/, sanitiser.sanitize()];
|
|
4357
|
+
case 4:
|
|
4358
|
+
_d.sent();
|
|
4359
|
+
_d.label = 5;
|
|
4360
|
+
case 5:
|
|
4361
|
+
_c = _b.next();
|
|
4362
|
+
return [3 /*break*/, 3];
|
|
4363
|
+
case 6: return [3 /*break*/, 9];
|
|
4364
|
+
case 7:
|
|
4365
|
+
e_1_1 = _d.sent();
|
|
4366
|
+
e_1 = { error: e_1_1 };
|
|
4367
|
+
return [3 /*break*/, 9];
|
|
4368
|
+
case 8:
|
|
4369
|
+
try {
|
|
4370
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4371
|
+
}
|
|
4372
|
+
finally { if (e_1) throw e_1.error; }
|
|
4373
|
+
return [7 /*endfinally*/];
|
|
4374
|
+
case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
|
|
4375
|
+
* @param {?} s
|
|
4376
|
+
* @return {?}
|
|
4377
|
+
*/
|
|
4378
|
+
function (s) { return s.valueChanged; }))];
|
|
4379
|
+
}
|
|
4380
|
+
});
|
|
4381
|
+
});
|
|
3534
4382
|
};
|
|
3535
|
-
PlaceRouteGuard.decorators = [
|
|
3536
|
-
{ type: Injectable, args: [{
|
|
3537
|
-
providedIn: 'root'
|
|
3538
|
-
},] }
|
|
3539
|
-
];
|
|
3540
|
-
/** @nocollapse */
|
|
3541
|
-
PlaceRouteGuard.ctorParameters = function () { return [
|
|
3542
|
-
{ type: Router },
|
|
3543
|
-
{ type: Injector }
|
|
3544
|
-
]; };
|
|
3545
|
-
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3546
|
-
__decorate([
|
|
3547
|
-
Trace(),
|
|
3548
|
-
__metadata("design:type", Function),
|
|
3549
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot]),
|
|
3550
|
-
__metadata("design:returntype", Object)
|
|
3551
|
-
], PlaceRouteGuard.prototype, "canActivate", null);
|
|
3552
|
-
return PlaceRouteGuard;
|
|
3553
|
-
}());
|
|
3554
|
-
if (false) {
|
|
3555
4383
|
/**
|
|
3556
|
-
* @type {?}
|
|
3557
4384
|
* @private
|
|
4385
|
+
* @template T, S
|
|
4386
|
+
* @param {?} def
|
|
4387
|
+
* @return {?}
|
|
3558
4388
|
*/
|
|
3559
|
-
|
|
3560
|
-
/**
|
|
3561
|
-
* @type {?}
|
|
4389
|
+
RouteParameterSanitiser.prototype.getSanitiser = /**
|
|
3562
4390
|
* @private
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
}
|
|
3566
|
-
|
|
3567
|
-
/**
|
|
3568
|
-
* @fileoverview added by tsickle
|
|
3569
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3570
|
-
*/
|
|
3571
|
-
/**
|
|
3572
|
-
* @record
|
|
3573
|
-
*/
|
|
3574
|
-
function JsonArray() { }
|
|
3575
|
-
/**
|
|
3576
|
-
* @record
|
|
3577
|
-
*/
|
|
3578
|
-
function JsonMap() { }
|
|
3579
|
-
|
|
3580
|
-
/**
|
|
3581
|
-
* @fileoverview added by tsickle
|
|
3582
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3583
|
-
*/
|
|
3584
|
-
/**
|
|
3585
|
-
* @record
|
|
3586
|
-
* @template T
|
|
3587
|
-
*/
|
|
3588
|
-
function ParameterOptions() { }
|
|
3589
|
-
if (false) {
|
|
3590
|
-
/** @type {?|undefined} */
|
|
3591
|
-
ParameterOptions.prototype.as;
|
|
3592
|
-
/** @type {?|undefined} */
|
|
3593
|
-
ParameterOptions.prototype.optional;
|
|
3594
|
-
/** @type {?|undefined} */
|
|
3595
|
-
ParameterOptions.prototype.sanitiser;
|
|
3596
|
-
}
|
|
3597
|
-
/**
|
|
3598
|
-
* @record
|
|
3599
|
-
* @template T
|
|
3600
|
-
*/
|
|
3601
|
-
function ListParameterOptions() { }
|
|
3602
|
-
if (false) {
|
|
3603
|
-
/** @type {?|undefined} */
|
|
3604
|
-
ListParameterOptions.prototype.as;
|
|
3605
|
-
/** @type {?|undefined} */
|
|
3606
|
-
ListParameterOptions.prototype.optional;
|
|
3607
|
-
/** @type {?|undefined} */
|
|
3608
|
-
ListParameterOptions.prototype.listSanitiser;
|
|
3609
|
-
}
|
|
3610
|
-
/**
|
|
3611
|
-
* @template T
|
|
3612
|
-
* @param {?} type
|
|
3613
|
-
* @param {?=} options
|
|
3614
|
-
* @return {?}
|
|
3615
|
-
*/
|
|
3616
|
-
function RouteId(type, options) {
|
|
3617
|
-
// assert.isTruthy(type.isValid());
|
|
3618
|
-
return (/**
|
|
3619
|
-
* @param {?} prototype
|
|
3620
|
-
* @param {?} propertyKey
|
|
4391
|
+
* @template T, S
|
|
4392
|
+
* @param {?} def
|
|
3621
4393
|
* @return {?}
|
|
3622
4394
|
*/
|
|
3623
|
-
function (
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
// assert.isTruthy(type.isValid());
|
|
3638
|
-
return (/**
|
|
3639
|
-
* @param {?} prototype
|
|
3640
|
-
* @param {?} propertyKey
|
|
4395
|
+
function (def) {
|
|
4396
|
+
if (def.sanitiser) {
|
|
4397
|
+
if (this.isSanitiserContructor(def.sanitiser)) {
|
|
4398
|
+
return this.injector.get(def.sanitiser, new def.sanitiser());
|
|
4399
|
+
}
|
|
4400
|
+
else {
|
|
4401
|
+
return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
else {
|
|
4405
|
+
return null;
|
|
4406
|
+
}
|
|
4407
|
+
};
|
|
4408
|
+
/**
|
|
3641
4409
|
* @return {?}
|
|
3642
4410
|
*/
|
|
3643
|
-
|
|
3644
|
-
/** @type {?} */
|
|
3645
|
-
var param = createDefinition(propertyKey, type, options, false);
|
|
3646
|
-
Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
|
|
3647
|
-
UseDelegate()(prototype, propertyKey);
|
|
3648
|
-
});
|
|
3649
|
-
}
|
|
3650
|
-
/**
|
|
3651
|
-
* @template E
|
|
3652
|
-
* @param {?} elementType
|
|
3653
|
-
* @param {?=} options
|
|
3654
|
-
* @return {?}
|
|
3655
|
-
*/
|
|
3656
|
-
function RouteParameterList(elementType, options) {
|
|
3657
|
-
// assert.isTruthy(type.isValid());
|
|
3658
|
-
return (/**
|
|
3659
|
-
* @param {?} prototype
|
|
3660
|
-
* @param {?} propertyKey
|
|
4411
|
+
RouteParameterSanitiser.prototype.routeIdHasChanged = /**
|
|
3661
4412
|
* @return {?}
|
|
3662
4413
|
*/
|
|
3663
|
-
function (
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
/**
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
type: assert.notNil(type),
|
|
3688
|
-
sanitiser: opts.getOptional('sanitiser', null),
|
|
3689
|
-
isRouteId: routeId,
|
|
3690
|
-
isArray: false
|
|
4414
|
+
function () {
|
|
4415
|
+
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
4416
|
+
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
4417
|
+
};
|
|
4418
|
+
/**
|
|
4419
|
+
* @return {?}
|
|
4420
|
+
*/
|
|
4421
|
+
RouteParameterSanitiser.prototype.getRedirectParams = /**
|
|
4422
|
+
* @return {?}
|
|
4423
|
+
*/
|
|
4424
|
+
function () {
|
|
4425
|
+
if (this.routeIdHasChanged()) {
|
|
4426
|
+
return [this.routeIdSanitiser.sanitisedValue];
|
|
4427
|
+
}
|
|
4428
|
+
else {
|
|
4429
|
+
/** @type {?} */
|
|
4430
|
+
var routeParams_1 = {};
|
|
4431
|
+
this.parameterSanitisers.forEach((/**
|
|
4432
|
+
* @param {?} s
|
|
4433
|
+
* @return {?}
|
|
4434
|
+
*/
|
|
4435
|
+
function (s) { return s.injectRouteParam(routeParams_1); }));
|
|
4436
|
+
return [routeParams_1];
|
|
4437
|
+
}
|
|
3691
4438
|
};
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
/** @type {?} */
|
|
3707
|
-
var def = {
|
|
3708
|
-
name: opts.getOptional('as', propertyNameAsString),
|
|
3709
|
-
propertyName: propertyNameAsString,
|
|
3710
|
-
type: assert.notNil(type),
|
|
3711
|
-
sanitiser: opts.getOptional('listSanitiser', null),
|
|
3712
|
-
isRouteId: false,
|
|
3713
|
-
isArray: true
|
|
4439
|
+
/**
|
|
4440
|
+
* @private
|
|
4441
|
+
* @template S
|
|
4442
|
+
* @param {?} value
|
|
4443
|
+
* @return {?}
|
|
4444
|
+
*/
|
|
4445
|
+
RouteParameterSanitiser.prototype.isSanitiserContructor = /**
|
|
4446
|
+
* @private
|
|
4447
|
+
* @template S
|
|
4448
|
+
* @param {?} value
|
|
4449
|
+
* @return {?}
|
|
4450
|
+
*/
|
|
4451
|
+
function (value) {
|
|
4452
|
+
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
3714
4453
|
};
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
4454
|
+
__decorate([
|
|
4455
|
+
Memoize(),
|
|
4456
|
+
__metadata("design:type", Function),
|
|
4457
|
+
__metadata("design:paramtypes", [Object]),
|
|
4458
|
+
__metadata("design:returntype", Object)
|
|
4459
|
+
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
4460
|
+
__decorate([
|
|
4461
|
+
Trace(),
|
|
4462
|
+
__metadata("design:type", Function),
|
|
4463
|
+
__metadata("design:paramtypes", []),
|
|
4464
|
+
__metadata("design:returntype", Array)
|
|
4465
|
+
], RouteParameterSanitiser.prototype, "getRedirectParams", null);
|
|
4466
|
+
return RouteParameterSanitiser;
|
|
4467
|
+
}());
|
|
3727
4468
|
if (false) {
|
|
4469
|
+
/**
|
|
4470
|
+
* @type {?}
|
|
4471
|
+
* @private
|
|
4472
|
+
*/
|
|
4473
|
+
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
4474
|
+
/**
|
|
4475
|
+
* @type {?}
|
|
4476
|
+
* @private
|
|
4477
|
+
*/
|
|
4478
|
+
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
3728
4479
|
/** @type {?} */
|
|
3729
|
-
|
|
3730
|
-
/** @type {?} */
|
|
3731
|
-
ParameterDefinition.prototype.propertyName;
|
|
3732
|
-
/** @type {?} */
|
|
3733
|
-
ParameterDefinition.prototype.type;
|
|
4480
|
+
RouteParameterSanitiser.prototype.parameterDefs;
|
|
3734
4481
|
/** @type {?} */
|
|
3735
|
-
|
|
4482
|
+
RouteParameterSanitiser.prototype.snapshot;
|
|
3736
4483
|
/** @type {?} */
|
|
3737
|
-
|
|
4484
|
+
RouteParameterSanitiser.prototype.placeService;
|
|
3738
4485
|
/** @type {?} */
|
|
3739
|
-
|
|
4486
|
+
RouteParameterSanitiser.prototype.injector;
|
|
3740
4487
|
}
|
|
3741
|
-
|
|
3742
|
-
/**
|
|
3743
|
-
* @fileoverview added by tsickle
|
|
3744
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3745
|
-
*/
|
|
3746
|
-
/**
|
|
3747
|
-
* @record
|
|
3748
|
-
* @template T
|
|
3749
|
-
*/
|
|
3750
|
-
function ParameterSanitiser() { }
|
|
3751
|
-
if (false) {
|
|
4488
|
+
(function (Sanitiser) {
|
|
3752
4489
|
/**
|
|
3753
|
-
* @
|
|
3754
|
-
* @return {?}
|
|
4490
|
+
* @template T
|
|
3755
4491
|
*/
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
/**
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
// WARNING: interface has both a type and a value, skipping emit
|
|
3764
|
-
var ParameterType;
|
|
3765
|
-
(function (ParameterType) {
|
|
3766
|
-
var StringType = /** @class */ (function () {
|
|
3767
|
-
function StringType() {
|
|
4492
|
+
var /**
|
|
4493
|
+
* @template T
|
|
4494
|
+
*/
|
|
4495
|
+
Value = /** @class */ (function (_super) {
|
|
4496
|
+
__extends(Value, _super);
|
|
4497
|
+
function Value() {
|
|
4498
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3768
4499
|
}
|
|
3769
4500
|
/**
|
|
3770
|
-
* @param {?}
|
|
4501
|
+
* @param {?} snapshot
|
|
3771
4502
|
* @return {?}
|
|
3772
4503
|
*/
|
|
3773
|
-
|
|
3774
|
-
* @param {?}
|
|
4504
|
+
Value.prototype.readFrom = /**
|
|
4505
|
+
* @param {?} snapshot
|
|
3775
4506
|
* @return {?}
|
|
3776
4507
|
*/
|
|
3777
|
-
function (
|
|
3778
|
-
|
|
4508
|
+
function (snapshot) {
|
|
4509
|
+
/** @type {?} */
|
|
4510
|
+
var rawValue = snapshot.paramMap.get(this.parameterDef.name);
|
|
4511
|
+
return this.parameterDef.type.parse(rawValue);
|
|
3779
4512
|
};
|
|
3780
4513
|
/**
|
|
3781
|
-
* @
|
|
4514
|
+
* @protected
|
|
4515
|
+
* @param {?} initialValue
|
|
4516
|
+
* @param {?} sanitisedValue
|
|
3782
4517
|
* @return {?}
|
|
3783
4518
|
*/
|
|
3784
|
-
|
|
3785
|
-
* @
|
|
4519
|
+
Value.prototype.hasChanged = /**
|
|
4520
|
+
* @protected
|
|
4521
|
+
* @param {?} initialValue
|
|
4522
|
+
* @param {?} sanitisedValue
|
|
3786
4523
|
* @return {?}
|
|
3787
4524
|
*/
|
|
3788
|
-
function (
|
|
3789
|
-
return
|
|
4525
|
+
function (initialValue, sanitisedValue) {
|
|
4526
|
+
return initialValue !== sanitisedValue;
|
|
3790
4527
|
};
|
|
3791
|
-
return StringType;
|
|
3792
|
-
}());
|
|
3793
|
-
var NumberType = /** @class */ (function () {
|
|
3794
|
-
function NumberType() {
|
|
3795
|
-
}
|
|
3796
4528
|
/**
|
|
3797
|
-
* @param {?}
|
|
4529
|
+
* @param {?} dest
|
|
3798
4530
|
* @return {?}
|
|
3799
4531
|
*/
|
|
3800
|
-
|
|
3801
|
-
* @param {?}
|
|
4532
|
+
Value.prototype.injectRouteParam = /**
|
|
4533
|
+
* @param {?} dest
|
|
3802
4534
|
* @return {?}
|
|
3803
4535
|
*/
|
|
3804
|
-
function (
|
|
3805
|
-
|
|
4536
|
+
function (dest) {
|
|
4537
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
3806
4538
|
};
|
|
4539
|
+
return Value;
|
|
4540
|
+
}(Sanitiser));
|
|
4541
|
+
Sanitiser.Value = Value;
|
|
4542
|
+
/**
|
|
4543
|
+
* @template T
|
|
4544
|
+
*/
|
|
4545
|
+
var /**
|
|
4546
|
+
* @template T
|
|
4547
|
+
*/
|
|
4548
|
+
Array = /** @class */ (function (_super) {
|
|
4549
|
+
__extends(Array, _super);
|
|
4550
|
+
function Array() {
|
|
4551
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4552
|
+
}
|
|
3807
4553
|
/**
|
|
3808
|
-
* @param {?}
|
|
4554
|
+
* @param {?} snapshot
|
|
3809
4555
|
* @return {?}
|
|
3810
4556
|
*/
|
|
3811
|
-
|
|
3812
|
-
* @param {?}
|
|
4557
|
+
Array.prototype.readFrom = /**
|
|
4558
|
+
* @param {?} snapshot
|
|
3813
4559
|
* @return {?}
|
|
3814
4560
|
*/
|
|
3815
|
-
function (
|
|
3816
|
-
|
|
4561
|
+
function (snapshot) {
|
|
4562
|
+
var _this = this;
|
|
4563
|
+
/** @type {?} */
|
|
4564
|
+
var rawValues = snapshot.paramMap.getAll(this.parameterDef.name);
|
|
4565
|
+
return rawValues.map((/**
|
|
4566
|
+
* @param {?} value
|
|
4567
|
+
* @return {?}
|
|
4568
|
+
*/
|
|
4569
|
+
function (value) { return _this.parameterDef.type.parse(value); }));
|
|
3817
4570
|
};
|
|
3818
|
-
return NumberType;
|
|
3819
|
-
}());
|
|
3820
|
-
var BooleanType = /** @class */ (function () {
|
|
3821
|
-
function BooleanType() {
|
|
3822
|
-
}
|
|
3823
4571
|
/**
|
|
3824
|
-
* @
|
|
4572
|
+
* @protected
|
|
4573
|
+
* @param {?} initialValue
|
|
4574
|
+
* @param {?} sanitisedValue
|
|
3825
4575
|
* @return {?}
|
|
3826
4576
|
*/
|
|
3827
|
-
|
|
3828
|
-
* @
|
|
4577
|
+
Array.prototype.hasChanged = /**
|
|
4578
|
+
* @protected
|
|
4579
|
+
* @param {?} initialValue
|
|
4580
|
+
* @param {?} sanitisedValue
|
|
3829
4581
|
* @return {?}
|
|
3830
4582
|
*/
|
|
3831
|
-
function (
|
|
3832
|
-
return
|
|
4583
|
+
function (initialValue, sanitisedValue) {
|
|
4584
|
+
return initialValue !== sanitisedValue;
|
|
3833
4585
|
};
|
|
3834
4586
|
/**
|
|
3835
|
-
* @param {?}
|
|
4587
|
+
* @param {?} dest
|
|
3836
4588
|
* @return {?}
|
|
3837
4589
|
*/
|
|
3838
|
-
|
|
3839
|
-
* @param {?}
|
|
4590
|
+
Array.prototype.injectRouteParam = /**
|
|
4591
|
+
* @param {?} dest
|
|
3840
4592
|
* @return {?}
|
|
3841
4593
|
*/
|
|
3842
|
-
function (
|
|
3843
|
-
|
|
4594
|
+
function (dest) {
|
|
4595
|
+
var _this = this;
|
|
4596
|
+
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
4597
|
+
* @param {?} v
|
|
4598
|
+
* @return {?}
|
|
4599
|
+
*/
|
|
4600
|
+
function (v) { return _this.parameterDef.type.format(v); }));
|
|
3844
4601
|
};
|
|
3845
|
-
return
|
|
3846
|
-
}());
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
ParameterType.BOOLEAN = new BooleanType();
|
|
3850
|
-
})(ParameterType || (ParameterType = {}));
|
|
3851
|
-
|
|
3852
|
-
/**
|
|
3853
|
-
* @fileoverview added by tsickle
|
|
3854
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3855
|
-
*/
|
|
3856
|
-
/**
|
|
3857
|
-
* @record
|
|
3858
|
-
* @template T
|
|
3859
|
-
*/
|
|
3860
|
-
function ResolvedParameter() { }
|
|
3861
|
-
if (false) {
|
|
3862
|
-
/** @type {?} */
|
|
3863
|
-
ResolvedParameter.prototype.parameterDef;
|
|
3864
|
-
/** @type {?} */
|
|
3865
|
-
ResolvedParameter.prototype.resolvedValue;
|
|
3866
|
-
}
|
|
3867
|
-
|
|
3868
|
-
/**
|
|
3869
|
-
* @fileoverview added by tsickle
|
|
3870
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3871
|
-
*/
|
|
3872
|
-
var VisitSnapshot = /** @class */ (function () {
|
|
3873
|
-
function VisitSnapshot() {
|
|
3874
|
-
}
|
|
3875
|
-
return VisitSnapshot;
|
|
3876
|
-
}());
|
|
4602
|
+
return Array;
|
|
4603
|
+
}(Sanitiser));
|
|
4604
|
+
Sanitiser.Array = Array;
|
|
4605
|
+
})(Sanitiser || (Sanitiser = {}));
|
|
3877
4606
|
|
|
3878
4607
|
/**
|
|
3879
4608
|
* @fileoverview added by tsickle
|
|
@@ -3895,5 +4624,5 @@ var VisitSnapshot = /** @class */ (function () {
|
|
|
3895
4624
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3896
4625
|
*/
|
|
3897
4626
|
|
|
3898
|
-
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,
|
|
4627
|
+
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 };
|
|
3899
4628
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|