@coolon/angular-ui-powerups 0.0.49 → 0.0.51
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 +27 -13
- 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 +2 -5
- package/esm2015/lib/place/route/parameter-snapshot.js +22 -5
- package/esm5/lib/place/guards/place-route.guard.js +3 -2
- package/esm5/lib/place/route/parameter-definition.class.js +2 -5
- package/esm5/lib/place/route/parameter-snapshot.js +26 -10
- package/fesm2015/coolon-angular-ui-powerups.js +23 -8
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +27 -13
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/route/parameter-snapshot.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2710,12 +2710,9 @@
|
|
|
2710
2710
|
*/
|
|
2711
2711
|
function (v) { return !_this.isBlank(parameterDef, v); }));
|
|
2712
2712
|
}
|
|
2713
|
-
|
|
2714
|
-
console.log(parameterDef.name + " is blank, returning: " + value);
|
|
2715
|
-
return value;
|
|
2713
|
+
return this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2716
2714
|
}
|
|
2717
2715
|
else {
|
|
2718
|
-
console.log(parameterDef.name + " is not blank");
|
|
2719
2716
|
return value;
|
|
2720
2717
|
}
|
|
2721
2718
|
};
|
|
@@ -2939,6 +2936,25 @@
|
|
|
2939
2936
|
}));
|
|
2940
2937
|
return params;
|
|
2941
2938
|
};
|
|
2939
|
+
/**
|
|
2940
|
+
* @return {?}
|
|
2941
|
+
*/
|
|
2942
|
+
ParameterSnapshot.prototype.getAllParameters = /**
|
|
2943
|
+
* @return {?}
|
|
2944
|
+
*/
|
|
2945
|
+
function () {
|
|
2946
|
+
/** @type {?} */
|
|
2947
|
+
var params = {};
|
|
2948
|
+
/** @type {?} */
|
|
2949
|
+
var routeIdParam = this.resolved.forEach((/**
|
|
2950
|
+
* @param {?} p
|
|
2951
|
+
* @return {?}
|
|
2952
|
+
*/
|
|
2953
|
+
function (p) {
|
|
2954
|
+
params[p.parameterDef.name] = p.value;
|
|
2955
|
+
}));
|
|
2956
|
+
return params;
|
|
2957
|
+
};
|
|
2942
2958
|
/**
|
|
2943
2959
|
* @template T, S
|
|
2944
2960
|
* @param {?} parameter
|
|
@@ -2960,21 +2976,17 @@
|
|
|
2960
2976
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2961
2977
|
})));
|
|
2962
2978
|
};
|
|
2963
|
-
// @Trace()
|
|
2964
|
-
// @Trace()
|
|
2965
2979
|
/**
|
|
2966
2980
|
* @param {?} injector
|
|
2967
2981
|
* @return {?}
|
|
2968
2982
|
*/
|
|
2969
|
-
ParameterSnapshot.prototype.sanitise =
|
|
2970
|
-
// @Trace()
|
|
2971
|
-
/**
|
|
2983
|
+
ParameterSnapshot.prototype.sanitise = /**
|
|
2972
2984
|
* @param {?} injector
|
|
2973
2985
|
* @return {?}
|
|
2974
2986
|
*/
|
|
2975
2987
|
function (injector) {
|
|
2976
2988
|
return __awaiter(this, void 0, void 0, function () {
|
|
2977
|
-
var routeId, sanitisedValue, result, routeParameters, i, sanitisedValue;
|
|
2989
|
+
var routeId, sanitisedValue, result, routeParameters, i, routeParameter, sanitisedValue;
|
|
2978
2990
|
return __generator(this, function (_a) {
|
|
2979
2991
|
switch (_a.label) {
|
|
2980
2992
|
case 0:
|
|
@@ -2996,11 +3008,12 @@
|
|
|
2996
3008
|
_a.label = 3;
|
|
2997
3009
|
case 3:
|
|
2998
3010
|
if (!(i < routeParameters.length)) return [3 /*break*/, 6];
|
|
2999
|
-
|
|
3011
|
+
routeParameter = routeParameters[i];
|
|
3012
|
+
return [4 /*yield*/, routeParameter.sanitise(this, injector)];
|
|
3000
3013
|
case 4:
|
|
3001
3014
|
sanitisedValue = _a.sent();
|
|
3002
|
-
if (!
|
|
3003
|
-
result =
|
|
3015
|
+
if (!routeParameter.isSame(sanitisedValue)) {
|
|
3016
|
+
result = result.replace(routeParameter.parameterDef, sanitisedValue);
|
|
3004
3017
|
}
|
|
3005
3018
|
_a.label = 5;
|
|
3006
3019
|
case 5:
|
|
@@ -4425,6 +4438,7 @@
|
|
|
4425
4438
|
* @return {?}
|
|
4426
4439
|
*/
|
|
4427
4440
|
function (sanitised) {
|
|
4441
|
+
pectin.Logger.get(_this).info("ParameterSnapshot.sanitise result", sanitised.getAllParameters());
|
|
4428
4442
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4429
4443
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4430
4444
|
}
|