@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 { __decorate, __metadata, __awaiter } 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';
|
|
@@ -2099,12 +2099,9 @@ if (false) {
|
|
|
2099
2099
|
*/
|
|
2100
2100
|
v => !this.isBlank(parameterDef, v)));
|
|
2101
2101
|
}
|
|
2102
|
-
|
|
2103
|
-
console.log(`${parameterDef.name} is blank, returning: ${value}`);
|
|
2104
|
-
return value;
|
|
2102
|
+
return this.isBlank(parameterDef, value) ? this.defaultValue : value;
|
|
2105
2103
|
}
|
|
2106
2104
|
else {
|
|
2107
|
-
console.log(`${parameterDef.name} is not blank`);
|
|
2108
2105
|
return value;
|
|
2109
2106
|
}
|
|
2110
2107
|
}
|
|
@@ -2120,6 +2117,12 @@ if (false) {
|
|
|
2120
2117
|
return isNil ? true : def.isArray ? value['length'] < 1 : false;
|
|
2121
2118
|
}
|
|
2122
2119
|
}
|
|
2120
|
+
__decorate([
|
|
2121
|
+
Trace(),
|
|
2122
|
+
__metadata("design:type", Function),
|
|
2123
|
+
__metadata("design:paramtypes", [ParameterDefinition, Object, Object]),
|
|
2124
|
+
__metadata("design:returntype", Object)
|
|
2125
|
+
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
2123
2126
|
ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
|
|
2124
2127
|
if (false) {
|
|
2125
2128
|
/** @type {?} */
|
|
@@ -2131,7 +2134,7 @@ if (false) {
|
|
|
2131
2134
|
}
|
|
2132
2135
|
})(ParameterDefinition || (ParameterDefinition = {}));
|
|
2133
2136
|
|
|
2134
|
-
var _a;
|
|
2137
|
+
var _a, _b;
|
|
2135
2138
|
class ParameterSnapshot {
|
|
2136
2139
|
/**
|
|
2137
2140
|
* @param {?} placeDefinition
|
|
@@ -2294,7 +2297,6 @@ class ParameterSnapshot {
|
|
|
2294
2297
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2295
2298
|
})));
|
|
2296
2299
|
}
|
|
2297
|
-
// @Trace()
|
|
2298
2300
|
/**
|
|
2299
2301
|
* @param {?} injector
|
|
2300
2302
|
* @return {?}
|
|
@@ -2318,9 +2320,11 @@ class ParameterSnapshot {
|
|
|
2318
2320
|
const routeParameters = this.getRouteParameters();
|
|
2319
2321
|
for (let i = 0; i < routeParameters.length; i++) {
|
|
2320
2322
|
/** @type {?} */
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2323
|
-
|
|
2323
|
+
const routeParameter = routeParameters[i];
|
|
2324
|
+
/** @type {?} */
|
|
2325
|
+
const sanitisedValue = yield routeParameter.sanitise(this, injector);
|
|
2326
|
+
if (!routeParameter.isSame(sanitisedValue)) {
|
|
2327
|
+
result = this.replace(routeParameter.parameterDef, sanitisedValue);
|
|
2324
2328
|
}
|
|
2325
2329
|
}
|
|
2326
2330
|
return result;
|
|
@@ -2357,6 +2361,18 @@ __decorate([
|
|
|
2357
2361
|
__metadata("design:paramtypes", []),
|
|
2358
2362
|
__metadata("design:returntype", Array)
|
|
2359
2363
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2364
|
+
__decorate([
|
|
2365
|
+
Trace(),
|
|
2366
|
+
__metadata("design:type", Function),
|
|
2367
|
+
__metadata("design:paramtypes", [ParameterDefinition, typeof (_b = typeof S !== "undefined" && S) === "function" ? _b : Object]),
|
|
2368
|
+
__metadata("design:returntype", ParameterSnapshot)
|
|
2369
|
+
], ParameterSnapshot.prototype, "replace", null);
|
|
2370
|
+
__decorate([
|
|
2371
|
+
Trace(),
|
|
2372
|
+
__metadata("design:type", Function),
|
|
2373
|
+
__metadata("design:paramtypes", [Injector]),
|
|
2374
|
+
__metadata("design:returntype", Promise)
|
|
2375
|
+
], ParameterSnapshot.prototype, "sanitise", null);
|
|
2360
2376
|
if (false) {
|
|
2361
2377
|
/** @type {?} */
|
|
2362
2378
|
ParameterSnapshot.prototype.placeDefinition;
|
|
@@ -3567,6 +3583,7 @@ class PlaceRouteGuard {
|
|
|
3567
3583
|
* @return {?}
|
|
3568
3584
|
*/
|
|
3569
3585
|
sanitised => {
|
|
3586
|
+
Logger.get(this).info("ParameterSnapshot.sanitise", { sanitised });
|
|
3570
3587
|
if (sanitised.hasChanged(snapshot, true)) {
|
|
3571
3588
|
return this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
|
|
3572
3589
|
}
|