@coolon/angular-ui-powerups 0.0.69 → 0.0.71
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 +206 -150
- 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 +46 -20
- package/esm2015/lib/place/place-router.js +43 -29
- package/esm2015/lib/place/route/guards/place-route.guard.js +8 -8
- package/esm2015/lib/place/route/parameter-decorators.js +8 -4
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +52 -23
- package/esm5/lib/place/place-router.js +58 -34
- package/esm5/lib/place/route/guards/place-route.guard.js +9 -9
- package/esm5/lib/place/route/parameter-decorators.js +8 -4
- package/fesm2015/coolon-angular-ui-powerups.js +170 -128
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +209 -153
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +5 -5
- package/lib/place/place-router.d.ts +6 -3
- package/package.json +1 -1
- package/schematics/place-routes/place-builder.js +1 -0
- package/schematics/place-routes/place-builder.js.map +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DOCUMENT, Location, CommonModule } from '@angular/common';
|
|
2
|
-
import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, Optional, ɵɵdefineInjectable, ɵɵinject, NgModule, HostBinding, INJECTOR } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, Optional, ɵɵdefineInjectable, ɵɵinject, NgModule, HostBinding, SkipSelf, INJECTOR } from '@angular/core';
|
|
3
3
|
import { FormsModule } from '@angular/forms';
|
|
4
4
|
import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgressSpinnerModule, MatInputModule, MatFormFieldModule, MatSelectModule } from '@angular/material';
|
|
5
5
|
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
|
-
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator } from 'tslib';
|
|
7
|
+
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __spread } from 'tslib';
|
|
8
8
|
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, DelegatingValueModel, MutableStream, MutableListModel, DelegatingListModel, StoreInValueModel, Binding, MutableValueModel, Trace, Guard as Guard$1, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
9
9
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
|
-
import { Router, RouterModule, NavigationStart, NavigationEnd, NavigationError, ActivatedRoute, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
10
|
+
import { Router, RouterModule, NavigationStart, NavigationEnd, NavigationError, ActivatedRoute, RouterOutlet, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
11
11
|
import ___default, { last, isNil, isEqual } from 'lodash';
|
|
12
12
|
import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
|
|
13
13
|
import { MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialog as MatDialog$1 } from '@angular/material/dialog';
|
|
@@ -3224,94 +3224,6 @@ if (false) {
|
|
|
3224
3224
|
ListPlaceNavComponent.prototype.expanded;
|
|
3225
3225
|
}
|
|
3226
3226
|
|
|
3227
|
-
/**
|
|
3228
|
-
* @fileoverview added by tsickle
|
|
3229
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3230
|
-
*/
|
|
3231
|
-
var PlaceHistory = /** @class */ (function () {
|
|
3232
|
-
function PlaceHistory(router) {
|
|
3233
|
-
this.router = router;
|
|
3234
|
-
this._history = new Map();
|
|
3235
|
-
}
|
|
3236
|
-
// @Trace()
|
|
3237
|
-
// @Trace()
|
|
3238
|
-
/**
|
|
3239
|
-
* @param {?} state
|
|
3240
|
-
* @return {?}
|
|
3241
|
-
*/
|
|
3242
|
-
PlaceHistory.prototype.add =
|
|
3243
|
-
// @Trace()
|
|
3244
|
-
/**
|
|
3245
|
-
* @param {?} state
|
|
3246
|
-
* @return {?}
|
|
3247
|
-
*/
|
|
3248
|
-
function (state) {
|
|
3249
|
-
/** @type {?} */
|
|
3250
|
-
var history = this.getHistory(state.placeDefinition);
|
|
3251
|
-
/** @type {?} */
|
|
3252
|
-
var previousState = ___default.last(history);
|
|
3253
|
-
if (!previousState || state.hasChangedFrom(previousState)) {
|
|
3254
|
-
history.unshift(state); // LIFO
|
|
3255
|
-
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
3256
|
-
}
|
|
3257
|
-
};
|
|
3258
|
-
/**
|
|
3259
|
-
* @param {?} placeDef
|
|
3260
|
-
* @return {?}
|
|
3261
|
-
*/
|
|
3262
|
-
PlaceHistory.prototype.getHistory = /**
|
|
3263
|
-
* @param {?} placeDef
|
|
3264
|
-
* @return {?}
|
|
3265
|
-
*/
|
|
3266
|
-
function (placeDef) {
|
|
3267
|
-
/** @type {?} */
|
|
3268
|
-
var history = this._history.get(placeDef);
|
|
3269
|
-
if (!history) {
|
|
3270
|
-
history = [];
|
|
3271
|
-
this.setHistory(placeDef, history);
|
|
3272
|
-
}
|
|
3273
|
-
return history;
|
|
3274
|
-
};
|
|
3275
|
-
/**
|
|
3276
|
-
* @private
|
|
3277
|
-
* @param {?} placeDef
|
|
3278
|
-
* @param {?} history
|
|
3279
|
-
* @return {?}
|
|
3280
|
-
*/
|
|
3281
|
-
PlaceHistory.prototype.setHistory = /**
|
|
3282
|
-
* @private
|
|
3283
|
-
* @param {?} placeDef
|
|
3284
|
-
* @param {?} history
|
|
3285
|
-
* @return {?}
|
|
3286
|
-
*/
|
|
3287
|
-
function (placeDef, history) {
|
|
3288
|
-
this._history.set(placeDef, history);
|
|
3289
|
-
};
|
|
3290
|
-
PlaceHistory.decorators = [
|
|
3291
|
-
{ type: Injectable, args: [{
|
|
3292
|
-
providedIn: 'root'
|
|
3293
|
-
},] }
|
|
3294
|
-
];
|
|
3295
|
-
/** @nocollapse */
|
|
3296
|
-
PlaceHistory.ctorParameters = function () { return [
|
|
3297
|
-
{ type: Router }
|
|
3298
|
-
]; };
|
|
3299
|
-
/** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
3300
|
-
return PlaceHistory;
|
|
3301
|
-
}());
|
|
3302
|
-
if (false) {
|
|
3303
|
-
/**
|
|
3304
|
-
* @type {?}
|
|
3305
|
-
* @private
|
|
3306
|
-
*/
|
|
3307
|
-
PlaceHistory.prototype._history;
|
|
3308
|
-
/**
|
|
3309
|
-
* @type {?}
|
|
3310
|
-
* @private
|
|
3311
|
-
*/
|
|
3312
|
-
PlaceHistory.prototype.router;
|
|
3313
|
-
}
|
|
3314
|
-
|
|
3315
3227
|
/**
|
|
3316
3228
|
* @fileoverview added by tsickle
|
|
3317
3229
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3500,6 +3412,94 @@ if (false) {
|
|
|
3500
3412
|
NavigationSession.createExternal = createExternal;
|
|
3501
3413
|
})(NavigationSession || (NavigationSession = {}));
|
|
3502
3414
|
|
|
3415
|
+
/**
|
|
3416
|
+
* @fileoverview added by tsickle
|
|
3417
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3418
|
+
*/
|
|
3419
|
+
var PlaceHistory = /** @class */ (function () {
|
|
3420
|
+
function PlaceHistory(router) {
|
|
3421
|
+
this.router = router;
|
|
3422
|
+
this._history = new Map();
|
|
3423
|
+
}
|
|
3424
|
+
// @Trace()
|
|
3425
|
+
// @Trace()
|
|
3426
|
+
/**
|
|
3427
|
+
* @param {?} state
|
|
3428
|
+
* @return {?}
|
|
3429
|
+
*/
|
|
3430
|
+
PlaceHistory.prototype.add =
|
|
3431
|
+
// @Trace()
|
|
3432
|
+
/**
|
|
3433
|
+
* @param {?} state
|
|
3434
|
+
* @return {?}
|
|
3435
|
+
*/
|
|
3436
|
+
function (state) {
|
|
3437
|
+
/** @type {?} */
|
|
3438
|
+
var history = this.getHistory(state.placeDefinition);
|
|
3439
|
+
/** @type {?} */
|
|
3440
|
+
var previousState = ___default.last(history);
|
|
3441
|
+
if (!previousState || state.hasChangedFrom(previousState)) {
|
|
3442
|
+
history.unshift(state); // LIFO
|
|
3443
|
+
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
3444
|
+
}
|
|
3445
|
+
};
|
|
3446
|
+
/**
|
|
3447
|
+
* @param {?} placeDef
|
|
3448
|
+
* @return {?}
|
|
3449
|
+
*/
|
|
3450
|
+
PlaceHistory.prototype.getHistory = /**
|
|
3451
|
+
* @param {?} placeDef
|
|
3452
|
+
* @return {?}
|
|
3453
|
+
*/
|
|
3454
|
+
function (placeDef) {
|
|
3455
|
+
/** @type {?} */
|
|
3456
|
+
var history = this._history.get(placeDef);
|
|
3457
|
+
if (!history) {
|
|
3458
|
+
history = [];
|
|
3459
|
+
this.setHistory(placeDef, history);
|
|
3460
|
+
}
|
|
3461
|
+
return history;
|
|
3462
|
+
};
|
|
3463
|
+
/**
|
|
3464
|
+
* @private
|
|
3465
|
+
* @param {?} placeDef
|
|
3466
|
+
* @param {?} history
|
|
3467
|
+
* @return {?}
|
|
3468
|
+
*/
|
|
3469
|
+
PlaceHistory.prototype.setHistory = /**
|
|
3470
|
+
* @private
|
|
3471
|
+
* @param {?} placeDef
|
|
3472
|
+
* @param {?} history
|
|
3473
|
+
* @return {?}
|
|
3474
|
+
*/
|
|
3475
|
+
function (placeDef, history) {
|
|
3476
|
+
this._history.set(placeDef, history);
|
|
3477
|
+
};
|
|
3478
|
+
PlaceHistory.decorators = [
|
|
3479
|
+
{ type: Injectable, args: [{
|
|
3480
|
+
providedIn: 'root'
|
|
3481
|
+
},] }
|
|
3482
|
+
];
|
|
3483
|
+
/** @nocollapse */
|
|
3484
|
+
PlaceHistory.ctorParameters = function () { return [
|
|
3485
|
+
{ type: Router }
|
|
3486
|
+
]; };
|
|
3487
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
3488
|
+
return PlaceHistory;
|
|
3489
|
+
}());
|
|
3490
|
+
if (false) {
|
|
3491
|
+
/**
|
|
3492
|
+
* @type {?}
|
|
3493
|
+
* @private
|
|
3494
|
+
*/
|
|
3495
|
+
PlaceHistory.prototype._history;
|
|
3496
|
+
/**
|
|
3497
|
+
* @type {?}
|
|
3498
|
+
* @private
|
|
3499
|
+
*/
|
|
3500
|
+
PlaceHistory.prototype.router;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
3503
|
/**
|
|
3504
3504
|
* @fileoverview added by tsickle
|
|
3505
3505
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -3759,23 +3759,43 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3759
3759
|
* placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
|
|
3760
3760
|
* @param visit
|
|
3761
3761
|
*/
|
|
3762
|
-
// @Trace()
|
|
3763
3762
|
/**
|
|
3764
3763
|
* placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
|
|
3765
3764
|
* @param {?} visit
|
|
3765
|
+
* @param {?=} options
|
|
3766
3766
|
* @return {?}
|
|
3767
3767
|
*/
|
|
3768
|
-
// @Trace()
|
|
3769
3768
|
PlaceRouter.prototype.navigate = /**
|
|
3770
3769
|
* placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
|
|
3771
3770
|
* @param {?} visit
|
|
3771
|
+
* @param {?=} options
|
|
3772
3772
|
* @return {?}
|
|
3773
3773
|
*/
|
|
3774
|
-
|
|
3775
|
-
function (visit) {
|
|
3774
|
+
function (visit, options) {
|
|
3776
3775
|
return __awaiter(this, void 0, void 0, function () {
|
|
3776
|
+
var _this = this;
|
|
3777
3777
|
return __generator(this, function (_a) {
|
|
3778
|
-
this.doNavigation(visit
|
|
3778
|
+
this.doNavigation(visit, (/**
|
|
3779
|
+
* @param {?} router
|
|
3780
|
+
* @return {?}
|
|
3781
|
+
*/
|
|
3782
|
+
function (router) { return __awaiter(_this, void 0, void 0, function () {
|
|
3783
|
+
var commands;
|
|
3784
|
+
return __generator(this, function (_a) {
|
|
3785
|
+
switch (_a.label) {
|
|
3786
|
+
case 0:
|
|
3787
|
+
commands = __spread([
|
|
3788
|
+
visit.placeDefinition.path
|
|
3789
|
+
], this.createRouteParameters(visit));
|
|
3790
|
+
return [4 /*yield*/, this.router.navigate(commands, {
|
|
3791
|
+
relativeTo: options ? options.relativeTo : null
|
|
3792
|
+
})];
|
|
3793
|
+
case 1:
|
|
3794
|
+
_a.sent();
|
|
3795
|
+
return [2 /*return*/];
|
|
3796
|
+
}
|
|
3797
|
+
});
|
|
3798
|
+
}); }));
|
|
3779
3799
|
return [2 /*return*/];
|
|
3780
3800
|
});
|
|
3781
3801
|
});
|
|
@@ -3809,13 +3829,9 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3809
3829
|
/** @type {?} */
|
|
3810
3830
|
var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
|
|
3811
3831
|
/** @type {?} */
|
|
3812
|
-
var
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
[def.getFormattedRouteId(next), def.getFormattedRouteParameters(next)] :
|
|
3816
|
-
[def.getFormattedRouteParameters(next)];
|
|
3817
|
-
/** @type {?} */
|
|
3818
|
-
var commands = [relativePath].concat(params, _this.getChildPath(activatedRoute.snapshot));
|
|
3832
|
+
var commands = __spread([
|
|
3833
|
+
relativePath
|
|
3834
|
+
], _this.createRouteParameters(next), _this.extractChildPath(activatedRoute.snapshot));
|
|
3819
3835
|
console.log('### Redirect', commands);
|
|
3820
3836
|
return router.navigate(commands, {
|
|
3821
3837
|
relativeTo: activatedRoute
|
|
@@ -3828,52 +3844,54 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3828
3844
|
};
|
|
3829
3845
|
/**
|
|
3830
3846
|
* @param {?} visit
|
|
3831
|
-
* @param {
|
|
3847
|
+
* @param {?} customNavigation
|
|
3832
3848
|
* @return {?}
|
|
3833
3849
|
*/
|
|
3834
3850
|
PlaceRouter.prototype.doNavigation = /**
|
|
3835
3851
|
* @param {?} visit
|
|
3836
|
-
* @param {
|
|
3852
|
+
* @param {?} customNavigation
|
|
3837
3853
|
* @return {?}
|
|
3838
3854
|
*/
|
|
3839
3855
|
function (visit, customNavigation) {
|
|
3840
3856
|
return __awaiter(this, void 0, void 0, function () {
|
|
3841
|
-
var def, parameterCommands, commands;
|
|
3842
3857
|
return __generator(this, function (_a) {
|
|
3843
3858
|
switch (_a.label) {
|
|
3844
3859
|
case 0:
|
|
3845
3860
|
this._navigationSessionModel.value = NavigationSession.createInternal(visit);
|
|
3846
3861
|
_a.label = 1;
|
|
3847
3862
|
case 1:
|
|
3848
|
-
_a.trys.push([1, ,
|
|
3849
|
-
if (!customNavigation) return [3 /*break*/, 3];
|
|
3863
|
+
_a.trys.push([1, , 3, 4]);
|
|
3850
3864
|
return [4 /*yield*/, customNavigation(this.router)];
|
|
3851
3865
|
case 2:
|
|
3852
3866
|
_a.sent();
|
|
3853
|
-
return [3 /*break*/,
|
|
3867
|
+
return [3 /*break*/, 4];
|
|
3854
3868
|
case 3:
|
|
3855
|
-
def = visit.placeDefinition;
|
|
3856
|
-
// @see https://coolon.atlassian.net/browse/AUP-41
|
|
3857
|
-
parameterCommands = visit.hasRouteId() ?
|
|
3858
|
-
[def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
|
|
3859
|
-
[def.getFormattedRouteParameters(visit)];
|
|
3860
|
-
commands = [def.path].concat(parameterCommands);
|
|
3861
|
-
console.log('_doNavigation', visit, commands);
|
|
3862
|
-
return [4 /*yield*/, this.router.navigate(commands)];
|
|
3863
|
-
case 4:
|
|
3864
|
-
_a.sent();
|
|
3865
|
-
_a.label = 5;
|
|
3866
|
-
case 5: return [3 /*break*/, 7];
|
|
3867
|
-
case 6:
|
|
3868
3869
|
if (this.navigationSession && !this.router.getCurrentNavigation()) {
|
|
3869
3870
|
this.onAngularRouterFinished();
|
|
3870
3871
|
}
|
|
3871
3872
|
return [7 /*endfinally*/];
|
|
3872
|
-
case
|
|
3873
|
+
case 4: return [2 /*return*/];
|
|
3873
3874
|
}
|
|
3874
3875
|
});
|
|
3875
3876
|
});
|
|
3876
3877
|
};
|
|
3878
|
+
/**
|
|
3879
|
+
* @private
|
|
3880
|
+
* @param {?} visit
|
|
3881
|
+
* @return {?}
|
|
3882
|
+
*/
|
|
3883
|
+
PlaceRouter.prototype.createRouteParameters = /**
|
|
3884
|
+
* @private
|
|
3885
|
+
* @param {?} visit
|
|
3886
|
+
* @return {?}
|
|
3887
|
+
*/
|
|
3888
|
+
function (visit) {
|
|
3889
|
+
/** @type {?} */
|
|
3890
|
+
var def = visit.placeDefinition;
|
|
3891
|
+
return visit.hasRouteId() ?
|
|
3892
|
+
[def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
|
|
3893
|
+
[def.getFormattedRouteParameters(visit)];
|
|
3894
|
+
};
|
|
3877
3895
|
// @Trace()
|
|
3878
3896
|
// @Trace()
|
|
3879
3897
|
/**
|
|
@@ -3934,7 +3952,7 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3934
3952
|
* @param {?} activatedRoute
|
|
3935
3953
|
* @return {?}
|
|
3936
3954
|
*/
|
|
3937
|
-
PlaceRouter.prototype.
|
|
3955
|
+
PlaceRouter.prototype.extractChildPath = /**
|
|
3938
3956
|
* @param {?} activatedRoute
|
|
3939
3957
|
* @return {?}
|
|
3940
3958
|
*/
|
|
@@ -3957,6 +3975,12 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3957
3975
|
{ type: PlaceHistory }
|
|
3958
3976
|
]; };
|
|
3959
3977
|
/** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router), ɵɵinject(Location), ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
|
|
3978
|
+
__decorate([
|
|
3979
|
+
Trace(),
|
|
3980
|
+
__metadata("design:type", Function),
|
|
3981
|
+
__metadata("design:paramtypes", [Visit, Object]),
|
|
3982
|
+
__metadata("design:returntype", Promise)
|
|
3983
|
+
], PlaceRouter.prototype, "navigate", null);
|
|
3960
3984
|
__decorate([
|
|
3961
3985
|
Trace(),
|
|
3962
3986
|
__metadata("design:type", Function),
|
|
@@ -4072,11 +4096,11 @@ if (false) {
|
|
|
4072
4096
|
}
|
|
4073
4097
|
var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
4074
4098
|
__extends(PlaceOutletComponent, _super);
|
|
4075
|
-
function PlaceOutletComponent(router, placeRouter,
|
|
4099
|
+
function PlaceOutletComponent(router, placeRouter, parentOutlet) {
|
|
4076
4100
|
var _this = _super.call(this) || this;
|
|
4077
4101
|
_this.router = router;
|
|
4078
4102
|
_this.placeRouter = placeRouter;
|
|
4079
|
-
_this.
|
|
4103
|
+
_this.parentOutlet = parentOutlet;
|
|
4080
4104
|
_this.animate = true;
|
|
4081
4105
|
_this.placeChanged = new EventEmitter();
|
|
4082
4106
|
_this._activePlace = new MutableValueModel();
|
|
@@ -4137,6 +4161,20 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4137
4161
|
*/
|
|
4138
4162
|
function () {
|
|
4139
4163
|
};
|
|
4164
|
+
/**
|
|
4165
|
+
* @param {?} visit
|
|
4166
|
+
* @return {?}
|
|
4167
|
+
*/
|
|
4168
|
+
PlaceOutletComponent.prototype.navigate = /**
|
|
4169
|
+
* @param {?} visit
|
|
4170
|
+
* @return {?}
|
|
4171
|
+
*/
|
|
4172
|
+
function (visit) {
|
|
4173
|
+
console.log({ activatedRoute: this._activatedRouteModel.value });
|
|
4174
|
+
this.placeRouter.navigate(visit, {
|
|
4175
|
+
relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null
|
|
4176
|
+
});
|
|
4177
|
+
};
|
|
4140
4178
|
/**
|
|
4141
4179
|
* @param {?} next
|
|
4142
4180
|
* @param {?} previous
|
|
@@ -4162,6 +4200,16 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4162
4200
|
enumerable: true,
|
|
4163
4201
|
configurable: true
|
|
4164
4202
|
});
|
|
4203
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "activatedRouteModel", {
|
|
4204
|
+
get: /**
|
|
4205
|
+
* @return {?}
|
|
4206
|
+
*/
|
|
4207
|
+
function () {
|
|
4208
|
+
return this._activatedRouteModel.readonly;
|
|
4209
|
+
},
|
|
4210
|
+
enumerable: true,
|
|
4211
|
+
configurable: true
|
|
4212
|
+
});
|
|
4165
4213
|
/**
|
|
4166
4214
|
* @param {?} routerOutlet
|
|
4167
4215
|
* @param {?} place
|
|
@@ -4236,17 +4284,6 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4236
4284
|
this._activePlace.value.onPlaceReady();
|
|
4237
4285
|
}
|
|
4238
4286
|
};
|
|
4239
|
-
/**
|
|
4240
|
-
* @param {?} placeDestination
|
|
4241
|
-
* @return {?}
|
|
4242
|
-
*/
|
|
4243
|
-
PlaceOutletComponent.prototype.activate = /**
|
|
4244
|
-
* @param {?} placeDestination
|
|
4245
|
-
* @return {?}
|
|
4246
|
-
*/
|
|
4247
|
-
function (placeDestination) {
|
|
4248
|
-
// this.router.
|
|
4249
|
-
};
|
|
4250
4287
|
PlaceOutletComponent.decorators = [
|
|
4251
4288
|
{ type: Component, args: [{
|
|
4252
4289
|
selector: 'angular-ui-powerups-place-outlet',
|
|
@@ -4259,13 +4296,31 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4259
4296
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4260
4297
|
{ type: Router },
|
|
4261
4298
|
{ type: PlaceRouter },
|
|
4262
|
-
{ type:
|
|
4299
|
+
{ type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] }
|
|
4263
4300
|
]; };
|
|
4264
4301
|
PlaceOutletComponent.propDecorators = {
|
|
4265
4302
|
animate: [{ type: Input }],
|
|
4266
4303
|
placeChanged: [{ type: Output }],
|
|
4267
4304
|
routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
4268
4305
|
};
|
|
4306
|
+
__decorate([
|
|
4307
|
+
Trace(),
|
|
4308
|
+
__metadata("design:type", Function),
|
|
4309
|
+
__metadata("design:paramtypes", [Visit]),
|
|
4310
|
+
__metadata("design:returntype", void 0)
|
|
4311
|
+
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4312
|
+
__decorate([
|
|
4313
|
+
Trace(),
|
|
4314
|
+
__metadata("design:type", Function),
|
|
4315
|
+
__metadata("design:paramtypes", [RouterOutlet, PlaceComponent]),
|
|
4316
|
+
__metadata("design:returntype", void 0)
|
|
4317
|
+
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
4318
|
+
__decorate([
|
|
4319
|
+
Trace(),
|
|
4320
|
+
__metadata("design:type", Function),
|
|
4321
|
+
__metadata("design:paramtypes", [RouterOutlet, Object]),
|
|
4322
|
+
__metadata("design:returntype", void 0)
|
|
4323
|
+
], PlaceOutletComponent.prototype, "onOutletDeactivated", null);
|
|
4269
4324
|
return PlaceOutletComponent;
|
|
4270
4325
|
}(DisposableComponent));
|
|
4271
4326
|
if (false) {
|
|
@@ -4310,11 +4365,8 @@ if (false) {
|
|
|
4310
4365
|
* @private
|
|
4311
4366
|
*/
|
|
4312
4367
|
PlaceOutletComponent.prototype.placeRouter;
|
|
4313
|
-
/**
|
|
4314
|
-
|
|
4315
|
-
* @private
|
|
4316
|
-
*/
|
|
4317
|
-
PlaceOutletComponent.prototype.placeHistory;
|
|
4368
|
+
/** @type {?} */
|
|
4369
|
+
PlaceOutletComponent.prototype.parentOutlet;
|
|
4318
4370
|
}
|
|
4319
4371
|
|
|
4320
4372
|
/**
|
|
@@ -5128,6 +5180,8 @@ function RouteId(type, options) {
|
|
|
5128
5180
|
* @return {?}
|
|
5129
5181
|
*/
|
|
5130
5182
|
function VisitParameter(options) {
|
|
5183
|
+
/** @type {?} */
|
|
5184
|
+
var opts = Opts.get(options);
|
|
5131
5185
|
return (/**
|
|
5132
5186
|
* @param {?} prototype
|
|
5133
5187
|
* @param {?} propertyKey
|
|
@@ -5135,7 +5189,7 @@ function VisitParameter(options) {
|
|
|
5135
5189
|
*/
|
|
5136
5190
|
function (prototype, propertyKey) {
|
|
5137
5191
|
/** @type {?} */
|
|
5138
|
-
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options,
|
|
5192
|
+
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
|
|
5139
5193
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
5140
5194
|
UseDelegate()(prototype, propertyKey);
|
|
5141
5195
|
});
|
|
@@ -5146,6 +5200,8 @@ function VisitParameter(options) {
|
|
|
5146
5200
|
* @return {?}
|
|
5147
5201
|
*/
|
|
5148
5202
|
function VisitParameterList(options) {
|
|
5203
|
+
/** @type {?} */
|
|
5204
|
+
var opts = Opts.get(options);
|
|
5149
5205
|
return (/**
|
|
5150
5206
|
* @param {?} prototype
|
|
5151
5207
|
* @param {?} propertyKey
|
|
@@ -5153,7 +5209,7 @@ function VisitParameterList(options) {
|
|
|
5153
5209
|
*/
|
|
5154
5210
|
function (prototype, propertyKey) {
|
|
5155
5211
|
/** @type {?} */
|
|
5156
|
-
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options,
|
|
5212
|
+
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional("storeInUrl", null));
|
|
5157
5213
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
5158
5214
|
UseDelegate()(prototype, propertyKey);
|
|
5159
5215
|
});
|
|
@@ -5462,7 +5518,7 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
5462
5518
|
*/
|
|
5463
5519
|
function (activatedRoute, state) {
|
|
5464
5520
|
return __awaiter(this, void 0, void 0, function () {
|
|
5465
|
-
var placeDefinition, params, parsedParams, initialVisit, sanitiser,
|
|
5521
|
+
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, parameterCommands, commands;
|
|
5466
5522
|
return __generator(this, function (_a) {
|
|
5467
5523
|
switch (_a.label) {
|
|
5468
5524
|
case 0:
|
|
@@ -5475,14 +5531,14 @@ var PlaceRouteGuard = /** @class */ (function () {
|
|
|
5475
5531
|
sanitiser = new VisitSanitiser(activatedRoute, this.router, this.placeHistory, this.injector);
|
|
5476
5532
|
return [4 /*yield*/, sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams))];
|
|
5477
5533
|
case 1:
|
|
5478
|
-
|
|
5534
|
+
sanitisedVisit = _a.sent();
|
|
5479
5535
|
// Save the visit with any updated parameters. We need to save it so we remember any non route parameters
|
|
5480
|
-
this.placeRouter.navigationSession.storeVisit(
|
|
5481
|
-
if (initialVisit.hasRoutingChangedFrom(
|
|
5482
|
-
parameterCommands =
|
|
5483
|
-
[placeDefinition.getFormattedRouteId(
|
|
5484
|
-
[placeDefinition.getFormattedRouteParameters(
|
|
5485
|
-
commands = [(activatedRoute.url[0].path)].concat(parameterCommands, this.placeRouter.
|
|
5536
|
+
this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
|
|
5537
|
+
if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
|
|
5538
|
+
parameterCommands = sanitisedVisit.hasRouteId() ?
|
|
5539
|
+
[placeDefinition.getFormattedRouteId(sanitisedVisit), placeDefinition.getFormattedRouteParameters(sanitisedVisit)] :
|
|
5540
|
+
[placeDefinition.getFormattedRouteParameters(sanitisedVisit)];
|
|
5541
|
+
commands = [(activatedRoute.url[0].path)].concat(parameterCommands, this.placeRouter.extractChildPath(activatedRoute));
|
|
5486
5542
|
console.log('##### Redirect', commands);
|
|
5487
5543
|
return [2 /*return*/, this.router.createUrlTree(commands, {
|
|
5488
5544
|
replaceUrl: true,
|