@coolon/angular-ui-powerups 0.0.70 → 0.0.72
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 +197 -142
- 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 +50 -24
- package/esm2015/lib/place/place-router.js +42 -27
- package/esm2015/lib/place/place.decorator.js +3 -1
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +56 -27
- package/esm5/lib/place/place-router.js +57 -32
- package/esm5/lib/place/place.decorator.js +3 -1
- package/fesm2015/coolon-angular-ui-powerups.js +162 -121
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +200 -145
- 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 +5 -2
- package/lib/place/place.decorator.d.ts +1 -0
- package/package.json +1 -1
- package/schematics/place-routes/place-builder.js +1 -0
- package/schematics/place-routes/place-builder.js.map +1 -1
- package/schematics/place-routes/place-class-scanner.d.ts +1 -0
- package/schematics/place-routes/place-class-scanner.js +7 -1
- package/schematics/place-routes/place-class-scanner.js.map +1 -1
- package/schematics/place-routes/place-def.d.ts +4 -1
- package/schematics/place-routes/place-def.js +33 -19
- package/schematics/place-routes/place-def.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.extractChildPath(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,51 +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
|
-
parameterCommands = visit.hasRouteId() ?
|
|
3857
|
-
[def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
|
|
3858
|
-
[def.getFormattedRouteParameters(visit)];
|
|
3859
|
-
commands = [def.path].concat(parameterCommands);
|
|
3860
|
-
console.log('_doNavigation', visit, commands);
|
|
3861
|
-
return [4 /*yield*/, this.router.navigate(commands)];
|
|
3862
|
-
case 4:
|
|
3863
|
-
_a.sent();
|
|
3864
|
-
_a.label = 5;
|
|
3865
|
-
case 5: return [3 /*break*/, 7];
|
|
3866
|
-
case 6:
|
|
3867
3869
|
if (this.navigationSession && !this.router.getCurrentNavigation()) {
|
|
3868
3870
|
this.onAngularRouterFinished();
|
|
3869
3871
|
}
|
|
3870
3872
|
return [7 /*endfinally*/];
|
|
3871
|
-
case
|
|
3873
|
+
case 4: return [2 /*return*/];
|
|
3872
3874
|
}
|
|
3873
3875
|
});
|
|
3874
3876
|
});
|
|
3875
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
|
+
};
|
|
3876
3895
|
// @Trace()
|
|
3877
3896
|
// @Trace()
|
|
3878
3897
|
/**
|
|
@@ -3956,6 +3975,12 @@ var PlaceRouter = /** @class */ (function (_super) {
|
|
|
3956
3975
|
{ type: PlaceHistory }
|
|
3957
3976
|
]; };
|
|
3958
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);
|
|
3959
3984
|
__decorate([
|
|
3960
3985
|
Trace(),
|
|
3961
3986
|
__metadata("design:type", Function),
|
|
@@ -4071,11 +4096,11 @@ if (false) {
|
|
|
4071
4096
|
}
|
|
4072
4097
|
var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
4073
4098
|
__extends(PlaceOutletComponent, _super);
|
|
4074
|
-
function PlaceOutletComponent(router, placeRouter,
|
|
4099
|
+
function PlaceOutletComponent(router, placeRouter, parentOutlet) {
|
|
4075
4100
|
var _this = _super.call(this) || this;
|
|
4076
4101
|
_this.router = router;
|
|
4077
4102
|
_this.placeRouter = placeRouter;
|
|
4078
|
-
_this.
|
|
4103
|
+
_this.parentOutlet = parentOutlet;
|
|
4079
4104
|
_this.animate = true;
|
|
4080
4105
|
_this.placeChanged = new EventEmitter();
|
|
4081
4106
|
_this._activePlace = new MutableValueModel();
|
|
@@ -4087,17 +4112,17 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4087
4112
|
*/
|
|
4088
4113
|
_this._placeVisit = new MutableValueModel();
|
|
4089
4114
|
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
4090
|
-
//
|
|
4091
|
-
/** @type {?} */
|
|
4092
|
-
var inRouteVisitUpdate = new Guard$1();
|
|
4115
|
+
// Push incoming changes into the component
|
|
4093
4116
|
/** @type {?} */
|
|
4094
4117
|
var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
|
|
4118
|
+
/** @type {?} */
|
|
4119
|
+
var inRouteVisitUpdate = new Guard$1();
|
|
4095
4120
|
when.valueOf(routeVisit).changes((/**
|
|
4096
4121
|
* @param {?} visit
|
|
4097
4122
|
* @return {?}
|
|
4098
4123
|
*/
|
|
4099
4124
|
function (visit) {
|
|
4100
|
-
if (visit) {
|
|
4125
|
+
if (visit) { // can be null while the place and index sync up
|
|
4101
4126
|
inRouteVisitUpdate.whileTrue((/**
|
|
4102
4127
|
* @return {?}
|
|
4103
4128
|
*/
|
|
@@ -4136,6 +4161,20 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4136
4161
|
*/
|
|
4137
4162
|
function () {
|
|
4138
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
|
+
};
|
|
4139
4178
|
/**
|
|
4140
4179
|
* @param {?} next
|
|
4141
4180
|
* @param {?} previous
|
|
@@ -4161,6 +4200,16 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4161
4200
|
enumerable: true,
|
|
4162
4201
|
configurable: true
|
|
4163
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
|
+
});
|
|
4164
4213
|
/**
|
|
4165
4214
|
* @param {?} routerOutlet
|
|
4166
4215
|
* @param {?} place
|
|
@@ -4235,17 +4284,6 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4235
4284
|
this._activePlace.value.onPlaceReady();
|
|
4236
4285
|
}
|
|
4237
4286
|
};
|
|
4238
|
-
/**
|
|
4239
|
-
* @param {?} placeDestination
|
|
4240
|
-
* @return {?}
|
|
4241
|
-
*/
|
|
4242
|
-
PlaceOutletComponent.prototype.activate = /**
|
|
4243
|
-
* @param {?} placeDestination
|
|
4244
|
-
* @return {?}
|
|
4245
|
-
*/
|
|
4246
|
-
function (placeDestination) {
|
|
4247
|
-
// this.router.
|
|
4248
|
-
};
|
|
4249
4287
|
PlaceOutletComponent.decorators = [
|
|
4250
4288
|
{ type: Component, args: [{
|
|
4251
4289
|
selector: 'angular-ui-powerups-place-outlet',
|
|
@@ -4258,13 +4296,31 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
|
4258
4296
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4259
4297
|
{ type: Router },
|
|
4260
4298
|
{ type: PlaceRouter },
|
|
4261
|
-
{ type:
|
|
4299
|
+
{ type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] }
|
|
4262
4300
|
]; };
|
|
4263
4301
|
PlaceOutletComponent.propDecorators = {
|
|
4264
4302
|
animate: [{ type: Input }],
|
|
4265
4303
|
placeChanged: [{ type: Output }],
|
|
4266
4304
|
routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
4267
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);
|
|
4268
4324
|
return PlaceOutletComponent;
|
|
4269
4325
|
}(DisposableComponent));
|
|
4270
4326
|
if (false) {
|
|
@@ -4309,11 +4365,8 @@ if (false) {
|
|
|
4309
4365
|
* @private
|
|
4310
4366
|
*/
|
|
4311
4367
|
PlaceOutletComponent.prototype.placeRouter;
|
|
4312
|
-
/**
|
|
4313
|
-
|
|
4314
|
-
* @private
|
|
4315
|
-
*/
|
|
4316
|
-
PlaceOutletComponent.prototype.placeHistory;
|
|
4368
|
+
/** @type {?} */
|
|
4369
|
+
PlaceOutletComponent.prototype.parentOutlet;
|
|
4317
4370
|
}
|
|
4318
4371
|
|
|
4319
4372
|
/**
|
|
@@ -4938,6 +4991,8 @@ function Place(options) {
|
|
|
4938
4991
|
Options.prototype.authenticate;
|
|
4939
4992
|
/** @type {?|undefined} */
|
|
4940
4993
|
Options.prototype.children;
|
|
4994
|
+
/** @type {?|undefined} */
|
|
4995
|
+
Options.prototype.defaultChild;
|
|
4941
4996
|
}
|
|
4942
4997
|
})(Place || (Place = {}));
|
|
4943
4998
|
|