@coolon/angular-ui-powerups 0.0.8 → 0.0.9
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 +549 -156
- 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 +12 -11
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +12 -11
- package/esm2015/index.js +2 -2
- package/esm2015/lib/components/forms/abstract-input.component.js +8 -3
- package/esm2015/lib/directives/command.directive.js +48 -4
- package/esm2015/lib/directives/focus-binding.directive.js +30 -14
- package/esm2015/lib/place/components/nav/nav.component.js +31 -0
- package/esm2015/lib/place/guards/place-route.guard.js +3 -3
- package/esm2015/lib/place/index.js +4 -3
- package/esm2015/lib/place/place.module.js +16 -5
- package/esm2015/lib/place/route/parameter-decorators.js +77 -2
- package/esm2015/lib/place/route/parameter-definition.class.js +4 -2
- package/esm2015/lib/place/route/route-parameter-bindings.js +25 -13
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +206 -74
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +12 -11
- package/esm5/index.js +2 -2
- package/esm5/lib/components/forms/abstract-input.component.js +8 -3
- package/esm5/lib/directives/command.directive.js +52 -4
- package/esm5/lib/directives/focus-binding.directive.js +34 -14
- package/esm5/lib/place/components/nav/nav.component.js +36 -0
- package/esm5/lib/place/guards/place-route.guard.js +3 -3
- package/esm5/lib/place/index.js +4 -3
- package/esm5/lib/place/place.module.js +16 -5
- package/esm5/lib/place/route/parameter-decorators.js +77 -2
- package/esm5/lib/place/route/parameter-definition.class.js +4 -2
- package/esm5/lib/place/route/route-parameter-bindings.js +25 -13
- package/esm5/lib/place/route/route-parameter-sanitiser.js +284 -92
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +433 -109
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +518 -127
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +7 -7
- package/lib/directives/command.directive.d.ts +6 -3
- package/lib/directives/focus-binding.directive.d.ts +1 -0
- package/lib/place/components/nav/nav.component.d.ts +7 -0
- package/lib/place/index.d.ts +1 -0
- package/lib/place/route/parameter-decorators.d.ts +17 -0
- package/lib/place/route/parameter-definition.class.d.ts +4 -3
- package/lib/place/route/route-parameter-sanitiser.d.ts +33 -6
- package/package.json +2 -2
|
@@ -5,10 +5,13 @@ import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgress
|
|
|
5
5
|
import { BrowserModule } from '@angular/platform-browser';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
7
|
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
|
|
8
|
-
import { GarbageCollector, MutableListModel, Constant, UseDelegate, MutableValueModel, assert, Dsl, Logger, ListModel, StoreInListModel, EventListenerList, DelegatingValueModel,
|
|
8
|
+
import { GarbageCollector, MutableListModel, Constant, UseDelegate, MutableValueModel, assert, UnaryCommand, lang, Dsl, Logger, ListModel, StoreInListModel, EventListenerList, DelegatingValueModel, UseDelegatingValueModel, ValueModel, StoreInValueModel, Trace, OptionsHelper, ValueHolder, TransactionObserver, Binding } from '@coolon/pectin';
|
|
9
9
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
10
|
import { Deferred } from '@coolon/pectin/lib/promise/deferred.class';
|
|
11
11
|
import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
|
|
12
|
+
import { MatListModule } from '@angular/material/list';
|
|
13
|
+
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
14
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
12
15
|
import { RouterModule, Router, ActivatedRoute, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
13
16
|
import { style, trigger, transition, animate } from '@angular/animations';
|
|
14
17
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
@@ -53,9 +56,14 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
53
56
|
__extends(AbstractInputComponent, _super);
|
|
54
57
|
function AbstractInputComponent() {
|
|
55
58
|
var _this = _super.call(this) || this;
|
|
59
|
+
// TODO: fix this.
|
|
60
|
+
// tslint:disable-next-line:no-output-native
|
|
56
61
|
_this.focus = new EventEmitter();
|
|
62
|
+
// tslint:disable-next-line:no-output-native
|
|
57
63
|
_this.blur = new EventEmitter();
|
|
64
|
+
// tslint:disable-next-line:no-output-native
|
|
58
65
|
_this.enterKey = new EventEmitter();
|
|
66
|
+
// tslint:disable-next-line:no-output-native
|
|
59
67
|
_this.escapeKey = new EventEmitter();
|
|
60
68
|
/** @type {?} */
|
|
61
69
|
var self = _this;
|
|
@@ -131,7 +139,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
131
139
|
* @return {?}
|
|
132
140
|
*/
|
|
133
141
|
function (command) {
|
|
134
|
-
if (command && command.
|
|
142
|
+
if (command && command.enabled.value) {
|
|
135
143
|
command.execute();
|
|
136
144
|
}
|
|
137
145
|
};
|
|
@@ -284,13 +292,35 @@ var NumberInputComponent = /** @class */ (function (_super) {
|
|
|
284
292
|
* @fileoverview added by tsickle
|
|
285
293
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
286
294
|
*/
|
|
295
|
+
/**
|
|
296
|
+
* @template P
|
|
297
|
+
*/
|
|
287
298
|
var CommandDirective = /** @class */ (function (_super) {
|
|
288
299
|
__extends(CommandDirective, _super);
|
|
289
300
|
function CommandDirective(elementRef) {
|
|
290
301
|
var _this = _super.call(this) || this;
|
|
291
302
|
_this.elementRef = elementRef;
|
|
303
|
+
_this._commandParameterProvided = false;
|
|
292
304
|
return _this;
|
|
293
305
|
}
|
|
306
|
+
Object.defineProperty(CommandDirective.prototype, "commandParameter", {
|
|
307
|
+
get: /**
|
|
308
|
+
* @return {?}
|
|
309
|
+
*/
|
|
310
|
+
function () {
|
|
311
|
+
return this._commandParameter;
|
|
312
|
+
},
|
|
313
|
+
set: /**
|
|
314
|
+
* @param {?} value
|
|
315
|
+
* @return {?}
|
|
316
|
+
*/
|
|
317
|
+
function (value) {
|
|
318
|
+
this._commandParameterProvided = true;
|
|
319
|
+
this._commandParameter = value;
|
|
320
|
+
},
|
|
321
|
+
enumerable: true,
|
|
322
|
+
configurable: true
|
|
323
|
+
});
|
|
294
324
|
/**
|
|
295
325
|
* @return {?}
|
|
296
326
|
*/
|
|
@@ -299,6 +329,16 @@ var CommandDirective = /** @class */ (function (_super) {
|
|
|
299
329
|
*/
|
|
300
330
|
function () {
|
|
301
331
|
assert.notNil(this.pectinCommand);
|
|
332
|
+
if (this.pectinCommand instanceof UnaryCommand) {
|
|
333
|
+
if (!this._commandParameterProvided) {
|
|
334
|
+
lang.illegalState('UnaryCommands required the command parameter to be specified.');
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
if (this._commandParameterProvided) {
|
|
339
|
+
lang.illegalState('command parameters are only supported by UnaryCommands');
|
|
340
|
+
}
|
|
341
|
+
}
|
|
302
342
|
};
|
|
303
343
|
/**
|
|
304
344
|
* @return {?}
|
|
@@ -350,8 +390,13 @@ var CommandDirective = /** @class */ (function (_super) {
|
|
|
350
390
|
function ($event) {
|
|
351
391
|
$event.preventDefault();
|
|
352
392
|
$event.stopPropagation();
|
|
353
|
-
if (this.pectinCommand.
|
|
354
|
-
this.pectinCommand
|
|
393
|
+
if (this.pectinCommand.enabled.value) {
|
|
394
|
+
if (this.pectinCommand instanceof UnaryCommand) {
|
|
395
|
+
this.pectinCommand.withContext({ event: $event }).execute(this.commandParameter);
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
this.pectinCommand.withContext({ event: $event }).execute();
|
|
399
|
+
}
|
|
355
400
|
}
|
|
356
401
|
else {
|
|
357
402
|
console.warn('disabled command clicked, ignoring.');
|
|
@@ -369,6 +414,7 @@ var CommandDirective = /** @class */ (function (_super) {
|
|
|
369
414
|
]; };
|
|
370
415
|
CommandDirective.propDecorators = {
|
|
371
416
|
pectinCommand: [{ type: Input }],
|
|
417
|
+
commandParameter: [{ type: Input }],
|
|
372
418
|
notifyClick: [{ type: HostListener, args: ['click', ['$event'],] }]
|
|
373
419
|
};
|
|
374
420
|
return CommandDirective;
|
|
@@ -376,6 +422,16 @@ var CommandDirective = /** @class */ (function (_super) {
|
|
|
376
422
|
if (false) {
|
|
377
423
|
/** @type {?} */
|
|
378
424
|
CommandDirective.prototype.pectinCommand;
|
|
425
|
+
/**
|
|
426
|
+
* @type {?}
|
|
427
|
+
* @private
|
|
428
|
+
*/
|
|
429
|
+
CommandDirective.prototype._commandParameter;
|
|
430
|
+
/**
|
|
431
|
+
* @type {?}
|
|
432
|
+
* @private
|
|
433
|
+
*/
|
|
434
|
+
CommandDirective.prototype._commandParameterProvided;
|
|
379
435
|
/**
|
|
380
436
|
* @type {?}
|
|
381
437
|
* @private
|
|
@@ -404,7 +460,9 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
404
460
|
* @return {?}
|
|
405
461
|
*/
|
|
406
462
|
function () {
|
|
407
|
-
this.
|
|
463
|
+
if (this.hasBinding()) {
|
|
464
|
+
this.pectinFocusBinding.focusCallbacks.notifyFocusIn();
|
|
465
|
+
}
|
|
408
466
|
};
|
|
409
467
|
/**
|
|
410
468
|
* @return {?}
|
|
@@ -413,7 +471,9 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
413
471
|
* @return {?}
|
|
414
472
|
*/
|
|
415
473
|
function () {
|
|
416
|
-
this.
|
|
474
|
+
if (this.hasBinding()) {
|
|
475
|
+
this.pectinFocusBinding.focusCallbacks.notifyFocusOut();
|
|
476
|
+
}
|
|
417
477
|
};
|
|
418
478
|
/**
|
|
419
479
|
* @return {?}
|
|
@@ -432,16 +492,32 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
432
492
|
function () {
|
|
433
493
|
var _this = this;
|
|
434
494
|
// TODO: Make this also track the current enabled/disabled state.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
_this.
|
|
443
|
-
|
|
444
|
-
|
|
495
|
+
if (this.hasBinding()) {
|
|
496
|
+
var chain = Dsl.disposeWith(this).chain;
|
|
497
|
+
chain.value(this.pectinFocusBinding.focused).subscribe((/**
|
|
498
|
+
* @param {?} focused
|
|
499
|
+
* @return {?}
|
|
500
|
+
*/
|
|
501
|
+
function (focused) {
|
|
502
|
+
if (focused && !_this.alreadyHasFocus()) {
|
|
503
|
+
_this.tryAndFocus();
|
|
504
|
+
}
|
|
505
|
+
}));
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
Logger.get(this).warn("pectinFocusBinding was nil");
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* @private
|
|
513
|
+
* @return {?}
|
|
514
|
+
*/
|
|
515
|
+
FocusBindingDirective.prototype.hasBinding = /**
|
|
516
|
+
* @private
|
|
517
|
+
* @return {?}
|
|
518
|
+
*/
|
|
519
|
+
function () {
|
|
520
|
+
return this.pectinFocusBinding && this.pectinFocusBinding.focused;
|
|
445
521
|
};
|
|
446
522
|
// Hook method for debugging via tracing.
|
|
447
523
|
// Hook method for debugging via tracing.
|
|
@@ -526,7 +602,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
526
602
|
* @return {?}
|
|
527
603
|
*/
|
|
528
604
|
function () {
|
|
529
|
-
return this.pectinFocusBinding.focused.value;
|
|
605
|
+
return this.hasBinding() && this.pectinFocusBinding.focused.value;
|
|
530
606
|
};
|
|
531
607
|
// Hook method for debugging via tracing.
|
|
532
608
|
// Hook method for debugging via tracing.
|
|
@@ -1632,6 +1708,40 @@ var EmptyStateComponent = /** @class */ (function () {
|
|
|
1632
1708
|
return EmptyStateComponent;
|
|
1633
1709
|
}());
|
|
1634
1710
|
|
|
1711
|
+
/**
|
|
1712
|
+
* @fileoverview added by tsickle
|
|
1713
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1714
|
+
*/
|
|
1715
|
+
var NavComponent = /** @class */ (function () {
|
|
1716
|
+
function NavComponent() {
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* @return {?}
|
|
1720
|
+
*/
|
|
1721
|
+
NavComponent.prototype.ngOnInit = /**
|
|
1722
|
+
* @return {?}
|
|
1723
|
+
*/
|
|
1724
|
+
function () {
|
|
1725
|
+
};
|
|
1726
|
+
NavComponent.decorators = [
|
|
1727
|
+
{ type: Component, args: [{
|
|
1728
|
+
selector: 'angular-ui-powerups-nav',
|
|
1729
|
+
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of places\" [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"place.title\">{{place.title}}</a>\n</nav>\n\n",
|
|
1730
|
+
styles: [""]
|
|
1731
|
+
}] }
|
|
1732
|
+
];
|
|
1733
|
+
/** @nocollapse */
|
|
1734
|
+
NavComponent.ctorParameters = function () { return []; };
|
|
1735
|
+
NavComponent.propDecorators = {
|
|
1736
|
+
places: [{ type: Input }]
|
|
1737
|
+
};
|
|
1738
|
+
return NavComponent;
|
|
1739
|
+
}());
|
|
1740
|
+
if (false) {
|
|
1741
|
+
/** @type {?} */
|
|
1742
|
+
NavComponent.prototype.places;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1635
1745
|
/**
|
|
1636
1746
|
* @fileoverview added by tsickle
|
|
1637
1747
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -1772,19 +1882,25 @@ var PlaceModule = /** @class */ (function () {
|
|
|
1772
1882
|
{ type: NgModule, args: [{
|
|
1773
1883
|
imports: [
|
|
1774
1884
|
CommonModule,
|
|
1885
|
+
BrowserAnimationsModule,
|
|
1775
1886
|
MatProgressSpinnerModule,
|
|
1776
|
-
RouterModule
|
|
1887
|
+
RouterModule,
|
|
1888
|
+
MatTabsModule$1,
|
|
1889
|
+
MatListModule,
|
|
1890
|
+
MatTooltipModule
|
|
1777
1891
|
],
|
|
1778
1892
|
declarations: [
|
|
1779
1893
|
EmptyStateComponent,
|
|
1780
1894
|
BusyOverlayComponent,
|
|
1781
|
-
PlaceOutletComponent
|
|
1895
|
+
PlaceOutletComponent,
|
|
1896
|
+
NavComponent
|
|
1782
1897
|
],
|
|
1783
1898
|
entryComponents: [BusyOverlayComponent],
|
|
1784
1899
|
exports: [
|
|
1785
1900
|
BusyOverlayComponent,
|
|
1786
1901
|
PlaceOutletComponent,
|
|
1787
|
-
EmptyStateComponent
|
|
1902
|
+
EmptyStateComponent,
|
|
1903
|
+
NavComponent
|
|
1788
1904
|
],
|
|
1789
1905
|
providers: [
|
|
1790
1906
|
PlaceService
|
|
@@ -2275,7 +2391,7 @@ function Place(options) {
|
|
|
2275
2391
|
function ResolvedParameter() { }
|
|
2276
2392
|
if (false) {
|
|
2277
2393
|
/** @type {?} */
|
|
2278
|
-
ResolvedParameter.prototype.
|
|
2394
|
+
ResolvedParameter.prototype.parameterDef;
|
|
2279
2395
|
/** @type {?} */
|
|
2280
2396
|
ResolvedParameter.prototype.resolvedValue;
|
|
2281
2397
|
}
|
|
@@ -2299,7 +2415,7 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2299
2415
|
* @param {?} p
|
|
2300
2416
|
* @return {?}
|
|
2301
2417
|
*/
|
|
2302
|
-
function (p) { return p.
|
|
2418
|
+
function (p) { return p.parameterDef === parameter; }));
|
|
2303
2419
|
return resolved ? resolved.resolvedValue : null;
|
|
2304
2420
|
};
|
|
2305
2421
|
/**
|
|
@@ -2319,8 +2435,8 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2319
2435
|
* @param {?} p
|
|
2320
2436
|
* @return {?}
|
|
2321
2437
|
*/
|
|
2322
|
-
function (p) { return p.
|
|
2323
|
-
|
|
2438
|
+
function (p) { return p.parameterDef !== parameter; })).concat({
|
|
2439
|
+
parameterDef: parameter,
|
|
2324
2440
|
resolvedValue: value
|
|
2325
2441
|
}));
|
|
2326
2442
|
};
|
|
@@ -2335,7 +2451,7 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2335
2451
|
function () {
|
|
2336
2452
|
/** @type {?} */
|
|
2337
2453
|
var routeIdParam = this.getRouteIdParam();
|
|
2338
|
-
return routeIdParam ? routeIdParam.
|
|
2454
|
+
return routeIdParam ? routeIdParam.parameterDef.type.format(routeIdParam.resolvedValue) : null;
|
|
2339
2455
|
};
|
|
2340
2456
|
/**
|
|
2341
2457
|
* @private
|
|
@@ -2350,7 +2466,7 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2350
2466
|
* @param {?} p
|
|
2351
2467
|
* @return {?}
|
|
2352
2468
|
*/
|
|
2353
|
-
function (p) { return p.
|
|
2469
|
+
function (p) { return p.parameterDef.isRouteId; }));
|
|
2354
2470
|
};
|
|
2355
2471
|
/**
|
|
2356
2472
|
* @protected
|
|
@@ -2368,12 +2484,12 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2368
2484
|
* @param {?} p
|
|
2369
2485
|
* @return {?}
|
|
2370
2486
|
*/
|
|
2371
|
-
function (p) { return !p.
|
|
2487
|
+
function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
|
|
2372
2488
|
* @param {?} p
|
|
2373
2489
|
* @return {?}
|
|
2374
2490
|
*/
|
|
2375
2491
|
function (p) {
|
|
2376
|
-
params[p.
|
|
2492
|
+
params[p.parameterDef.name] = p.parameterDef.type.format(p.resolvedValue);
|
|
2377
2493
|
}));
|
|
2378
2494
|
return params;
|
|
2379
2495
|
};
|
|
@@ -2406,7 +2522,7 @@ var ResolvedParameters = /** @class */ (function () {
|
|
|
2406
2522
|
/** @type {?} */
|
|
2407
2523
|
var path = routeId ? [relativePath, routeId, this.getFormattedParameters()] : [relativePath, this.getFormattedParameters()];
|
|
2408
2524
|
router.navigate(path, {
|
|
2409
|
-
relativeTo: activatedRoute
|
|
2525
|
+
relativeTo: activatedRoute
|
|
2410
2526
|
});
|
|
2411
2527
|
};
|
|
2412
2528
|
__decorate([
|
|
@@ -2463,11 +2579,23 @@ var RouteParameterBindings = /** @class */ (function (_super) {
|
|
|
2463
2579
|
/** @type {?} */
|
|
2464
2580
|
var result = [];
|
|
2465
2581
|
routeParameterDefs.forEach((/**
|
|
2466
|
-
* @param {?}
|
|
2582
|
+
* @param {?} parameterDef
|
|
2467
2583
|
* @return {?}
|
|
2468
2584
|
*/
|
|
2469
|
-
function (
|
|
2470
|
-
|
|
2585
|
+
function (parameterDef) {
|
|
2586
|
+
/** @type {?} */
|
|
2587
|
+
var resolvedValue;
|
|
2588
|
+
if (parameterDef.isArray) {
|
|
2589
|
+
resolvedValue = params.getAll(parameterDef.name).map((/**
|
|
2590
|
+
* @param {?} v
|
|
2591
|
+
* @return {?}
|
|
2592
|
+
*/
|
|
2593
|
+
function (v) { return parameterDef.type.parse(v); }));
|
|
2594
|
+
}
|
|
2595
|
+
else {
|
|
2596
|
+
resolvedValue = parameterDef.type.parse(params.get(parameterDef.name));
|
|
2597
|
+
}
|
|
2598
|
+
result.push({ parameterDef: parameterDef, resolvedValue: resolvedValue });
|
|
2471
2599
|
}));
|
|
2472
2600
|
return new ResolvedParameters(result);
|
|
2473
2601
|
}));
|
|
@@ -2718,41 +2846,162 @@ if (false) {
|
|
|
2718
2846
|
* @fileoverview added by tsickle
|
|
2719
2847
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2720
2848
|
*/
|
|
2849
|
+
/**
|
|
2850
|
+
* @abstract
|
|
2851
|
+
* @template T, S
|
|
2852
|
+
*/
|
|
2853
|
+
var /**
|
|
2854
|
+
* @abstract
|
|
2855
|
+
* @template T, S
|
|
2856
|
+
*/
|
|
2857
|
+
Sanitiser = /** @class */ (function () {
|
|
2858
|
+
function Sanitiser(parameterDef, snapshot, sanitiser) {
|
|
2859
|
+
this.parameterDef = parameterDef;
|
|
2860
|
+
this.snapshot = snapshot;
|
|
2861
|
+
this.sanitiser = sanitiser;
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* @return {?}
|
|
2865
|
+
*/
|
|
2866
|
+
Sanitiser.prototype.isRouteId = /**
|
|
2867
|
+
* @return {?}
|
|
2868
|
+
*/
|
|
2869
|
+
function () {
|
|
2870
|
+
return this.parameterDef.isRouteId;
|
|
2871
|
+
};
|
|
2872
|
+
Object.defineProperty(Sanitiser.prototype, "valueChanged", {
|
|
2873
|
+
get: /**
|
|
2874
|
+
* @return {?}
|
|
2875
|
+
*/
|
|
2876
|
+
function () {
|
|
2877
|
+
return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
2878
|
+
},
|
|
2879
|
+
enumerable: true,
|
|
2880
|
+
configurable: true
|
|
2881
|
+
});
|
|
2882
|
+
Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
|
|
2883
|
+
get: /**
|
|
2884
|
+
* @return {?}
|
|
2885
|
+
*/
|
|
2886
|
+
function () {
|
|
2887
|
+
return this._sanitisedValue;
|
|
2888
|
+
},
|
|
2889
|
+
enumerable: true,
|
|
2890
|
+
configurable: true
|
|
2891
|
+
});
|
|
2892
|
+
/**
|
|
2893
|
+
* @return {?}
|
|
2894
|
+
*/
|
|
2895
|
+
Sanitiser.prototype.sanitize = /**
|
|
2896
|
+
* @return {?}
|
|
2897
|
+
*/
|
|
2898
|
+
function () {
|
|
2899
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2900
|
+
var _a;
|
|
2901
|
+
return __generator(this, function (_b) {
|
|
2902
|
+
switch (_b.label) {
|
|
2903
|
+
case 0:
|
|
2904
|
+
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
2905
|
+
this.initialValue = this.readFrom(this.snapshot);
|
|
2906
|
+
_a = this;
|
|
2907
|
+
return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
|
|
2908
|
+
case 1:
|
|
2909
|
+
_a._sanitisedValue = _b.sent();
|
|
2910
|
+
if (this.initialValue !== this._sanitisedValue) {
|
|
2911
|
+
return [2 /*return*/, false];
|
|
2912
|
+
}
|
|
2913
|
+
_b.label = 2;
|
|
2914
|
+
case 2: return [2 /*return*/, true];
|
|
2915
|
+
}
|
|
2916
|
+
});
|
|
2917
|
+
});
|
|
2918
|
+
};
|
|
2919
|
+
return Sanitiser;
|
|
2920
|
+
}());
|
|
2921
|
+
if (false) {
|
|
2922
|
+
/**
|
|
2923
|
+
* @type {?}
|
|
2924
|
+
* @private
|
|
2925
|
+
*/
|
|
2926
|
+
Sanitiser.prototype.initialValue;
|
|
2927
|
+
/**
|
|
2928
|
+
* @type {?}
|
|
2929
|
+
* @private
|
|
2930
|
+
*/
|
|
2931
|
+
Sanitiser.prototype._sanitisedValue;
|
|
2932
|
+
/** @type {?} */
|
|
2933
|
+
Sanitiser.prototype.parameterDef;
|
|
2934
|
+
/** @type {?} */
|
|
2935
|
+
Sanitiser.prototype.snapshot;
|
|
2936
|
+
/** @type {?} */
|
|
2937
|
+
Sanitiser.prototype.sanitiser;
|
|
2938
|
+
/**
|
|
2939
|
+
* @abstract
|
|
2940
|
+
* @protected
|
|
2941
|
+
* @param {?} snapshot
|
|
2942
|
+
* @return {?}
|
|
2943
|
+
*/
|
|
2944
|
+
Sanitiser.prototype.readFrom = function (snapshot) { };
|
|
2945
|
+
/**
|
|
2946
|
+
* @abstract
|
|
2947
|
+
* @protected
|
|
2948
|
+
* @param {?} initialValue
|
|
2949
|
+
* @param {?} sanitisedValue
|
|
2950
|
+
* @return {?}
|
|
2951
|
+
*/
|
|
2952
|
+
Sanitiser.prototype.hasChanged = function (initialValue, sanitisedValue) { };
|
|
2953
|
+
/**
|
|
2954
|
+
* @abstract
|
|
2955
|
+
* @param {?} dest
|
|
2956
|
+
* @return {?}
|
|
2957
|
+
*/
|
|
2958
|
+
Sanitiser.prototype.injectRouteParam = function (dest) { };
|
|
2959
|
+
}
|
|
2721
2960
|
var RouteParameterSanitiser = /** @class */ (function () {
|
|
2722
|
-
function RouteParameterSanitiser(parameterDefs, injector) {
|
|
2961
|
+
function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
|
|
2962
|
+
var _this = this;
|
|
2723
2963
|
this.parameterDefs = parameterDefs;
|
|
2964
|
+
this.snapshot = snapshot;
|
|
2724
2965
|
this.injector = injector;
|
|
2725
|
-
this.
|
|
2726
|
-
|
|
2966
|
+
this.parameterSanitisers = [];
|
|
2967
|
+
/** @type {?} */
|
|
2968
|
+
var sanitisers = parameterDefs.map((/**
|
|
2969
|
+
* @param {?} def
|
|
2970
|
+
* @return {?}
|
|
2971
|
+
*/
|
|
2972
|
+
function (def) {
|
|
2973
|
+
return def.isArray ?
|
|
2974
|
+
new Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
|
|
2975
|
+
new Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
|
|
2976
|
+
}));
|
|
2977
|
+
this.routeIdSanitiser = sanitisers.find((/**
|
|
2727
2978
|
* @param {?} p
|
|
2728
2979
|
* @return {?}
|
|
2729
2980
|
*/
|
|
2730
|
-
function (p) { return p.isRouteId; }));
|
|
2731
|
-
this.
|
|
2981
|
+
function (p) { return p.isRouteId(); }));
|
|
2982
|
+
this.parameterSanitisers = sanitisers.filter((/**
|
|
2732
2983
|
* @param {?} p
|
|
2733
2984
|
* @return {?}
|
|
2734
2985
|
*/
|
|
2735
|
-
function (p) { return !p.isRouteId; }));
|
|
2986
|
+
function (p) { return !p.isRouteId(); }));
|
|
2736
2987
|
}
|
|
2737
2988
|
/**
|
|
2738
|
-
* @param {?} snapshot
|
|
2739
2989
|
* @return {?}
|
|
2740
2990
|
*/
|
|
2741
2991
|
RouteParameterSanitiser.prototype.sanitise = /**
|
|
2742
|
-
* @param {?} snapshot
|
|
2743
2992
|
* @return {?}
|
|
2744
2993
|
*/
|
|
2745
|
-
function (
|
|
2994
|
+
function () {
|
|
2746
2995
|
return __awaiter(this, void 0, void 0, function () {
|
|
2747
|
-
var e_1, _a,
|
|
2996
|
+
var e_1, _a, _b, _c, sanitiser, e_1_1;
|
|
2748
2997
|
return __generator(this, function (_d) {
|
|
2749
2998
|
switch (_d.label) {
|
|
2750
2999
|
case 0:
|
|
2751
|
-
if (!this.
|
|
2752
|
-
return [4 /*yield*/, this.
|
|
3000
|
+
if (!this.routeIdSanitiser) return [3 /*break*/, 2];
|
|
3001
|
+
return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
|
|
2753
3002
|
case 1:
|
|
2754
|
-
|
|
2755
|
-
if (
|
|
3003
|
+
_d.sent();
|
|
3004
|
+
if (this.routeIdSanitiser.valueChanged) {
|
|
2756
3005
|
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
2757
3006
|
// context of the route id.
|
|
2758
3007
|
return [2 /*return*/, false];
|
|
@@ -2760,12 +3009,12 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
2760
3009
|
_d.label = 2;
|
|
2761
3010
|
case 2:
|
|
2762
3011
|
_d.trys.push([2, 7, 8, 9]);
|
|
2763
|
-
_b = __values(this.
|
|
3012
|
+
_b = __values(this.parameterSanitisers), _c = _b.next();
|
|
2764
3013
|
_d.label = 3;
|
|
2765
3014
|
case 3:
|
|
2766
3015
|
if (!!_c.done) return [3 /*break*/, 6];
|
|
2767
|
-
|
|
2768
|
-
return [4 /*yield*/,
|
|
3016
|
+
sanitiser = _c.value;
|
|
3017
|
+
return [4 /*yield*/, sanitiser.sanitize()];
|
|
2769
3018
|
case 4:
|
|
2770
3019
|
_d.sent();
|
|
2771
3020
|
_d.label = 5;
|
|
@@ -2783,42 +3032,11 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
2783
3032
|
}
|
|
2784
3033
|
finally { if (e_1) throw e_1.error; }
|
|
2785
3034
|
return [7 /*endfinally*/];
|
|
2786
|
-
case 9: return [2 /*return*/, this.
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
/**
|
|
2792
|
-
* @template T
|
|
2793
|
-
* @param {?} def
|
|
2794
|
-
* @param {?} formattedInitialValue
|
|
2795
|
-
* @return {?}
|
|
2796
|
-
*/
|
|
2797
|
-
RouteParameterSanitiser.prototype.sanitiseParameter = /**
|
|
2798
|
-
* @template T
|
|
2799
|
-
* @param {?} def
|
|
2800
|
-
* @param {?} formattedInitialValue
|
|
2801
|
-
* @return {?}
|
|
2802
|
-
*/
|
|
2803
|
-
function (def, formattedInitialValue) {
|
|
2804
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2805
|
-
var sanitiser, initialValue, sanitisedValue;
|
|
2806
|
-
return __generator(this, function (_a) {
|
|
2807
|
-
switch (_a.label) {
|
|
2808
|
-
case 0:
|
|
2809
|
-
if (!def) return [3 /*break*/, 2];
|
|
2810
|
-
sanitiser = this.getSanitiser(def);
|
|
2811
|
-
if (!sanitiser) return [3 /*break*/, 2];
|
|
2812
|
-
initialValue = def.type.parse(formattedInitialValue);
|
|
2813
|
-
return [4 /*yield*/, sanitiser.sanitise(initialValue)];
|
|
2814
|
-
case 1:
|
|
2815
|
-
sanitisedValue = _a.sent();
|
|
2816
|
-
if (initialValue !== sanitisedValue) {
|
|
2817
|
-
this.sanitisedParameters.push({ def: def, value: def.type.format(sanitisedValue) });
|
|
2818
|
-
return [2 /*return*/, false];
|
|
2819
|
-
}
|
|
2820
|
-
_a.label = 2;
|
|
2821
|
-
case 2: return [2 /*return*/, true];
|
|
3035
|
+
case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
|
|
3036
|
+
* @param {?} s
|
|
3037
|
+
* @return {?}
|
|
3038
|
+
*/
|
|
3039
|
+
function (s) { return s.valueChanged; }))];
|
|
2822
3040
|
}
|
|
2823
3041
|
});
|
|
2824
3042
|
});
|
|
@@ -2832,57 +3050,36 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
2832
3050
|
* @return {?}
|
|
2833
3051
|
*/
|
|
2834
3052
|
function (router) {
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
var sanitisedRouteId = this.sanitisedParameters.find((/**
|
|
2839
|
-
* @param {?} s
|
|
2840
|
-
* @return {?}
|
|
2841
|
-
*/
|
|
2842
|
-
function (s) { return s.def === _this.routeParameter; }));
|
|
2843
|
-
if (sanitisedRouteId) {
|
|
2844
|
-
return router.navigate(['..', sanitisedRouteId.value]);
|
|
3053
|
+
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
3054
|
+
if (this.routeIdSanitiser.valueChanged) {
|
|
3055
|
+
return router.navigate(['..', this.routeIdSanitiser.sanitisedValue]);
|
|
2845
3056
|
}
|
|
2846
3057
|
else {
|
|
2847
3058
|
/** @type {?} */
|
|
2848
|
-
var
|
|
3059
|
+
var routeParams_1 = {};
|
|
3060
|
+
this.parameterSanitisers.forEach((/**
|
|
2849
3061
|
* @param {?} s
|
|
2850
3062
|
* @return {?}
|
|
2851
3063
|
*/
|
|
2852
|
-
function (s) { return s.
|
|
2853
|
-
|
|
2854
|
-
* @param {?} params
|
|
2855
|
-
* @param {?} item
|
|
2856
|
-
* @return {?}
|
|
2857
|
-
*/
|
|
2858
|
-
function (params, item) {
|
|
2859
|
-
var _a;
|
|
2860
|
-
return (__assign({}, params, (_a = {}, _a[item.def.name] = item.value, _a)));
|
|
2861
|
-
}), {});
|
|
2862
|
-
return router.navigate(['.', queryParams]);
|
|
3064
|
+
function (s) { return s.injectRouteParam(routeParams_1); }));
|
|
3065
|
+
return router.navigate(['.', routeParams_1]);
|
|
2863
3066
|
}
|
|
2864
3067
|
};
|
|
2865
3068
|
/**
|
|
2866
3069
|
* @private
|
|
2867
|
-
* @template T
|
|
3070
|
+
* @template T, S
|
|
2868
3071
|
* @param {?} def
|
|
2869
3072
|
* @return {?}
|
|
2870
3073
|
*/
|
|
2871
3074
|
RouteParameterSanitiser.prototype.getSanitiser = /**
|
|
2872
3075
|
* @private
|
|
2873
|
-
* @template T
|
|
3076
|
+
* @template T, S
|
|
2874
3077
|
* @param {?} def
|
|
2875
3078
|
* @return {?}
|
|
2876
3079
|
*/
|
|
2877
3080
|
function (def) {
|
|
2878
3081
|
return def.sanitiser ? this.injector.get(def.sanitiser, new def.sanitiser()) : null;
|
|
2879
3082
|
};
|
|
2880
|
-
__decorate([
|
|
2881
|
-
Trace(),
|
|
2882
|
-
__metadata("design:type", Function),
|
|
2883
|
-
__metadata("design:paramtypes", [Object, String]),
|
|
2884
|
-
__metadata("design:returntype", Promise)
|
|
2885
|
-
], RouteParameterSanitiser.prototype, "sanitiseParameter", null);
|
|
2886
3083
|
__decorate([
|
|
2887
3084
|
Memoize$1(),
|
|
2888
3085
|
__metadata("design:type", Function),
|
|
@@ -2896,22 +3093,139 @@ if (false) {
|
|
|
2896
3093
|
* @type {?}
|
|
2897
3094
|
* @private
|
|
2898
3095
|
*/
|
|
2899
|
-
RouteParameterSanitiser.prototype.
|
|
3096
|
+
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
2900
3097
|
/**
|
|
2901
3098
|
* @type {?}
|
|
2902
3099
|
* @private
|
|
2903
3100
|
*/
|
|
2904
|
-
RouteParameterSanitiser.prototype.
|
|
2905
|
-
/**
|
|
2906
|
-
* @type {?}
|
|
2907
|
-
* @private
|
|
2908
|
-
*/
|
|
2909
|
-
RouteParameterSanitiser.prototype.sanitisedParameters;
|
|
3101
|
+
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
2910
3102
|
/** @type {?} */
|
|
2911
3103
|
RouteParameterSanitiser.prototype.parameterDefs;
|
|
2912
3104
|
/** @type {?} */
|
|
3105
|
+
RouteParameterSanitiser.prototype.snapshot;
|
|
3106
|
+
/** @type {?} */
|
|
2913
3107
|
RouteParameterSanitiser.prototype.injector;
|
|
2914
3108
|
}
|
|
3109
|
+
(function (Sanitiser) {
|
|
3110
|
+
/**
|
|
3111
|
+
* @template T
|
|
3112
|
+
*/
|
|
3113
|
+
var /**
|
|
3114
|
+
* @template T
|
|
3115
|
+
*/
|
|
3116
|
+
Value = /** @class */ (function (_super) {
|
|
3117
|
+
__extends(Value, _super);
|
|
3118
|
+
function Value() {
|
|
3119
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3120
|
+
}
|
|
3121
|
+
/**
|
|
3122
|
+
* @param {?} snapshot
|
|
3123
|
+
* @return {?}
|
|
3124
|
+
*/
|
|
3125
|
+
Value.prototype.readFrom = /**
|
|
3126
|
+
* @param {?} snapshot
|
|
3127
|
+
* @return {?}
|
|
3128
|
+
*/
|
|
3129
|
+
function (snapshot) {
|
|
3130
|
+
/** @type {?} */
|
|
3131
|
+
var rawValue = this.parameterDef.isRouteId ?
|
|
3132
|
+
snapshot.paramMap.get(this.parameterDef.name) :
|
|
3133
|
+
snapshot.queryParamMap.get(this.parameterDef.name);
|
|
3134
|
+
return this.parameterDef.type.parse(rawValue);
|
|
3135
|
+
};
|
|
3136
|
+
/**
|
|
3137
|
+
* @protected
|
|
3138
|
+
* @param {?} initialValue
|
|
3139
|
+
* @param {?} sanitisedValue
|
|
3140
|
+
* @return {?}
|
|
3141
|
+
*/
|
|
3142
|
+
Value.prototype.hasChanged = /**
|
|
3143
|
+
* @protected
|
|
3144
|
+
* @param {?} initialValue
|
|
3145
|
+
* @param {?} sanitisedValue
|
|
3146
|
+
* @return {?}
|
|
3147
|
+
*/
|
|
3148
|
+
function (initialValue, sanitisedValue) {
|
|
3149
|
+
return initialValue !== sanitisedValue;
|
|
3150
|
+
};
|
|
3151
|
+
/**
|
|
3152
|
+
* @param {?} dest
|
|
3153
|
+
* @return {?}
|
|
3154
|
+
*/
|
|
3155
|
+
Value.prototype.injectRouteParam = /**
|
|
3156
|
+
* @param {?} dest
|
|
3157
|
+
* @return {?}
|
|
3158
|
+
*/
|
|
3159
|
+
function (dest) {
|
|
3160
|
+
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
3161
|
+
};
|
|
3162
|
+
return Value;
|
|
3163
|
+
}(Sanitiser));
|
|
3164
|
+
Sanitiser.Value = Value;
|
|
3165
|
+
/**
|
|
3166
|
+
* @template T
|
|
3167
|
+
*/
|
|
3168
|
+
var /**
|
|
3169
|
+
* @template T
|
|
3170
|
+
*/
|
|
3171
|
+
Array = /** @class */ (function (_super) {
|
|
3172
|
+
__extends(Array, _super);
|
|
3173
|
+
function Array() {
|
|
3174
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3175
|
+
}
|
|
3176
|
+
/**
|
|
3177
|
+
* @param {?} snapshot
|
|
3178
|
+
* @return {?}
|
|
3179
|
+
*/
|
|
3180
|
+
Array.prototype.readFrom = /**
|
|
3181
|
+
* @param {?} snapshot
|
|
3182
|
+
* @return {?}
|
|
3183
|
+
*/
|
|
3184
|
+
function (snapshot) {
|
|
3185
|
+
var _this = this;
|
|
3186
|
+
/** @type {?} */
|
|
3187
|
+
var rawValues = snapshot.queryParamMap.getAll(this.parameterDef.name);
|
|
3188
|
+
return rawValues.map((/**
|
|
3189
|
+
* @param {?} value
|
|
3190
|
+
* @return {?}
|
|
3191
|
+
*/
|
|
3192
|
+
function (value) { return _this.parameterDef.type.parse(value); }));
|
|
3193
|
+
};
|
|
3194
|
+
/**
|
|
3195
|
+
* @protected
|
|
3196
|
+
* @param {?} initialValue
|
|
3197
|
+
* @param {?} sanitisedValue
|
|
3198
|
+
* @return {?}
|
|
3199
|
+
*/
|
|
3200
|
+
Array.prototype.hasChanged = /**
|
|
3201
|
+
* @protected
|
|
3202
|
+
* @param {?} initialValue
|
|
3203
|
+
* @param {?} sanitisedValue
|
|
3204
|
+
* @return {?}
|
|
3205
|
+
*/
|
|
3206
|
+
function (initialValue, sanitisedValue) {
|
|
3207
|
+
return initialValue !== sanitisedValue;
|
|
3208
|
+
};
|
|
3209
|
+
/**
|
|
3210
|
+
* @param {?} dest
|
|
3211
|
+
* @return {?}
|
|
3212
|
+
*/
|
|
3213
|
+
Array.prototype.injectRouteParam = /**
|
|
3214
|
+
* @param {?} dest
|
|
3215
|
+
* @return {?}
|
|
3216
|
+
*/
|
|
3217
|
+
function (dest) {
|
|
3218
|
+
var _this = this;
|
|
3219
|
+
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
3220
|
+
* @param {?} v
|
|
3221
|
+
* @return {?}
|
|
3222
|
+
*/
|
|
3223
|
+
function (v) { return _this.parameterDef.type.format(v); }));
|
|
3224
|
+
};
|
|
3225
|
+
return Array;
|
|
3226
|
+
}(Sanitiser));
|
|
3227
|
+
Sanitiser.Array = Array;
|
|
3228
|
+
})(Sanitiser || (Sanitiser = {}));
|
|
2915
3229
|
|
|
2916
3230
|
/**
|
|
2917
3231
|
* @fileoverview added by tsickle
|
|
@@ -2937,8 +3251,8 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
2937
3251
|
/** @type {?} */
|
|
2938
3252
|
var routeParameters = Klass.get(route.component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
|
|
2939
3253
|
/** @type {?} */
|
|
2940
|
-
var sanitiser = new RouteParameterSanitiser(routeParameters, this.injector);
|
|
2941
|
-
return sanitiser.sanitise(
|
|
3254
|
+
var sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
|
|
3255
|
+
return sanitiser.sanitise().then((/**
|
|
2942
3256
|
* @param {?} proceed
|
|
2943
3257
|
* @return {?}
|
|
2944
3258
|
*/
|
|
@@ -3009,6 +3323,17 @@ if (false) {
|
|
|
3009
3323
|
/** @type {?|undefined} */
|
|
3010
3324
|
ParameterOptions.prototype.sanitiser;
|
|
3011
3325
|
}
|
|
3326
|
+
/**
|
|
3327
|
+
* @record
|
|
3328
|
+
* @template T
|
|
3329
|
+
*/
|
|
3330
|
+
function ListParameterOptions() { }
|
|
3331
|
+
if (false) {
|
|
3332
|
+
/** @type {?|undefined} */
|
|
3333
|
+
ListParameterOptions.prototype.as;
|
|
3334
|
+
/** @type {?|undefined} */
|
|
3335
|
+
ListParameterOptions.prototype.listSanitiser;
|
|
3336
|
+
}
|
|
3012
3337
|
/**
|
|
3013
3338
|
* @template T
|
|
3014
3339
|
* @param {?} type
|
|
@@ -3030,12 +3355,22 @@ function RouteId(type, options) {
|
|
|
3030
3355
|
});
|
|
3031
3356
|
}
|
|
3032
3357
|
/**
|
|
3358
|
+
* @deprecated use RouteParameter instead.
|
|
3033
3359
|
* @template T
|
|
3034
3360
|
* @param {?} type
|
|
3035
3361
|
* @param {?=} options
|
|
3036
3362
|
* @return {?}
|
|
3037
3363
|
*/
|
|
3038
3364
|
function QueryParameter(type, options) {
|
|
3365
|
+
return RouteParameter(type, options);
|
|
3366
|
+
}
|
|
3367
|
+
/**
|
|
3368
|
+
* @template T
|
|
3369
|
+
* @param {?} type
|
|
3370
|
+
* @param {?=} options
|
|
3371
|
+
* @return {?}
|
|
3372
|
+
*/
|
|
3373
|
+
function RouteParameter(type, options) {
|
|
3039
3374
|
// assert.isTruthy(type.isValid());
|
|
3040
3375
|
return (/**
|
|
3041
3376
|
* @param {?} prototype
|
|
@@ -3049,6 +3384,36 @@ function QueryParameter(type, options) {
|
|
|
3049
3384
|
UseDelegate()(prototype, propertyKey);
|
|
3050
3385
|
});
|
|
3051
3386
|
}
|
|
3387
|
+
/**
|
|
3388
|
+
* @deprecated use RouteParameterList instead
|
|
3389
|
+
* @template E
|
|
3390
|
+
* @param {?} elementType
|
|
3391
|
+
* @param {?=} options
|
|
3392
|
+
* @return {?}
|
|
3393
|
+
*/
|
|
3394
|
+
function QueryParameterList(elementType, options) {
|
|
3395
|
+
return RouteParameterList(elementType, options);
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* @template E
|
|
3399
|
+
* @param {?} elementType
|
|
3400
|
+
* @param {?=} options
|
|
3401
|
+
* @return {?}
|
|
3402
|
+
*/
|
|
3403
|
+
function RouteParameterList(elementType, options) {
|
|
3404
|
+
// assert.isTruthy(type.isValid());
|
|
3405
|
+
return (/**
|
|
3406
|
+
* @param {?} prototype
|
|
3407
|
+
* @param {?} propertyKey
|
|
3408
|
+
* @return {?}
|
|
3409
|
+
*/
|
|
3410
|
+
function (prototype, propertyKey) {
|
|
3411
|
+
/** @type {?} */
|
|
3412
|
+
var param = createArrayDefinition(propertyKey, elementType, options);
|
|
3413
|
+
Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
|
|
3414
|
+
UseDelegate()(prototype, propertyKey);
|
|
3415
|
+
});
|
|
3416
|
+
}
|
|
3052
3417
|
/**
|
|
3053
3418
|
* @template T
|
|
3054
3419
|
* @param {?} propertyName
|
|
@@ -3068,7 +3433,31 @@ function createDefinition(propertyName, type, options, routeId) {
|
|
|
3068
3433
|
propertyName: propertyNameAsString,
|
|
3069
3434
|
type: assert.notNil(type),
|
|
3070
3435
|
sanitiser: opts.getOptional('sanitiser', null),
|
|
3071
|
-
isRouteId: routeId
|
|
3436
|
+
isRouteId: routeId,
|
|
3437
|
+
isArray: false
|
|
3438
|
+
};
|
|
3439
|
+
return def;
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* @template T
|
|
3443
|
+
* @param {?} propertyName
|
|
3444
|
+
* @param {?} type
|
|
3445
|
+
* @param {?} options
|
|
3446
|
+
* @return {?}
|
|
3447
|
+
*/
|
|
3448
|
+
function createArrayDefinition(propertyName, type, options) {
|
|
3449
|
+
/** @type {?} */
|
|
3450
|
+
var opts = Opts.get(options);
|
|
3451
|
+
/** @type {?} */
|
|
3452
|
+
var propertyNameAsString = assert.notNil(propertyName).toString();
|
|
3453
|
+
/** @type {?} */
|
|
3454
|
+
var def = {
|
|
3455
|
+
name: opts.getOptional('as', propertyNameAsString),
|
|
3456
|
+
propertyName: propertyNameAsString,
|
|
3457
|
+
type: assert.notNil(type),
|
|
3458
|
+
sanitiser: opts.getOptional('listSanitiser', null),
|
|
3459
|
+
isRouteId: false,
|
|
3460
|
+
isArray: true
|
|
3072
3461
|
};
|
|
3073
3462
|
return def;
|
|
3074
3463
|
}
|
|
@@ -3079,7 +3468,7 @@ function createDefinition(propertyName, type, options, routeId) {
|
|
|
3079
3468
|
*/
|
|
3080
3469
|
/**
|
|
3081
3470
|
* @record
|
|
3082
|
-
* @template
|
|
3471
|
+
* @template E, S
|
|
3083
3472
|
*/
|
|
3084
3473
|
function ParameterDefinition() { }
|
|
3085
3474
|
if (false) {
|
|
@@ -3093,6 +3482,8 @@ if (false) {
|
|
|
3093
3482
|
ParameterDefinition.prototype.sanitiser;
|
|
3094
3483
|
/** @type {?} */
|
|
3095
3484
|
ParameterDefinition.prototype.isRouteId;
|
|
3485
|
+
/** @type {?} */
|
|
3486
|
+
ParameterDefinition.prototype.isArray;
|
|
3096
3487
|
}
|
|
3097
3488
|
|
|
3098
3489
|
/**
|
|
@@ -3197,5 +3588,5 @@ var ParameterType;
|
|
|
3197
3588
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3198
3589
|
*/
|
|
3199
3590
|
|
|
3200
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LeavePlaceGuard, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, QueryParameter, ResizeAwareComponent, RouteId, RouteParameterBindings, RouteParameterSanitiser, SelectInputComponent, StringInputComponent, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, 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, PlaceService as ɵm,
|
|
3591
|
+
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LeavePlaceGuard, NavComponent, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, QueryParameter, QueryParameterList, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterBindings, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, 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, PlaceService as ɵm, NavComponent as ɵn, InteractionModule as ɵo, ActivityContainerComponent as ɵp, ConfirmationDialogComponent as ɵq, AbstractActivity as ɵr, ACTIVITY_DATA as ɵs, AlertDialogComponent as ɵu, ActivityOutletComponent as ɵw, DialogInteractionService as ɵx, InteractionContext as ɵy };
|
|
3201
3592
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|