@coolon/angular-ui-powerups 0.0.37 → 0.0.38
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 +1427 -808
- 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 +6 -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/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 +11 -2
- 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 +118 -14
- 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 +30 -6
- 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 +6 -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/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 +11 -2
- 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 +132 -15
- 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 +35 -6
- 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 +1145 -650
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1390 -778
- 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/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,11 +1,10 @@
|
|
|
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 { BrowserModule } from '@angular/platform-browser';
|
|
6
5
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
6
|
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
|
|
8
|
-
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, assert, UnaryCommand, lang, Dsl, Logger,
|
|
7
|
+
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
8
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
9
|
import { Deferred } from '@coolon/pectin/lib/promise/deferred.class';
|
|
11
10
|
import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
|
|
@@ -14,13 +13,13 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
14
13
|
import { MatListModule } from '@angular/material/list';
|
|
15
14
|
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
16
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
17
|
-
import { Router, RouterModule
|
|
18
|
-
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
19
|
-
import {
|
|
16
|
+
import { Router, RouterModule } 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
|
-
|
|
1798
|
-
|
|
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
|
|
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
|
*/
|
|
@@ -2084,10 +2345,10 @@ var PlaceComponent = /** @class */ (function (_super) {
|
|
|
2084
2345
|
function () {
|
|
2085
2346
|
};
|
|
2086
2347
|
__decorate([
|
|
2087
|
-
Memoize(),
|
|
2348
|
+
Memoize$1(),
|
|
2088
2349
|
__metadata("design:type", PlaceComponent.Definition),
|
|
2089
2350
|
__metadata("design:paramtypes", [])
|
|
2090
|
-
], PlaceComponent.prototype, "
|
|
2351
|
+
], PlaceComponent.prototype, "placeDefinition", null);
|
|
2091
2352
|
__decorate([
|
|
2092
2353
|
Trace(),
|
|
2093
2354
|
__metadata("design:type", Function),
|
|
@@ -2097,11 +2358,13 @@ var PlaceComponent = /** @class */ (function (_super) {
|
|
|
2097
2358
|
return PlaceComponent;
|
|
2098
2359
|
}(DisposableComponent));
|
|
2099
2360
|
if (false) {
|
|
2361
|
+
/** @type {?} */
|
|
2362
|
+
PlaceComponent.prototype._incomingRouteChange;
|
|
2100
2363
|
/**
|
|
2101
2364
|
* @type {?}
|
|
2102
2365
|
* @private
|
|
2103
2366
|
*/
|
|
2104
|
-
PlaceComponent.prototype.
|
|
2367
|
+
PlaceComponent.prototype.resolvedParameters;
|
|
2105
2368
|
/** @type {?} */
|
|
2106
2369
|
PlaceComponent.prototype.activatedRoute;
|
|
2107
2370
|
}
|
|
@@ -2114,17 +2377,31 @@ if (false) {
|
|
|
2114
2377
|
this.order = options.order;
|
|
2115
2378
|
this.data = options.data;
|
|
2116
2379
|
this.authenticate = isNil(options.authenticate) || options.authenticate;
|
|
2380
|
+
this.children = (options.children || []).map((/**
|
|
2381
|
+
* @param {?} c
|
|
2382
|
+
* @return {?}
|
|
2383
|
+
*/
|
|
2384
|
+
function (c) { return PlaceComponent.getDefinition(c).component; }));
|
|
2117
2385
|
}
|
|
2118
2386
|
/**
|
|
2119
|
-
* @
|
|
2387
|
+
* @return {?}
|
|
2388
|
+
*/
|
|
2389
|
+
Definition.prototype.getRouteParameters = /**
|
|
2390
|
+
* @return {?}
|
|
2391
|
+
*/
|
|
2392
|
+
function () {
|
|
2393
|
+
return Klass.get(this.component).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
2394
|
+
};
|
|
2395
|
+
/**
|
|
2396
|
+
* @param {?} constructable
|
|
2120
2397
|
* @return {?}
|
|
2121
2398
|
*/
|
|
2122
2399
|
Definition.prototype.isDescriptorForType = /**
|
|
2123
|
-
* @param {?}
|
|
2400
|
+
* @param {?} constructable
|
|
2124
2401
|
* @return {?}
|
|
2125
2402
|
*/
|
|
2126
|
-
function (
|
|
2127
|
-
return lang.constructorChain(
|
|
2403
|
+
function (constructable) {
|
|
2404
|
+
return lang.constructorChain(constructable).includes(PlaceComponent);
|
|
2128
2405
|
};
|
|
2129
2406
|
/**
|
|
2130
2407
|
* @param {?} placeComponent
|
|
@@ -2181,6 +2458,12 @@ if (false) {
|
|
|
2181
2458
|
return defaultValue;
|
|
2182
2459
|
}
|
|
2183
2460
|
};
|
|
2461
|
+
__decorate([
|
|
2462
|
+
Memoize$1(),
|
|
2463
|
+
__metadata("design:type", Function),
|
|
2464
|
+
__metadata("design:paramtypes", []),
|
|
2465
|
+
__metadata("design:returntype", Array)
|
|
2466
|
+
], Definition.prototype, "getRouteParameters", null);
|
|
2184
2467
|
return Definition;
|
|
2185
2468
|
}());
|
|
2186
2469
|
PlaceComponent.Definition = Definition;
|
|
@@ -2194,6 +2477,8 @@ if (false) {
|
|
|
2194
2477
|
/** @type {?} */
|
|
2195
2478
|
Definition.prototype.data;
|
|
2196
2479
|
/** @type {?} */
|
|
2480
|
+
Definition.prototype.children;
|
|
2481
|
+
/** @type {?} */
|
|
2197
2482
|
Definition.prototype.component;
|
|
2198
2483
|
}
|
|
2199
2484
|
/**
|
|
@@ -2210,15 +2495,24 @@ if (false) {
|
|
|
2210
2495
|
Options.prototype.data;
|
|
2211
2496
|
/** @type {?|undefined} */
|
|
2212
2497
|
Options.prototype.authenticate;
|
|
2498
|
+
/** @type {?|undefined} */
|
|
2499
|
+
Options.prototype.children;
|
|
2500
|
+
}
|
|
2501
|
+
/**
|
|
2502
|
+
* @record
|
|
2503
|
+
*/
|
|
2504
|
+
function ChildOptions() { }
|
|
2505
|
+
PlaceComponent.ChildOptions = ChildOptions;
|
|
2506
|
+
if (false) {
|
|
2507
|
+
/** @type {?} */
|
|
2508
|
+
ChildOptions.prototype.parent;
|
|
2213
2509
|
}
|
|
2214
2510
|
/**
|
|
2215
2511
|
* @param {?} klass
|
|
2216
2512
|
* @return {?}
|
|
2217
2513
|
*/
|
|
2218
2514
|
function getDefinition(klass) {
|
|
2219
|
-
|
|
2220
|
-
var placeOptions = Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
2221
|
-
return new Definition(klass, placeOptions);
|
|
2515
|
+
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
2222
2516
|
}
|
|
2223
2517
|
PlaceComponent.getDefinition = getDefinition;
|
|
2224
2518
|
/**
|
|
@@ -2227,20 +2521,157 @@ if (false) {
|
|
|
2227
2521
|
* @return {?}
|
|
2228
2522
|
*/
|
|
2229
2523
|
function injectDefinition(klass, options) {
|
|
2230
|
-
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, options, klass);
|
|
2524
|
+
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, new Definition(klass, options), klass);
|
|
2231
2525
|
}
|
|
2232
2526
|
PlaceComponent.injectDefinition = injectDefinition;
|
|
2233
2527
|
})(PlaceComponent || (PlaceComponent = {}));
|
|
2234
2528
|
|
|
2529
|
+
/**
|
|
2530
|
+
* @fileoverview added by tsickle
|
|
2531
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2532
|
+
*/
|
|
2533
|
+
var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
2534
|
+
__extends(AbstractPlaceNavigationComponent, _super);
|
|
2535
|
+
function AbstractPlaceNavigationComponent() {
|
|
2536
|
+
var _this = _super.call(this) || this;
|
|
2537
|
+
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;
|
|
2538
|
+
_this.placeDefinitions = chain(_this.placesModel).map((/**
|
|
2539
|
+
* @param {?} c
|
|
2540
|
+
* @return {?}
|
|
2541
|
+
*/
|
|
2542
|
+
function (c) { return PlaceComponent.getDefinition(c); }));
|
|
2543
|
+
return _this;
|
|
2544
|
+
}
|
|
2545
|
+
/**
|
|
2546
|
+
* @param {?} placeDef
|
|
2547
|
+
* @return {?}
|
|
2548
|
+
*/
|
|
2549
|
+
AbstractPlaceNavigationComponent.prototype.getNavItem = /**
|
|
2550
|
+
* @param {?} placeDef
|
|
2551
|
+
* @return {?}
|
|
2552
|
+
*/
|
|
2553
|
+
function (placeDef) {
|
|
2554
|
+
/** @type {?} */
|
|
2555
|
+
var navItem = (/** @type {?} */ (placeDef.getData('navItem')));
|
|
2556
|
+
return {
|
|
2557
|
+
title: (/**
|
|
2558
|
+
* @return {?}
|
|
2559
|
+
*/
|
|
2560
|
+
function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
|
|
2561
|
+
tooltip: (/**
|
|
2562
|
+
* @return {?}
|
|
2563
|
+
*/
|
|
2564
|
+
function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
|
|
2565
|
+
icon: (/**
|
|
2566
|
+
* @return {?}
|
|
2567
|
+
*/
|
|
2568
|
+
function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
|
|
2569
|
+
};
|
|
2570
|
+
};
|
|
2571
|
+
/**
|
|
2572
|
+
* @return {?}
|
|
2573
|
+
*/
|
|
2574
|
+
AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
2575
|
+
* @return {?}
|
|
2576
|
+
*/
|
|
2577
|
+
function () {
|
|
2578
|
+
};
|
|
2579
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
2580
|
+
places: [{ type: Input }],
|
|
2581
|
+
placesModel: [{ type: Input }]
|
|
2582
|
+
};
|
|
2583
|
+
__decorate([
|
|
2584
|
+
StoreInListModel('placesModel'),
|
|
2585
|
+
__metadata("design:type", Array)
|
|
2586
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
2587
|
+
__decorate([
|
|
2588
|
+
UseDelegate(),
|
|
2589
|
+
__metadata("design:type", ListModel)
|
|
2590
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
2591
|
+
__decorate([
|
|
2592
|
+
Memoize(),
|
|
2593
|
+
__metadata("design:type", Function),
|
|
2594
|
+
__metadata("design:paramtypes", [PlaceComponent.Definition]),
|
|
2595
|
+
__metadata("design:returntype", Object)
|
|
2596
|
+
], AbstractPlaceNavigationComponent.prototype, "getNavItem", null);
|
|
2597
|
+
return AbstractPlaceNavigationComponent;
|
|
2598
|
+
}(DisposableComponent));
|
|
2599
|
+
if (false) {
|
|
2600
|
+
/** @type {?} */
|
|
2601
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
2602
|
+
/** @type {?} */
|
|
2603
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
2604
|
+
/** @type {?} */
|
|
2605
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
/**
|
|
2609
|
+
* @fileoverview added by tsickle
|
|
2610
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2611
|
+
*/
|
|
2612
|
+
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
2613
|
+
__extends(ListPlaceNavComponent, _super);
|
|
2614
|
+
function ListPlaceNavComponent() {
|
|
2615
|
+
var _this = _super.call(this) || this;
|
|
2616
|
+
_this.expanded = true;
|
|
2617
|
+
return _this;
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* @return {?}
|
|
2621
|
+
*/
|
|
2622
|
+
ListPlaceNavComponent.prototype.expandMenu = /**
|
|
2623
|
+
* @return {?}
|
|
2624
|
+
*/
|
|
2625
|
+
function () {
|
|
2626
|
+
this.expanded = true;
|
|
2627
|
+
};
|
|
2628
|
+
/**
|
|
2629
|
+
* @return {?}
|
|
2630
|
+
*/
|
|
2631
|
+
ListPlaceNavComponent.prototype.collapseMenu = /**
|
|
2632
|
+
* @return {?}
|
|
2633
|
+
*/
|
|
2634
|
+
function () {
|
|
2635
|
+
this.expanded = false;
|
|
2636
|
+
};
|
|
2637
|
+
/**
|
|
2638
|
+
* @return {?}
|
|
2639
|
+
*/
|
|
2640
|
+
ListPlaceNavComponent.prototype.toggleMenu = /**
|
|
2641
|
+
* @return {?}
|
|
2642
|
+
*/
|
|
2643
|
+
function () {
|
|
2644
|
+
this.expanded = !this.expanded;
|
|
2645
|
+
};
|
|
2646
|
+
ListPlaceNavComponent.decorators = [
|
|
2647
|
+
{ type: Component, args: [{
|
|
2648
|
+
selector: 'angular-ui-powerups-list-place-nav',
|
|
2649
|
+
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]=\"getNavItem(place).tooltip()\">\n <mat-icon *ngIf=\"getNavItem(place).icon()\">{{getNavItem(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNavItem(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
|
|
2650
|
+
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}"]
|
|
2651
|
+
}] }
|
|
2652
|
+
];
|
|
2653
|
+
/** @nocollapse */
|
|
2654
|
+
ListPlaceNavComponent.ctorParameters = function () { return []; };
|
|
2655
|
+
ListPlaceNavComponent.propDecorators = {
|
|
2656
|
+
expanded: [{ type: HostBinding, args: ['class.expanded',] }]
|
|
2657
|
+
};
|
|
2658
|
+
return ListPlaceNavComponent;
|
|
2659
|
+
}(AbstractPlaceNavigationComponent));
|
|
2660
|
+
if (false) {
|
|
2661
|
+
/** @type {?} */
|
|
2662
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2235
2665
|
/**
|
|
2236
2666
|
* @fileoverview added by tsickle
|
|
2237
2667
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2238
2668
|
*/
|
|
2239
2669
|
var PlaceService = /** @class */ (function (_super) {
|
|
2240
2670
|
__extends(PlaceService, _super);
|
|
2241
|
-
function PlaceService(router) {
|
|
2671
|
+
function PlaceService(router, injector) {
|
|
2242
2672
|
var _this = _super.call(this) || this;
|
|
2243
2673
|
_this.router = router;
|
|
2674
|
+
_this.injector = injector;
|
|
2244
2675
|
_this._activePlaces = new MutableListModel();
|
|
2245
2676
|
return _this;
|
|
2246
2677
|
}
|
|
@@ -2294,10 +2725,25 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2294
2725
|
/** @type {?} */
|
|
2295
2726
|
var path = routeId ? [relativePath, routeId, params.next.getFormattedParameters()] : [relativePath, params.next.getFormattedParameters()];
|
|
2296
2727
|
this.router.navigate(path, {
|
|
2297
|
-
relativeTo: params.
|
|
2728
|
+
relativeTo: params.activatedRoute
|
|
2298
2729
|
});
|
|
2299
2730
|
}
|
|
2300
2731
|
};
|
|
2732
|
+
/**
|
|
2733
|
+
* @param {?} snapshot
|
|
2734
|
+
* @return {?}
|
|
2735
|
+
*/
|
|
2736
|
+
PlaceService.prototype.sanitise = /**
|
|
2737
|
+
* @param {?} snapshot
|
|
2738
|
+
* @return {?}
|
|
2739
|
+
*/
|
|
2740
|
+
function (snapshot) {
|
|
2741
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2742
|
+
return __generator(this, function (_a) {
|
|
2743
|
+
return [2 /*return*/, snapshot];
|
|
2744
|
+
});
|
|
2745
|
+
});
|
|
2746
|
+
};
|
|
2301
2747
|
PlaceService.decorators = [
|
|
2302
2748
|
{ type: Injectable, args: [{
|
|
2303
2749
|
providedIn: 'root'
|
|
@@ -2305,9 +2751,10 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2305
2751
|
];
|
|
2306
2752
|
/** @nocollapse */
|
|
2307
2753
|
PlaceService.ctorParameters = function () { return [
|
|
2308
|
-
{ type: Router }
|
|
2754
|
+
{ type: Router },
|
|
2755
|
+
{ type: Injector }
|
|
2309
2756
|
]; };
|
|
2310
|
-
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router)); }, token: PlaceService, providedIn: "root" });
|
|
2757
|
+
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
|
|
2311
2758
|
__decorate([
|
|
2312
2759
|
Trace(),
|
|
2313
2760
|
__metadata("design:type", Function),
|
|
@@ -2326,6 +2773,12 @@ var PlaceService = /** @class */ (function (_super) {
|
|
|
2326
2773
|
__metadata("design:paramtypes", [Object]),
|
|
2327
2774
|
__metadata("design:returntype", void 0)
|
|
2328
2775
|
], PlaceService.prototype, "notifyRouteParametersChanged", null);
|
|
2776
|
+
__decorate([
|
|
2777
|
+
Trace(),
|
|
2778
|
+
__metadata("design:type", Function),
|
|
2779
|
+
__metadata("design:paramtypes", [ParameterSnapshot]),
|
|
2780
|
+
__metadata("design:returntype", Promise)
|
|
2781
|
+
], PlaceService.prototype, "sanitise", null);
|
|
2329
2782
|
return PlaceService;
|
|
2330
2783
|
}(GarbageCollector));
|
|
2331
2784
|
if (false) {
|
|
@@ -2339,6 +2792,11 @@ if (false) {
|
|
|
2339
2792
|
* @protected
|
|
2340
2793
|
*/
|
|
2341
2794
|
PlaceService.prototype.router;
|
|
2795
|
+
/**
|
|
2796
|
+
* @type {?}
|
|
2797
|
+
* @protected
|
|
2798
|
+
*/
|
|
2799
|
+
PlaceService.prototype.injector;
|
|
2342
2800
|
}
|
|
2343
2801
|
|
|
2344
2802
|
/**
|
|
@@ -2381,11 +2839,18 @@ var right = [
|
|
|
2381
2839
|
})
|
|
2382
2840
|
])
|
|
2383
2841
|
];
|
|
2842
|
+
/**
|
|
2843
|
+
* @param {?} duration
|
|
2844
|
+
* @return {?}
|
|
2845
|
+
*/
|
|
2846
|
+
function leftRightPlaceAnimation(duration) {
|
|
2847
|
+
return trigger('routeAnimations', [
|
|
2848
|
+
transition(':increment', right, { params: { duration: duration } }),
|
|
2849
|
+
transition(':decrement', left, { params: { duration: duration } })
|
|
2850
|
+
]);
|
|
2851
|
+
}
|
|
2384
2852
|
/** @type {?} */
|
|
2385
|
-
var LEFT_RIGHT_PLACE_ANIMATION =
|
|
2386
|
-
transition(':increment', right, { params: { duration: '.3s' } }),
|
|
2387
|
-
transition(':decrement', left, { params: { duration: '.3s' } })
|
|
2388
|
-
]);
|
|
2853
|
+
var LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
|
|
2389
2854
|
|
|
2390
2855
|
/**
|
|
2391
2856
|
* @fileoverview added by tsickle
|
|
@@ -2506,54 +2971,19 @@ if (false) {
|
|
|
2506
2971
|
var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
2507
2972
|
__extends(TabbedPlaceNavigationComponent, _super);
|
|
2508
2973
|
function TabbedPlaceNavigationComponent() {
|
|
2509
|
-
|
|
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;
|
|
2974
|
+
return _super.call(this) || this;
|
|
2517
2975
|
}
|
|
2518
|
-
/**
|
|
2519
|
-
* @return {?}
|
|
2520
|
-
*/
|
|
2521
|
-
TabbedPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
2522
|
-
* @return {?}
|
|
2523
|
-
*/
|
|
2524
|
-
function () {
|
|
2525
|
-
};
|
|
2526
2976
|
TabbedPlaceNavigationComponent.decorators = [
|
|
2527
2977
|
{ type: Component, args: [{
|
|
2528
2978
|
selector: 'angular-ui-powerups-tabbed-place-navigation',
|
|
2529
|
-
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let
|
|
2979
|
+
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]=\"getNavItem(place).tooltip()\">\n <mat-icon *ngIf=\"getNavItem(place).icon()\">{{getNavItem(place).icon()}}</mat-icon>\n <span>{{getNavItem(place).title()}}</span>\n </a>\n</nav>\n",
|
|
2530
2980
|
styles: [""]
|
|
2531
2981
|
}] }
|
|
2532
2982
|
];
|
|
2533
2983
|
/** @nocollapse */
|
|
2534
2984
|
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
2985
|
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
|
-
}
|
|
2986
|
+
}(AbstractPlaceNavigationComponent));
|
|
2557
2987
|
|
|
2558
2988
|
/**
|
|
2559
2989
|
* @fileoverview added by tsickle
|
|
@@ -2578,14 +3008,16 @@ var PlaceModule = /** @class */ (function () {
|
|
|
2578
3008
|
EmptyStateComponent,
|
|
2579
3009
|
BusyOverlayComponent,
|
|
2580
3010
|
PlaceOutletComponent,
|
|
2581
|
-
TabbedPlaceNavigationComponent
|
|
3011
|
+
TabbedPlaceNavigationComponent,
|
|
3012
|
+
ListPlaceNavComponent
|
|
2582
3013
|
],
|
|
2583
3014
|
entryComponents: [BusyOverlayComponent],
|
|
2584
3015
|
exports: [
|
|
2585
3016
|
BusyOverlayComponent,
|
|
2586
3017
|
PlaceOutletComponent,
|
|
2587
3018
|
EmptyStateComponent,
|
|
2588
|
-
TabbedPlaceNavigationComponent
|
|
3019
|
+
TabbedPlaceNavigationComponent,
|
|
3020
|
+
ListPlaceNavComponent
|
|
2589
3021
|
],
|
|
2590
3022
|
providers: [
|
|
2591
3023
|
PlaceService
|
|
@@ -2610,11 +3042,10 @@ var AngularUiPowerupsModule = /** @class */ (function () {
|
|
|
2610
3042
|
NumberInputComponent,
|
|
2611
3043
|
StringInputComponent,
|
|
2612
3044
|
PasswordInputComponent,
|
|
2613
|
-
SelectInputComponent
|
|
3045
|
+
SelectInputComponent
|
|
2614
3046
|
],
|
|
2615
3047
|
imports: [
|
|
2616
3048
|
CommonModule,
|
|
2617
|
-
BrowserModule,
|
|
2618
3049
|
BrowserAnimationsModule,
|
|
2619
3050
|
FormsModule,
|
|
2620
3051
|
MatInputModule,
|
|
@@ -2631,7 +3062,7 @@ var AngularUiPowerupsModule = /** @class */ (function () {
|
|
|
2631
3062
|
PasswordInputComponent,
|
|
2632
3063
|
SelectInputComponent,
|
|
2633
3064
|
InteractionModule,
|
|
2634
|
-
PlaceModule
|
|
3065
|
+
PlaceModule
|
|
2635
3066
|
]
|
|
2636
3067
|
},] }
|
|
2637
3068
|
];
|
|
@@ -3012,14 +3443,37 @@ if (false) {
|
|
|
3012
3443
|
/**
|
|
3013
3444
|
* @record
|
|
3014
3445
|
*/
|
|
3015
|
-
function
|
|
3446
|
+
function NavItem() { }
|
|
3447
|
+
if (false) {
|
|
3448
|
+
/**
|
|
3449
|
+
* @return {?}
|
|
3450
|
+
*/
|
|
3451
|
+
NavItem.prototype.title = function () { };
|
|
3452
|
+
/**
|
|
3453
|
+
* @return {?}
|
|
3454
|
+
*/
|
|
3455
|
+
NavItem.prototype.icon = function () { };
|
|
3456
|
+
/**
|
|
3457
|
+
* @return {?}
|
|
3458
|
+
*/
|
|
3459
|
+
NavItem.prototype.tooltip = function () { };
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
/**
|
|
3463
|
+
* @fileoverview added by tsickle
|
|
3464
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3465
|
+
*/
|
|
3466
|
+
/**
|
|
3467
|
+
* @record
|
|
3468
|
+
*/
|
|
3469
|
+
function PlaceComponentLike() { }
|
|
3016
3470
|
if (false) {
|
|
3017
3471
|
/** @type {?} */
|
|
3018
|
-
|
|
3472
|
+
PlaceComponentLike.prototype.activatedRoute;
|
|
3019
3473
|
/**
|
|
3020
3474
|
* @return {?}
|
|
3021
3475
|
*/
|
|
3022
|
-
|
|
3476
|
+
PlaceComponentLike.prototype.onPlaceReady = function () { };
|
|
3023
3477
|
}
|
|
3024
3478
|
|
|
3025
3479
|
/**
|
|
@@ -3029,13 +3483,13 @@ if (false) {
|
|
|
3029
3483
|
/**
|
|
3030
3484
|
* @record
|
|
3031
3485
|
*/
|
|
3032
|
-
function
|
|
3486
|
+
function PlaceUpdatesService() { }
|
|
3033
3487
|
if (false) {
|
|
3034
3488
|
/**
|
|
3035
3489
|
* @param {?} params
|
|
3036
3490
|
* @return {?}
|
|
3037
3491
|
*/
|
|
3038
|
-
|
|
3492
|
+
PlaceUpdatesService.prototype.notifyRouteParametersChanged = function (params) { };
|
|
3039
3493
|
}
|
|
3040
3494
|
|
|
3041
3495
|
/**
|
|
@@ -3059,6 +3513,28 @@ function Place(options) {
|
|
|
3059
3513
|
});
|
|
3060
3514
|
}
|
|
3061
3515
|
|
|
3516
|
+
/**
|
|
3517
|
+
* @fileoverview added by tsickle
|
|
3518
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3519
|
+
*/
|
|
3520
|
+
/**
|
|
3521
|
+
* @record
|
|
3522
|
+
*/
|
|
3523
|
+
function Visit() { }
|
|
3524
|
+
if (false) {
|
|
3525
|
+
/** @type {?} */
|
|
3526
|
+
Visit.prototype.placeDefinition;
|
|
3527
|
+
/**
|
|
3528
|
+
* @return {?}
|
|
3529
|
+
*/
|
|
3530
|
+
Visit.prototype.getRouteId = function () { };
|
|
3531
|
+
/**
|
|
3532
|
+
* @param {?} name
|
|
3533
|
+
* @return {?}
|
|
3534
|
+
*/
|
|
3535
|
+
Visit.prototype.getRouteParameter = function (name) { };
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3062
3538
|
/**
|
|
3063
3539
|
* @fileoverview added by tsickle
|
|
3064
3540
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3083,7 +3559,16 @@ var LeavePlaceGuard = /** @class */ (function () {
|
|
|
3083
3559
|
* @return {?}
|
|
3084
3560
|
*/
|
|
3085
3561
|
function (component, currentRoute, currentState, nextState) {
|
|
3086
|
-
|
|
3562
|
+
// HACK: this will break with child routes...
|
|
3563
|
+
/** @type {?} */
|
|
3564
|
+
var path = "/" + component.placeDefinition.path;
|
|
3565
|
+
console.log({ path: path, next: nextState.url });
|
|
3566
|
+
if (!nextState.url.startsWith(path)) {
|
|
3567
|
+
return component.canDeactivate();
|
|
3568
|
+
}
|
|
3569
|
+
else {
|
|
3570
|
+
return true;
|
|
3571
|
+
}
|
|
3087
3572
|
};
|
|
3088
3573
|
LeavePlaceGuard.decorators = [
|
|
3089
3574
|
{ type: Injectable, args: [{
|
|
@@ -3115,453 +3600,143 @@ if (false) {
|
|
|
3115
3600
|
* @fileoverview added by tsickle
|
|
3116
3601
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3117
3602
|
*/
|
|
3118
|
-
/**
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
var /**
|
|
3123
|
-
* @abstract
|
|
3124
|
-
* @template T, S
|
|
3125
|
-
*/
|
|
3126
|
-
Sanitiser = /** @class */ (function () {
|
|
3127
|
-
function Sanitiser(parameterDef, snapshot, sanitiser) {
|
|
3128
|
-
this.parameterDef = parameterDef;
|
|
3129
|
-
this.snapshot = snapshot;
|
|
3130
|
-
this.sanitiser = sanitiser;
|
|
3603
|
+
var PlaceRouteGuard = /** @class */ (function () {
|
|
3604
|
+
function PlaceRouteGuard(placeService, router) {
|
|
3605
|
+
this.placeService = placeService;
|
|
3606
|
+
this.router = router;
|
|
3131
3607
|
}
|
|
3132
3608
|
/**
|
|
3609
|
+
* @param {?} route
|
|
3610
|
+
* @param {?} state
|
|
3133
3611
|
* @return {?}
|
|
3134
3612
|
*/
|
|
3135
|
-
|
|
3136
|
-
* @
|
|
3137
|
-
|
|
3138
|
-
function () {
|
|
3139
|
-
return this.parameterDef.isRouteId;
|
|
3140
|
-
};
|
|
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
|
-
/**
|
|
3162
|
-
* @return {?}
|
|
3163
|
-
*/
|
|
3164
|
-
Sanitiser.prototype.sanitize = /**
|
|
3613
|
+
PlaceRouteGuard.prototype.canActivate = /**
|
|
3614
|
+
* @param {?} route
|
|
3615
|
+
* @param {?} state
|
|
3165
3616
|
* @return {?}
|
|
3166
3617
|
*/
|
|
3167
|
-
function () {
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
case 2: return [2 /*return*/, true];
|
|
3184
|
-
}
|
|
3185
|
-
});
|
|
3186
|
-
});
|
|
3618
|
+
function (route, state) {
|
|
3619
|
+
// Implement this when adding child routes.
|
|
3620
|
+
// TODO: there are really two types of snapshot, ones with id's and ones without.
|
|
3621
|
+
// Id snapshot are repesented by 2 url segments
|
|
3622
|
+
// ID => [{'/basePath', params}, {'id', params}]
|
|
3623
|
+
// NO ID => [{'/basePath', params}]
|
|
3624
|
+
console.log({ urlSegments: route.url });
|
|
3625
|
+
// const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
|
|
3626
|
+
// return this.placeService.sanitise(snapshot).then(sanitised => {
|
|
3627
|
+
// if (sanitised.hasChanged(snapshot)) {
|
|
3628
|
+
// return this.router.createUrlTree(snapshot.updateUrl(route.url))
|
|
3629
|
+
// } else {
|
|
3630
|
+
// return true;
|
|
3631
|
+
// }
|
|
3632
|
+
// });
|
|
3633
|
+
return true;
|
|
3187
3634
|
};
|
|
3188
|
-
|
|
3635
|
+
PlaceRouteGuard.decorators = [
|
|
3636
|
+
{ type: Injectable, args: [{
|
|
3637
|
+
providedIn: 'root'
|
|
3638
|
+
},] }
|
|
3639
|
+
];
|
|
3640
|
+
/** @nocollapse */
|
|
3641
|
+
PlaceRouteGuard.ctorParameters = function () { return [
|
|
3642
|
+
{ type: PlaceService },
|
|
3643
|
+
{ type: Router }
|
|
3644
|
+
]; };
|
|
3645
|
+
/** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceService), ɵɵinject(Router)); }, token: PlaceRouteGuard, providedIn: "root" });
|
|
3646
|
+
return PlaceRouteGuard;
|
|
3189
3647
|
}());
|
|
3190
3648
|
if (false) {
|
|
3191
3649
|
/**
|
|
3192
3650
|
* @type {?}
|
|
3193
3651
|
* @private
|
|
3194
3652
|
*/
|
|
3195
|
-
|
|
3653
|
+
PlaceRouteGuard.prototype.placeService;
|
|
3196
3654
|
/**
|
|
3197
3655
|
* @type {?}
|
|
3198
3656
|
* @private
|
|
3199
3657
|
*/
|
|
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) { };
|
|
3214
|
-
/**
|
|
3215
|
-
* @abstract
|
|
3216
|
-
* @protected
|
|
3217
|
-
* @param {?} initialValue
|
|
3218
|
-
* @param {?} sanitisedValue
|
|
3219
|
-
* @return {?}
|
|
3220
|
-
*/
|
|
3221
|
-
Sanitiser.prototype.hasChanged = function (initialValue, sanitisedValue) { };
|
|
3222
|
-
/**
|
|
3223
|
-
* @abstract
|
|
3224
|
-
* @param {?} dest
|
|
3225
|
-
* @return {?}
|
|
3226
|
-
*/
|
|
3227
|
-
Sanitiser.prototype.injectRouteParam = function (dest) { };
|
|
3658
|
+
PlaceRouteGuard.prototype.router;
|
|
3228
3659
|
}
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
new Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
|
|
3244
|
-
new Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
|
|
3245
|
-
}));
|
|
3246
|
-
this.routeIdSanitiser = sanitisers.find((/**
|
|
3247
|
-
* @param {?} p
|
|
3248
|
-
* @return {?}
|
|
3249
|
-
*/
|
|
3250
|
-
function (p) { return p.isRouteId(); }));
|
|
3251
|
-
this.parameterSanitisers = sanitisers.filter((/**
|
|
3252
|
-
* @param {?} p
|
|
3253
|
-
* @return {?}
|
|
3254
|
-
*/
|
|
3255
|
-
function (p) { return !p.isRouteId(); }));
|
|
3660
|
+
|
|
3661
|
+
/**
|
|
3662
|
+
* @fileoverview added by tsickle
|
|
3663
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3664
|
+
*/
|
|
3665
|
+
/**
|
|
3666
|
+
* @template T, S
|
|
3667
|
+
*/
|
|
3668
|
+
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
3669
|
+
function DefaultParameterSanitiser(def, placeService, options) {
|
|
3670
|
+
this.def = def;
|
|
3671
|
+
this.placeService = placeService;
|
|
3672
|
+
this.remember = isNil(options.remember) ? false : options.remember;
|
|
3673
|
+
this.defaultValue = isNil(options.defaultValue) ? null : options.defaultValue;
|
|
3256
3674
|
}
|
|
3257
3675
|
/**
|
|
3676
|
+
* @param {?} value
|
|
3677
|
+
* @param {?} visit
|
|
3258
3678
|
* @return {?}
|
|
3259
3679
|
*/
|
|
3260
|
-
|
|
3261
|
-
* @
|
|
3262
|
-
|
|
3263
|
-
function () {
|
|
3264
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3265
|
-
var e_1, _a, _b, _c, sanitiser, e_1_1;
|
|
3266
|
-
return __generator(this, function (_d) {
|
|
3267
|
-
switch (_d.label) {
|
|
3268
|
-
case 0:
|
|
3269
|
-
if (!this.routeIdSanitiser) return [3 /*break*/, 2];
|
|
3270
|
-
return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
|
|
3271
|
-
case 1:
|
|
3272
|
-
_d.sent();
|
|
3273
|
-
if (this.routeIdSanitiser.valueChanged) {
|
|
3274
|
-
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
3275
|
-
// context of the route id.
|
|
3276
|
-
return [2 /*return*/, false];
|
|
3277
|
-
}
|
|
3278
|
-
_d.label = 2;
|
|
3279
|
-
case 2:
|
|
3280
|
-
_d.trys.push([2, 7, 8, 9]);
|
|
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
|
|
3315
|
-
* @return {?}
|
|
3316
|
-
*/
|
|
3317
|
-
RouteParameterSanitiser.prototype.redirect = /**
|
|
3318
|
-
* @param {?} router
|
|
3680
|
+
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
3681
|
+
* @param {?} value
|
|
3682
|
+
* @param {?} visit
|
|
3319
3683
|
* @return {?}
|
|
3320
3684
|
*/
|
|
3321
|
-
function (
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3685
|
+
function (value, visit) {
|
|
3686
|
+
if (this.isBlank(value)) {
|
|
3687
|
+
if (this.remember) {
|
|
3688
|
+
// value = null;
|
|
3689
|
+
}
|
|
3690
|
+
return this.isBlank(value) && !isNil(this.defaultValue) ? this.defaultValue : value;
|
|
3325
3691
|
}
|
|
3326
3692
|
else {
|
|
3327
|
-
|
|
3328
|
-
var routeParams_1 = {};
|
|
3329
|
-
this.parameterSanitisers.forEach((/**
|
|
3330
|
-
* @param {?} s
|
|
3331
|
-
* @return {?}
|
|
3332
|
-
*/
|
|
3333
|
-
function (s) { return s.injectRouteParam(routeParams_1); }));
|
|
3334
|
-
return router.navigate(['.', routeParams_1]);
|
|
3693
|
+
return value;
|
|
3335
3694
|
}
|
|
3336
3695
|
};
|
|
3337
3696
|
/**
|
|
3338
3697
|
* @private
|
|
3339
|
-
* @
|
|
3340
|
-
* @param {?} def
|
|
3698
|
+
* @param {?} value
|
|
3341
3699
|
* @return {?}
|
|
3342
3700
|
*/
|
|
3343
|
-
|
|
3701
|
+
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
3344
3702
|
* @private
|
|
3345
|
-
* @
|
|
3346
|
-
* @param {?} def
|
|
3703
|
+
* @param {?} value
|
|
3347
3704
|
* @return {?}
|
|
3348
3705
|
*/
|
|
3349
|
-
function (
|
|
3350
|
-
|
|
3706
|
+
function (value) {
|
|
3707
|
+
/** @type {?} */
|
|
3708
|
+
var isNil$1 = isNil(value);
|
|
3709
|
+
return this.def.isArray ? !isNil$1 || value['length'] < 1 : isNil$1;
|
|
3351
3710
|
};
|
|
3352
3711
|
__decorate([
|
|
3353
|
-
|
|
3712
|
+
Trace(),
|
|
3354
3713
|
__metadata("design:type", Function),
|
|
3355
|
-
__metadata("design:paramtypes", [Object]),
|
|
3714
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
3356
3715
|
__metadata("design:returntype", Object)
|
|
3357
|
-
],
|
|
3358
|
-
return
|
|
3716
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
3717
|
+
return DefaultParameterSanitiser;
|
|
3359
3718
|
}());
|
|
3360
3719
|
if (false) {
|
|
3361
3720
|
/**
|
|
3362
3721
|
* @type {?}
|
|
3363
3722
|
* @private
|
|
3364
3723
|
*/
|
|
3365
|
-
|
|
3724
|
+
DefaultParameterSanitiser.prototype.remember;
|
|
3366
3725
|
/**
|
|
3367
3726
|
* @type {?}
|
|
3368
3727
|
* @private
|
|
3369
3728
|
*/
|
|
3370
|
-
|
|
3371
|
-
/** @type {?} */
|
|
3372
|
-
RouteParameterSanitiser.prototype.parameterDefs;
|
|
3373
|
-
/** @type {?} */
|
|
3374
|
-
RouteParameterSanitiser.prototype.snapshot;
|
|
3375
|
-
/** @type {?} */
|
|
3376
|
-
RouteParameterSanitiser.prototype.injector;
|
|
3377
|
-
}
|
|
3378
|
-
(function (Sanitiser) {
|
|
3729
|
+
DefaultParameterSanitiser.prototype.defaultValue;
|
|
3379
3730
|
/**
|
|
3380
|
-
* @
|
|
3731
|
+
* @type {?}
|
|
3732
|
+
* @private
|
|
3381
3733
|
*/
|
|
3382
|
-
|
|
3383
|
-
|
|
3734
|
+
DefaultParameterSanitiser.prototype.def;
|
|
3735
|
+
/**
|
|
3736
|
+
* @type {?}
|
|
3737
|
+
* @private
|
|
3384
3738
|
*/
|
|
3385
|
-
|
|
3386
|
-
__extends(Value, _super);
|
|
3387
|
-
function Value() {
|
|
3388
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3389
|
-
}
|
|
3390
|
-
/**
|
|
3391
|
-
* @param {?} snapshot
|
|
3392
|
-
* @return {?}
|
|
3393
|
-
*/
|
|
3394
|
-
Value.prototype.readFrom = /**
|
|
3395
|
-
* @param {?} snapshot
|
|
3396
|
-
* @return {?}
|
|
3397
|
-
*/
|
|
3398
|
-
function (snapshot) {
|
|
3399
|
-
/** @type {?} */
|
|
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);
|
|
3404
|
-
};
|
|
3405
|
-
/**
|
|
3406
|
-
* @protected
|
|
3407
|
-
* @param {?} initialValue
|
|
3408
|
-
* @param {?} sanitisedValue
|
|
3409
|
-
* @return {?}
|
|
3410
|
-
*/
|
|
3411
|
-
Value.prototype.hasChanged = /**
|
|
3412
|
-
* @protected
|
|
3413
|
-
* @param {?} initialValue
|
|
3414
|
-
* @param {?} sanitisedValue
|
|
3415
|
-
* @return {?}
|
|
3416
|
-
*/
|
|
3417
|
-
function (initialValue, sanitisedValue) {
|
|
3418
|
-
return initialValue !== sanitisedValue;
|
|
3419
|
-
};
|
|
3420
|
-
/**
|
|
3421
|
-
* @param {?} dest
|
|
3422
|
-
* @return {?}
|
|
3423
|
-
*/
|
|
3424
|
-
Value.prototype.injectRouteParam = /**
|
|
3425
|
-
* @param {?} dest
|
|
3426
|
-
* @return {?}
|
|
3427
|
-
*/
|
|
3428
|
-
function (dest) {
|
|
3429
|
-
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
3430
|
-
};
|
|
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
|
-
/**
|
|
3446
|
-
* @param {?} snapshot
|
|
3447
|
-
* @return {?}
|
|
3448
|
-
*/
|
|
3449
|
-
Array.prototype.readFrom = /**
|
|
3450
|
-
* @param {?} snapshot
|
|
3451
|
-
* @return {?}
|
|
3452
|
-
*/
|
|
3453
|
-
function (snapshot) {
|
|
3454
|
-
var _this = this;
|
|
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); }));
|
|
3462
|
-
};
|
|
3463
|
-
/**
|
|
3464
|
-
* @protected
|
|
3465
|
-
* @param {?} initialValue
|
|
3466
|
-
* @param {?} sanitisedValue
|
|
3467
|
-
* @return {?}
|
|
3468
|
-
*/
|
|
3469
|
-
Array.prototype.hasChanged = /**
|
|
3470
|
-
* @protected
|
|
3471
|
-
* @param {?} initialValue
|
|
3472
|
-
* @param {?} sanitisedValue
|
|
3473
|
-
* @return {?}
|
|
3474
|
-
*/
|
|
3475
|
-
function (initialValue, sanitisedValue) {
|
|
3476
|
-
return initialValue !== sanitisedValue;
|
|
3477
|
-
};
|
|
3478
|
-
/**
|
|
3479
|
-
* @param {?} dest
|
|
3480
|
-
* @return {?}
|
|
3481
|
-
*/
|
|
3482
|
-
Array.prototype.injectRouteParam = /**
|
|
3483
|
-
* @param {?} dest
|
|
3484
|
-
* @return {?}
|
|
3485
|
-
*/
|
|
3486
|
-
function (dest) {
|
|
3487
|
-
var _this = this;
|
|
3488
|
-
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
3489
|
-
* @param {?} v
|
|
3490
|
-
* @return {?}
|
|
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;
|
|
3507
|
-
}
|
|
3508
|
-
/**
|
|
3509
|
-
* @param {?} route
|
|
3510
|
-
* @param {?} state
|
|
3511
|
-
* @return {?}
|
|
3512
|
-
*/
|
|
3513
|
-
PlaceRouteGuard.prototype.canActivate = /**
|
|
3514
|
-
* @param {?} route
|
|
3515
|
-
* @param {?} state
|
|
3516
|
-
* @return {?}
|
|
3517
|
-
*/
|
|
3518
|
-
function (route, state) {
|
|
3519
|
-
var _this = this;
|
|
3520
|
-
/** @type {?} */
|
|
3521
|
-
var routeParameters = Klass.get(route.component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
|
|
3522
|
-
/** @type {?} */
|
|
3523
|
-
var sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
|
|
3524
|
-
return sanitiser.sanitise().then((/**
|
|
3525
|
-
* @param {?} proceed
|
|
3526
|
-
* @return {?}
|
|
3527
|
-
*/
|
|
3528
|
-
function (proceed) {
|
|
3529
|
-
if (!proceed) {
|
|
3530
|
-
sanitiser.redirect(_this.router);
|
|
3531
|
-
}
|
|
3532
|
-
return proceed;
|
|
3533
|
-
}));
|
|
3534
|
-
};
|
|
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
|
-
/**
|
|
3556
|
-
* @type {?}
|
|
3557
|
-
* @private
|
|
3558
|
-
*/
|
|
3559
|
-
PlaceRouteGuard.prototype.router;
|
|
3560
|
-
/**
|
|
3561
|
-
* @type {?}
|
|
3562
|
-
* @private
|
|
3563
|
-
*/
|
|
3564
|
-
PlaceRouteGuard.prototype.injector;
|
|
3739
|
+
DefaultParameterSanitiser.prototype.placeService;
|
|
3565
3740
|
}
|
|
3566
3741
|
|
|
3567
3742
|
/**
|
|
@@ -3592,6 +3767,10 @@ if (false) {
|
|
|
3592
3767
|
/** @type {?|undefined} */
|
|
3593
3768
|
ParameterOptions.prototype.optional;
|
|
3594
3769
|
/** @type {?|undefined} */
|
|
3770
|
+
ParameterOptions.prototype.remember;
|
|
3771
|
+
/** @type {?|undefined} */
|
|
3772
|
+
ParameterOptions.prototype.defaultValue;
|
|
3773
|
+
/** @type {?|undefined} */
|
|
3595
3774
|
ParameterOptions.prototype.sanitiser;
|
|
3596
3775
|
}
|
|
3597
3776
|
/**
|
|
@@ -3605,7 +3784,11 @@ if (false) {
|
|
|
3605
3784
|
/** @type {?|undefined} */
|
|
3606
3785
|
ListParameterOptions.prototype.optional;
|
|
3607
3786
|
/** @type {?|undefined} */
|
|
3608
|
-
ListParameterOptions.prototype.
|
|
3787
|
+
ListParameterOptions.prototype.remember;
|
|
3788
|
+
/** @type {?|undefined} */
|
|
3789
|
+
ListParameterOptions.prototype.defaultValue;
|
|
3790
|
+
/** @type {?|undefined} */
|
|
3791
|
+
ListParameterOptions.prototype.sanitiser;
|
|
3609
3792
|
}
|
|
3610
3793
|
/**
|
|
3611
3794
|
* @template T
|
|
@@ -3623,7 +3806,7 @@ function RouteId(type, options) {
|
|
|
3623
3806
|
function (prototype, propertyKey) {
|
|
3624
3807
|
/** @type {?} */
|
|
3625
3808
|
var param = createDefinition(propertyKey, type, options, true);
|
|
3626
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3809
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3627
3810
|
UseDelegate()(prototype, propertyKey);
|
|
3628
3811
|
});
|
|
3629
3812
|
}
|
|
@@ -3643,7 +3826,7 @@ function RouteParameter(type, options) {
|
|
|
3643
3826
|
function (prototype, propertyKey) {
|
|
3644
3827
|
/** @type {?} */
|
|
3645
3828
|
var param = createDefinition(propertyKey, type, options, false);
|
|
3646
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3829
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3647
3830
|
UseDelegate()(prototype, propertyKey);
|
|
3648
3831
|
});
|
|
3649
3832
|
}
|
|
@@ -3663,7 +3846,7 @@ function RouteParameterList(elementType, options) {
|
|
|
3663
3846
|
function (prototype, propertyKey) {
|
|
3664
3847
|
/** @type {?} */
|
|
3665
3848
|
var param = createArrayDefinition(propertyKey, elementType, options);
|
|
3666
|
-
Klass.get(prototype).addToOwnMetadataList(
|
|
3849
|
+
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
3667
3850
|
UseDelegate()(prototype, propertyKey);
|
|
3668
3851
|
});
|
|
3669
3852
|
}
|
|
@@ -3708,7 +3891,7 @@ function createArrayDefinition(propertyName, type, options) {
|
|
|
3708
3891
|
name: opts.getOptional('as', propertyNameAsString),
|
|
3709
3892
|
propertyName: propertyNameAsString,
|
|
3710
3893
|
type: assert.notNil(type),
|
|
3711
|
-
sanitiser: opts.getOptional('
|
|
3894
|
+
sanitiser: opts.getOptional('sanitiser', null),
|
|
3712
3895
|
isRouteId: false,
|
|
3713
3896
|
isArray: true
|
|
3714
3897
|
};
|
|
@@ -3721,7 +3904,7 @@ function createArrayDefinition(propertyName, type, options) {
|
|
|
3721
3904
|
*/
|
|
3722
3905
|
/**
|
|
3723
3906
|
* @record
|
|
3724
|
-
* @template
|
|
3907
|
+
* @template T, S
|
|
3725
3908
|
*/
|
|
3726
3909
|
function ParameterDefinition() { }
|
|
3727
3910
|
if (false) {
|
|
@@ -3751,10 +3934,25 @@ function ParameterSanitiser() { }
|
|
|
3751
3934
|
if (false) {
|
|
3752
3935
|
/**
|
|
3753
3936
|
* @param {?} value
|
|
3937
|
+
* @param {?=} visit
|
|
3754
3938
|
* @return {?}
|
|
3755
3939
|
*/
|
|
3756
|
-
ParameterSanitiser.prototype.sanitise = function (value) { };
|
|
3940
|
+
ParameterSanitiser.prototype.sanitise = function (value, visit) { };
|
|
3757
3941
|
}
|
|
3942
|
+
(function (ParameterSanitiser) {
|
|
3943
|
+
/**
|
|
3944
|
+
* @record
|
|
3945
|
+
* @template T
|
|
3946
|
+
*/
|
|
3947
|
+
function Options() { }
|
|
3948
|
+
ParameterSanitiser.Options = Options;
|
|
3949
|
+
if (false) {
|
|
3950
|
+
/** @type {?|undefined} */
|
|
3951
|
+
Options.prototype.remember;
|
|
3952
|
+
/** @type {?|undefined} */
|
|
3953
|
+
Options.prototype.defaultValue;
|
|
3954
|
+
}
|
|
3955
|
+
})(ParameterSanitiser || (ParameterSanitiser = {}));
|
|
3758
3956
|
|
|
3759
3957
|
/**
|
|
3760
3958
|
* @fileoverview added by tsickle
|
|
@@ -3813,7 +4011,7 @@ var ParameterType;
|
|
|
3813
4011
|
* @return {?}
|
|
3814
4012
|
*/
|
|
3815
4013
|
function (value) {
|
|
3816
|
-
return +value;
|
|
4014
|
+
return isNil(value) || isEmpty(value) ? null : +value;
|
|
3817
4015
|
};
|
|
3818
4016
|
return NumberType;
|
|
3819
4017
|
}());
|
|
@@ -3854,26 +4052,440 @@ var ParameterType;
|
|
|
3854
4052
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3855
4053
|
*/
|
|
3856
4054
|
/**
|
|
3857
|
-
* @
|
|
3858
|
-
* @template T
|
|
4055
|
+
* @template T, S
|
|
3859
4056
|
*/
|
|
3860
|
-
|
|
3861
|
-
|
|
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
|
|
4057
|
+
var /**
|
|
4058
|
+
* @template T, S
|
|
3871
4059
|
*/
|
|
3872
|
-
|
|
3873
|
-
function
|
|
4060
|
+
Sanitiser = /** @class */ (function () {
|
|
4061
|
+
function Sanitiser(parameterDef, snapshot, sanitiser) {
|
|
4062
|
+
this.parameterDef = parameterDef;
|
|
4063
|
+
this.snapshot = snapshot;
|
|
4064
|
+
this.sanitiser = sanitiser;
|
|
3874
4065
|
}
|
|
3875
|
-
|
|
3876
|
-
}
|
|
4066
|
+
/**
|
|
4067
|
+
* @return {?}
|
|
4068
|
+
*/
|
|
4069
|
+
Sanitiser.prototype.isRouteId = /**
|
|
4070
|
+
* @return {?}
|
|
4071
|
+
*/
|
|
4072
|
+
function () {
|
|
4073
|
+
return this.parameterDef.isRouteId;
|
|
4074
|
+
};
|
|
4075
|
+
Object.defineProperty(Sanitiser.prototype, "valueChanged", {
|
|
4076
|
+
get: /**
|
|
4077
|
+
* @return {?}
|
|
4078
|
+
*/
|
|
4079
|
+
function () {
|
|
4080
|
+
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
4081
|
+
},
|
|
4082
|
+
enumerable: true,
|
|
4083
|
+
configurable: true
|
|
4084
|
+
});
|
|
4085
|
+
Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
|
|
4086
|
+
get: /**
|
|
4087
|
+
* @return {?}
|
|
4088
|
+
*/
|
|
4089
|
+
function () {
|
|
4090
|
+
return this._sanitisedValue;
|
|
4091
|
+
},
|
|
4092
|
+
enumerable: true,
|
|
4093
|
+
configurable: true
|
|
4094
|
+
});
|
|
4095
|
+
/**
|
|
4096
|
+
* @protected
|
|
4097
|
+
* @param {?} snapshot
|
|
4098
|
+
* @return {?}
|
|
4099
|
+
*/
|
|
4100
|
+
Sanitiser.prototype.readFrom = /**
|
|
4101
|
+
* @protected
|
|
4102
|
+
* @param {?} snapshot
|
|
4103
|
+
* @return {?}
|
|
4104
|
+
*/
|
|
4105
|
+
function (snapshot) {
|
|
4106
|
+
return lang.abstractMethod(this.constructor);
|
|
4107
|
+
};
|
|
4108
|
+
/**
|
|
4109
|
+
* @protected
|
|
4110
|
+
* @param {?} initialValue
|
|
4111
|
+
* @param {?} sanitisedValue
|
|
4112
|
+
* @return {?}
|
|
4113
|
+
*/
|
|
4114
|
+
Sanitiser.prototype.hasChanged = /**
|
|
4115
|
+
* @protected
|
|
4116
|
+
* @param {?} initialValue
|
|
4117
|
+
* @param {?} sanitisedValue
|
|
4118
|
+
* @return {?}
|
|
4119
|
+
*/
|
|
4120
|
+
function (initialValue, sanitisedValue) {
|
|
4121
|
+
return lang.abstractMethod(this.constructor);
|
|
4122
|
+
};
|
|
4123
|
+
/**
|
|
4124
|
+
* @param {?} dest
|
|
4125
|
+
* @return {?}
|
|
4126
|
+
*/
|
|
4127
|
+
Sanitiser.prototype.injectRouteParam = /**
|
|
4128
|
+
* @param {?} dest
|
|
4129
|
+
* @return {?}
|
|
4130
|
+
*/
|
|
4131
|
+
function (dest) {
|
|
4132
|
+
lang.abstractMethod(this.constructor);
|
|
4133
|
+
};
|
|
4134
|
+
/**
|
|
4135
|
+
* @return {?}
|
|
4136
|
+
*/
|
|
4137
|
+
Sanitiser.prototype.sanitize = /**
|
|
4138
|
+
* @return {?}
|
|
4139
|
+
*/
|
|
4140
|
+
function () {
|
|
4141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4142
|
+
var _a;
|
|
4143
|
+
return __generator(this, function (_b) {
|
|
4144
|
+
switch (_b.label) {
|
|
4145
|
+
case 0:
|
|
4146
|
+
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
4147
|
+
this.initialValue = this.readFrom(this.snapshot);
|
|
4148
|
+
_a = this;
|
|
4149
|
+
return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
|
|
4150
|
+
case 1:
|
|
4151
|
+
_a._sanitisedValue = _b.sent();
|
|
4152
|
+
if (this.initialValue !== this._sanitisedValue) {
|
|
4153
|
+
return [2 /*return*/, false];
|
|
4154
|
+
}
|
|
4155
|
+
_b.label = 2;
|
|
4156
|
+
case 2: return [2 /*return*/, true];
|
|
4157
|
+
}
|
|
4158
|
+
});
|
|
4159
|
+
});
|
|
4160
|
+
};
|
|
4161
|
+
return Sanitiser;
|
|
4162
|
+
}());
|
|
4163
|
+
if (false) {
|
|
4164
|
+
/**
|
|
4165
|
+
* @type {?}
|
|
4166
|
+
* @private
|
|
4167
|
+
*/
|
|
4168
|
+
Sanitiser.prototype.initialValue;
|
|
4169
|
+
/**
|
|
4170
|
+
* @type {?}
|
|
4171
|
+
* @private
|
|
4172
|
+
*/
|
|
4173
|
+
Sanitiser.prototype._sanitisedValue;
|
|
4174
|
+
/** @type {?} */
|
|
4175
|
+
Sanitiser.prototype.parameterDef;
|
|
4176
|
+
/** @type {?} */
|
|
4177
|
+
Sanitiser.prototype.snapshot;
|
|
4178
|
+
/** @type {?} */
|
|
4179
|
+
Sanitiser.prototype.sanitiser;
|
|
4180
|
+
}
|
|
4181
|
+
var RouteParameterSanitiser = /** @class */ (function () {
|
|
4182
|
+
function RouteParameterSanitiser(parameterDefs, snapshot, placeService, injector) {
|
|
4183
|
+
var _this = this;
|
|
4184
|
+
this.parameterDefs = parameterDefs;
|
|
4185
|
+
this.snapshot = snapshot;
|
|
4186
|
+
this.placeService = placeService;
|
|
4187
|
+
this.injector = injector;
|
|
4188
|
+
this.parameterSanitisers = [];
|
|
4189
|
+
/** @type {?} */
|
|
4190
|
+
var sanitisers = parameterDefs.map((/**
|
|
4191
|
+
* @param {?} def
|
|
4192
|
+
* @return {?}
|
|
4193
|
+
*/
|
|
4194
|
+
function (def) {
|
|
4195
|
+
return def.isArray ?
|
|
4196
|
+
new Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
|
|
4197
|
+
new Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
|
|
4198
|
+
}));
|
|
4199
|
+
this.routeIdSanitiser = sanitisers.find((/**
|
|
4200
|
+
* @param {?} p
|
|
4201
|
+
* @return {?}
|
|
4202
|
+
*/
|
|
4203
|
+
function (p) { return p.isRouteId(); }));
|
|
4204
|
+
this.parameterSanitisers = sanitisers.filter((/**
|
|
4205
|
+
* @param {?} p
|
|
4206
|
+
* @return {?}
|
|
4207
|
+
*/
|
|
4208
|
+
function (p) { return !p.isRouteId(); }));
|
|
4209
|
+
}
|
|
4210
|
+
/**
|
|
4211
|
+
* @return {?}
|
|
4212
|
+
*/
|
|
4213
|
+
RouteParameterSanitiser.prototype.sanitise = /**
|
|
4214
|
+
* @return {?}
|
|
4215
|
+
*/
|
|
4216
|
+
function () {
|
|
4217
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4218
|
+
var e_1, _a, _b, _c, sanitiser, e_1_1;
|
|
4219
|
+
return __generator(this, function (_d) {
|
|
4220
|
+
switch (_d.label) {
|
|
4221
|
+
case 0:
|
|
4222
|
+
if (!this.routeIdSanitiser) return [3 /*break*/, 2];
|
|
4223
|
+
return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
|
|
4224
|
+
case 1:
|
|
4225
|
+
_d.sent();
|
|
4226
|
+
if (this.routeIdSanitiser.valueChanged) {
|
|
4227
|
+
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
4228
|
+
// context of the route id.
|
|
4229
|
+
return [2 /*return*/, false];
|
|
4230
|
+
}
|
|
4231
|
+
_d.label = 2;
|
|
4232
|
+
case 2:
|
|
4233
|
+
_d.trys.push([2, 7, 8, 9]);
|
|
4234
|
+
_b = __values(this.parameterSanitisers), _c = _b.next();
|
|
4235
|
+
_d.label = 3;
|
|
4236
|
+
case 3:
|
|
4237
|
+
if (!!_c.done) return [3 /*break*/, 6];
|
|
4238
|
+
sanitiser = _c.value;
|
|
4239
|
+
return [4 /*yield*/, sanitiser.sanitize()];
|
|
4240
|
+
case 4:
|
|
4241
|
+
_d.sent();
|
|
4242
|
+
_d.label = 5;
|
|
4243
|
+
case 5:
|
|
4244
|
+
_c = _b.next();
|
|
4245
|
+
return [3 /*break*/, 3];
|
|
4246
|
+
case 6: return [3 /*break*/, 9];
|
|
4247
|
+
case 7:
|
|
4248
|
+
e_1_1 = _d.sent();
|
|
4249
|
+
e_1 = { error: e_1_1 };
|
|
4250
|
+
return [3 /*break*/, 9];
|
|
4251
|
+
case 8:
|
|
4252
|
+
try {
|
|
4253
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4254
|
+
}
|
|
4255
|
+
finally { if (e_1) throw e_1.error; }
|
|
4256
|
+
return [7 /*endfinally*/];
|
|
4257
|
+
case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
|
|
4258
|
+
* @param {?} s
|
|
4259
|
+
* @return {?}
|
|
4260
|
+
*/
|
|
4261
|
+
function (s) { return s.valueChanged; }))];
|
|
4262
|
+
}
|
|
4263
|
+
});
|
|
4264
|
+
});
|
|
4265
|
+
};
|
|
4266
|
+
/**
|
|
4267
|
+
* @private
|
|
4268
|
+
* @template T, S
|
|
4269
|
+
* @param {?} def
|
|
4270
|
+
* @return {?}
|
|
4271
|
+
*/
|
|
4272
|
+
RouteParameterSanitiser.prototype.getSanitiser = /**
|
|
4273
|
+
* @private
|
|
4274
|
+
* @template T, S
|
|
4275
|
+
* @param {?} def
|
|
4276
|
+
* @return {?}
|
|
4277
|
+
*/
|
|
4278
|
+
function (def) {
|
|
4279
|
+
if (def.sanitiser) {
|
|
4280
|
+
if (this.isSanitiserContructor(def.sanitiser)) {
|
|
4281
|
+
return this.injector.get(def.sanitiser, new def.sanitiser());
|
|
4282
|
+
}
|
|
4283
|
+
else {
|
|
4284
|
+
return new DefaultParameterSanitiser(def, this.placeService, def.sanitiser);
|
|
4285
|
+
}
|
|
4286
|
+
}
|
|
4287
|
+
else {
|
|
4288
|
+
return null;
|
|
4289
|
+
}
|
|
4290
|
+
};
|
|
4291
|
+
/**
|
|
4292
|
+
* @return {?}
|
|
4293
|
+
*/
|
|
4294
|
+
RouteParameterSanitiser.prototype.routeIdHasChanged = /**
|
|
4295
|
+
* @return {?}
|
|
4296
|
+
*/
|
|
4297
|
+
function () {
|
|
4298
|
+
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
4299
|
+
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
4300
|
+
};
|
|
4301
|
+
/**
|
|
4302
|
+
* @return {?}
|
|
4303
|
+
*/
|
|
4304
|
+
RouteParameterSanitiser.prototype.getRedirectParams = /**
|
|
4305
|
+
* @return {?}
|
|
4306
|
+
*/
|
|
4307
|
+
function () {
|
|
4308
|
+
if (this.routeIdHasChanged()) {
|
|
4309
|
+
return [this.routeIdSanitiser.sanitisedValue];
|
|
4310
|
+
}
|
|
4311
|
+
else {
|
|
4312
|
+
/** @type {?} */
|
|
4313
|
+
var routeParams_1 = {};
|
|
4314
|
+
this.parameterSanitisers.forEach((/**
|
|
4315
|
+
* @param {?} s
|
|
4316
|
+
* @return {?}
|
|
4317
|
+
*/
|
|
4318
|
+
function (s) { return s.injectRouteParam(routeParams_1); }));
|
|
4319
|
+
return [routeParams_1];
|
|
4320
|
+
}
|
|
4321
|
+
};
|
|
4322
|
+
/**
|
|
4323
|
+
* @private
|
|
4324
|
+
* @template S
|
|
4325
|
+
* @param {?} value
|
|
4326
|
+
* @return {?}
|
|
4327
|
+
*/
|
|
4328
|
+
RouteParameterSanitiser.prototype.isSanitiserContructor = /**
|
|
4329
|
+
* @private
|
|
4330
|
+
* @template S
|
|
4331
|
+
* @param {?} value
|
|
4332
|
+
* @return {?}
|
|
4333
|
+
*/
|
|
4334
|
+
function (value) {
|
|
4335
|
+
return isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
4336
|
+
};
|
|
4337
|
+
__decorate([
|
|
4338
|
+
Memoize(),
|
|
4339
|
+
__metadata("design:type", Function),
|
|
4340
|
+
__metadata("design:paramtypes", [Object]),
|
|
4341
|
+
__metadata("design:returntype", Object)
|
|
4342
|
+
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
4343
|
+
__decorate([
|
|
4344
|
+
Trace(),
|
|
4345
|
+
__metadata("design:type", Function),
|
|
4346
|
+
__metadata("design:paramtypes", []),
|
|
4347
|
+
__metadata("design:returntype", Array)
|
|
4348
|
+
], RouteParameterSanitiser.prototype, "getRedirectParams", null);
|
|
4349
|
+
return RouteParameterSanitiser;
|
|
4350
|
+
}());
|
|
4351
|
+
if (false) {
|
|
4352
|
+
/**
|
|
4353
|
+
* @type {?}
|
|
4354
|
+
* @private
|
|
4355
|
+
*/
|
|
4356
|
+
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
4357
|
+
/**
|
|
4358
|
+
* @type {?}
|
|
4359
|
+
* @private
|
|
4360
|
+
*/
|
|
4361
|
+
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
4362
|
+
/** @type {?} */
|
|
4363
|
+
RouteParameterSanitiser.prototype.parameterDefs;
|
|
4364
|
+
/** @type {?} */
|
|
4365
|
+
RouteParameterSanitiser.prototype.snapshot;
|
|
4366
|
+
/** @type {?} */
|
|
4367
|
+
RouteParameterSanitiser.prototype.placeService;
|
|
4368
|
+
/** @type {?} */
|
|
4369
|
+
RouteParameterSanitiser.prototype.injector;
|
|
4370
|
+
}
|
|
4371
|
+
(function (Sanitiser) {
|
|
4372
|
+
/**
|
|
4373
|
+
* @template T
|
|
4374
|
+
*/
|
|
4375
|
+
var /**
|
|
4376
|
+
* @template T
|
|
4377
|
+
*/
|
|
4378
|
+
Value = /** @class */ (function (_super) {
|
|
4379
|
+
__extends(Value, _super);
|
|
4380
|
+
function Value() {
|
|
4381
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4382
|
+
}
|
|
4383
|
+
/**
|
|
4384
|
+
* @param {?} snapshot
|
|
4385
|
+
* @return {?}
|
|
4386
|
+
*/
|
|
4387
|
+
Value.prototype.readFrom = /**
|
|
4388
|
+
* @param {?} snapshot
|
|
4389
|
+
* @return {?}
|
|
4390
|
+
*/
|
|
4391
|
+
function (snapshot) {
|
|
4392
|
+
/** @type {?} */
|
|
4393
|
+
var rawValue = snapshot.paramMap.get(this.parameterDef.name);
|
|
4394
|
+
return this.parameterDef.type.parse(rawValue);
|
|
4395
|
+
};
|
|
4396
|
+
/**
|
|
4397
|
+
* @protected
|
|
4398
|
+
* @param {?} initialValue
|
|
4399
|
+
* @param {?} sanitisedValue
|
|
4400
|
+
* @return {?}
|
|
4401
|
+
*/
|
|
4402
|
+
Value.prototype.hasChanged = /**
|
|
4403
|
+
* @protected
|
|
4404
|
+
* @param {?} initialValue
|
|
4405
|
+
* @param {?} sanitisedValue
|
|
4406
|
+
* @return {?}
|
|
4407
|
+
*/
|
|
4408
|
+
function (initialValue, sanitisedValue) {
|
|
4409
|
+
return initialValue !== sanitisedValue;
|
|
4410
|
+
};
|
|
4411
|
+
/**
|
|
4412
|
+
* @param {?} dest
|
|
4413
|
+
* @return {?}
|
|
4414
|
+
*/
|
|
4415
|
+
Value.prototype.injectRouteParam = /**
|
|
4416
|
+
* @param {?} dest
|
|
4417
|
+
* @return {?}
|
|
4418
|
+
*/
|
|
4419
|
+
function (dest) {
|
|
4420
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
4421
|
+
};
|
|
4422
|
+
return Value;
|
|
4423
|
+
}(Sanitiser));
|
|
4424
|
+
Sanitiser.Value = Value;
|
|
4425
|
+
/**
|
|
4426
|
+
* @template T
|
|
4427
|
+
*/
|
|
4428
|
+
var /**
|
|
4429
|
+
* @template T
|
|
4430
|
+
*/
|
|
4431
|
+
Array = /** @class */ (function (_super) {
|
|
4432
|
+
__extends(Array, _super);
|
|
4433
|
+
function Array() {
|
|
4434
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4435
|
+
}
|
|
4436
|
+
/**
|
|
4437
|
+
* @param {?} snapshot
|
|
4438
|
+
* @return {?}
|
|
4439
|
+
*/
|
|
4440
|
+
Array.prototype.readFrom = /**
|
|
4441
|
+
* @param {?} snapshot
|
|
4442
|
+
* @return {?}
|
|
4443
|
+
*/
|
|
4444
|
+
function (snapshot) {
|
|
4445
|
+
var _this = this;
|
|
4446
|
+
/** @type {?} */
|
|
4447
|
+
var rawValues = snapshot.paramMap.getAll(this.parameterDef.name);
|
|
4448
|
+
return rawValues.map((/**
|
|
4449
|
+
* @param {?} value
|
|
4450
|
+
* @return {?}
|
|
4451
|
+
*/
|
|
4452
|
+
function (value) { return _this.parameterDef.type.parse(value); }));
|
|
4453
|
+
};
|
|
4454
|
+
/**
|
|
4455
|
+
* @protected
|
|
4456
|
+
* @param {?} initialValue
|
|
4457
|
+
* @param {?} sanitisedValue
|
|
4458
|
+
* @return {?}
|
|
4459
|
+
*/
|
|
4460
|
+
Array.prototype.hasChanged = /**
|
|
4461
|
+
* @protected
|
|
4462
|
+
* @param {?} initialValue
|
|
4463
|
+
* @param {?} sanitisedValue
|
|
4464
|
+
* @return {?}
|
|
4465
|
+
*/
|
|
4466
|
+
function (initialValue, sanitisedValue) {
|
|
4467
|
+
return initialValue !== sanitisedValue;
|
|
4468
|
+
};
|
|
4469
|
+
/**
|
|
4470
|
+
* @param {?} dest
|
|
4471
|
+
* @return {?}
|
|
4472
|
+
*/
|
|
4473
|
+
Array.prototype.injectRouteParam = /**
|
|
4474
|
+
* @param {?} dest
|
|
4475
|
+
* @return {?}
|
|
4476
|
+
*/
|
|
4477
|
+
function (dest) {
|
|
4478
|
+
var _this = this;
|
|
4479
|
+
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
4480
|
+
* @param {?} v
|
|
4481
|
+
* @return {?}
|
|
4482
|
+
*/
|
|
4483
|
+
function (v) { return _this.parameterDef.type.format(v); }));
|
|
4484
|
+
};
|
|
4485
|
+
return Array;
|
|
4486
|
+
}(Sanitiser));
|
|
4487
|
+
Sanitiser.Array = Array;
|
|
4488
|
+
})(Sanitiser || (Sanitiser = {}));
|
|
3877
4489
|
|
|
3878
4490
|
/**
|
|
3879
4491
|
* @fileoverview added by tsickle
|
|
@@ -3895,5 +4507,5 @@ var VisitSnapshot = /** @class */ (function () {
|
|
|
3895
4507
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3896
4508
|
*/
|
|
3897
4509
|
|
|
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,
|
|
4510
|
+
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
4511
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|