@coolon/angular-ui-powerups 0.0.46 → 0.0.48
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 +127 -132
- 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/interaction/abstract-activity.js +3 -9
- package/esm2015/lib/place/place-history.js +2 -2
- package/esm2015/lib/place/place-router.js +3 -11
- package/esm2015/lib/place/route/parameter-snapshot.js +2 -9
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +3 -8
- package/esm5/lib/interaction/abstract-activity.js +14 -10
- package/esm5/lib/place/place-history.js +2 -2
- package/esm5/lib/place/place-router.js +7 -12
- package/esm5/lib/place/route/parameter-snapshot.js +6 -10
- package/esm5/lib/place/route/route-parameter-sanitiser.js +7 -9
- package/fesm2015/coolon-angular-ui-powerups.js +91 -111
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +129 -134
- 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 { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
|
|
8
|
-
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel,
|
|
8
|
+
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, MutableListModel, StoreInValueModel, Binding, Guard, MutableValueModel, 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';
|
|
@@ -13,7 +13,7 @@ import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
|
|
|
13
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
14
14
|
import { MatListModule } from '@angular/material/list';
|
|
15
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
-
import { Router,
|
|
16
|
+
import { Router, RouterModule } from '@angular/router';
|
|
17
17
|
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
18
18
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
19
19
|
import 'reflect-metadata';
|
|
@@ -1083,7 +1083,10 @@ if (false) {
|
|
|
1083
1083
|
/**
|
|
1084
1084
|
* @template D, R, E
|
|
1085
1085
|
*/
|
|
1086
|
-
var
|
|
1086
|
+
var /**
|
|
1087
|
+
* @template D, R, E
|
|
1088
|
+
*/
|
|
1089
|
+
AbstractActivity = /** @class */ (function (_super) {
|
|
1087
1090
|
__extends(AbstractActivity, _super);
|
|
1088
1091
|
function AbstractActivity() {
|
|
1089
1092
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1157,10 +1160,14 @@ var AbstractActivity = /** @class */ (function (_super) {
|
|
|
1157
1160
|
*/
|
|
1158
1161
|
function () { return _this.finalizeAndDispose(); }));
|
|
1159
1162
|
};
|
|
1163
|
+
// @Trace()
|
|
1164
|
+
// @Trace()
|
|
1160
1165
|
/**
|
|
1161
1166
|
* @return {?}
|
|
1162
1167
|
*/
|
|
1163
|
-
AbstractActivity.prototype.onActivityReady =
|
|
1168
|
+
AbstractActivity.prototype.onActivityReady =
|
|
1169
|
+
// @Trace()
|
|
1170
|
+
/**
|
|
1164
1171
|
* @return {?}
|
|
1165
1172
|
*/
|
|
1166
1173
|
function () {
|
|
@@ -1222,12 +1229,6 @@ var AbstractActivity = /** @class */ (function (_super) {
|
|
|
1222
1229
|
function () {
|
|
1223
1230
|
return this._busyModel.value;
|
|
1224
1231
|
};
|
|
1225
|
-
__decorate([
|
|
1226
|
-
Trace(),
|
|
1227
|
-
__metadata("design:type", Function),
|
|
1228
|
-
__metadata("design:paramtypes", []),
|
|
1229
|
-
__metadata("design:returntype", void 0)
|
|
1230
|
-
], AbstractActivity.prototype, "onActivityReady", null);
|
|
1231
1232
|
return AbstractActivity;
|
|
1232
1233
|
}(DisposableComponent));
|
|
1233
1234
|
if (false) {
|
|
@@ -2165,7 +2166,7 @@ var PlaceHistory = /** @class */ (function () {
|
|
|
2165
2166
|
var previousState = ___default.last(history);
|
|
2166
2167
|
if (!previousState || state.hasChanged(previousState)) {
|
|
2167
2168
|
history.unshift(state); // LIFO
|
|
2168
|
-
this.setHistory(state.placeDefinition, history.slice(
|
|
2169
|
+
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
2169
2170
|
}
|
|
2170
2171
|
};
|
|
2171
2172
|
/**
|
|
@@ -2225,6 +2226,113 @@ if (false) {
|
|
|
2225
2226
|
PlaceHistory.prototype.router;
|
|
2226
2227
|
}
|
|
2227
2228
|
|
|
2229
|
+
/**
|
|
2230
|
+
* @fileoverview added by tsickle
|
|
2231
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2232
|
+
*/
|
|
2233
|
+
var PlaceRouter = /** @class */ (function () {
|
|
2234
|
+
function PlaceRouter(router) {
|
|
2235
|
+
this.router = router;
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* @param {?} activatedRoute
|
|
2239
|
+
* @param {?} previous
|
|
2240
|
+
* @param {?} next
|
|
2241
|
+
* @return {?}
|
|
2242
|
+
*/
|
|
2243
|
+
PlaceRouter.prototype.pushParameterChangesToRoute = /**
|
|
2244
|
+
* @param {?} activatedRoute
|
|
2245
|
+
* @param {?} previous
|
|
2246
|
+
* @param {?} next
|
|
2247
|
+
* @return {?}
|
|
2248
|
+
*/
|
|
2249
|
+
function (activatedRoute, previous, next) {
|
|
2250
|
+
/** @type {?} */
|
|
2251
|
+
var relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
2252
|
+
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
2253
|
+
relativeTo: activatedRoute
|
|
2254
|
+
});
|
|
2255
|
+
};
|
|
2256
|
+
// @Trace()
|
|
2257
|
+
// @Trace()
|
|
2258
|
+
/**
|
|
2259
|
+
* @param {?} activatedRoute
|
|
2260
|
+
* @param {?} sanitised
|
|
2261
|
+
* @return {?}
|
|
2262
|
+
*/
|
|
2263
|
+
PlaceRouter.prototype.getRedirectUrlTree =
|
|
2264
|
+
// @Trace()
|
|
2265
|
+
/**
|
|
2266
|
+
* @param {?} activatedRoute
|
|
2267
|
+
* @param {?} sanitised
|
|
2268
|
+
* @return {?}
|
|
2269
|
+
*/
|
|
2270
|
+
function (activatedRoute, sanitised) {
|
|
2271
|
+
/** @type {?} */
|
|
2272
|
+
var urlSegments = activatedRoute.url;
|
|
2273
|
+
/** @type {?} */
|
|
2274
|
+
var weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
2275
|
+
/** @type {?} */
|
|
2276
|
+
var commands = (weHaveARouteId) ?
|
|
2277
|
+
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
2278
|
+
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
2279
|
+
console.log("redirect path", commands);
|
|
2280
|
+
return this.router.createUrlTree(commands);
|
|
2281
|
+
};
|
|
2282
|
+
/**
|
|
2283
|
+
* @protected
|
|
2284
|
+
* @param {?} activatedRoute
|
|
2285
|
+
* @return {?}
|
|
2286
|
+
*/
|
|
2287
|
+
PlaceRouter.prototype.getChildPath = /**
|
|
2288
|
+
* @protected
|
|
2289
|
+
* @param {?} activatedRoute
|
|
2290
|
+
* @return {?}
|
|
2291
|
+
*/
|
|
2292
|
+
function (activatedRoute) {
|
|
2293
|
+
return ___default.flatten(activatedRoute.children.map((/**
|
|
2294
|
+
* @param {?} child
|
|
2295
|
+
* @return {?}
|
|
2296
|
+
*/
|
|
2297
|
+
function (child) { return child.url; })));
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* @protected
|
|
2301
|
+
* @param {?} parameters
|
|
2302
|
+
* @return {?}
|
|
2303
|
+
*/
|
|
2304
|
+
PlaceRouter.prototype.createRouteParameters = /**
|
|
2305
|
+
* @protected
|
|
2306
|
+
* @param {?} parameters
|
|
2307
|
+
* @return {?}
|
|
2308
|
+
*/
|
|
2309
|
+
function (parameters) {
|
|
2310
|
+
/** @type {?} */
|
|
2311
|
+
var routeId = parameters.getFormattedRouteId();
|
|
2312
|
+
return routeId ?
|
|
2313
|
+
[routeId, parameters.getFormattedParameters()] :
|
|
2314
|
+
[parameters.getFormattedParameters()];
|
|
2315
|
+
};
|
|
2316
|
+
PlaceRouter.decorators = [
|
|
2317
|
+
{ type: Injectable, args: [{
|
|
2318
|
+
providedIn: 'root'
|
|
2319
|
+
},] }
|
|
2320
|
+
];
|
|
2321
|
+
/** @nocollapse */
|
|
2322
|
+
PlaceRouter.ctorParameters = function () { return [
|
|
2323
|
+
{ type: Router }
|
|
2324
|
+
]; };
|
|
2325
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
2326
|
+
return PlaceRouter;
|
|
2327
|
+
}());
|
|
2328
|
+
if (false) {
|
|
2329
|
+
/**
|
|
2330
|
+
* @type {?}
|
|
2331
|
+
* @private
|
|
2332
|
+
*/
|
|
2333
|
+
PlaceRouter.prototype.router;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2228
2336
|
/**
|
|
2229
2337
|
* @fileoverview added by tsickle
|
|
2230
2338
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -2669,11 +2777,15 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2669
2777
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2670
2778
|
})));
|
|
2671
2779
|
};
|
|
2780
|
+
// @Trace()
|
|
2781
|
+
// @Trace()
|
|
2672
2782
|
/**
|
|
2673
2783
|
* @param {?} injector
|
|
2674
2784
|
* @return {?}
|
|
2675
2785
|
*/
|
|
2676
|
-
ParameterSnapshot.prototype.sanitise =
|
|
2786
|
+
ParameterSnapshot.prototype.sanitise =
|
|
2787
|
+
// @Trace()
|
|
2788
|
+
/**
|
|
2677
2789
|
* @param {?} injector
|
|
2678
2790
|
* @return {?}
|
|
2679
2791
|
*/
|
|
@@ -2747,12 +2859,6 @@ var ParameterSnapshot = /** @class */ (function () {
|
|
|
2747
2859
|
__metadata("design:paramtypes", []),
|
|
2748
2860
|
__metadata("design:returntype", Array)
|
|
2749
2861
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2750
|
-
__decorate([
|
|
2751
|
-
Trace(),
|
|
2752
|
-
__metadata("design:type", Function),
|
|
2753
|
-
__metadata("design:paramtypes", [Injector]),
|
|
2754
|
-
__metadata("design:returntype", Promise)
|
|
2755
|
-
], ParameterSnapshot.prototype, "sanitise", null);
|
|
2756
2862
|
return ParameterSnapshot;
|
|
2757
2863
|
}());
|
|
2758
2864
|
if (false) {
|
|
@@ -3140,115 +3246,6 @@ if (false) {
|
|
|
3140
3246
|
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
3141
3247
|
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
3142
3248
|
|
|
3143
|
-
/**
|
|
3144
|
-
* @fileoverview added by tsickle
|
|
3145
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3146
|
-
*/
|
|
3147
|
-
var PlaceRouter = /** @class */ (function () {
|
|
3148
|
-
function PlaceRouter(router) {
|
|
3149
|
-
this.router = router;
|
|
3150
|
-
}
|
|
3151
|
-
/**
|
|
3152
|
-
* @param {?} activatedRoute
|
|
3153
|
-
* @param {?} previous
|
|
3154
|
-
* @param {?} next
|
|
3155
|
-
* @return {?}
|
|
3156
|
-
*/
|
|
3157
|
-
PlaceRouter.prototype.pushParameterChangesToRoute = /**
|
|
3158
|
-
* @param {?} activatedRoute
|
|
3159
|
-
* @param {?} previous
|
|
3160
|
-
* @param {?} next
|
|
3161
|
-
* @return {?}
|
|
3162
|
-
*/
|
|
3163
|
-
function (activatedRoute, previous, next) {
|
|
3164
|
-
/** @type {?} */
|
|
3165
|
-
var relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
3166
|
-
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
3167
|
-
relativeTo: activatedRoute
|
|
3168
|
-
});
|
|
3169
|
-
};
|
|
3170
|
-
/**
|
|
3171
|
-
* @param {?} activatedRoute
|
|
3172
|
-
* @param {?} sanitised
|
|
3173
|
-
* @return {?}
|
|
3174
|
-
*/
|
|
3175
|
-
PlaceRouter.prototype.getRedirectUrlTree = /**
|
|
3176
|
-
* @param {?} activatedRoute
|
|
3177
|
-
* @param {?} sanitised
|
|
3178
|
-
* @return {?}
|
|
3179
|
-
*/
|
|
3180
|
-
function (activatedRoute, sanitised) {
|
|
3181
|
-
/** @type {?} */
|
|
3182
|
-
var urlSegments = activatedRoute.url;
|
|
3183
|
-
/** @type {?} */
|
|
3184
|
-
var weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
3185
|
-
/** @type {?} */
|
|
3186
|
-
var commands = (weHaveARouteId) ?
|
|
3187
|
-
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
3188
|
-
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
3189
|
-
console.log("redirect path", commands);
|
|
3190
|
-
return this.router.createUrlTree(commands);
|
|
3191
|
-
};
|
|
3192
|
-
/**
|
|
3193
|
-
* @protected
|
|
3194
|
-
* @param {?} activatedRoute
|
|
3195
|
-
* @return {?}
|
|
3196
|
-
*/
|
|
3197
|
-
PlaceRouter.prototype.getChildPath = /**
|
|
3198
|
-
* @protected
|
|
3199
|
-
* @param {?} activatedRoute
|
|
3200
|
-
* @return {?}
|
|
3201
|
-
*/
|
|
3202
|
-
function (activatedRoute) {
|
|
3203
|
-
return ___default.flatten(activatedRoute.children.map((/**
|
|
3204
|
-
* @param {?} child
|
|
3205
|
-
* @return {?}
|
|
3206
|
-
*/
|
|
3207
|
-
function (child) { return child.url; })));
|
|
3208
|
-
};
|
|
3209
|
-
/**
|
|
3210
|
-
* @protected
|
|
3211
|
-
* @param {?} parameters
|
|
3212
|
-
* @return {?}
|
|
3213
|
-
*/
|
|
3214
|
-
PlaceRouter.prototype.createRouteParameters = /**
|
|
3215
|
-
* @protected
|
|
3216
|
-
* @param {?} parameters
|
|
3217
|
-
* @return {?}
|
|
3218
|
-
*/
|
|
3219
|
-
function (parameters) {
|
|
3220
|
-
/** @type {?} */
|
|
3221
|
-
var routeId = parameters.getFormattedRouteId();
|
|
3222
|
-
return routeId ?
|
|
3223
|
-
[routeId, parameters.getFormattedParameters()] :
|
|
3224
|
-
[parameters.getFormattedParameters()];
|
|
3225
|
-
};
|
|
3226
|
-
PlaceRouter.decorators = [
|
|
3227
|
-
{ type: Injectable, args: [{
|
|
3228
|
-
providedIn: 'root'
|
|
3229
|
-
},] }
|
|
3230
|
-
];
|
|
3231
|
-
/** @nocollapse */
|
|
3232
|
-
PlaceRouter.ctorParameters = function () { return [
|
|
3233
|
-
{ type: Router }
|
|
3234
|
-
]; };
|
|
3235
|
-
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
3236
|
-
__decorate([
|
|
3237
|
-
Trace(),
|
|
3238
|
-
__metadata("design:type", Function),
|
|
3239
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, ParameterSnapshot]),
|
|
3240
|
-
__metadata("design:returntype", UrlTree)
|
|
3241
|
-
], PlaceRouter.prototype, "getRedirectUrlTree", null);
|
|
3242
|
-
return PlaceRouter;
|
|
3243
|
-
}());
|
|
3244
|
-
if (false) {
|
|
3245
|
-
/**
|
|
3246
|
-
* @type {?}
|
|
3247
|
-
* @private
|
|
3248
|
-
*/
|
|
3249
|
-
PlaceRouter.prototype.router;
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
3249
|
/**
|
|
3253
3250
|
* @fileoverview added by tsickle
|
|
3254
3251
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -4729,10 +4726,14 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
4729
4726
|
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
4730
4727
|
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
4731
4728
|
};
|
|
4729
|
+
// @Trace()
|
|
4730
|
+
// @Trace()
|
|
4732
4731
|
/**
|
|
4733
4732
|
* @return {?}
|
|
4734
4733
|
*/
|
|
4735
|
-
RouteParameterSanitiser.prototype.getRedirectParams =
|
|
4734
|
+
RouteParameterSanitiser.prototype.getRedirectParams =
|
|
4735
|
+
// @Trace()
|
|
4736
|
+
/**
|
|
4736
4737
|
* @return {?}
|
|
4737
4738
|
*/
|
|
4738
4739
|
function () {
|
|
@@ -4771,12 +4772,6 @@ var RouteParameterSanitiser = /** @class */ (function () {
|
|
|
4771
4772
|
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
4772
4773
|
__metadata("design:returntype", Object)
|
|
4773
4774
|
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
4774
|
-
__decorate([
|
|
4775
|
-
Trace(),
|
|
4776
|
-
__metadata("design:type", Function),
|
|
4777
|
-
__metadata("design:paramtypes", []),
|
|
4778
|
-
__metadata("design:returntype", Array)
|
|
4779
|
-
], RouteParameterSanitiser.prototype, "getRedirectParams", null);
|
|
4780
4775
|
return RouteParameterSanitiser;
|
|
4781
4776
|
}());
|
|
4782
4777
|
if (false) {
|