@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
|
@@ -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,
|
|
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) {
|
|
@@ -3327,6 +3336,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3327
3336
|
_this.router = router;
|
|
3328
3337
|
_this.placeHistory = placeHistory;
|
|
3329
3338
|
_this.animate = true;
|
|
3339
|
+
_this._activePlace = new MutableValueModel();
|
|
3330
3340
|
_this._incomingRouteChange = new Guard();
|
|
3331
3341
|
_this._inOutletUpdate = new Guard();
|
|
3332
3342
|
_this._activatedRouteModel = new MutableValueModel();
|
|
@@ -3379,6 +3389,14 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3379
3389
|
// txo.observe('urls', urls);
|
|
3380
3390
|
// txo.observe('this._resolvedParameters', this._resolvedParameters);
|
|
3381
3391
|
}
|
|
3392
|
+
/**
|
|
3393
|
+
* @return {?}
|
|
3394
|
+
*/
|
|
3395
|
+
PlaceOutletComponent.prototype.ngOnInit = /**
|
|
3396
|
+
* @return {?}
|
|
3397
|
+
*/
|
|
3398
|
+
function () {
|
|
3399
|
+
};
|
|
3382
3400
|
Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
|
|
3383
3401
|
get: /**
|
|
3384
3402
|
* @return {?}
|
|
@@ -3389,14 +3407,16 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3389
3407
|
enumerable: true,
|
|
3390
3408
|
configurable: true
|
|
3391
3409
|
});
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3410
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "activePlace", {
|
|
3411
|
+
get: /**
|
|
3412
|
+
* @return {?}
|
|
3413
|
+
*/
|
|
3414
|
+
function () {
|
|
3415
|
+
return this._activePlace.readonly;
|
|
3416
|
+
},
|
|
3417
|
+
enumerable: true,
|
|
3418
|
+
configurable: true
|
|
3419
|
+
});
|
|
3400
3420
|
/**
|
|
3401
3421
|
* @param {?} routerOutlet
|
|
3402
3422
|
* @param {?} place
|
|
@@ -3414,7 +3434,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3414
3434
|
*/
|
|
3415
3435
|
function () {
|
|
3416
3436
|
try {
|
|
3417
|
-
_this.
|
|
3437
|
+
_this._activePlace.value = place;
|
|
3418
3438
|
_this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
3419
3439
|
_this._placeDefinition.value = place.placeDefinition;
|
|
3420
3440
|
place.initialiseBindings(_this._resolvedParameters);
|
|
@@ -3444,7 +3464,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3444
3464
|
* @return {?}
|
|
3445
3465
|
*/
|
|
3446
3466
|
function () {
|
|
3447
|
-
_this.
|
|
3467
|
+
_this._activePlace.value = null;
|
|
3448
3468
|
_this._activatedRouteModel.value = null;
|
|
3449
3469
|
_this._placeDefinition.value = null;
|
|
3450
3470
|
}));
|
|
@@ -3467,8 +3487,8 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
3467
3487
|
* @return {?}
|
|
3468
3488
|
*/
|
|
3469
3489
|
function () {
|
|
3470
|
-
if (this.
|
|
3471
|
-
this.
|
|
3490
|
+
if (this._activePlace.value) {
|
|
3491
|
+
this._activePlace.value.onPlaceReady();
|
|
3472
3492
|
}
|
|
3473
3493
|
};
|
|
3474
3494
|
/**
|
|
@@ -3527,7 +3547,7 @@ if (false) {
|
|
|
3527
3547
|
* @type {?}
|
|
3528
3548
|
* @private
|
|
3529
3549
|
*/
|
|
3530
|
-
PlaceOutletComponent.prototype.
|
|
3550
|
+
PlaceOutletComponent.prototype._activePlace;
|
|
3531
3551
|
/**
|
|
3532
3552
|
* @type {?}
|
|
3533
3553
|
* @private
|
|
@@ -4231,6 +4251,7 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
4231
4251
|
* @return {?}
|
|
4232
4252
|
*/
|
|
4233
4253
|
function (sanitised) {
|
|
4254
|
+
Logger.get(_this).info("ParameterSnapshot.sanitise", { sanitised: sanitised });
|
|
4234
4255
|
if (sanitised.hasChanged(snapshot_1, true)) {
|
|
4235
4256
|
return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
4236
4257
|
}
|