@coolon/angular-ui-powerups 0.0.46 → 0.0.47
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 +126 -131
- 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-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-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 +90 -110
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +128 -133
- 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,
|
|
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';
|
|
@@ -947,6 +947,7 @@ class AbstractActivity extends DisposableComponent {
|
|
|
947
947
|
*/
|
|
948
948
|
() => this.finalizeAndDispose()));
|
|
949
949
|
}
|
|
950
|
+
// @Trace()
|
|
950
951
|
/**
|
|
951
952
|
* @return {?}
|
|
952
953
|
*/
|
|
@@ -995,12 +996,6 @@ class AbstractActivity extends DisposableComponent {
|
|
|
995
996
|
return this._busyModel.value;
|
|
996
997
|
}
|
|
997
998
|
}
|
|
998
|
-
__decorate([
|
|
999
|
-
Trace(),
|
|
1000
|
-
__metadata("design:type", Function),
|
|
1001
|
-
__metadata("design:paramtypes", []),
|
|
1002
|
-
__metadata("design:returntype", void 0)
|
|
1003
|
-
], AbstractActivity.prototype, "onActivityReady", null);
|
|
1004
999
|
if (false) {
|
|
1005
1000
|
/**
|
|
1006
1001
|
* @type {?}
|
|
@@ -1852,6 +1847,91 @@ if (false) {
|
|
|
1852
1847
|
PlaceHistory.prototype.router;
|
|
1853
1848
|
}
|
|
1854
1849
|
|
|
1850
|
+
/**
|
|
1851
|
+
* @fileoverview added by tsickle
|
|
1852
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1853
|
+
*/
|
|
1854
|
+
class PlaceRouter {
|
|
1855
|
+
/**
|
|
1856
|
+
* @param {?} router
|
|
1857
|
+
*/
|
|
1858
|
+
constructor(router) {
|
|
1859
|
+
this.router = router;
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* @param {?} activatedRoute
|
|
1863
|
+
* @param {?} previous
|
|
1864
|
+
* @param {?} next
|
|
1865
|
+
* @return {?}
|
|
1866
|
+
*/
|
|
1867
|
+
pushParameterChangesToRoute(activatedRoute, previous, next) {
|
|
1868
|
+
/** @type {?} */
|
|
1869
|
+
const relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
1870
|
+
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
1871
|
+
relativeTo: activatedRoute
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
// @Trace()
|
|
1875
|
+
/**
|
|
1876
|
+
* @param {?} activatedRoute
|
|
1877
|
+
* @param {?} sanitised
|
|
1878
|
+
* @return {?}
|
|
1879
|
+
*/
|
|
1880
|
+
getRedirectUrlTree(activatedRoute, sanitised) {
|
|
1881
|
+
/** @type {?} */
|
|
1882
|
+
const urlSegments = activatedRoute.url;
|
|
1883
|
+
/** @type {?} */
|
|
1884
|
+
const weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
1885
|
+
/** @type {?} */
|
|
1886
|
+
const commands = (weHaveARouteId) ?
|
|
1887
|
+
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
1888
|
+
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
1889
|
+
console.log("redirect path", commands);
|
|
1890
|
+
return this.router.createUrlTree(commands);
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* @protected
|
|
1894
|
+
* @param {?} activatedRoute
|
|
1895
|
+
* @return {?}
|
|
1896
|
+
*/
|
|
1897
|
+
getChildPath(activatedRoute) {
|
|
1898
|
+
return ___default.flatten(activatedRoute.children.map((/**
|
|
1899
|
+
* @param {?} child
|
|
1900
|
+
* @return {?}
|
|
1901
|
+
*/
|
|
1902
|
+
child => child.url)));
|
|
1903
|
+
}
|
|
1904
|
+
/**
|
|
1905
|
+
* @protected
|
|
1906
|
+
* @param {?} parameters
|
|
1907
|
+
* @return {?}
|
|
1908
|
+
*/
|
|
1909
|
+
createRouteParameters(parameters) {
|
|
1910
|
+
/** @type {?} */
|
|
1911
|
+
const routeId = parameters.getFormattedRouteId();
|
|
1912
|
+
return routeId ?
|
|
1913
|
+
[routeId, parameters.getFormattedParameters()] :
|
|
1914
|
+
[parameters.getFormattedParameters()];
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
PlaceRouter.decorators = [
|
|
1918
|
+
{ type: Injectable, args: [{
|
|
1919
|
+
providedIn: 'root'
|
|
1920
|
+
},] }
|
|
1921
|
+
];
|
|
1922
|
+
/** @nocollapse */
|
|
1923
|
+
PlaceRouter.ctorParameters = () => [
|
|
1924
|
+
{ type: Router }
|
|
1925
|
+
];
|
|
1926
|
+
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
1927
|
+
if (false) {
|
|
1928
|
+
/**
|
|
1929
|
+
* @type {?}
|
|
1930
|
+
* @private
|
|
1931
|
+
*/
|
|
1932
|
+
PlaceRouter.prototype.router;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1855
1935
|
/**
|
|
1856
1936
|
* @fileoverview added by tsickle
|
|
1857
1937
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -2214,6 +2294,7 @@ class ParameterSnapshot {
|
|
|
2214
2294
|
return p.parameterDef === parameter ? p.replace(value) : p;
|
|
2215
2295
|
})));
|
|
2216
2296
|
}
|
|
2297
|
+
// @Trace()
|
|
2217
2298
|
/**
|
|
2218
2299
|
* @param {?} injector
|
|
2219
2300
|
* @return {?}
|
|
@@ -2276,12 +2357,6 @@ __decorate([
|
|
|
2276
2357
|
__metadata("design:paramtypes", []),
|
|
2277
2358
|
__metadata("design:returntype", Array)
|
|
2278
2359
|
], ParameterSnapshot.prototype, "getRouteParameters", null);
|
|
2279
|
-
__decorate([
|
|
2280
|
-
Trace(),
|
|
2281
|
-
__metadata("design:type", Function),
|
|
2282
|
-
__metadata("design:paramtypes", [Injector]),
|
|
2283
|
-
__metadata("design:returntype", Promise)
|
|
2284
|
-
], ParameterSnapshot.prototype, "sanitise", null);
|
|
2285
2360
|
if (false) {
|
|
2286
2361
|
/** @type {?} */
|
|
2287
2362
|
ParameterSnapshot.prototype.placeDefinition;
|
|
@@ -2579,96 +2654,6 @@ if (false) {
|
|
|
2579
2654
|
ParameterSnapshot.ResolvedArrayParameter = ResolvedArrayParameter;
|
|
2580
2655
|
})(ParameterSnapshot || (ParameterSnapshot = {}));
|
|
2581
2656
|
|
|
2582
|
-
/**
|
|
2583
|
-
* @fileoverview added by tsickle
|
|
2584
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2585
|
-
*/
|
|
2586
|
-
class PlaceRouter {
|
|
2587
|
-
/**
|
|
2588
|
-
* @param {?} router
|
|
2589
|
-
*/
|
|
2590
|
-
constructor(router) {
|
|
2591
|
-
this.router = router;
|
|
2592
|
-
}
|
|
2593
|
-
/**
|
|
2594
|
-
* @param {?} activatedRoute
|
|
2595
|
-
* @param {?} previous
|
|
2596
|
-
* @param {?} next
|
|
2597
|
-
* @return {?}
|
|
2598
|
-
*/
|
|
2599
|
-
pushParameterChangesToRoute(activatedRoute, previous, next) {
|
|
2600
|
-
/** @type {?} */
|
|
2601
|
-
const relativePath = !!previous.hasRouteId() ? '..' : '.';
|
|
2602
|
-
this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
|
|
2603
|
-
relativeTo: activatedRoute
|
|
2604
|
-
});
|
|
2605
|
-
}
|
|
2606
|
-
/**
|
|
2607
|
-
* @param {?} activatedRoute
|
|
2608
|
-
* @param {?} sanitised
|
|
2609
|
-
* @return {?}
|
|
2610
|
-
*/
|
|
2611
|
-
getRedirectUrlTree(activatedRoute, sanitised) {
|
|
2612
|
-
/** @type {?} */
|
|
2613
|
-
const urlSegments = activatedRoute.url;
|
|
2614
|
-
/** @type {?} */
|
|
2615
|
-
const weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
|
|
2616
|
-
/** @type {?} */
|
|
2617
|
-
const commands = (weHaveARouteId) ?
|
|
2618
|
-
[urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
|
|
2619
|
-
[urlSegments[0].path, sanitised.getFormattedParameters()];
|
|
2620
|
-
console.log("redirect path", commands);
|
|
2621
|
-
return this.router.createUrlTree(commands);
|
|
2622
|
-
}
|
|
2623
|
-
/**
|
|
2624
|
-
* @protected
|
|
2625
|
-
* @param {?} activatedRoute
|
|
2626
|
-
* @return {?}
|
|
2627
|
-
*/
|
|
2628
|
-
getChildPath(activatedRoute) {
|
|
2629
|
-
return ___default.flatten(activatedRoute.children.map((/**
|
|
2630
|
-
* @param {?} child
|
|
2631
|
-
* @return {?}
|
|
2632
|
-
*/
|
|
2633
|
-
child => child.url)));
|
|
2634
|
-
}
|
|
2635
|
-
/**
|
|
2636
|
-
* @protected
|
|
2637
|
-
* @param {?} parameters
|
|
2638
|
-
* @return {?}
|
|
2639
|
-
*/
|
|
2640
|
-
createRouteParameters(parameters) {
|
|
2641
|
-
/** @type {?} */
|
|
2642
|
-
const routeId = parameters.getFormattedRouteId();
|
|
2643
|
-
return routeId ?
|
|
2644
|
-
[routeId, parameters.getFormattedParameters()] :
|
|
2645
|
-
[parameters.getFormattedParameters()];
|
|
2646
|
-
}
|
|
2647
|
-
}
|
|
2648
|
-
PlaceRouter.decorators = [
|
|
2649
|
-
{ type: Injectable, args: [{
|
|
2650
|
-
providedIn: 'root'
|
|
2651
|
-
},] }
|
|
2652
|
-
];
|
|
2653
|
-
/** @nocollapse */
|
|
2654
|
-
PlaceRouter.ctorParameters = () => [
|
|
2655
|
-
{ type: Router }
|
|
2656
|
-
];
|
|
2657
|
-
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router)); }, token: PlaceRouter, providedIn: "root" });
|
|
2658
|
-
__decorate([
|
|
2659
|
-
Trace(),
|
|
2660
|
-
__metadata("design:type", Function),
|
|
2661
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, ParameterSnapshot]),
|
|
2662
|
-
__metadata("design:returntype", UrlTree)
|
|
2663
|
-
], PlaceRouter.prototype, "getRedirectUrlTree", null);
|
|
2664
|
-
if (false) {
|
|
2665
|
-
/**
|
|
2666
|
-
* @type {?}
|
|
2667
|
-
* @private
|
|
2668
|
-
*/
|
|
2669
|
-
PlaceRouter.prototype.router;
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
2657
|
/**
|
|
2673
2658
|
* @fileoverview added by tsickle
|
|
2674
2659
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3961,6 +3946,7 @@ class RouteParameterSanitiser {
|
|
|
3961
3946
|
assert.isTruthy(this.parameterSanitisers.length !== 0);
|
|
3962
3947
|
return this.routeIdSanitiser && this.routeIdSanitiser.valueChanged;
|
|
3963
3948
|
}
|
|
3949
|
+
// @Trace()
|
|
3964
3950
|
/**
|
|
3965
3951
|
* @return {?}
|
|
3966
3952
|
*/
|
|
@@ -3995,12 +3981,6 @@ __decorate([
|
|
|
3995
3981
|
__metadata("design:paramtypes", [ParameterDefinition]),
|
|
3996
3982
|
__metadata("design:returntype", Object)
|
|
3997
3983
|
], RouteParameterSanitiser.prototype, "getSanitiser", null);
|
|
3998
|
-
__decorate([
|
|
3999
|
-
Trace(),
|
|
4000
|
-
__metadata("design:type", Function),
|
|
4001
|
-
__metadata("design:paramtypes", []),
|
|
4002
|
-
__metadata("design:returntype", Array)
|
|
4003
|
-
], RouteParameterSanitiser.prototype, "getRedirectParams", null);
|
|
4004
3984
|
if (false) {
|
|
4005
3985
|
/**
|
|
4006
3986
|
* @type {?}
|