@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
|
@@ -2667,10 +2667,7 @@
|
|
|
2667
2667
|
/**
|
|
2668
2668
|
* @template T, S
|
|
2669
2669
|
*/
|
|
2670
|
-
var /**
|
|
2671
|
-
* @template T, S
|
|
2672
|
-
*/
|
|
2673
|
-
DefaultParameterSanitiser = /** @class */ (function () {
|
|
2670
|
+
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
2674
2671
|
function DefaultParameterSanitiser(remember, defaultValue, placeHistory) {
|
|
2675
2672
|
this.remember = remember;
|
|
2676
2673
|
this.defaultValue = defaultValue;
|
|
@@ -2710,12 +2707,9 @@
|
|
|
2710
2707
|
*/
|
|
2711
2708
|
function (v) { return !_this.isBlank(parameterDef, v); }));
|
|
2712
2709
|
}
|
|
2713
|
-
|
|
2714
|
-
console.log(parameterDef.name + " is blank, returning: " + value);
|
|
2715
|
-
return value;
|
|
2710
|
+
return this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2716
2711
|
}
|
|
2717
2712
|
else {
|
|
2718
|
-
console.log(parameterDef.name + " is not blank");
|
|
2719
2713
|
return value;
|
|
2720
2714
|
}
|
|
2721
2715
|
};
|
|
@@ -2736,6 +2730,12 @@
|
|
|
2736
2730
|
var isNil = ___default__default.isNil(value);
|
|
2737
2731
|
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2738
2732
|
};
|
|
2733
|
+
__decorate([
|
|
2734
|
+
pectin.Trace(),
|
|
2735
|
+
__metadata("design:type", Function),
|
|
2736
|
+
__metadata("design:paramtypes", [ParameterDefinition, Object, Object]),
|
|
2737
|
+
__metadata("design:returntype", Object)
|
|
2738
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
2739
2739
|
return DefaultParameterSanitiser;
|
|
2740
2740
|
}());
|
|
2741
2741
|
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
@@ -2960,21 +2960,17 @@
|
|
|
2960
2960
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2961
2961
|
})));
|
|
2962
2962
|
};
|
|
2963
|
-
// @Trace()
|
|
2964
|
-
// @Trace()
|
|
2965
2963
|
/**
|
|
2966
2964
|
* @param {?} injector
|
|
2967
2965
|
* @return {?}
|
|
2968
2966
|
*/
|
|
2969
|
-
ParameterSnapshot.prototype.sanitise =
|
|
2970
|
-
// @Trace()
|
|
2971
|
-
/**
|
|
2967
|
+
ParameterSnapshot.prototype.sanitise = /**
|
|
2972
2968
|
* @param {?} injector
|
|
2973
2969
|
* @return {?}
|
|
2974
2970
|
*/
|
|
2975
2971
|
function (injector) {
|
|
2976
2972
|
return __awaiter(this, void 0, void 0, function () {
|
|
2977
|
-
var routeId, sanitisedValue, result, routeParameters, i, sanitisedValue;
|
|
2973
|
+
var routeId, sanitisedValue, result, routeParameters, i, routeParameter, sanitisedValue;
|
|
2978
2974
|
return __generator(this, function (_a) {
|
|
2979
2975
|
switch (_a.label) {
|
|
2980
2976
|
case 0:
|
|
@@ -2996,11 +2992,12 @@
|
|
|
2996
2992
|
_a.label = 3;
|
|
2997
2993
|
case 3:
|
|
2998
2994
|
if (!(i < routeParameters.length)) return [3 /*break*/, 6];
|
|
2999
|
-
|
|
2995
|
+
routeParameter = routeParameters[i];
|
|
2996
|
+
return [4 /*yield*/, routeParameter.sanitise(this, injector)];
|
|
3000
2997
|
case 4:
|
|
3001
2998
|
sanitisedValue = _a.sent();
|
|
3002
|
-
if (!
|
|
3003
|
-
result = this.replace(
|
|
2999
|
+
if (!routeParameter.isSame(sanitisedValue)) {
|
|
3000
|
+
result = this.replace(routeParameter.parameterDef, sanitisedValue);
|
|
3004
3001
|
}
|
|
3005
3002
|
_a.label = 5;
|
|
3006
3003
|
case 5:
|
|
@@ -3011,7 +3008,7 @@
|
|
|
3011
3008
|
});
|
|
3012
3009
|
});
|
|
3013
3010
|
};
|
|
3014
|
-
var _a;
|
|
3011
|
+
var _a, _b;
|
|
3015
3012
|
__decorate([
|
|
3016
3013
|
src.Memoize(),
|
|
3017
3014
|
__metadata("design:type", Function),
|
|
@@ -3042,6 +3039,18 @@
|
|
|
3042
3039
|
__metadata("design:paramtypes", []),
|
|
3043
3040
|
__metadata("design:returntype", Array)
|
|
3044
3041
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
3042
|
+
__decorate([
|
|
3043
|
+
pectin.Trace(),
|
|
3044
|
+
__metadata("design:type", Function),
|
|
3045
|
+
__metadata("design:paramtypes", [exports.ParameterDefinition, typeof (_b = typeof S !== "undefined" && S) === "function" ? _b : Object]),
|
|
3046
|
+
__metadata("design:returntype", ParameterSnapshot)
|
|
3047
|
+
], ParameterSnapshot.prototype, "replace", null);
|
|
3048
|
+
__decorate([
|
|
3049
|
+
pectin.Trace(),
|
|
3050
|
+
__metadata("design:type", Function),
|
|
3051
|
+
__metadata("design:paramtypes", [core.Injector]),
|
|
3052
|
+
__metadata("design:returntype", Promise)
|
|
3053
|
+
], ParameterSnapshot.prototype, "sanitise", null);
|
|
3045
3054
|
return ParameterSnapshot;
|
|
3046
3055
|
}());
|
|
3047
3056
|
if (false) {
|
|
@@ -4425,6 +4434,7 @@
|
|
|
4425
4434
|
* @return {?}
|
|
4426
4435
|
*/
|
|
4427
4436
|
function (sanitised) {
|
|
4437
|
+
pectin.Logger.get(_this).info("ParameterSnapshot.sanitise", { sanitised: sanitised });
|
|
4428
4438
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4429
4439
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4430
4440
|
}
|