@coolon/angular-ui-powerups 0.0.51 → 0.0.53
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 +393 -750
- 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.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +2 -2
- package/esm2015/index.js +2 -2
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +2 -2
- package/esm2015/lib/place/guards/place-route.guard.js +2 -2
- package/esm2015/lib/place/index.js +2 -2
- package/esm2015/lib/place/route/parameter-definition.class.js +24 -35
- package/esm2015/lib/place/route/parameter-sanitiser.js +3 -4
- package/esm2015/lib/place/route/parameter-snapshot.js +65 -209
- package/esm2015/lib/place/route/route-parameter-value.js +223 -0
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +2 -2
- package/esm5/index.js +2 -2
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +2 -2
- package/esm5/lib/place/guards/place-route.guard.js +2 -2
- package/esm5/lib/place/index.js +2 -2
- package/esm5/lib/place/route/parameter-definition.class.js +25 -48
- package/esm5/lib/place/route/parameter-sanitiser.js +3 -4
- package/esm5/lib/place/route/parameter-snapshot.js +69 -274
- package/esm5/lib/place/route/route-parameter-value.js +309 -0
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +308 -539
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +396 -752
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/index.d.ts +1 -1
- package/lib/place/route/parameter-definition.class.d.ts +2 -2
- package/lib/place/route/parameter-sanitiser.d.ts +2 -2
- package/lib/place/route/parameter-snapshot.d.ts +5 -27
- package/lib/place/route/route-parameter-value.d.ts +42 -0
- package/package.json +1 -1
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +0 -296
- package/esm5/lib/place/route/route-parameter-sanitiser.js +0 -435
- package/lib/place/route/route-parameter-sanitiser.d.ts +0 -44
|
@@ -4,8 +4,8 @@ import { FormsModule } from '@angular/forms';
|
|
|
4
4
|
import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgressSpinnerModule, MatInputModule, MatFormFieldModule, MatSelectModule } from '@angular/material';
|
|
5
5
|
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
|
-
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator
|
|
8
|
-
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, MutableListModel, StoreInValueModel, Binding, MutableValueModel, Guard, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
7
|
+
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator } from 'tslib';
|
|
8
|
+
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, MutableListModel, StoreInValueModel, Binding, Trace, MutableValueModel, Guard, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
9
9
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
10
|
import { Deferred } from '@coolon/pectin/lib/promise/deferred.class';
|
|
11
11
|
import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
|
|
@@ -2333,6 +2333,307 @@ if (false) {
|
|
|
2333
2333
|
PlaceRouter.prototype.router;
|
|
2334
2334
|
}
|
|
2335
2335
|
|
|
2336
|
+
/**
|
|
2337
|
+
* @fileoverview added by tsickle
|
|
2338
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2339
|
+
*/
|
|
2340
|
+
/**
|
|
2341
|
+
* @abstract
|
|
2342
|
+
* @template S, T, R
|
|
2343
|
+
*/
|
|
2344
|
+
var /**
|
|
2345
|
+
* @abstract
|
|
2346
|
+
* @template S, T, R
|
|
2347
|
+
*/
|
|
2348
|
+
RouteParameterValue = /** @class */ (function () {
|
|
2349
|
+
function RouteParameterValue(definition, rawValue) {
|
|
2350
|
+
this.definition = definition;
|
|
2351
|
+
this.rawValue = rawValue;
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* @return {?}
|
|
2355
|
+
*/
|
|
2356
|
+
RouteParameterValue.prototype.isRouteId = /**
|
|
2357
|
+
* @return {?}
|
|
2358
|
+
*/
|
|
2359
|
+
function () {
|
|
2360
|
+
return this.definition.isRouteId;
|
|
2361
|
+
};
|
|
2362
|
+
/**
|
|
2363
|
+
* @param {?} otherValue
|
|
2364
|
+
* @return {?}
|
|
2365
|
+
*/
|
|
2366
|
+
RouteParameterValue.prototype.hasChanged = /**
|
|
2367
|
+
* @param {?} otherValue
|
|
2368
|
+
* @return {?}
|
|
2369
|
+
*/
|
|
2370
|
+
function (otherValue) {
|
|
2371
|
+
return this.isEmpty() ?
|
|
2372
|
+
!this.isEmptyValue(otherValue) :
|
|
2373
|
+
this.isEmptyValue(otherValue) || !this.isSameValue(otherValue);
|
|
2374
|
+
};
|
|
2375
|
+
/**
|
|
2376
|
+
* Return's true if the current value is empty.
|
|
2377
|
+
*/
|
|
2378
|
+
/**
|
|
2379
|
+
* Return's true if the current value is empty.
|
|
2380
|
+
* @return {?}
|
|
2381
|
+
*/
|
|
2382
|
+
RouteParameterValue.prototype.isEmpty = /**
|
|
2383
|
+
* Return's true if the current value is empty.
|
|
2384
|
+
* @return {?}
|
|
2385
|
+
*/
|
|
2386
|
+
function () {
|
|
2387
|
+
return this.isEmptyValue(this.value);
|
|
2388
|
+
};
|
|
2389
|
+
/**
|
|
2390
|
+
* Returns true if the rawValue is undefined. This
|
|
2391
|
+
*/
|
|
2392
|
+
/**
|
|
2393
|
+
* Returns true if the rawValue is undefined. This
|
|
2394
|
+
* @return {?}
|
|
2395
|
+
*/
|
|
2396
|
+
RouteParameterValue.prototype.isMissing = /**
|
|
2397
|
+
* Returns true if the rawValue is undefined. This
|
|
2398
|
+
* @return {?}
|
|
2399
|
+
*/
|
|
2400
|
+
function () {
|
|
2401
|
+
return ___default.isUndefined(this.rawValue);
|
|
2402
|
+
};
|
|
2403
|
+
/**
|
|
2404
|
+
* @param {?} visit
|
|
2405
|
+
* @param {?} injector
|
|
2406
|
+
* @return {?}
|
|
2407
|
+
*/
|
|
2408
|
+
RouteParameterValue.prototype.sanitise = /**
|
|
2409
|
+
* @param {?} visit
|
|
2410
|
+
* @param {?} injector
|
|
2411
|
+
* @return {?}
|
|
2412
|
+
*/
|
|
2413
|
+
function (visit, injector) {
|
|
2414
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2415
|
+
var sanitiser;
|
|
2416
|
+
return __generator(this, function (_a) {
|
|
2417
|
+
sanitiser = this.definition.getSanitiser(injector);
|
|
2418
|
+
if (sanitiser) {
|
|
2419
|
+
return [2 /*return*/, sanitiser.sanitise(this, visit)];
|
|
2420
|
+
}
|
|
2421
|
+
else {
|
|
2422
|
+
return [2 /*return*/, this.value];
|
|
2423
|
+
}
|
|
2424
|
+
return [2 /*return*/];
|
|
2425
|
+
});
|
|
2426
|
+
});
|
|
2427
|
+
};
|
|
2428
|
+
return RouteParameterValue;
|
|
2429
|
+
}());
|
|
2430
|
+
if (false) {
|
|
2431
|
+
/** @type {?} */
|
|
2432
|
+
RouteParameterValue.prototype.value;
|
|
2433
|
+
/** @type {?} */
|
|
2434
|
+
RouteParameterValue.prototype.definition;
|
|
2435
|
+
/**
|
|
2436
|
+
* @type {?}
|
|
2437
|
+
* @protected
|
|
2438
|
+
*/
|
|
2439
|
+
RouteParameterValue.prototype.rawValue;
|
|
2440
|
+
/**
|
|
2441
|
+
* @abstract
|
|
2442
|
+
* @param {?} otherValue
|
|
2443
|
+
* @return {?}
|
|
2444
|
+
*/
|
|
2445
|
+
RouteParameterValue.prototype.isSameValue = function (otherValue) { };
|
|
2446
|
+
/**
|
|
2447
|
+
* @abstract
|
|
2448
|
+
* @return {?}
|
|
2449
|
+
*/
|
|
2450
|
+
RouteParameterValue.prototype.formattedValue = function () { };
|
|
2451
|
+
/**
|
|
2452
|
+
* @abstract
|
|
2453
|
+
* @param {?} value
|
|
2454
|
+
* @return {?}
|
|
2455
|
+
*/
|
|
2456
|
+
RouteParameterValue.prototype.replace = function (value) { };
|
|
2457
|
+
/**
|
|
2458
|
+
* @abstract
|
|
2459
|
+
* @param {?} value
|
|
2460
|
+
* @return {?}
|
|
2461
|
+
*/
|
|
2462
|
+
RouteParameterValue.prototype.isEmptyValue = function (value) { };
|
|
2463
|
+
}
|
|
2464
|
+
(function (RouteParameterValue) {
|
|
2465
|
+
/**
|
|
2466
|
+
* @template T
|
|
2467
|
+
* @param {?} def
|
|
2468
|
+
* @param {?} paramMap
|
|
2469
|
+
* @return {?}
|
|
2470
|
+
*/
|
|
2471
|
+
function create(def, paramMap) {
|
|
2472
|
+
// NOTE: Using undefined is important as it triggers the isMissing flag which is used by defaultValue and remember flags
|
|
2473
|
+
return def.isArray ?
|
|
2474
|
+
new RouteParameterValue.Array(def, paramMap.has(def.name) ? paramMap.getAll(def.name) : undefined) :
|
|
2475
|
+
new RouteParameterValue.Scalar(def, paramMap.has(def.name) ? paramMap.get(def.name) : undefined);
|
|
2476
|
+
}
|
|
2477
|
+
RouteParameterValue.create = create;
|
|
2478
|
+
/**
|
|
2479
|
+
* @template T
|
|
2480
|
+
*/
|
|
2481
|
+
var Scalar = /** @class */ (function (_super) {
|
|
2482
|
+
__extends(Scalar, _super);
|
|
2483
|
+
function Scalar() {
|
|
2484
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2485
|
+
}
|
|
2486
|
+
Object.defineProperty(Scalar.prototype, "value", {
|
|
2487
|
+
get: /**
|
|
2488
|
+
* @return {?}
|
|
2489
|
+
*/
|
|
2490
|
+
function () {
|
|
2491
|
+
return this.definition.type.parse(this.rawValue);
|
|
2492
|
+
},
|
|
2493
|
+
enumerable: true,
|
|
2494
|
+
configurable: true
|
|
2495
|
+
});
|
|
2496
|
+
/**
|
|
2497
|
+
* @param {?} otherValue
|
|
2498
|
+
* @return {?}
|
|
2499
|
+
*/
|
|
2500
|
+
Scalar.prototype.isSameValue = /**
|
|
2501
|
+
* @param {?} otherValue
|
|
2502
|
+
* @return {?}
|
|
2503
|
+
*/
|
|
2504
|
+
function (otherValue) {
|
|
2505
|
+
return this.value === otherValue;
|
|
2506
|
+
};
|
|
2507
|
+
/**
|
|
2508
|
+
* @param {?} value
|
|
2509
|
+
* @return {?}
|
|
2510
|
+
*/
|
|
2511
|
+
Scalar.prototype.replace = /**
|
|
2512
|
+
* @param {?} value
|
|
2513
|
+
* @return {?}
|
|
2514
|
+
*/
|
|
2515
|
+
function (value) {
|
|
2516
|
+
return new RouteParameterValue.Scalar(this.definition, this.isEmptyValue(value) ? undefined : this.definition.type.format(value));
|
|
2517
|
+
};
|
|
2518
|
+
/**
|
|
2519
|
+
* @return {?}
|
|
2520
|
+
*/
|
|
2521
|
+
Scalar.prototype.formattedValue = /**
|
|
2522
|
+
* @return {?}
|
|
2523
|
+
*/
|
|
2524
|
+
function () {
|
|
2525
|
+
return this.isEmpty() ? undefined : this.definition.type.format(this.value);
|
|
2526
|
+
};
|
|
2527
|
+
/**
|
|
2528
|
+
* @param {?} value
|
|
2529
|
+
* @return {?}
|
|
2530
|
+
*/
|
|
2531
|
+
Scalar.prototype.isEmptyValue = /**
|
|
2532
|
+
* @param {?} value
|
|
2533
|
+
* @return {?}
|
|
2534
|
+
*/
|
|
2535
|
+
function (value) {
|
|
2536
|
+
return ___default.isNil(value);
|
|
2537
|
+
};
|
|
2538
|
+
__decorate([
|
|
2539
|
+
Memoize$1(),
|
|
2540
|
+
__metadata("design:type", Object),
|
|
2541
|
+
__metadata("design:paramtypes", [])
|
|
2542
|
+
], Scalar.prototype, "value", null);
|
|
2543
|
+
return Scalar;
|
|
2544
|
+
}(RouteParameterValue));
|
|
2545
|
+
RouteParameterValue.Scalar = Scalar;
|
|
2546
|
+
/**
|
|
2547
|
+
* @template T
|
|
2548
|
+
*/
|
|
2549
|
+
var Array = /** @class */ (function (_super) {
|
|
2550
|
+
__extends(Array, _super);
|
|
2551
|
+
function Array() {
|
|
2552
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2553
|
+
}
|
|
2554
|
+
Object.defineProperty(Array.prototype, "value", {
|
|
2555
|
+
get: /**
|
|
2556
|
+
* @return {?}
|
|
2557
|
+
*/
|
|
2558
|
+
function () {
|
|
2559
|
+
var _this = this;
|
|
2560
|
+
return (this.rawValue || [])
|
|
2561
|
+
.filter((/**
|
|
2562
|
+
* @param {?} s
|
|
2563
|
+
* @return {?}
|
|
2564
|
+
*/
|
|
2565
|
+
function (s) { return !___default.isEmpty(s); }))
|
|
2566
|
+
.map((/**
|
|
2567
|
+
* @param {?} raw
|
|
2568
|
+
* @return {?}
|
|
2569
|
+
*/
|
|
2570
|
+
function (raw) { return _this.definition.type.parse(raw); }));
|
|
2571
|
+
},
|
|
2572
|
+
enumerable: true,
|
|
2573
|
+
configurable: true
|
|
2574
|
+
});
|
|
2575
|
+
/**
|
|
2576
|
+
* @param {?} otherValue
|
|
2577
|
+
* @return {?}
|
|
2578
|
+
*/
|
|
2579
|
+
Array.prototype.isSameValue = /**
|
|
2580
|
+
* @param {?} otherValue
|
|
2581
|
+
* @return {?}
|
|
2582
|
+
*/
|
|
2583
|
+
function (otherValue) {
|
|
2584
|
+
return ___default.isEqual(this.value, otherValue);
|
|
2585
|
+
};
|
|
2586
|
+
/**
|
|
2587
|
+
* @param {?} value
|
|
2588
|
+
* @return {?}
|
|
2589
|
+
*/
|
|
2590
|
+
Array.prototype.replace = /**
|
|
2591
|
+
* @param {?} value
|
|
2592
|
+
* @return {?}
|
|
2593
|
+
*/
|
|
2594
|
+
function (value) {
|
|
2595
|
+
var _this = this;
|
|
2596
|
+
return new RouteParameterValue.Array(this.definition, this.isEmptyValue(value) ? undefined : value.map((/**
|
|
2597
|
+
* @param {?} v
|
|
2598
|
+
* @return {?}
|
|
2599
|
+
*/
|
|
2600
|
+
function (v) { return _this.definition.type.format(v); })));
|
|
2601
|
+
};
|
|
2602
|
+
/**
|
|
2603
|
+
* @return {?}
|
|
2604
|
+
*/
|
|
2605
|
+
Array.prototype.formattedValue = /**
|
|
2606
|
+
* @return {?}
|
|
2607
|
+
*/
|
|
2608
|
+
function () {
|
|
2609
|
+
var _this = this;
|
|
2610
|
+
return this.isEmpty() ? [] : this.value.map((/**
|
|
2611
|
+
* @param {?} v
|
|
2612
|
+
* @return {?}
|
|
2613
|
+
*/
|
|
2614
|
+
function (v) { return _this.definition.type.format(v); }));
|
|
2615
|
+
};
|
|
2616
|
+
/**
|
|
2617
|
+
* @param {?} value
|
|
2618
|
+
* @return {?}
|
|
2619
|
+
*/
|
|
2620
|
+
Array.prototype.isEmptyValue = /**
|
|
2621
|
+
* @param {?} value
|
|
2622
|
+
* @return {?}
|
|
2623
|
+
*/
|
|
2624
|
+
function (value) {
|
|
2625
|
+
return ___default.isNil(value) || value.length < 1;
|
|
2626
|
+
};
|
|
2627
|
+
__decorate([
|
|
2628
|
+
Memoize$1(),
|
|
2629
|
+
__metadata("design:type", Array),
|
|
2630
|
+
__metadata("design:paramtypes", [])
|
|
2631
|
+
], Array.prototype, "value", null);
|
|
2632
|
+
return Array;
|
|
2633
|
+
}(RouteParameterValue));
|
|
2634
|
+
RouteParameterValue.Array = Array;
|
|
2635
|
+
})(RouteParameterValue || (RouteParameterValue = {}));
|
|
2636
|
+
|
|
2336
2637
|
/**
|
|
2337
2638
|
* @fileoverview added by tsickle
|
|
2338
2639
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -2484,72 +2785,47 @@ if (false) {
|
|
|
2484
2785
|
/**
|
|
2485
2786
|
* @template T, S
|
|
2486
2787
|
*/
|
|
2487
|
-
var /**
|
|
2488
|
-
* @template T, S
|
|
2489
|
-
*/
|
|
2490
|
-
DefaultParameterSanitiser = /** @class */ (function () {
|
|
2788
|
+
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
2491
2789
|
function DefaultParameterSanitiser(remember, defaultValue, placeHistory) {
|
|
2492
2790
|
this.remember = remember;
|
|
2493
2791
|
this.defaultValue = defaultValue;
|
|
2494
2792
|
this.placeHistory = placeHistory;
|
|
2495
2793
|
}
|
|
2496
2794
|
/**
|
|
2497
|
-
* @param {?}
|
|
2498
|
-
* @param {?} value
|
|
2795
|
+
* @param {?} parameter
|
|
2499
2796
|
* @param {?=} visit
|
|
2500
2797
|
* @return {?}
|
|
2501
2798
|
*/
|
|
2502
2799
|
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
2503
|
-
* @param {?}
|
|
2504
|
-
* @param {?} value
|
|
2800
|
+
* @param {?} parameter
|
|
2505
2801
|
* @param {?=} visit
|
|
2506
2802
|
* @return {?}
|
|
2507
2803
|
*/
|
|
2508
|
-
function (
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
* @return {?}
|
|
2517
|
-
*/
|
|
2518
|
-
function (v) { return v.getValueOf(parameterDef); }))
|
|
2519
|
-
.filter((/**
|
|
2520
|
-
* @param {?} v
|
|
2521
|
-
* @return {?}
|
|
2522
|
-
*/
|
|
2523
|
-
function (v) { return !___default.isNil(v); }))
|
|
2524
|
-
.find((/**
|
|
2525
|
-
* @param {?} v
|
|
2526
|
-
* @return {?}
|
|
2527
|
-
*/
|
|
2528
|
-
function (v) { return !_this.isBlank(parameterDef, v); }));
|
|
2804
|
+
function (parameter, visit) {
|
|
2805
|
+
/** @type {?} */
|
|
2806
|
+
var value = parameter.value;
|
|
2807
|
+
if (parameter.isMissing()) {
|
|
2808
|
+
/** @type {?} */
|
|
2809
|
+
var previousVisit = ___default.first(this.placeHistory.getHistory(visit.placeDefinition));
|
|
2810
|
+
if (this.remember && previousVisit) {
|
|
2811
|
+
value = previousVisit.getValueOf(parameter.definition);
|
|
2529
2812
|
}
|
|
2530
|
-
|
|
2813
|
+
/** @type {?} */
|
|
2814
|
+
var s = parameter.isEmptyValue(value) ? this.defaultValue : value;
|
|
2815
|
+
console.log("missing -> " + parameter.definition.name + ", returning " + s);
|
|
2816
|
+
return s;
|
|
2531
2817
|
}
|
|
2532
2818
|
else {
|
|
2819
|
+
console.log("not missing -> " + parameter.definition.name);
|
|
2533
2820
|
return value;
|
|
2534
2821
|
}
|
|
2535
2822
|
};
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
2543
|
-
* @private
|
|
2544
|
-
* @param {?} def
|
|
2545
|
-
* @param {?} value
|
|
2546
|
-
* @return {?}
|
|
2547
|
-
*/
|
|
2548
|
-
function (def, value) {
|
|
2549
|
-
/** @type {?} */
|
|
2550
|
-
var isNil = ___default.isNil(value);
|
|
2551
|
-
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2552
|
-
};
|
|
2823
|
+
__decorate([
|
|
2824
|
+
Trace(),
|
|
2825
|
+
__metadata("design:type", Function),
|
|
2826
|
+
__metadata("design:paramtypes", [RouteParameterValue, Object]),
|
|
2827
|
+
__metadata("design:returntype", Object)
|
|
2828
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
2553
2829
|
return DefaultParameterSanitiser;
|
|
2554
2830
|
}());
|
|
2555
2831
|
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
@@ -2568,9 +2844,9 @@ if (false) {
|
|
|
2568
2844
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2569
2845
|
*/
|
|
2570
2846
|
var ParameterSnapshot = /** @class */ (function () {
|
|
2571
|
-
function ParameterSnapshot(placeDefinition,
|
|
2847
|
+
function ParameterSnapshot(placeDefinition, parameters) {
|
|
2572
2848
|
this.placeDefinition = placeDefinition;
|
|
2573
|
-
this.
|
|
2849
|
+
this.parameters = parameters;
|
|
2574
2850
|
}
|
|
2575
2851
|
/**
|
|
2576
2852
|
* @param {?} other
|
|
@@ -2585,18 +2861,18 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2585
2861
|
function (other, debug) {
|
|
2586
2862
|
if (debug === void 0) { debug = false; }
|
|
2587
2863
|
/** @type {?} */
|
|
2588
|
-
var changed = this.
|
|
2864
|
+
var changed = this.parameters.find((/**
|
|
2589
2865
|
* @param {?} r
|
|
2590
2866
|
* @return {?}
|
|
2591
2867
|
*/
|
|
2592
2868
|
function (r) {
|
|
2593
|
-
return
|
|
2869
|
+
return r.hasChanged(other.getValueOf(r.definition));
|
|
2594
2870
|
}));
|
|
2595
2871
|
if (changed && debug) {
|
|
2596
2872
|
console.log({
|
|
2597
|
-
name: changed.
|
|
2873
|
+
name: changed.definition.name,
|
|
2598
2874
|
mine: changed.value,
|
|
2599
|
-
theirs: other.getValueOf(changed.
|
|
2875
|
+
theirs: other.getValueOf(changed.definition)
|
|
2600
2876
|
});
|
|
2601
2877
|
}
|
|
2602
2878
|
return !!changed;
|
|
@@ -2612,11 +2888,11 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2612
2888
|
* @return {?}
|
|
2613
2889
|
*/
|
|
2614
2890
|
function (parameterDef) {
|
|
2615
|
-
return this.
|
|
2891
|
+
return this.parameters.find((/**
|
|
2616
2892
|
* @param {?} r
|
|
2617
2893
|
* @return {?}
|
|
2618
2894
|
*/
|
|
2619
|
-
function (r) { return r.
|
|
2895
|
+
function (r) { return r.definition === parameterDef; }));
|
|
2620
2896
|
};
|
|
2621
2897
|
/**
|
|
2622
2898
|
* @template T, S
|
|
@@ -2652,11 +2928,11 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2652
2928
|
*/
|
|
2653
2929
|
function (name) {
|
|
2654
2930
|
/** @type {?} */
|
|
2655
|
-
var resolvedParameter = this.
|
|
2931
|
+
var resolvedParameter = this.parameters.find((/**
|
|
2656
2932
|
* @param {?} r
|
|
2657
2933
|
* @return {?}
|
|
2658
2934
|
*/
|
|
2659
|
-
function (r) { return r.
|
|
2935
|
+
function (r) { return r.definition.name === name; }));
|
|
2660
2936
|
return resolvedParameter ? resolvedParameter.value : null;
|
|
2661
2937
|
};
|
|
2662
2938
|
/**
|
|
@@ -2670,11 +2946,11 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2670
2946
|
function () {
|
|
2671
2947
|
// RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
|
|
2672
2948
|
// capture this in the type system though
|
|
2673
|
-
return (/** @type {?} */ (this.
|
|
2949
|
+
return (/** @type {?} */ (this.parameters.find((/**
|
|
2674
2950
|
* @param {?} p
|
|
2675
2951
|
* @return {?}
|
|
2676
2952
|
*/
|
|
2677
|
-
function (p) { return p.
|
|
2953
|
+
function (p) { return p.definition.isRouteId; }))));
|
|
2678
2954
|
};
|
|
2679
2955
|
/**
|
|
2680
2956
|
* @private
|
|
@@ -2685,11 +2961,11 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2685
2961
|
* @return {?}
|
|
2686
2962
|
*/
|
|
2687
2963
|
function () {
|
|
2688
|
-
return this.
|
|
2964
|
+
return this.parameters.filter((/**
|
|
2689
2965
|
* @param {?} r
|
|
2690
2966
|
* @return {?}
|
|
2691
2967
|
*/
|
|
2692
|
-
function (r) { return !r.
|
|
2968
|
+
function (r) { return !r.definition.isRouteId; }));
|
|
2693
2969
|
};
|
|
2694
2970
|
/**
|
|
2695
2971
|
* @return {?}
|
|
@@ -2714,43 +2990,37 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2714
2990
|
/**
|
|
2715
2991
|
* @return {?}
|
|
2716
2992
|
*/
|
|
2717
|
-
ParameterSnapshot.prototype.
|
|
2993
|
+
ParameterSnapshot.prototype.getNonEmptyParameters = /**
|
|
2718
2994
|
* @return {?}
|
|
2719
2995
|
*/
|
|
2720
2996
|
function () {
|
|
2721
|
-
/**
|
|
2722
|
-
var params = {};
|
|
2723
|
-
/** @type {?} */
|
|
2724
|
-
var routeIdParam = this.resolved.filter((/**
|
|
2997
|
+
return this.parameters.filter((/**
|
|
2725
2998
|
* @param {?} p
|
|
2726
2999
|
* @return {?}
|
|
2727
3000
|
*/
|
|
2728
|
-
function (p) { return !p.
|
|
2729
|
-
* @param {?} p
|
|
2730
|
-
* @return {?}
|
|
2731
|
-
*/
|
|
2732
|
-
function (p) {
|
|
2733
|
-
params[p.parameterDef.name] = p.formattedValue();
|
|
2734
|
-
}));
|
|
2735
|
-
return params;
|
|
3001
|
+
function (p) { return !p.isEmpty(); }));
|
|
2736
3002
|
};
|
|
2737
3003
|
/**
|
|
2738
3004
|
* @return {?}
|
|
2739
3005
|
*/
|
|
2740
|
-
ParameterSnapshot.prototype.
|
|
3006
|
+
ParameterSnapshot.prototype.getFormattedParameters = /**
|
|
2741
3007
|
* @return {?}
|
|
2742
3008
|
*/
|
|
2743
3009
|
function () {
|
|
2744
3010
|
/** @type {?} */
|
|
2745
3011
|
var params = {};
|
|
2746
3012
|
/** @type {?} */
|
|
2747
|
-
var routeIdParam = this.
|
|
3013
|
+
var routeIdParam = this.getNonEmptyParameters()
|
|
3014
|
+
.filter((/**
|
|
2748
3015
|
* @param {?} p
|
|
2749
3016
|
* @return {?}
|
|
2750
3017
|
*/
|
|
2751
|
-
function (p) {
|
|
2752
|
-
|
|
2753
|
-
|
|
3018
|
+
function (p) { return !p.definition.isRouteId; }))
|
|
3019
|
+
.forEach((/**
|
|
3020
|
+
* @param {?} p
|
|
3021
|
+
* @return {?}
|
|
3022
|
+
*/
|
|
3023
|
+
function (p) { return params[p.definition.name] = p.formattedValue(); }));
|
|
2754
3024
|
return params;
|
|
2755
3025
|
};
|
|
2756
3026
|
/**
|
|
@@ -2763,12 +3033,12 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2763
3033
|
/** @type {?} */
|
|
2764
3034
|
var params = {};
|
|
2765
3035
|
/** @type {?} */
|
|
2766
|
-
var routeIdParam = this.
|
|
3036
|
+
var routeIdParam = this.parameters.forEach((/**
|
|
2767
3037
|
* @param {?} p
|
|
2768
3038
|
* @return {?}
|
|
2769
3039
|
*/
|
|
2770
3040
|
function (p) {
|
|
2771
|
-
params[p.
|
|
3041
|
+
params[p.definition.name] = p.value;
|
|
2772
3042
|
}));
|
|
2773
3043
|
return params;
|
|
2774
3044
|
};
|
|
@@ -2785,12 +3055,12 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2785
3055
|
* @return {?}
|
|
2786
3056
|
*/
|
|
2787
3057
|
function (parameter, value) {
|
|
2788
|
-
return new ParameterSnapshot(this.placeDefinition, this.
|
|
3058
|
+
return new ParameterSnapshot(this.placeDefinition, this.parameters.map((/**
|
|
2789
3059
|
* @param {?} p
|
|
2790
3060
|
* @return {?}
|
|
2791
3061
|
*/
|
|
2792
3062
|
function (p) {
|
|
2793
|
-
return p.
|
|
3063
|
+
return p.definition === parameter ? p.replace(value) : p;
|
|
2794
3064
|
})));
|
|
2795
3065
|
};
|
|
2796
3066
|
/**
|
|
@@ -2812,10 +3082,10 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2812
3082
|
return [4 /*yield*/, routeId.sanitise(this, injector)];
|
|
2813
3083
|
case 1:
|
|
2814
3084
|
sanitisedValue = _a.sent();
|
|
2815
|
-
if (
|
|
3085
|
+
if (routeId.hasChanged(sanitisedValue)) {
|
|
2816
3086
|
// if the route id has changed we redirect immediately as other
|
|
2817
3087
|
// parameter sanitisers might use it.
|
|
2818
|
-
return [2 /*return*/, this.replace(routeId.
|
|
3088
|
+
return [2 /*return*/, this.replace(routeId.definition, sanitisedValue)];
|
|
2819
3089
|
}
|
|
2820
3090
|
_a.label = 2;
|
|
2821
3091
|
case 2:
|
|
@@ -2829,8 +3099,8 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2829
3099
|
return [4 /*yield*/, routeParameter.sanitise(this, injector)];
|
|
2830
3100
|
case 4:
|
|
2831
3101
|
sanitisedValue = _a.sent();
|
|
2832
|
-
if (
|
|
2833
|
-
result = result.replace(routeParameter.
|
|
3102
|
+
if (routeParameter.hasChanged(sanitisedValue)) {
|
|
3103
|
+
result = result.replace(routeParameter.definition, sanitisedValue);
|
|
2834
3104
|
}
|
|
2835
3105
|
_a.label = 5;
|
|
2836
3106
|
case 5:
|
|
@@ -2846,7 +3116,7 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2846
3116
|
Memoize$1(),
|
|
2847
3117
|
__metadata("design:type", Function),
|
|
2848
3118
|
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
2849
|
-
__metadata("design:returntype",
|
|
3119
|
+
__metadata("design:returntype", RouteParameterValue)
|
|
2850
3120
|
], ParameterSnapshot.prototype, "getParameter", null);
|
|
2851
3121
|
__decorate([
|
|
2852
3122
|
Memoize$1(),
|
|
@@ -2864,7 +3134,7 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2864
3134
|
Memoize$1(),
|
|
2865
3135
|
__metadata("design:type", Function),
|
|
2866
3136
|
__metadata("design:paramtypes", []),
|
|
2867
|
-
__metadata("design:returntype",
|
|
3137
|
+
__metadata("design:returntype", RouteParameterValue.Scalar)
|
|
2868
3138
|
], ParameterSnapshot.prototype, "getRouteIdParameter", null);
|
|
2869
3139
|
__decorate([
|
|
2870
3140
|
Memoize$1(),
|
|
@@ -2872,6 +3142,12 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2872
3142
|
__metadata("design:paramtypes", []),
|
|
2873
3143
|
__metadata("design:returntype", Array)
|
|
2874
3144
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
3145
|
+
__decorate([
|
|
3146
|
+
Trace(),
|
|
3147
|
+
__metadata("design:type", Function),
|
|
3148
|
+
__metadata("design:paramtypes", []),
|
|
3149
|
+
__metadata("design:returntype", void 0)
|
|
3150
|
+
], ParameterSnapshot.prototype, "getFormattedParameters", null);
|
|
2875
3151
|
return ParameterSnapshot;
|
|
2876
3152
|
}());
|
|
2877
3153
|
if (false) {
|
|
@@ -2881,7 +3157,7 @@ if (false) {
|
|
|
2881
3157
|
* @type {?}
|
|
2882
3158
|
* @private
|
|
2883
3159
|
*/
|
|
2884
|
-
ParameterSnapshot.prototype.
|
|
3160
|
+
ParameterSnapshot.prototype.parameters;
|
|
2885
3161
|
}
|
|
2886
3162
|
(function (ParameterSnapshot) {
|
|
2887
3163
|
/**
|
|
@@ -2894,31 +3170,11 @@ if (false) {
|
|
|
2894
3170
|
/** @type {?} */
|
|
2895
3171
|
var paramMap = new ConsolidatedParameterMap(params, urlSegments);
|
|
2896
3172
|
/** @type {?} */
|
|
2897
|
-
var resolvedParameters = placeDef.getRouteParameters()
|
|
2898
|
-
.map((/**
|
|
3173
|
+
var resolvedParameters = placeDef.getRouteParameters().map((/**
|
|
2899
3174
|
* @param {?} def
|
|
2900
3175
|
* @return {?}
|
|
2901
3176
|
*/
|
|
2902
|
-
function (def) {
|
|
2903
|
-
if (def.isArray) {
|
|
2904
|
-
/** @type {?} */
|
|
2905
|
-
var value = paramMap.has(def.name) ? paramMap.getAll(def.name).filter((/**
|
|
2906
|
-
* @param {?} s
|
|
2907
|
-
* @return {?}
|
|
2908
|
-
*/
|
|
2909
|
-
function (s) { return !___default.isEmpty(s); })).map((/**
|
|
2910
|
-
* @param {?} raw
|
|
2911
|
-
* @return {?}
|
|
2912
|
-
*/
|
|
2913
|
-
function (raw) { return def.type.parse(raw); })) : null;
|
|
2914
|
-
return new ResolvedArrayParameter(def, value);
|
|
2915
|
-
}
|
|
2916
|
-
else {
|
|
2917
|
-
/** @type {?} */
|
|
2918
|
-
var value = paramMap.has(def.name) ? def.type.parse(paramMap.get(def.name)) : null;
|
|
2919
|
-
return new ResolvedValueParameter(def, value);
|
|
2920
|
-
}
|
|
2921
|
-
}));
|
|
3177
|
+
function (def) { return RouteParameterValue.create(def, paramMap); }));
|
|
2922
3178
|
return new ParameterSnapshot(placeDef, resolvedParameters);
|
|
2923
3179
|
}
|
|
2924
3180
|
ParameterSnapshot.create = create;
|
|
@@ -2927,12 +3183,7 @@ if (false) {
|
|
|
2927
3183
|
* include the segment params in the paramMap as well as each segment returns an empty
|
|
2928
3184
|
* param map even when `parameter`s has content.
|
|
2929
3185
|
*/
|
|
2930
|
-
var /**
|
|
2931
|
-
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
2932
|
-
* include the segment params in the paramMap as well as each segment returns an empty
|
|
2933
|
-
* param map even when `parameter`s has content.
|
|
2934
|
-
*/
|
|
2935
|
-
ConsolidatedParameterMap = /** @class */ (function () {
|
|
3186
|
+
var ConsolidatedParameterMap = /** @class */ (function () {
|
|
2936
3187
|
function ConsolidatedParameterMap(paramMap, urlSegments) {
|
|
2937
3188
|
this.paramMaps = [paramMap].concat((urlSegments || []).map((/**
|
|
2938
3189
|
* @param {?} s
|
|
@@ -2989,6 +3240,26 @@ if (false) {
|
|
|
2989
3240
|
*/
|
|
2990
3241
|
function (m) { return m.has(name); }));
|
|
2991
3242
|
};
|
|
3243
|
+
Object.defineProperty(ConsolidatedParameterMap.prototype, "keys", {
|
|
3244
|
+
get: /**
|
|
3245
|
+
* @return {?}
|
|
3246
|
+
*/
|
|
3247
|
+
function () {
|
|
3248
|
+
return this.paramMaps.reduce((/**
|
|
3249
|
+
* @param {?} result
|
|
3250
|
+
* @param {?} params
|
|
3251
|
+
* @return {?}
|
|
3252
|
+
*/
|
|
3253
|
+
function (result, params) { return result.concat(params.keys); }), []);
|
|
3254
|
+
},
|
|
3255
|
+
enumerable: true,
|
|
3256
|
+
configurable: true
|
|
3257
|
+
});
|
|
3258
|
+
__decorate([
|
|
3259
|
+
Memoize$1(),
|
|
3260
|
+
__metadata("design:type", Array),
|
|
3261
|
+
__metadata("design:paramtypes", [])
|
|
3262
|
+
], ConsolidatedParameterMap.prototype, "keys", null);
|
|
2992
3263
|
return ConsolidatedParameterMap;
|
|
2993
3264
|
}());
|
|
2994
3265
|
if (false) {
|
|
@@ -3056,207 +3327,6 @@ if (false) {
|
|
|
3056
3327
|
*/
|
|
3057
3328
|
ParamMapAdapter.prototype.params;
|
|
3058
3329
|
}
|
|
3059
|
-
/**
|
|
3060
|
-
* @abstract
|
|
3061
|
-
* @template T, S
|
|
3062
|
-
*/
|
|
3063
|
-
var /**
|
|
3064
|
-
* @abstract
|
|
3065
|
-
* @template T, S
|
|
3066
|
-
*/
|
|
3067
|
-
ResolvedParameter = /** @class */ (function () {
|
|
3068
|
-
function ResolvedParameter(parameterDef, value) {
|
|
3069
|
-
this.parameterDef = parameterDef;
|
|
3070
|
-
this.value = value;
|
|
3071
|
-
}
|
|
3072
|
-
/**
|
|
3073
|
-
* @return {?}
|
|
3074
|
-
*/
|
|
3075
|
-
ResolvedParameter.prototype.isRouteId = /**
|
|
3076
|
-
* @return {?}
|
|
3077
|
-
*/
|
|
3078
|
-
function () {
|
|
3079
|
-
return this.parameterDef.isRouteId;
|
|
3080
|
-
};
|
|
3081
|
-
/**
|
|
3082
|
-
* @param {?} visit
|
|
3083
|
-
* @param {?} injector
|
|
3084
|
-
* @return {?}
|
|
3085
|
-
*/
|
|
3086
|
-
ResolvedParameter.prototype.sanitise = /**
|
|
3087
|
-
* @param {?} visit
|
|
3088
|
-
* @param {?} injector
|
|
3089
|
-
* @return {?}
|
|
3090
|
-
*/
|
|
3091
|
-
function (visit, injector) {
|
|
3092
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3093
|
-
var sanitiser;
|
|
3094
|
-
return __generator(this, function (_a) {
|
|
3095
|
-
sanitiser = this.parameterDef.getSanitiser(injector);
|
|
3096
|
-
if (sanitiser) {
|
|
3097
|
-
return [2 /*return*/, sanitiser.sanitise(this.parameterDef, this.value, visit)];
|
|
3098
|
-
}
|
|
3099
|
-
else {
|
|
3100
|
-
return [2 /*return*/, this.value];
|
|
3101
|
-
}
|
|
3102
|
-
return [2 /*return*/];
|
|
3103
|
-
});
|
|
3104
|
-
});
|
|
3105
|
-
};
|
|
3106
|
-
return ResolvedParameter;
|
|
3107
|
-
}());
|
|
3108
|
-
ParameterSnapshot.ResolvedParameter = ResolvedParameter;
|
|
3109
|
-
if (false) {
|
|
3110
|
-
/** @type {?} */
|
|
3111
|
-
ResolvedParameter.prototype.parameterDef;
|
|
3112
|
-
/** @type {?} */
|
|
3113
|
-
ResolvedParameter.prototype.value;
|
|
3114
|
-
/**
|
|
3115
|
-
* @abstract
|
|
3116
|
-
* @param {?} dest
|
|
3117
|
-
* @return {?}
|
|
3118
|
-
*/
|
|
3119
|
-
ResolvedParameter.prototype.injectRouteParam = function (dest) { };
|
|
3120
|
-
/**
|
|
3121
|
-
* @abstract
|
|
3122
|
-
* @param {?} otherValue
|
|
3123
|
-
* @return {?}
|
|
3124
|
-
*/
|
|
3125
|
-
ResolvedParameter.prototype.isSame = function (otherValue) { };
|
|
3126
|
-
/**
|
|
3127
|
-
* @abstract
|
|
3128
|
-
* @return {?}
|
|
3129
|
-
*/
|
|
3130
|
-
ResolvedParameter.prototype.formattedValue = function () { };
|
|
3131
|
-
/**
|
|
3132
|
-
* @abstract
|
|
3133
|
-
* @param {?} value
|
|
3134
|
-
* @return {?}
|
|
3135
|
-
*/
|
|
3136
|
-
ResolvedParameter.prototype.replace = function (value) { };
|
|
3137
|
-
}
|
|
3138
|
-
/**
|
|
3139
|
-
* @template T
|
|
3140
|
-
*/
|
|
3141
|
-
var /**
|
|
3142
|
-
* @template T
|
|
3143
|
-
*/
|
|
3144
|
-
ResolvedValueParameter = /** @class */ (function (_super) {
|
|
3145
|
-
__extends(ResolvedValueParameter, _super);
|
|
3146
|
-
function ResolvedValueParameter() {
|
|
3147
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3148
|
-
}
|
|
3149
|
-
/**
|
|
3150
|
-
* @param {?} otherValue
|
|
3151
|
-
* @return {?}
|
|
3152
|
-
*/
|
|
3153
|
-
ResolvedValueParameter.prototype.isSame = /**
|
|
3154
|
-
* @param {?} otherValue
|
|
3155
|
-
* @return {?}
|
|
3156
|
-
*/
|
|
3157
|
-
function (otherValue) {
|
|
3158
|
-
return this.value === otherValue;
|
|
3159
|
-
};
|
|
3160
|
-
/**
|
|
3161
|
-
* @param {?} dest
|
|
3162
|
-
* @return {?}
|
|
3163
|
-
*/
|
|
3164
|
-
ResolvedValueParameter.prototype.injectRouteParam = /**
|
|
3165
|
-
* @param {?} dest
|
|
3166
|
-
* @return {?}
|
|
3167
|
-
*/
|
|
3168
|
-
function (dest) {
|
|
3169
|
-
dest[this.parameterDef.name] = this.parameterDef.type.format(this.value);
|
|
3170
|
-
};
|
|
3171
|
-
/**
|
|
3172
|
-
* @param {?} value
|
|
3173
|
-
* @return {?}
|
|
3174
|
-
*/
|
|
3175
|
-
ResolvedValueParameter.prototype.replace = /**
|
|
3176
|
-
* @param {?} value
|
|
3177
|
-
* @return {?}
|
|
3178
|
-
*/
|
|
3179
|
-
function (value) {
|
|
3180
|
-
return new ResolvedValueParameter(this.parameterDef, value);
|
|
3181
|
-
};
|
|
3182
|
-
/**
|
|
3183
|
-
* @return {?}
|
|
3184
|
-
*/
|
|
3185
|
-
ResolvedValueParameter.prototype.formattedValue = /**
|
|
3186
|
-
* @return {?}
|
|
3187
|
-
*/
|
|
3188
|
-
function () {
|
|
3189
|
-
return !___default.isNil(this.value) ? this.parameterDef.type.format(this.value) : null;
|
|
3190
|
-
};
|
|
3191
|
-
return ResolvedValueParameter;
|
|
3192
|
-
}(ResolvedParameter));
|
|
3193
|
-
ParameterSnapshot.ResolvedValueParameter = ResolvedValueParameter;
|
|
3194
|
-
/**
|
|
3195
|
-
* @template T
|
|
3196
|
-
*/
|
|
3197
|
-
var /**
|
|
3198
|
-
* @template T
|
|
3199
|
-
*/
|
|
3200
|
-
ResolvedArrayParameter = /** @class */ (function (_super) {
|
|
3201
|
-
__extends(ResolvedArrayParameter, _super);
|
|
3202
|
-
function ResolvedArrayParameter() {
|
|
3203
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3204
|
-
}
|
|
3205
|
-
/**
|
|
3206
|
-
* @param {?} otherValue
|
|
3207
|
-
* @return {?}
|
|
3208
|
-
*/
|
|
3209
|
-
ResolvedArrayParameter.prototype.isSame = /**
|
|
3210
|
-
* @param {?} otherValue
|
|
3211
|
-
* @return {?}
|
|
3212
|
-
*/
|
|
3213
|
-
function (otherValue) {
|
|
3214
|
-
return ___default.isEqual(this.value, otherValue);
|
|
3215
|
-
};
|
|
3216
|
-
/**
|
|
3217
|
-
* @param {?} dest
|
|
3218
|
-
* @return {?}
|
|
3219
|
-
*/
|
|
3220
|
-
ResolvedArrayParameter.prototype.injectRouteParam = /**
|
|
3221
|
-
* @param {?} dest
|
|
3222
|
-
* @return {?}
|
|
3223
|
-
*/
|
|
3224
|
-
function (dest) {
|
|
3225
|
-
var _this = this;
|
|
3226
|
-
dest[this.parameterDef.name] = this.value.map((/**
|
|
3227
|
-
* @param {?} v
|
|
3228
|
-
* @return {?}
|
|
3229
|
-
*/
|
|
3230
|
-
function (v) { return _this.parameterDef.type.format(v); }));
|
|
3231
|
-
};
|
|
3232
|
-
/**
|
|
3233
|
-
* @param {?} value
|
|
3234
|
-
* @return {?}
|
|
3235
|
-
*/
|
|
3236
|
-
ResolvedArrayParameter.prototype.replace = /**
|
|
3237
|
-
* @param {?} value
|
|
3238
|
-
* @return {?}
|
|
3239
|
-
*/
|
|
3240
|
-
function (value) {
|
|
3241
|
-
return new ResolvedArrayParameter(this.parameterDef, value);
|
|
3242
|
-
};
|
|
3243
|
-
/**
|
|
3244
|
-
* @return {?}
|
|
3245
|
-
*/
|
|
3246
|
-
ResolvedArrayParameter.prototype.formattedValue = /**
|
|
3247
|
-
* @return {?}
|
|
3248
|
-
*/
|
|
3249
|
-
function () {
|
|
3250
|
-
var _this = this;
|
|
3251
|
-
return this.value ? this.value.map((/**
|
|
3252
|
-
* @param {?} v
|
|
3253
|
-
* @return {?}
|
|
3254
|
-
*/
|
|
3255
|
-
function (v) { return _this.parameterDef.type.format(v); })) : [];
|
|
3256
|
-
};
|
|
3257
|
-
return ResolvedArrayParameter;
|
|
3258
|
-
}(ResolvedParameter));
|
|
3259
|
-
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
3260
3330
|
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
3261
3331
|
|
|
3262
3332
|
/**
|
|
@@ -3382,8 +3452,8 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3382
3452
|
* @return {?}
|
|
3383
3453
|
*/
|
|
3384
3454
|
function (next, previous) {
|
|
3385
|
-
_this.pushChangesToRoute(next, previous);
|
|
3386
3455
|
_this.placeHistory.add(next); // the above route change doesn't seem to propagate back in, so I'm add the state to the history manually for now.
|
|
3456
|
+
_this.pushChangesToRoute(next, previous);
|
|
3387
3457
|
}), {
|
|
3388
3458
|
unless: _this.incomingRouteChange
|
|
3389
3459
|
});
|
|
@@ -4255,7 +4325,7 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
4255
4325
|
* @return {?}
|
|
4256
4326
|
*/
|
|
4257
4327
|
function (sanitised) {
|
|
4258
|
-
Logger.get(_this).info("ParameterSnapshot.sanitise
|
|
4328
|
+
Logger.get(_this).info("ParameterSnapshot.sanitise ->", sanitised.getAllParameters());
|
|
4259
4329
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4260
4330
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4261
4331
|
}
|
|
@@ -4410,12 +4480,11 @@ function RouteParameterList(elementType, options) {
|
|
|
4410
4480
|
function ParameterSanitiser() { }
|
|
4411
4481
|
if (false) {
|
|
4412
4482
|
/**
|
|
4413
|
-
* @param {?}
|
|
4414
|
-
* @param {?} value
|
|
4483
|
+
* @param {?} paramter
|
|
4415
4484
|
* @param {?=} visit
|
|
4416
4485
|
* @return {?}
|
|
4417
4486
|
*/
|
|
4418
|
-
ParameterSanitiser.prototype.sanitise = function (
|
|
4487
|
+
ParameterSanitiser.prototype.sanitise = function (paramter, visit) { };
|
|
4419
4488
|
}
|
|
4420
4489
|
|
|
4421
4490
|
/**
|
|
@@ -4511,431 +4580,6 @@ var ParameterType;
|
|
|
4511
4580
|
ParameterType.BOOLEAN = new BooleanType();
|
|
4512
4581
|
})(ParameterType || (ParameterType = {}));
|
|
4513
4582
|
|
|
4514
|
-
/**
|
|
4515
|
-
* @fileoverview added by tsickle
|
|
4516
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4517
|
-
*/
|
|
4518
|
-
/**
|
|
4519
|
-
* @template T, S
|
|
4520
|
-
*/
|
|
4521
|
-
var /**
|
|
4522
|
-
* @template T, S
|
|
4523
|
-
*/
|
|
4524
|
-
Sanitiser = /** @class */ (function () {
|
|
4525
|
-
function Sanitiser(parameterDef, snapshot, sanitiser) {
|
|
4526
|
-
this.parameterDef = parameterDef;
|
|
4527
|
-
this.snapshot = snapshot;
|
|
4528
|
-
this.sanitiser = sanitiser;
|
|
4529
|
-
}
|
|
4530
|
-
/**
|
|
4531
|
-
* @return {?}
|
|
4532
|
-
*/
|
|
4533
|
-
Sanitiser.prototype.isRouteId = /**
|
|
4534
|
-
* @return {?}
|
|
4535
|
-
*/
|
|
4536
|
-
function () {
|
|
4537
|
-
return this.parameterDef.isRouteId;
|
|
4538
|
-
};
|
|
4539
|
-
Object.defineProperty(Sanitiser.prototype, "valueChanged", {
|
|
4540
|
-
get: /**
|
|
4541
|
-
* @return {?}
|
|
4542
|
-
*/
|
|
4543
|
-
function () {
|
|
4544
|
-
return !___default.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
|
|
4545
|
-
},
|
|
4546
|
-
enumerable: true,
|
|
4547
|
-
configurable: true
|
|
4548
|
-
});
|
|
4549
|
-
Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
|
|
4550
|
-
get: /**
|
|
4551
|
-
* @return {?}
|
|
4552
|
-
*/
|
|
4553
|
-
function () {
|
|
4554
|
-
return this._sanitisedValue;
|
|
4555
|
-
},
|
|
4556
|
-
enumerable: true,
|
|
4557
|
-
configurable: true
|
|
4558
|
-
});
|
|
4559
|
-
/**
|
|
4560
|
-
* @protected
|
|
4561
|
-
* @param {?} snapshot
|
|
4562
|
-
* @return {?}
|
|
4563
|
-
*/
|
|
4564
|
-
Sanitiser.prototype.readFrom = /**
|
|
4565
|
-
* @protected
|
|
4566
|
-
* @param {?} snapshot
|
|
4567
|
-
* @return {?}
|
|
4568
|
-
*/
|
|
4569
|
-
function (snapshot) {
|
|
4570
|
-
return lang.abstractMethod(this.constructor);
|
|
4571
|
-
};
|
|
4572
|
-
/**
|
|
4573
|
-
* @protected
|
|
4574
|
-
* @param {?} initialValue
|
|
4575
|
-
* @param {?} sanitisedValue
|
|
4576
|
-
* @return {?}
|
|
4577
|
-
*/
|
|
4578
|
-
Sanitiser.prototype.hasChanged = /**
|
|
4579
|
-
* @protected
|
|
4580
|
-
* @param {?} initialValue
|
|
4581
|
-
* @param {?} sanitisedValue
|
|
4582
|
-
* @return {?}
|
|
4583
|
-
*/
|
|
4584
|
-
function (initialValue, sanitisedValue) {
|
|
4585
|
-
return lang.abstractMethod(this.constructor);
|
|
4586
|
-
};
|
|
4587
|
-
/**
|
|
4588
|
-
* @param {?} dest
|
|
4589
|
-
* @return {?}
|
|
4590
|
-
*/
|
|
4591
|
-
Sanitiser.prototype.injectRouteParam = /**
|
|
4592
|
-
* @param {?} dest
|
|
4593
|
-
* @return {?}
|
|
4594
|
-
*/
|
|
4595
|
-
function (dest) {
|
|
4596
|
-
lang.abstractMethod(this.constructor);
|
|
4597
|
-
};
|
|
4598
|
-
/**
|
|
4599
|
-
* @return {?}
|
|
4600
|
-
*/
|
|
4601
|
-
Sanitiser.prototype.sanitize = /**
|
|
4602
|
-
* @return {?}
|
|
4603
|
-
*/
|
|
4604
|
-
function () {
|
|
4605
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
4606
|
-
var _a;
|
|
4607
|
-
return __generator(this, function (_b) {
|
|
4608
|
-
switch (_b.label) {
|
|
4609
|
-
case 0:
|
|
4610
|
-
if (!this.sanitiser) return [3 /*break*/, 2];
|
|
4611
|
-
this.initialValue = this.readFrom(this.snapshot);
|
|
4612
|
-
_a = this;
|
|
4613
|
-
return [4 /*yield*/, this.sanitiser.sanitise(null, this.initialValue)];
|
|
4614
|
-
case 1:
|
|
4615
|
-
_a._sanitisedValue = _b.sent();
|
|
4616
|
-
if (this.initialValue !== this._sanitisedValue) {
|
|
4617
|
-
return [2 /*return*/, false];
|
|
4618
|
-
}
|
|
4619
|
-
_b.label = 2;
|
|
4620
|
-
case 2: return [2 /*return*/, true];
|
|
4621
|
-
}
|
|
4622
|
-
});
|
|
4623
|
-
});
|
|
4624
|
-
};
|
|
4625
|
-
return Sanitiser;
|
|
4626
|
-
}());
|
|
4627
|
-
if (false) {
|
|
4628
|
-
/**
|
|
4629
|
-
* @type {?}
|
|
4630
|
-
* @private
|
|
4631
|
-
*/
|
|
4632
|
-
Sanitiser.prototype.initialValue;
|
|
4633
|
-
/**
|
|
4634
|
-
* @type {?}
|
|
4635
|
-
* @private
|
|
4636
|
-
*/
|
|
4637
|
-
Sanitiser.prototype._sanitisedValue;
|
|
4638
|
-
/** @type {?} */
|
|
4639
|
-
Sanitiser.prototype.parameterDef;
|
|
4640
|
-
/** @type {?} */
|
|
4641
|
-
Sanitiser.prototype.snapshot;
|
|
4642
|
-
/** @type {?} */
|
|
4643
|
-
Sanitiser.prototype.sanitiser;
|
|
4644
|
-
}
|
|
4645
|
-
var RouteParameterSanitiser = /** @class */ (function () {
|
|
4646
|
-
function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
|
|
4647
|
-
var _this = this;
|
|
4648
|
-
this.parameterDefs = parameterDefs;
|
|
4649
|
-
this.snapshot = snapshot;
|
|
4650
|
-
this.injector = injector;
|
|
4651
|
-
this.parameterSanitisers = [];
|
|
4652
|
-
/** @type {?} */
|
|
4653
|
-
var sanitisers = parameterDefs.map((/**
|
|
4654
|
-
* @param {?} def
|
|
4655
|
-
* @return {?}
|
|
4656
|
-
*/
|
|
4657
|
-
function (def) {
|
|
4658
|
-
return def.isArray ?
|
|
4659
|
-
new Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
|
|
4660
|
-
new Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
|
|
4661
|
-
}));
|
|
4662
|
-
this.routeIdSanitiser = sanitisers.find((/**
|
|
4663
|
-
* @param {?} p
|
|
4664
|
-
* @return {?}
|
|
4665
|
-
*/
|
|
4666
|
-
function (p) { return p.isRouteId(); }));
|
|
4667
|
-
this.parameterSanitisers = sanitisers.filter((/**
|
|
4668
|
-
* @param {?} p
|
|
4669
|
-
* @return {?}
|
|
4670
|
-
*/
|
|
4671
|
-
function (p) { return !p.isRouteId(); }));
|
|
4672
|
-
}
|
|
4673
|
-
/**
|
|
4674
|
-
* @return {?}
|
|
4675
|
-
*/
|
|
4676
|
-
RouteParameterSanitiser.prototype.sanitise = /**
|
|
4677
|
-
* @return {?}
|
|
4678
|
-
*/
|
|
4679
|
-
function () {
|
|
4680
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
4681
|
-
var e_1, _a, _b, _c, sanitiser, e_1_1;
|
|
4682
|
-
return __generator(this, function (_d) {
|
|
4683
|
-
switch (_d.label) {
|
|
4684
|
-
case 0:
|
|
4685
|
-
if (!this.routeIdSanitiser) return [3 /*break*/, 2];
|
|
4686
|
-
return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
|
|
4687
|
-
case 1:
|
|
4688
|
-
_d.sent();
|
|
4689
|
-
if (this.routeIdSanitiser.valueChanged) {
|
|
4690
|
-
// if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
|
|
4691
|
-
// context of the route id.
|
|
4692
|
-
return [2 /*return*/, false];
|
|
4693
|
-
}
|
|
4694
|
-
_d.label = 2;
|
|
4695
|
-
case 2:
|
|
4696
|
-
_d.trys.push([2, 7, 8, 9]);
|
|
4697
|
-
_b = __values(this.parameterSanitisers), _c = _b.next();
|
|
4698
|
-
_d.label = 3;
|
|
4699
|
-
case 3:
|
|
4700
|
-
if (!!_c.done) return [3 /*break*/, 6];
|
|
4701
|
-
sanitiser = _c.value;
|
|
4702
|
-
return [4 /*yield*/, sanitiser.sanitize()];
|
|
4703
|
-
case 4:
|
|
4704
|
-
_d.sent();
|
|
4705
|
-
_d.label = 5;
|
|
4706
|
-
case 5:
|
|
4707
|
-
_c = _b.next();
|
|
4708
|
-
return [3 /*break*/, 3];
|
|
4709
|
-
case 6: return [3 /*break*/, 9];
|
|
4710
|
-
case 7:
|
|
4711
|
-
e_1_1 = _d.sent();
|
|
4712
|
-
e_1 = { error: e_1_1 };
|
|
4713
|
-
return [3 /*break*/, 9];
|
|
4714
|
-
case 8:
|
|
4715
|
-
try {
|
|
4716
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4717
|
-
}
|
|
4718
|
-
finally { if (e_1) throw e_1.error; }
|
|
4719
|
-
return [7 /*endfinally*/];
|
|
4720
|
-
case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
|
|
4721
|
-
* @param {?} s
|
|
4722
|
-
* @return {?}
|
|
4723
|
-
*/
|
|
4724
|
-
function (s) { return s.valueChanged; }))];
|
|
4725
|
-
}
|
|
4726
|
-
});
|
|
4727
|
-
});
|
|
4728
|
-
};
|
|
4729
|
-
/**
|
|
4730
|
-
* @private
|
|
4731
|
-
* @template T, S
|
|
4732
|
-
* @param {?} def
|
|
4733
|
-
* @return {?}
|
|
4734
|
-
*/
|
|
4735
|
-
RouteParameterSanitiser.prototype.getSanitiser = /**
|
|
4736
|
-
* @private
|
|
4737
|
-
* @template T, S
|
|
4738
|
-
* @param {?} def
|
|
4739
|
-
* @return {?}
|
|
4740
|
-
*/
|
|
4741
|
-
function (def) {
|
|
4742
|
-
return def.getSanitiser(this.injector);
|
|
4743
|
-
};
|
|
4744
|
-
/**
|
|
4745
|
-
* @return {?}
|
|
4746
|
-
*/
|
|
4747
|
-
RouteParameterSanitiser.prototype.routeIdHasChanged = /**
|
|
4748
|
-
* @return {?}
|
|
4749
|
-
*/
|
|
4750
|
-
function () {
|
|
4751
|
-
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
4752
|
-
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
4753
|
-
};
|
|
4754
|
-
// @Trace()
|
|
4755
|
-
// @Trace()
|
|
4756
|
-
/**
|
|
4757
|
-
* @return {?}
|
|
4758
|
-
*/
|
|
4759
|
-
RouteParameterSanitiser.prototype.getRedirectParams =
|
|
4760
|
-
// @Trace()
|
|
4761
|
-
/**
|
|
4762
|
-
* @return {?}
|
|
4763
|
-
*/
|
|
4764
|
-
function () {
|
|
4765
|
-
if (this.routeIdHasChanged()) {
|
|
4766
|
-
return [this.routeIdSanitiser.sanitisedValue];
|
|
4767
|
-
}
|
|
4768
|
-
else {
|
|
4769
|
-
/** @type {?} */
|
|
4770
|
-
var routeParams_1 = {};
|
|
4771
|
-
this.parameterSanitisers.forEach((/**
|
|
4772
|
-
* @param {?} s
|
|
4773
|
-
* @return {?}
|
|
4774
|
-
*/
|
|
4775
|
-
function (s) { return s.injectRouteParam(routeParams_1); }));
|
|
4776
|
-
return [routeParams_1];
|
|
4777
|
-
}
|
|
4778
|
-
};
|
|
4779
|
-
/**
|
|
4780
|
-
* @private
|
|
4781
|
-
* @template S
|
|
4782
|
-
* @param {?} value
|
|
4783
|
-
* @return {?}
|
|
4784
|
-
*/
|
|
4785
|
-
RouteParameterSanitiser.prototype.isSanitiserContructor = /**
|
|
4786
|
-
* @private
|
|
4787
|
-
* @template S
|
|
4788
|
-
* @param {?} value
|
|
4789
|
-
* @return {?}
|
|
4790
|
-
*/
|
|
4791
|
-
function (value) {
|
|
4792
|
-
return ___default.isFunction(value) && lang.constructorChain((/** @type {?} */ ((/** @type {?} */ (value))))).includes(Sanitiser);
|
|
4793
|
-
};
|
|
4794
|
-
__decorate([
|
|
4795
|
-
Memoize$1(),
|
|
4796
|
-
__metadata("design:type", Function),
|
|
4797
|
-
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
4798
|
-
__metadata("design:returntype", Object)
|
|
4799
|
-
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
4800
|
-
return RouteParameterSanitiser;
|
|
4801
|
-
}());
|
|
4802
|
-
if (false) {
|
|
4803
|
-
/**
|
|
4804
|
-
* @type {?}
|
|
4805
|
-
* @private
|
|
4806
|
-
*/
|
|
4807
|
-
RouteParameterSanitiser.prototype.routeIdSanitiser;
|
|
4808
|
-
/**
|
|
4809
|
-
* @type {?}
|
|
4810
|
-
* @private
|
|
4811
|
-
*/
|
|
4812
|
-
RouteParameterSanitiser.prototype.parameterSanitisers;
|
|
4813
|
-
/** @type {?} */
|
|
4814
|
-
RouteParameterSanitiser.prototype.parameterDefs;
|
|
4815
|
-
/** @type {?} */
|
|
4816
|
-
RouteParameterSanitiser.prototype.snapshot;
|
|
4817
|
-
/** @type {?} */
|
|
4818
|
-
RouteParameterSanitiser.prototype.injector;
|
|
4819
|
-
}
|
|
4820
|
-
(function (Sanitiser) {
|
|
4821
|
-
/**
|
|
4822
|
-
* @template T
|
|
4823
|
-
*/
|
|
4824
|
-
var /**
|
|
4825
|
-
* @template T
|
|
4826
|
-
*/
|
|
4827
|
-
Value = /** @class */ (function (_super) {
|
|
4828
|
-
__extends(Value, _super);
|
|
4829
|
-
function Value() {
|
|
4830
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4831
|
-
}
|
|
4832
|
-
/**
|
|
4833
|
-
* @param {?} snapshot
|
|
4834
|
-
* @return {?}
|
|
4835
|
-
*/
|
|
4836
|
-
Value.prototype.readFrom = /**
|
|
4837
|
-
* @param {?} snapshot
|
|
4838
|
-
* @return {?}
|
|
4839
|
-
*/
|
|
4840
|
-
function (snapshot) {
|
|
4841
|
-
/** @type {?} */
|
|
4842
|
-
var rawValue = snapshot.paramMap.get(this.parameterDef.name);
|
|
4843
|
-
return this.parameterDef.type.parse(rawValue);
|
|
4844
|
-
};
|
|
4845
|
-
/**
|
|
4846
|
-
* @protected
|
|
4847
|
-
* @param {?} initialValue
|
|
4848
|
-
* @param {?} sanitisedValue
|
|
4849
|
-
* @return {?}
|
|
4850
|
-
*/
|
|
4851
|
-
Value.prototype.hasChanged = /**
|
|
4852
|
-
* @protected
|
|
4853
|
-
* @param {?} initialValue
|
|
4854
|
-
* @param {?} sanitisedValue
|
|
4855
|
-
* @return {?}
|
|
4856
|
-
*/
|
|
4857
|
-
function (initialValue, sanitisedValue) {
|
|
4858
|
-
return initialValue !== sanitisedValue;
|
|
4859
|
-
};
|
|
4860
|
-
/**
|
|
4861
|
-
* @param {?} dest
|
|
4862
|
-
* @return {?}
|
|
4863
|
-
*/
|
|
4864
|
-
Value.prototype.injectRouteParam = /**
|
|
4865
|
-
* @param {?} dest
|
|
4866
|
-
* @return {?}
|
|
4867
|
-
*/
|
|
4868
|
-
function (dest) {
|
|
4869
|
-
dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
|
|
4870
|
-
};
|
|
4871
|
-
return Value;
|
|
4872
|
-
}(Sanitiser));
|
|
4873
|
-
Sanitiser.Value = Value;
|
|
4874
|
-
/**
|
|
4875
|
-
* @template T
|
|
4876
|
-
*/
|
|
4877
|
-
var /**
|
|
4878
|
-
* @template T
|
|
4879
|
-
*/
|
|
4880
|
-
Array = /** @class */ (function (_super) {
|
|
4881
|
-
__extends(Array, _super);
|
|
4882
|
-
function Array() {
|
|
4883
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4884
|
-
}
|
|
4885
|
-
/**
|
|
4886
|
-
* @param {?} snapshot
|
|
4887
|
-
* @return {?}
|
|
4888
|
-
*/
|
|
4889
|
-
Array.prototype.readFrom = /**
|
|
4890
|
-
* @param {?} snapshot
|
|
4891
|
-
* @return {?}
|
|
4892
|
-
*/
|
|
4893
|
-
function (snapshot) {
|
|
4894
|
-
var _this = this;
|
|
4895
|
-
/** @type {?} */
|
|
4896
|
-
var rawValues = snapshot.paramMap.getAll(this.parameterDef.name);
|
|
4897
|
-
return rawValues.map((/**
|
|
4898
|
-
* @param {?} value
|
|
4899
|
-
* @return {?}
|
|
4900
|
-
*/
|
|
4901
|
-
function (value) { return _this.parameterDef.type.parse(value); }));
|
|
4902
|
-
};
|
|
4903
|
-
/**
|
|
4904
|
-
* @protected
|
|
4905
|
-
* @param {?} initialValue
|
|
4906
|
-
* @param {?} sanitisedValue
|
|
4907
|
-
* @return {?}
|
|
4908
|
-
*/
|
|
4909
|
-
Array.prototype.hasChanged = /**
|
|
4910
|
-
* @protected
|
|
4911
|
-
* @param {?} initialValue
|
|
4912
|
-
* @param {?} sanitisedValue
|
|
4913
|
-
* @return {?}
|
|
4914
|
-
*/
|
|
4915
|
-
function (initialValue, sanitisedValue) {
|
|
4916
|
-
return initialValue !== sanitisedValue;
|
|
4917
|
-
};
|
|
4918
|
-
/**
|
|
4919
|
-
* @param {?} dest
|
|
4920
|
-
* @return {?}
|
|
4921
|
-
*/
|
|
4922
|
-
Array.prototype.injectRouteParam = /**
|
|
4923
|
-
* @param {?} dest
|
|
4924
|
-
* @return {?}
|
|
4925
|
-
*/
|
|
4926
|
-
function (dest) {
|
|
4927
|
-
var _this = this;
|
|
4928
|
-
dest[this.parameterDef.name] = this.sanitisedValue.map((/**
|
|
4929
|
-
* @param {?} v
|
|
4930
|
-
* @return {?}
|
|
4931
|
-
*/
|
|
4932
|
-
function (v) { return _this.parameterDef.type.format(v); }));
|
|
4933
|
-
};
|
|
4934
|
-
return Array;
|
|
4935
|
-
}(Sanitiser));
|
|
4936
|
-
Sanitiser.Array = Array;
|
|
4937
|
-
})(Sanitiser || (Sanitiser = {}));
|
|
4938
|
-
|
|
4939
4583
|
/**
|
|
4940
4584
|
* @fileoverview added by tsickle
|
|
4941
4585
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -4956,5 +4600,5 @@ if (false) {
|
|
|
4956
4600
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4957
4601
|
*/
|
|
4958
4602
|
|
|
4959
|
-
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, 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, ListPlaceNavComponent, NumberInputComponent, ParameterDefinition, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList,
|
|
4603
|
+
export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, 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, ListPlaceNavComponent, NumberInputComponent, ParameterDefinition, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterValue, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, AlertDialogComponent as ɵba, DialogInteractionService as ɵbc, InteractionContext as ɵbd, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceRouter as ɵo, PlaceHistory as ɵp, TabbedPlaceNavigationComponent as ɵq, AbstractPlaceNavigationComponent as ɵr, ListPlaceNavComponent as ɵs, InteractionModule as ɵt, ActivityContainerComponent as ɵu, ActivityOutletComponent as ɵv, ConfirmationDialogComponent as ɵw, AbstractActivity as ɵx, ACTIVITY_DATA as ɵy };
|
|
4960
4604
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|