@coolon/angular-ui-powerups 0.0.38 → 0.0.42
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 +183 -63
- 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/angular-ui-powerups.module.js +3 -1
- package/esm2015/lib/interaction/interaction.module.js +4 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +4 -4
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +2 -2
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +110 -16
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
- package/esm2015/lib/place/guards/leave-place.guard.js +12 -4
- package/esm2015/lib/place/guards/place-route.guard.js +2 -2
- package/esm2015/lib/place/place-component.js +3 -8
- package/esm2015/lib/place/place.service.js +6 -28
- package/esm5/lib/angular-ui-powerups.module.js +3 -1
- package/esm5/lib/interaction/interaction.module.js +4 -1
- package/esm5/lib/place/components/abstract-place-navigation.component.js +4 -4
- package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +2 -2
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +141 -20
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
- package/esm5/lib/place/guards/leave-place.guard.js +11 -3
- package/esm5/lib/place/guards/place-route.guard.js +2 -2
- package/esm5/lib/place/place-component.js +7 -9
- package/esm5/lib/place/place.service.js +22 -32
- package/fesm2015/coolon-angular-ui-powerups.js +132 -53
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +181 -61
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/components/abstract-place-navigation.component.d.ts +1 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +16 -8
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { DOCUMENT, CommonModule } from '@angular/common';
|
|
|
2
2
|
import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule, HostBinding, 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
|
+
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
5
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
6
7
|
import { __decorate, __metadata, __awaiter } from 'tslib';
|
|
7
8
|
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, EventListenerList, DelegatingValueModel, Trace, MutableListModel, StoreInValueModel, MutableValueModel, Binding, OptionsHelper, ValueHolder } from '@coolon/pectin';
|
|
@@ -11,9 +12,8 @@ import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
|
|
|
11
12
|
import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
|
|
12
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
13
14
|
import { MatListModule } from '@angular/material/list';
|
|
14
|
-
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
15
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
-
import { Router, RouterModule } from '@angular/router';
|
|
16
|
+
import { Router, ActivatedRoute, RouterOutlet, RouterModule, PRIMARY_OUTLET } from '@angular/router';
|
|
17
17
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
18
18
|
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
|
|
19
19
|
import { isNil, isEqual, isEmpty, isFunction } from 'lodash';
|
|
@@ -1367,6 +1367,9 @@ InteractionModule.decorators = [
|
|
|
1367
1367
|
AlertDialogComponent,
|
|
1368
1368
|
ActivityOutletComponent
|
|
1369
1369
|
],
|
|
1370
|
+
exports: [
|
|
1371
|
+
ActivityContainerComponent,
|
|
1372
|
+
],
|
|
1370
1373
|
entryComponents: [
|
|
1371
1374
|
ActivityContainerComponent,
|
|
1372
1375
|
ConfirmationDialogComponent,
|
|
@@ -1922,6 +1925,7 @@ class PlaceComponent extends DisposableComponent {
|
|
|
1922
1925
|
canDeactivate() {
|
|
1923
1926
|
return true;
|
|
1924
1927
|
}
|
|
1928
|
+
// @Trace()
|
|
1925
1929
|
/**
|
|
1926
1930
|
* @return {?}
|
|
1927
1931
|
*/
|
|
@@ -1933,12 +1937,6 @@ __decorate([
|
|
|
1933
1937
|
__metadata("design:type", PlaceComponent.Definition),
|
|
1934
1938
|
__metadata("design:paramtypes", [])
|
|
1935
1939
|
], PlaceComponent.prototype, "placeDefinition", null);
|
|
1936
|
-
__decorate([
|
|
1937
|
-
Trace(),
|
|
1938
|
-
__metadata("design:type", Function),
|
|
1939
|
-
__metadata("design:paramtypes", []),
|
|
1940
|
-
__metadata("design:returntype", void 0)
|
|
1941
|
-
], PlaceComponent.prototype, "onPlaceReady", null);
|
|
1942
1940
|
if (false) {
|
|
1943
1941
|
/** @type {?} */
|
|
1944
1942
|
PlaceComponent.prototype._incomingRouteChange;
|
|
@@ -2105,9 +2103,9 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
|
2105
2103
|
* @param {?} placeDef
|
|
2106
2104
|
* @return {?}
|
|
2107
2105
|
*/
|
|
2108
|
-
|
|
2106
|
+
getNav(placeDef) {
|
|
2109
2107
|
/** @type {?} */
|
|
2110
|
-
const navItem = (/** @type {?} */ (placeDef.getData('
|
|
2108
|
+
const navItem = (/** @type {?} */ (placeDef.getData('nav')));
|
|
2111
2109
|
return {
|
|
2112
2110
|
title: (/**
|
|
2113
2111
|
* @return {?}
|
|
@@ -2146,7 +2144,7 @@ __decorate([
|
|
|
2146
2144
|
__metadata("design:type", Function),
|
|
2147
2145
|
__metadata("design:paramtypes", [PlaceComponent.Definition]),
|
|
2148
2146
|
__metadata("design:returntype", Object)
|
|
2149
|
-
], AbstractPlaceNavigationComponent.prototype, "
|
|
2147
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
2150
2148
|
if (false) {
|
|
2151
2149
|
/** @type {?} */
|
|
2152
2150
|
AbstractPlaceNavigationComponent.prototype.places;
|
|
@@ -2187,7 +2185,7 @@ class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
|
2187
2185
|
ListPlaceNavComponent.decorators = [
|
|
2188
2186
|
{ type: Component, args: [{
|
|
2189
2187
|
selector: 'angular-ui-powerups-list-place-nav',
|
|
2190
|
-
template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"
|
|
2188
|
+
template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
|
|
2191
2189
|
styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
|
|
2192
2190
|
}] }
|
|
2193
2191
|
];
|
|
@@ -2222,6 +2220,7 @@ class PlaceService extends GarbageCollector {
|
|
|
2222
2220
|
get activePlaces() {
|
|
2223
2221
|
return this._activePlaces.readonly;
|
|
2224
2222
|
}
|
|
2223
|
+
// @Trace()
|
|
2225
2224
|
/**
|
|
2226
2225
|
* @param {?} place
|
|
2227
2226
|
* @return {?}
|
|
@@ -2229,6 +2228,7 @@ class PlaceService extends GarbageCollector {
|
|
|
2229
2228
|
onActivate(place) {
|
|
2230
2229
|
this._activePlaces.push(place);
|
|
2231
2230
|
}
|
|
2231
|
+
// @Trace()
|
|
2232
2232
|
/**
|
|
2233
2233
|
* @param {?} place
|
|
2234
2234
|
* @return {?}
|
|
@@ -2236,6 +2236,7 @@ class PlaceService extends GarbageCollector {
|
|
|
2236
2236
|
onDeactivate(place) {
|
|
2237
2237
|
this._activePlaces.remove(place);
|
|
2238
2238
|
}
|
|
2239
|
+
// @Trace()
|
|
2239
2240
|
/**
|
|
2240
2241
|
* @param {?} params
|
|
2241
2242
|
* @return {?}
|
|
@@ -2254,6 +2255,7 @@ class PlaceService extends GarbageCollector {
|
|
|
2254
2255
|
});
|
|
2255
2256
|
}
|
|
2256
2257
|
}
|
|
2258
|
+
// @Trace()
|
|
2257
2259
|
/**
|
|
2258
2260
|
* @param {?} snapshot
|
|
2259
2261
|
* @return {?}
|
|
@@ -2275,30 +2277,6 @@ PlaceService.ctorParameters = () => [
|
|
|
2275
2277
|
{ type: Injector }
|
|
2276
2278
|
];
|
|
2277
2279
|
/** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceService, providedIn: "root" });
|
|
2278
|
-
__decorate([
|
|
2279
|
-
Trace(),
|
|
2280
|
-
__metadata("design:type", Function),
|
|
2281
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
2282
|
-
__metadata("design:returntype", void 0)
|
|
2283
|
-
], PlaceService.prototype, "onActivate", null);
|
|
2284
|
-
__decorate([
|
|
2285
|
-
Trace(),
|
|
2286
|
-
__metadata("design:type", Function),
|
|
2287
|
-
__metadata("design:paramtypes", [PlaceComponent]),
|
|
2288
|
-
__metadata("design:returntype", void 0)
|
|
2289
|
-
], PlaceService.prototype, "onDeactivate", null);
|
|
2290
|
-
__decorate([
|
|
2291
|
-
Trace(),
|
|
2292
|
-
__metadata("design:type", Function),
|
|
2293
|
-
__metadata("design:paramtypes", [Object]),
|
|
2294
|
-
__metadata("design:returntype", void 0)
|
|
2295
|
-
], PlaceService.prototype, "notifyRouteParametersChanged", null);
|
|
2296
|
-
__decorate([
|
|
2297
|
-
Trace(),
|
|
2298
|
-
__metadata("design:type", Function),
|
|
2299
|
-
__metadata("design:paramtypes", [ParameterSnapshot]),
|
|
2300
|
-
__metadata("design:returntype", Promise)
|
|
2301
|
-
], PlaceService.prototype, "sanitise", null);
|
|
2302
2280
|
if (false) {
|
|
2303
2281
|
/**
|
|
2304
2282
|
* @type {?}
|
|
@@ -2374,35 +2352,97 @@ const LEFT_RIGHT_PLACE_ANIMATION = leftRightPlaceAnimation("0.3s");
|
|
|
2374
2352
|
* @fileoverview added by tsickle
|
|
2375
2353
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2376
2354
|
*/
|
|
2377
|
-
class PlaceOutletComponent {
|
|
2355
|
+
class PlaceOutletComponent extends DisposableComponent {
|
|
2378
2356
|
/**
|
|
2379
2357
|
* @param {?} placeService
|
|
2358
|
+
* @param {?} activatedRoute
|
|
2380
2359
|
*/
|
|
2381
|
-
constructor(placeService) {
|
|
2360
|
+
constructor(placeService, activatedRoute) {
|
|
2361
|
+
super();
|
|
2382
2362
|
this.placeService = placeService;
|
|
2363
|
+
this.activatedRoute = activatedRoute;
|
|
2383
2364
|
this.animate = true;
|
|
2365
|
+
this.outletUrlSegment = new MutableListModel();
|
|
2366
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2367
|
+
this.myPath = observe.listsFrom(activatedRoute.url).last().map((/**
|
|
2368
|
+
* @param {?} s
|
|
2369
|
+
* @return {?}
|
|
2370
|
+
*/
|
|
2371
|
+
s => s.toString())).reduce((/**
|
|
2372
|
+
* @param {?} bits
|
|
2373
|
+
* @return {?}
|
|
2374
|
+
*/
|
|
2375
|
+
bits => bits.join(',')));
|
|
2376
|
+
console.log(`new outlet@(${this.myPath.value})`);
|
|
2377
|
+
this.outletChildPath = chain(this.outletUrlSegment).map((/**
|
|
2378
|
+
* @param {?} s
|
|
2379
|
+
* @return {?}
|
|
2380
|
+
*/
|
|
2381
|
+
s => s.toString())).reduce((/**
|
|
2382
|
+
* @param {?} bits
|
|
2383
|
+
* @return {?}
|
|
2384
|
+
*/
|
|
2385
|
+
bits => bits.join(",")));
|
|
2386
|
+
this.state = chain(this.myPath).map((/**
|
|
2387
|
+
* @param {?} path
|
|
2388
|
+
* @return {?}
|
|
2389
|
+
*/
|
|
2390
|
+
path => {
|
|
2391
|
+
return `outlet@(${path}), child path->${this.outletChildPath.value}`;
|
|
2392
|
+
}), { dependsOn: this.outletChildPath });
|
|
2393
|
+
when.valueOf(this.state).changes((/**
|
|
2394
|
+
* @param {?} debug
|
|
2395
|
+
* @return {?}
|
|
2396
|
+
*/
|
|
2397
|
+
debug => {
|
|
2398
|
+
console.log(`Outlet Changed -> ${debug}`);
|
|
2399
|
+
}));
|
|
2384
2400
|
}
|
|
2385
2401
|
/**
|
|
2386
2402
|
* @return {?}
|
|
2387
2403
|
*/
|
|
2388
2404
|
ngOnInit() {
|
|
2389
2405
|
}
|
|
2406
|
+
/**
|
|
2407
|
+
* @return {?}
|
|
2408
|
+
*/
|
|
2409
|
+
ngAfterViewInit() {
|
|
2410
|
+
// this.routerOutLetQuery.changes.subscribe(() => {
|
|
2411
|
+
// this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2412
|
+
// });
|
|
2413
|
+
}
|
|
2414
|
+
/**
|
|
2415
|
+
* @return {?}
|
|
2416
|
+
*/
|
|
2417
|
+
ngAfterViewChecked() {
|
|
2418
|
+
// console.log(`@AfterViewChecked: ${this.state.value}`);
|
|
2419
|
+
this.updateRouterOutlet(this.routerOutLetQuery.first);
|
|
2420
|
+
}
|
|
2421
|
+
// @Trace()
|
|
2422
|
+
// ngOnDestroy(): void {
|
|
2423
|
+
// console.log('outletSegments', this.outletUrlSegment.value);
|
|
2424
|
+
// console.log('mySegments', this.myPath.value);
|
|
2425
|
+
// super.ngOnDestroy();
|
|
2426
|
+
// }
|
|
2427
|
+
// @Trace()
|
|
2390
2428
|
/**
|
|
2391
2429
|
* @param {?} $event
|
|
2392
2430
|
* @return {?}
|
|
2393
2431
|
*/
|
|
2394
|
-
|
|
2432
|
+
onOutletActivated($event) {
|
|
2433
|
+
// console.log(this.routerOutLet.activatedRoute.snapshot.url);
|
|
2395
2434
|
this.currentPlace = $event;
|
|
2396
2435
|
this.placeService.onActivate($event);
|
|
2397
2436
|
if (!this.animate) {
|
|
2398
|
-
|
|
2437
|
+
// we're not animating so trigger any post animation callbacks now.
|
|
2438
|
+
this.animationDone();
|
|
2399
2439
|
}
|
|
2400
2440
|
}
|
|
2401
2441
|
/**
|
|
2402
2442
|
* @param {?} $event
|
|
2403
2443
|
* @return {?}
|
|
2404
2444
|
*/
|
|
2405
|
-
|
|
2445
|
+
onOutletDeactivated($event) {
|
|
2406
2446
|
this.currentPlace = null;
|
|
2407
2447
|
this.placeService.onDeactivate($event);
|
|
2408
2448
|
}
|
|
@@ -2417,49 +2457,79 @@ class PlaceOutletComponent {
|
|
|
2417
2457
|
* @return {?}
|
|
2418
2458
|
*/
|
|
2419
2459
|
animationDone() {
|
|
2420
|
-
this.
|
|
2460
|
+
if (this.currentPlace) {
|
|
2461
|
+
this.currentPlace.onPlaceReady();
|
|
2462
|
+
}
|
|
2421
2463
|
}
|
|
2464
|
+
// @Trace()
|
|
2422
2465
|
/**
|
|
2423
2466
|
* @private
|
|
2467
|
+
* @param {?} first
|
|
2424
2468
|
* @return {?}
|
|
2425
2469
|
*/
|
|
2426
|
-
|
|
2427
|
-
if (
|
|
2428
|
-
this.
|
|
2470
|
+
updateRouterOutlet(first) {
|
|
2471
|
+
if (first.isActivated) {
|
|
2472
|
+
this.outletUrlSegment.value = first.activatedRoute.snapshot.url;
|
|
2429
2473
|
}
|
|
2430
2474
|
}
|
|
2431
2475
|
}
|
|
2432
2476
|
PlaceOutletComponent.decorators = [
|
|
2433
2477
|
{ type: Component, args: [{
|
|
2434
2478
|
selector: 'angular-ui-powerups-place-outlet',
|
|
2435
|
-
template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"
|
|
2479
|
+
template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"getPlaceOrder(routerOutlet)\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated($event)\"\n (deactivate)=\"onOutletDeactivated($event)\">\n </router-outlet>\n</div>\n\n",
|
|
2436
2480
|
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
2437
2481
|
styles: [":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
|
|
2438
2482
|
}] }
|
|
2439
2483
|
];
|
|
2440
2484
|
/** @nocollapse */
|
|
2441
2485
|
PlaceOutletComponent.ctorParameters = () => [
|
|
2442
|
-
{ type: PlaceService }
|
|
2486
|
+
{ type: PlaceService },
|
|
2487
|
+
{ type: ActivatedRoute }
|
|
2443
2488
|
];
|
|
2444
2489
|
PlaceOutletComponent.propDecorators = {
|
|
2445
2490
|
animate: [{ type: Input }],
|
|
2446
|
-
|
|
2491
|
+
routerOutLetQuery: [{ type: ViewChildren, args: [RouterOutlet,] }]
|
|
2447
2492
|
};
|
|
2448
2493
|
if (false) {
|
|
2449
2494
|
/** @type {?} */
|
|
2450
2495
|
PlaceOutletComponent.prototype.animate;
|
|
2451
2496
|
/** @type {?} */
|
|
2452
|
-
PlaceOutletComponent.prototype.
|
|
2497
|
+
PlaceOutletComponent.prototype.routerOutLetQuery;
|
|
2453
2498
|
/**
|
|
2454
2499
|
* @type {?}
|
|
2455
2500
|
* @private
|
|
2456
2501
|
*/
|
|
2457
2502
|
PlaceOutletComponent.prototype.currentPlace;
|
|
2503
|
+
/**
|
|
2504
|
+
* @type {?}
|
|
2505
|
+
* @private
|
|
2506
|
+
*/
|
|
2507
|
+
PlaceOutletComponent.prototype.myPath;
|
|
2508
|
+
/**
|
|
2509
|
+
* @type {?}
|
|
2510
|
+
* @private
|
|
2511
|
+
*/
|
|
2512
|
+
PlaceOutletComponent.prototype.outletUrlSegment;
|
|
2513
|
+
/**
|
|
2514
|
+
* @type {?}
|
|
2515
|
+
* @private
|
|
2516
|
+
*/
|
|
2517
|
+
PlaceOutletComponent.prototype.outletChildPath;
|
|
2518
|
+
/**
|
|
2519
|
+
* @type {?}
|
|
2520
|
+
* @private
|
|
2521
|
+
*/
|
|
2522
|
+
PlaceOutletComponent.prototype.state;
|
|
2458
2523
|
/**
|
|
2459
2524
|
* @type {?}
|
|
2460
2525
|
* @private
|
|
2461
2526
|
*/
|
|
2462
2527
|
PlaceOutletComponent.prototype.placeService;
|
|
2528
|
+
/**
|
|
2529
|
+
* @type {?}
|
|
2530
|
+
* @private
|
|
2531
|
+
*/
|
|
2532
|
+
PlaceOutletComponent.prototype.activatedRoute;
|
|
2463
2533
|
}
|
|
2464
2534
|
|
|
2465
2535
|
/**
|
|
@@ -2474,7 +2544,7 @@ class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
|
2474
2544
|
TabbedPlaceNavigationComponent.decorators = [
|
|
2475
2545
|
{ type: Component, args: [{
|
|
2476
2546
|
selector: 'angular-ui-powerups-tabbed-place-navigation',
|
|
2477
|
-
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"
|
|
2547
|
+
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span>{{getNav(place).title()}}</span>\n </a>\n</nav>\n",
|
|
2478
2548
|
styles: [""]
|
|
2479
2549
|
}] }
|
|
2480
2550
|
];
|
|
@@ -2543,6 +2613,7 @@ AngularUiPowerupsModule.decorators = [
|
|
|
2543
2613
|
MatInputModule,
|
|
2544
2614
|
MatFormFieldModule,
|
|
2545
2615
|
MatSelectModule,
|
|
2616
|
+
MatTabsModule$1,
|
|
2546
2617
|
PlaceModule,
|
|
2547
2618
|
InteractionModule
|
|
2548
2619
|
],
|
|
@@ -3018,8 +3089,16 @@ class LeavePlaceGuard {
|
|
|
3018
3089
|
canDeactivate(component, currentRoute, currentState, nextState) {
|
|
3019
3090
|
// HACK: this will break with child routes...
|
|
3020
3091
|
/** @type {?} */
|
|
3021
|
-
|
|
3022
|
-
console.log({
|
|
3092
|
+
const path = `/${component.placeDefinition.path}`;
|
|
3093
|
+
console.log({
|
|
3094
|
+
placePath: path,
|
|
3095
|
+
currentRoute: currentRoute.toString(),
|
|
3096
|
+
currentStateUrl: currentState.url,
|
|
3097
|
+
nextStateUrl: nextState.url,
|
|
3098
|
+
currentStateUrlTree: this.router.parseUrl(currentState.url).root.children[PRIMARY_OUTLET].segments,
|
|
3099
|
+
nextStateUrlTree: this.router.parseUrl(nextState.url).root.children[PRIMARY_OUTLET].segments
|
|
3100
|
+
});
|
|
3101
|
+
// nextState is the full path...
|
|
3023
3102
|
if (!nextState.url.startsWith(path)) {
|
|
3024
3103
|
return component.canDeactivate();
|
|
3025
3104
|
}
|
|
@@ -3076,7 +3155,7 @@ class PlaceRouteGuard {
|
|
|
3076
3155
|
// Id snapshot are repesented by 2 url segments
|
|
3077
3156
|
// ID => [{'/basePath', params}, {'id', params}]
|
|
3078
3157
|
// NO ID => [{'/basePath', params}]
|
|
3079
|
-
console.log({
|
|
3158
|
+
// console.log({urlSegments: route.url});
|
|
3080
3159
|
// const snapshot = ParameterSnapshot.create(PlaceComponent.getDefinition(route.component as Constructable<PlaceComponent>), route.paramMap);
|
|
3081
3160
|
// return this.placeService.sanitise(snapshot).then(sanitised => {
|
|
3082
3161
|
// if (sanitised.hasChanged(snapshot)) {
|