@coolon/angular-ui-powerups 0.0.48 → 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 +52 -31
- 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/lib/place/components/place-outlet/place-outlet.component.js +14 -7
- 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/components/place-outlet/place-outlet.component.js +25 -14
- 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 +40 -16
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +53 -32
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +5 -3
- 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) {
|
|
@@ -3510,6 +3519,7 @@
|
|
|
3510
3519
|
_this.router = router;
|
|
3511
3520
|
_this.placeHistory = placeHistory;
|
|
3512
3521
|
_this.animate = true;
|
|
3522
|
+
_this._activePlace = new pectin.MutableValueModel();
|
|
3513
3523
|
_this._incomingRouteChange = new pectin.Guard();
|
|
3514
3524
|
_this._inOutletUpdate = new pectin.Guard();
|
|
3515
3525
|
_this._activatedRouteModel = new pectin.MutableValueModel();
|
|
@@ -3562,6 +3572,14 @@
|
|
|
3562
3572
|
// txo.observe('urls', urls);
|
|
3563
3573
|
// txo.observe('this._resolvedParameters', this._resolvedParameters);
|
|
3564
3574
|
}
|
|
3575
|
+
/**
|
|
3576
|
+
* @return {?}
|
|
3577
|
+
*/
|
|
3578
|
+
PlaceOutletComponent.prototype.ngOnInit = /**
|
|
3579
|
+
* @return {?}
|
|
3580
|
+
*/
|
|
3581
|
+
function () {
|
|
3582
|
+
};
|
|
3565
3583
|
Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
|
|
3566
3584
|
get: /**
|
|
3567
3585
|
* @return {?}
|
|
@@ -3572,14 +3590,16 @@
|
|
|
3572
3590
|
enumerable: true,
|
|
3573
3591
|
configurable: true
|
|
3574
3592
|
});
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3593
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "activePlace", {
|
|
3594
|
+
get: /**
|
|
3595
|
+
* @return {?}
|
|
3596
|
+
*/
|
|
3597
|
+
function () {
|
|
3598
|
+
return this._activePlace.readonly;
|
|
3599
|
+
},
|
|
3600
|
+
enumerable: true,
|
|
3601
|
+
configurable: true
|
|
3602
|
+
});
|
|
3583
3603
|
/**
|
|
3584
3604
|
* @param {?} routerOutlet
|
|
3585
3605
|
* @param {?} place
|
|
@@ -3597,7 +3617,7 @@
|
|
|
3597
3617
|
*/
|
|
3598
3618
|
function () {
|
|
3599
3619
|
try {
|
|
3600
|
-
_this.
|
|
3620
|
+
_this._activePlace.value = place;
|
|
3601
3621
|
_this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
3602
3622
|
_this._placeDefinition.value = place.placeDefinition;
|
|
3603
3623
|
place.initialiseBindings(_this._resolvedParameters);
|
|
@@ -3627,7 +3647,7 @@
|
|
|
3627
3647
|
* @return {?}
|
|
3628
3648
|
*/
|
|
3629
3649
|
function () {
|
|
3630
|
-
_this.
|
|
3650
|
+
_this._activePlace.value = null;
|
|
3631
3651
|
_this._activatedRouteModel.value = null;
|
|
3632
3652
|
_this._placeDefinition.value = null;
|
|
3633
3653
|
}));
|
|
@@ -3650,8 +3670,8 @@
|
|
|
3650
3670
|
* @return {?}
|
|
3651
3671
|
*/
|
|
3652
3672
|
function () {
|
|
3653
|
-
if (this.
|
|
3654
|
-
this.
|
|
3673
|
+
if (this._activePlace.value) {
|
|
3674
|
+
this._activePlace.value.onPlaceReady();
|
|
3655
3675
|
}
|
|
3656
3676
|
};
|
|
3657
3677
|
/**
|
|
@@ -3710,7 +3730,7 @@
|
|
|
3710
3730
|
* @type {?}
|
|
3711
3731
|
* @private
|
|
3712
3732
|
*/
|
|
3713
|
-
PlaceOutletComponent.prototype.
|
|
3733
|
+
PlaceOutletComponent.prototype._activePlace;
|
|
3714
3734
|
/**
|
|
3715
3735
|
* @type {?}
|
|
3716
3736
|
* @private
|
|
@@ -4414,6 +4434,7 @@
|
|
|
4414
4434
|
* @return {?}
|
|
4415
4435
|
*/
|
|
4416
4436
|
function (sanitised) {
|
|
4437
|
+
pectin.Logger.get(_this).info("ParameterSnapshot.sanitise", { sanitised: sanitised });
|
|
4417
4438
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4418
4439
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4419
4440
|
}
|