@coolon/angular-ui-powerups 0.0.49 → 0.0.50
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 +28 -18
- 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/esm2015/lib/place/guards/place-route.guard.js +3 -2
- package/esm2015/lib/place/route/parameter-definition.class.js +10 -5
- package/esm2015/lib/place/route/parameter-snapshot.js +21 -6
- package/esm5/lib/place/guards/place-route.guard.js +3 -2
- package/esm5/lib/place/route/parameter-definition.class.js +10 -9
- package/esm5/lib/place/route/parameter-snapshot.js +22 -11
- package/fesm2015/coolon-angular-ui-powerups.js +27 -10
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +29 -19
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgress
|
|
|
5
5
|
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
7
|
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
|
|
8
|
-
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, MutableListModel, StoreInValueModel, Binding, MutableValueModel, Guard, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
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';
|
|
@@ -2484,10 +2484,7 @@ if (false) {
|
|
|
2484
2484
|
/**
|
|
2485
2485
|
* @template T, S
|
|
2486
2486
|
*/
|
|
2487
|
-
var /**
|
|
2488
|
-
* @template T, S
|
|
2489
|
-
*/
|
|
2490
|
-
DefaultParameterSanitiser = /** @class */ (function () {
|
|
2487
|
+
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
2491
2488
|
function DefaultParameterSanitiser(remember, defaultValue, placeHistory) {
|
|
2492
2489
|
this.remember = remember;
|
|
2493
2490
|
this.defaultValue = defaultValue;
|
|
@@ -2527,12 +2524,9 @@ if (false) {
|
|
|
2527
2524
|
*/
|
|
2528
2525
|
function (v) { return !_this.isBlank(parameterDef, v); }));
|
|
2529
2526
|
}
|
|
2530
|
-
|
|
2531
|
-
console.log(parameterDef.name + " is blank, returning: " + value);
|
|
2532
|
-
return value;
|
|
2527
|
+
return this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2533
2528
|
}
|
|
2534
2529
|
else {
|
|
2535
|
-
console.log(parameterDef.name + " is not blank");
|
|
2536
2530
|
return value;
|
|
2537
2531
|
}
|
|
2538
2532
|
};
|
|
@@ -2553,6 +2547,12 @@ if (false) {
|
|
|
2553
2547
|
var isNil = ___default.isNil(value);
|
|
2554
2548
|
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2555
2549
|
};
|
|
2550
|
+
__decorate([
|
|
2551
|
+
Trace(),
|
|
2552
|
+
__metadata("design:type", Function),
|
|
2553
|
+
__metadata("design:paramtypes", [ParameterDefinition, Object, Object]),
|
|
2554
|
+
__metadata("design:returntype", Object)
|
|
2555
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
2556
2556
|
return DefaultParameterSanitiser;
|
|
2557
2557
|
}());
|
|
2558
2558
|
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
@@ -2777,21 +2777,17 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2777
2777
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2778
2778
|
})));
|
|
2779
2779
|
};
|
|
2780
|
-
// @Trace()
|
|
2781
|
-
// @Trace()
|
|
2782
2780
|
/**
|
|
2783
2781
|
* @param {?} injector
|
|
2784
2782
|
* @return {?}
|
|
2785
2783
|
*/
|
|
2786
|
-
ParameterSnapshot.prototype.sanitise =
|
|
2787
|
-
// @Trace()
|
|
2788
|
-
/**
|
|
2784
|
+
ParameterSnapshot.prototype.sanitise = /**
|
|
2789
2785
|
* @param {?} injector
|
|
2790
2786
|
* @return {?}
|
|
2791
2787
|
*/
|
|
2792
2788
|
function (injector) {
|
|
2793
2789
|
return __awaiter(this, void 0, void 0, function () {
|
|
2794
|
-
var routeId, sanitisedValue, result, routeParameters, i, sanitisedValue;
|
|
2790
|
+
var routeId, sanitisedValue, result, routeParameters, i, routeParameter, sanitisedValue;
|
|
2795
2791
|
return __generator(this, function (_a) {
|
|
2796
2792
|
switch (_a.label) {
|
|
2797
2793
|
case 0:
|
|
@@ -2813,11 +2809,12 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2813
2809
|
_a.label = 3;
|
|
2814
2810
|
case 3:
|
|
2815
2811
|
if (!(i < routeParameters.length)) return [3 /*break*/, 6];
|
|
2816
|
-
|
|
2812
|
+
routeParameter = routeParameters[i];
|
|
2813
|
+
return [4 /*yield*/, routeParameter.sanitise(this, injector)];
|
|
2817
2814
|
case 4:
|
|
2818
2815
|
sanitisedValue = _a.sent();
|
|
2819
|
-
if (!
|
|
2820
|
-
result = this.replace(
|
|
2816
|
+
if (!routeParameter.isSame(sanitisedValue)) {
|
|
2817
|
+
result = this.replace(routeParameter.parameterDef, sanitisedValue);
|
|
2821
2818
|
}
|
|
2822
2819
|
_a.label = 5;
|
|
2823
2820
|
case 5:
|
|
@@ -2828,7 +2825,7 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2828
2825
|
});
|
|
2829
2826
|
});
|
|
2830
2827
|
};
|
|
2831
|
-
var _a;
|
|
2828
|
+
var _a, _b;
|
|
2832
2829
|
__decorate([
|
|
2833
2830
|
Memoize$1(),
|
|
2834
2831
|
__metadata("design:type", Function),
|
|
@@ -2859,6 +2856,18 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2859
2856
|
__metadata("design:paramtypes", []),
|
|
2860
2857
|
__metadata("design:returntype", Array)
|
|
2861
2858
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2859
|
+
__decorate([
|
|
2860
|
+
Trace(),
|
|
2861
|
+
__metadata("design:type", Function),
|
|
2862
|
+
__metadata("design:paramtypes", [ParameterDefinition, typeof (_b = typeof S !== "undefined" && S) === "function" ? _b : Object]),
|
|
2863
|
+
__metadata("design:returntype", ParameterSnapshot)
|
|
2864
|
+
], ParameterSnapshot.prototype, "replace", null);
|
|
2865
|
+
__decorate([
|
|
2866
|
+
Trace(),
|
|
2867
|
+
__metadata("design:type", Function),
|
|
2868
|
+
__metadata("design:paramtypes", [Injector]),
|
|
2869
|
+
__metadata("design:returntype", Promise)
|
|
2870
|
+
], ParameterSnapshot.prototype, "sanitise", null);
|
|
2862
2871
|
return ParameterSnapshot;
|
|
2863
2872
|
}());
|
|
2864
2873
|
if (false) {
|
|
@@ -4242,6 +4251,7 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
4242
4251
|
* @return {?}
|
|
4243
4252
|
*/
|
|
4244
4253
|
function (sanitised) {
|
|
4254
|
+
Logger.get(_this).info("ParameterSnapshot.sanitise", { sanitised: sanitised });
|
|
4245
4255
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4246
4256
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4247
4257
|
}
|