@indice/ng-components 0.2.32 → 0.2.33
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/README.md +4 -4
- package/_styles.css +3457 -3457
- package/bundles/indice-ng-components.umd.js +3204 -3198
- package/bundles/indice-ng-components.umd.js.map +1 -1
- package/esm2015/indice-ng-components.js +6 -6
- package/esm2015/lib/controls/avatar-initials/avatar-initials.component.js +47 -47
- package/esm2015/lib/controls/collapsible-panel/collapsible-panel.component.js +20 -20
- package/esm2015/lib/controls/date-picker/date-picker.component.js +217 -217
- package/esm2015/lib/controls/drop-down-menu/drop-down-menu.component.js +62 -62
- package/esm2015/lib/controls/kpi-tile/kpi-tile.component.js +32 -32
- package/esm2015/lib/controls/list-view/list-column.component.js +19 -19
- package/esm2015/lib/controls/list-view/list-details-section.component.js +14 -14
- package/esm2015/lib/controls/list-view/list-tile.component.js +14 -14
- package/esm2015/lib/controls/list-view/list-view-empty-state.component.js +25 -25
- package/esm2015/lib/controls/list-view/list-view.component.js +133 -133
- package/esm2015/lib/controls/pager/pager.component.js +114 -114
- package/esm2015/lib/controls/side-pane/side-pane.component.js +71 -71
- package/esm2015/lib/controls/skeleton-loader/skeleton-loader.component.js +25 -25
- package/esm2015/lib/controls/toaster/toaster-container.component.js +28 -28
- package/esm2015/lib/controls/toaster/toaster.component.js +29 -29
- package/esm2015/lib/controls/toggle/toggle.component.js +56 -56
- package/esm2015/lib/directives/click-outside.directive.js +181 -181
- package/esm2015/lib/directives/dynamic-component-host.directive.js +17 -17
- package/esm2015/lib/helpers/base-list.component.js +182 -182
- package/esm2015/lib/icons.js +30 -30
- package/esm2015/lib/layouts/shell/shell-footer/shell-footer.component.js +17 -17
- package/esm2015/lib/layouts/shell/shell-header/shell-header.component.js +98 -98
- package/esm2015/lib/layouts/shell/shell-layout/shell-layout.component.js +92 -92
- package/esm2015/lib/layouts/views/form-layout/form-layout.component.js +72 -72
- package/esm2015/lib/layouts/views/model-view-layout/model-view-layout.component.js +47 -47
- package/esm2015/lib/layouts/views/side-view-layout/side-view-layout.component.js +73 -73
- package/esm2015/lib/layouts/views/view-layout/view-layout.component.js +87 -87
- package/esm2015/lib/ng-components.module.js +133 -133
- package/esm2015/lib/pages/auth/auth-callback/auth-callback.component.js +74 -74
- package/esm2015/lib/pages/auth/auth-renew/auth-renew.component.js +25 -25
- package/esm2015/lib/pages/auth/logged-out/logged-out.component.js +26 -26
- package/esm2015/lib/pages/http-status/error/error.component.js +15 -15
- package/esm2015/lib/pages/http-status/page-not-found/page-not-found.component.js +14 -14
- package/esm2015/lib/pages/http-status/unauthorized/unauthorized.component.js +22 -22
- package/esm2015/lib/pipes/address.pipe.js +17 -17
- package/esm2015/lib/pipes/duration-format.pipe.js +60 -60
- package/esm2015/lib/services/component-loader/component-loader-options.class.js +8 -8
- package/esm2015/lib/services/component-loader/component-loader.class.js +192 -192
- package/esm2015/lib/services/component-loader/component-loader.factory.js +35 -35
- package/esm2015/lib/services/component-loader/content-ref.class.js +13 -13
- package/esm2015/lib/services/modal-service/modal-backdrop-component.js +44 -44
- package/esm2015/lib/services/modal-service/modal-container-component.js +117 -117
- package/esm2015/lib/services/modal-service/modal-options.class.js +31 -31
- package/esm2015/lib/services/modal-service/modal-service.js +214 -214
- package/esm2015/lib/services/modal-service/modal-styles.class.js +11 -11
- package/esm2015/lib/services/modal-service/modal.class.js +24 -24
- package/esm2015/lib/services/toaster.service.js +23 -23
- package/esm2015/lib/tokens.js +4 -4
- package/esm2015/lib/types.js +104 -104
- package/esm2015/public-api.js +53 -53
- package/fesm2015/indice-ng-components.js +2758 -2758
- package/fesm2015/indice-ng-components.js.map +1 -1
- package/indice-ng-components.d.ts +6 -6
- package/indice-ng-components.metadata.json +1 -1
- package/lib/controls/avatar-initials/avatar-initials.component.d.ts +11 -11
- package/lib/controls/collapsible-panel/collapsible-panel.component.d.ts +7 -7
- package/lib/controls/date-picker/date-picker.component.d.ts +43 -43
- package/lib/controls/drop-down-menu/drop-down-menu.component.d.ts +22 -22
- package/lib/controls/kpi-tile/kpi-tile.component.d.ts +10 -10
- package/lib/controls/list-view/list-column.component.d.ts +6 -6
- package/lib/controls/list-view/list-details-section.component.d.ts +4 -4
- package/lib/controls/list-view/list-tile.component.d.ts +4 -4
- package/lib/controls/list-view/list-view-empty-state.component.d.ts +8 -8
- package/lib/controls/list-view/list-view.component.d.ts +50 -50
- package/lib/controls/pager/pager.component.d.ts +32 -32
- package/lib/controls/side-pane/side-pane.component.d.ts +15 -15
- package/lib/controls/skeleton-loader/skeleton-loader.component.d.ts +8 -8
- package/lib/controls/toaster/toaster-container.component.d.ts +10 -10
- package/lib/controls/toaster/toaster.component.d.ts +12 -12
- package/lib/controls/toggle/toggle.component.d.ts +16 -16
- package/lib/directives/click-outside.directive.d.ts +37 -37
- package/lib/directives/dynamic-component-host.directive.d.ts +6 -6
- package/lib/helpers/base-list.component.d.ts +39 -39
- package/lib/icons.d.ts +28 -28
- package/lib/layouts/shell/shell-footer/shell-footer.component.d.ts +5 -5
- package/lib/layouts/shell/shell-header/shell-header.component.d.ts +33 -33
- package/lib/layouts/shell/shell-layout/shell-layout.component.d.ts +23 -23
- package/lib/layouts/views/form-layout/form-layout.component.d.ts +21 -21
- package/lib/layouts/views/model-view-layout/model-view-layout.component.d.ts +22 -22
- package/lib/layouts/views/side-view-layout/side-view-layout.component.d.ts +24 -24
- package/lib/layouts/views/view-layout/view-layout.component.d.ts +27 -27
- package/lib/ng-components.module.d.ts +7 -7
- package/lib/pages/auth/auth-callback/auth-callback.component.d.ts +11 -11
- package/lib/pages/auth/auth-renew/auth-renew.component.d.ts +9 -9
- package/lib/pages/auth/logged-out/logged-out.component.d.ts +9 -9
- package/lib/pages/http-status/error/error.component.d.ts +5 -5
- package/lib/pages/http-status/page-not-found/page-not-found.component.d.ts +5 -5
- package/lib/pages/http-status/unauthorized/unauthorized.component.d.ts +8 -8
- package/lib/pipes/address.pipe.d.ts +5 -5
- package/lib/pipes/duration-format.pipe.d.ts +5 -5
- package/lib/services/component-loader/component-loader-options.class.d.ts +30 -30
- package/lib/services/component-loader/component-loader.class.d.ts +92 -92
- package/lib/services/component-loader/component-loader.factory.d.ts +21 -21
- package/lib/services/component-loader/content-ref.class.d.ts +12 -12
- package/lib/services/modal-service/modal-backdrop-component.d.ts +17 -17
- package/lib/services/modal-service/modal-container-component.d.ts +30 -30
- package/lib/services/modal-service/modal-options.class.d.ts +77 -77
- package/lib/services/modal-service/modal-service.d.ts +55 -55
- package/lib/services/modal-service/modal-styles.class.d.ts +10 -10
- package/lib/services/modal-service/modal.class.d.ts +40 -40
- package/lib/services/toaster.service.d.ts +8 -8
- package/lib/tokens.d.ts +4 -4
- package/lib/types.d.ts +124 -124
- package/modal.css +157 -157
- package/package.json +1 -1
- package/public-api.d.ts +41 -41
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { Component, Inject, Input } from '@angular/core';
|
|
2
|
-
import { NavigationStart, Router } from '@angular/router';
|
|
3
|
-
import { filter } from 'rxjs/operators';
|
|
4
|
-
import { AuthService } from '@indice/ng-auth';
|
|
5
|
-
import { APP_LINKS, SHELL_CONFIG } from '../../../tokens';
|
|
6
|
-
export class ShellHeaderComponent {
|
|
7
|
-
constructor(authService, router, config, links) {
|
|
8
|
-
this.authService = authService;
|
|
9
|
-
this.router = router;
|
|
10
|
-
this.config = config;
|
|
11
|
-
this.links = links;
|
|
12
|
-
// tslint:disable-next-line:no-input-rename
|
|
13
|
-
this.sectionLinksPath = 'main';
|
|
14
|
-
// tslint:disable-next-line:no-input-rename
|
|
15
|
-
this.profileMenuVisible = true;
|
|
16
|
-
this.showUserNameOnHeader = false;
|
|
17
|
-
this.border = true;
|
|
18
|
-
this.sectionLinks = [];
|
|
19
|
-
this.mobileMenuExpanded = false;
|
|
20
|
-
this.userMenuExpanded = false;
|
|
21
|
-
this.routerSub$ = null;
|
|
22
|
-
this.userSub$ = null;
|
|
23
|
-
this.statusSub$ = null;
|
|
24
|
-
this.user = null;
|
|
25
|
-
this.avatarName = null;
|
|
26
|
-
this.routeSubject = this.router.events.pipe(filter((event) => event instanceof NavigationStart));
|
|
27
|
-
this.userSubject = this.authService.userStatus;
|
|
28
|
-
}
|
|
29
|
-
ngOnDestroy() {
|
|
30
|
-
console.log(this.showUserNameOnHeader);
|
|
31
|
-
if (this.routerSub$) {
|
|
32
|
-
this.routerSub$.unsubscribe();
|
|
33
|
-
}
|
|
34
|
-
// TODO: check authenticated user here before we start polling server status
|
|
35
|
-
if (this.statusSub$) {
|
|
36
|
-
this.statusSub$.unsubscribe();
|
|
37
|
-
}
|
|
38
|
-
if (this.userSub$) {
|
|
39
|
-
this.userSub$.unsubscribe();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
ngOnInit() {
|
|
43
|
-
this.sectionLinks = this.links[this.sectionLinksPath];
|
|
44
|
-
this.routerSub$ = this.routeSubject.subscribe((event) => {
|
|
45
|
-
this.mobileMenuExpanded = false;
|
|
46
|
-
this.userMenuExpanded = false;
|
|
47
|
-
});
|
|
48
|
-
this.authService.loadUser().then((user) => {
|
|
49
|
-
console.log(user);
|
|
50
|
-
this.setCurrentUser(user);
|
|
51
|
-
}, (error) => {
|
|
52
|
-
//console.log(error);
|
|
53
|
-
});
|
|
54
|
-
// Detect user changes and display / or not user info accordingly...
|
|
55
|
-
this.userSub$ = this.userSubject.subscribe((user) => {
|
|
56
|
-
//console.log('ShellHeaderComponent user subscription');
|
|
57
|
-
this.setCurrentUser(user);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
// tslint:disable-next-line:typedef
|
|
61
|
-
onClickOutside($event) {
|
|
62
|
-
this.userMenuExpanded = false;
|
|
63
|
-
}
|
|
64
|
-
signin(event) {
|
|
65
|
-
if (event) {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
}
|
|
68
|
-
this.authService.startAuthentication();
|
|
69
|
-
}
|
|
70
|
-
setCurrentUser(user) {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
this.user = user;
|
|
73
|
-
if (this.user && this.user.profile) {
|
|
74
|
-
this.avatarName = `${(_a = this.user.profile.given_name) === null || _a === void 0 ? void 0 : _a.charAt(0)}${(_b = this.user.profile.family_name) === null || _b === void 0 ? void 0 : _b.charAt(0)}`;
|
|
75
|
-
//console.log('load user', this.avatarName);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
ShellHeaderComponent.decorators = [
|
|
80
|
-
{ type: Component, args: [{
|
|
81
|
-
// tslint:disable-next-line:component-selector
|
|
82
|
-
selector: 'lib-shell-header',
|
|
83
|
-
template: "<nav>\n <div class=\"shell-header-paddings\">\n <div [class]=\"border ? 'shell-header-border' : ''\">\n <div class=\"shell-header-menu-container\">\n <div class=\"shell-header-links-no-grow-container\">\n <div>\n <a href=\"#\"\n [routerLink]=\"['/']\"><img class=\"h-8 w-8\"\n style=\"width:2rem; height: 2rem;\"\n [src]=\"config.appLogo\"\n [alt]=\"config.appLogoAlt\" /></a>\n </div>\n </div>\n\n <div class=\"shell-header-link-container\">\n <ng-container *ngFor=\"let link of sectionLinks\">\n <a href=\"#\"\n [routerLink]=\"[link.path]\"\n [attr.target]=\"link.external ? '_blank' : '_self'\"\n [routerLinkActive]=\"['nav-link-active']\"\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\n class=\"nav-link\">\n {{ link.text }}\n </a>\n </ng-container>\n </div>\n\n <div class=\"shell-header-md-visible\">\n <div class=\"shell-header-links-no-grow-container\">\n\n <ng-container *ngFor=\"let link of links.profileActions\">\n <a class=\"shell-header-menu-rounded-button\"\n (clickOutside)=\"onClickOutside($event)\"\n [attr.href]=\"link.path\"\n [attr.target]=\"link.external ? '_blank' : '_self'\">\n <span class=\"sr-only\">{{ link.text }}</span>\n <i *ngIf=\"link.icon\"\n [class]=\"link.icon\"></i>\n </a>\n </ng-container>\n\n <!-- Profile dropdown -->\n <div class=\"ml-2 relative\"\n (clickOutside)=\"onClickOutside($event)\"\n *ngIf=\"profileMenuVisible\">\n <div [ngClass]=\"{'shell-header-profile': showUserNameOnHeader}\">\n <div *ngIf=\"user && showUserNameOnHeader\"\n class=\"shell-header-profile-userName\">\n {{ user.profile.name }}\n </div>\n <button type=\"button\"\n *ngIf=\"user\"\n (click)=\"userMenuExpanded = !userMenuExpanded\"\n class=\"shell-header-profile-dropdown-button\"\n id=\"user-menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\">\n <span class=\"sr-only\">Open user menu</span>\n <span class=\"avatar-container\">\n <span class=\"avatar-text\">{{this.avatarName}}</span>\n </span>\n </button>\n\n <button type=\"button\"\n *ngIf=\"!user\"\n (click)=\"signin(null)\"\n class=\"shell-header-profile-dropdown-button\"\n id=\"user-menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\">\n <span class=\"sr-only\">sign in</span>\n <span class=\"avatar-container\">\n <span class=\"avatar-text\"><i class=\"ms-Icon ms-Icon--Signin\"></i></span>\n </span>\n </button>\n\n <div *ngIf=\"userMenuExpanded\"\n [ngClass]=\"showUserNameOnHeader ? 'shell-header-profile-dropdown-with-username' : 'shell-header-profile-dropdown'\"\n role=\"menu\"\n aria-orientation=\"vertical\"\n aria-labelledby=\"user-menu\">\n <!-- <a href=\"#\" class=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">\u0391\u03C0\u03BF\u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7</a> -->\n <ng-container *ngFor=\"let link of links.profile\">\n <a [attr.href]=\"link.path\"\n [attr.target]=\"link.external ? '_blank' : '_self'\"\n [routerLinkActive]=\"['nav-link-profile-active']\"\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\n class=\"nav-link-profile\">\n {{ link.text }}\n </a>\n </ng-container>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mobile-menu-button-container\">\n <!-- Mobile menu button -->\n <button type=\"button\"\n (click)=\"mobileMenuExpanded = !mobileMenuExpanded\"\n class=\"mobile-menu-button\"\n aria-controls=\"mobile-menu\"\n [attr.aria-expanded]=\"mobileMenuExpanded\">\n <span class=\"sr-only\">Open main menu</span>\n <!--Heroicon name: outline/menu Menu open: \"hidden\", Menu closed: \"block\"-->\n <svg class=\"block h-6 w-6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\">\n <path stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n <!--Heroicon name: outline/x Menu open: \"block\", Menu closed: \"hidden\"-->\n <svg class=\"hidden h-6 w-6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\">\n <path stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n </div>\n </div>\n </div>\n <!-- Mobile menu, show/hide based on menu state. -->\n <div class=\"mobile-menu-container\"\n *ngIf=\"mobileMenuExpanded\"\n id=\"mobile-menu\">\n <div class=\"mobile-menu-link-container\">\n <ng-container *ngFor=\"let link of sectionLinks\">\n <a [attr.href]=\"link.path\"\n [attr.target]=\"link.external ? '_blank' : '_self'\"\n [routerLinkActive]=\"['nav-link-mobile-active']\"\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\n class=\"nav-link-mobile\">\n {{ link.text }}\n </a>\n </ng-container>\n <ng-container *ngIf=\"!user\">\n <a href=\"#\"\n (click)=\"signin($event)\"\n class=\"nav-link-mobile\">\n <i class=\"ms-Icon ms-Icon--Signin mr-2\"></i>\u03A3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7\n </a>\n </ng-container>\n </div>\n <div class=\"mobile-menu-user-info-container\"\n *ngIf=\"user\">\n <div class=\"mobile-menu-user-info-container-inner\">\n <div class=\"flex-shrink-0\">\n <span class=\"mobile-menu-avatar-container\">\n <span class=\"mobile-menu-avatar-name\">{{ this.avatarName }}</span>\n </span>\n </div>\n <div class=\"ml-3\">\n <div class=\"mobile-menu-user-name\">{{ user.profile.name }}</div>\n <div class=\"mobile-menu-user-email\">{{ user.profile.email }}</div>\n </div>\n <button class=\"mobile-menu-rounded-button\">\n <span class=\"sr-only\">View notifications</span>\n <!-- Heroicon name: outline/bell -->\n <svg class=\"mobile-menu-rounded-button-icon-style\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\">\n <path stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9\" />\n </svg>\n </button>\n </div>\n <div class=\"mobile-menu-link-container\">\n <ng-container *ngFor=\"let link of links.profile\">\n <a [attr.href]=\"link.path\"\n [attr.target]=\"link.external ? '_blank' : '_self'\"\n [routerLinkActive]=\"['nav-link-mobile-active']\"\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\n class=\"nav-link-mobile\">\n {{ link.text }}\n </a>\n </ng-container>\n <!-- <a href=\"#\" class=\"block px-3 py-2 rounded-sm text-base font-medium text-gray-400 hover:text-white hover:bg-gray-700\">\u0391\u03C0\u03BF\u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7</a> -->\n </div>\n </div>\n </div>\n</nav>"
|
|
84
|
-
},] }
|
|
85
|
-
];
|
|
86
|
-
ShellHeaderComponent.ctorParameters = () => [
|
|
87
|
-
{ type: AuthService, decorators: [{ type: Inject, args: [AuthService,] }] },
|
|
88
|
-
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
89
|
-
{ type: undefined, decorators: [{ type: Inject, args: [SHELL_CONFIG,] }] },
|
|
90
|
-
{ type: undefined, decorators: [{ type: Inject, args: [APP_LINKS,] }] }
|
|
91
|
-
];
|
|
92
|
-
ShellHeaderComponent.propDecorators = {
|
|
93
|
-
sectionLinksPath: [{ type: Input, args: ['section-links',] }],
|
|
94
|
-
profileMenuVisible: [{ type: Input, args: ['profile-menu',] }],
|
|
95
|
-
showUserNameOnHeader: [{ type: Input, args: ['show-userName',] }],
|
|
96
|
-
border: [{ type: Input }]
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Component, Inject, Input } from '@angular/core';
|
|
2
|
+
import { NavigationStart, Router } from '@angular/router';
|
|
3
|
+
import { filter } from 'rxjs/operators';
|
|
4
|
+
import { AuthService } from '@indice/ng-auth';
|
|
5
|
+
import { APP_LINKS, SHELL_CONFIG } from '../../../tokens';
|
|
6
|
+
export class ShellHeaderComponent {
|
|
7
|
+
constructor(authService, router, config, links) {
|
|
8
|
+
this.authService = authService;
|
|
9
|
+
this.router = router;
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.links = links;
|
|
12
|
+
// tslint:disable-next-line:no-input-rename
|
|
13
|
+
this.sectionLinksPath = 'main';
|
|
14
|
+
// tslint:disable-next-line:no-input-rename
|
|
15
|
+
this.profileMenuVisible = true;
|
|
16
|
+
this.showUserNameOnHeader = false;
|
|
17
|
+
this.border = true;
|
|
18
|
+
this.sectionLinks = [];
|
|
19
|
+
this.mobileMenuExpanded = false;
|
|
20
|
+
this.userMenuExpanded = false;
|
|
21
|
+
this.routerSub$ = null;
|
|
22
|
+
this.userSub$ = null;
|
|
23
|
+
this.statusSub$ = null;
|
|
24
|
+
this.user = null;
|
|
25
|
+
this.avatarName = null;
|
|
26
|
+
this.routeSubject = this.router.events.pipe(filter((event) => event instanceof NavigationStart));
|
|
27
|
+
this.userSubject = this.authService.userStatus;
|
|
28
|
+
}
|
|
29
|
+
ngOnDestroy() {
|
|
30
|
+
console.log(this.showUserNameOnHeader);
|
|
31
|
+
if (this.routerSub$) {
|
|
32
|
+
this.routerSub$.unsubscribe();
|
|
33
|
+
}
|
|
34
|
+
// TODO: check authenticated user here before we start polling server status
|
|
35
|
+
if (this.statusSub$) {
|
|
36
|
+
this.statusSub$.unsubscribe();
|
|
37
|
+
}
|
|
38
|
+
if (this.userSub$) {
|
|
39
|
+
this.userSub$.unsubscribe();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ngOnInit() {
|
|
43
|
+
this.sectionLinks = this.links[this.sectionLinksPath];
|
|
44
|
+
this.routerSub$ = this.routeSubject.subscribe((event) => {
|
|
45
|
+
this.mobileMenuExpanded = false;
|
|
46
|
+
this.userMenuExpanded = false;
|
|
47
|
+
});
|
|
48
|
+
this.authService.loadUser().then((user) => {
|
|
49
|
+
console.log(user);
|
|
50
|
+
this.setCurrentUser(user);
|
|
51
|
+
}, (error) => {
|
|
52
|
+
//console.log(error);
|
|
53
|
+
});
|
|
54
|
+
// Detect user changes and display / or not user info accordingly...
|
|
55
|
+
this.userSub$ = this.userSubject.subscribe((user) => {
|
|
56
|
+
//console.log('ShellHeaderComponent user subscription');
|
|
57
|
+
this.setCurrentUser(user);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// tslint:disable-next-line:typedef
|
|
61
|
+
onClickOutside($event) {
|
|
62
|
+
this.userMenuExpanded = false;
|
|
63
|
+
}
|
|
64
|
+
signin(event) {
|
|
65
|
+
if (event) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
this.authService.startAuthentication();
|
|
69
|
+
}
|
|
70
|
+
setCurrentUser(user) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
this.user = user;
|
|
73
|
+
if (this.user && this.user.profile) {
|
|
74
|
+
this.avatarName = `${(_a = this.user.profile.given_name) === null || _a === void 0 ? void 0 : _a.charAt(0)}${(_b = this.user.profile.family_name) === null || _b === void 0 ? void 0 : _b.charAt(0)}`;
|
|
75
|
+
//console.log('load user', this.avatarName);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
ShellHeaderComponent.decorators = [
|
|
80
|
+
{ type: Component, args: [{
|
|
81
|
+
// tslint:disable-next-line:component-selector
|
|
82
|
+
selector: 'lib-shell-header',
|
|
83
|
+
template: "<nav>\r\n <div class=\"shell-header-paddings\">\r\n <div [class]=\"border ? 'shell-header-border' : ''\">\r\n <div class=\"shell-header-menu-container\">\r\n <div class=\"shell-header-links-no-grow-container\">\r\n <div>\r\n <a href=\"#\"\r\n [routerLink]=\"['/']\"><img class=\"h-8 w-8\"\r\n style=\"width:2rem; height: 2rem;\"\r\n [src]=\"config.appLogo\"\r\n [alt]=\"config.appLogoAlt\" /></a>\r\n </div>\r\n </div>\r\n\r\n <div class=\"shell-header-link-container\">\r\n <ng-container *ngFor=\"let link of sectionLinks\">\r\n <a href=\"#\"\r\n [routerLink]=\"[link.path]\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\"\r\n [routerLinkActive]=\"['nav-link-active']\"\r\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\r\n class=\"nav-link\">\r\n {{ link.text }}\r\n </a>\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"shell-header-md-visible\">\r\n <div class=\"shell-header-links-no-grow-container\">\r\n\r\n <ng-container *ngFor=\"let link of links.profileActions\">\r\n <a class=\"shell-header-menu-rounded-button\"\r\n (clickOutside)=\"onClickOutside($event)\"\r\n [attr.href]=\"link.path\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\">\r\n <span class=\"sr-only\">{{ link.text }}</span>\r\n <i *ngIf=\"link.icon\"\r\n [class]=\"link.icon\"></i>\r\n </a>\r\n </ng-container>\r\n\r\n <!-- Profile dropdown -->\r\n <div class=\"ml-2 relative\"\r\n (clickOutside)=\"onClickOutside($event)\"\r\n *ngIf=\"profileMenuVisible\">\r\n <div [ngClass]=\"{'shell-header-profile': showUserNameOnHeader}\">\r\n <div *ngIf=\"user && showUserNameOnHeader\"\r\n class=\"shell-header-profile-userName\">\r\n {{ user.profile.name }}\r\n </div>\r\n <button type=\"button\"\r\n *ngIf=\"user\"\r\n (click)=\"userMenuExpanded = !userMenuExpanded\"\r\n class=\"shell-header-profile-dropdown-button\"\r\n id=\"user-menu\"\r\n aria-expanded=\"false\"\r\n aria-haspopup=\"true\">\r\n <span class=\"sr-only\">Open user menu</span>\r\n <span class=\"avatar-container\">\r\n <span class=\"avatar-text\">{{this.avatarName}}</span>\r\n </span>\r\n </button>\r\n\r\n <button type=\"button\"\r\n *ngIf=\"!user\"\r\n (click)=\"signin(null)\"\r\n class=\"shell-header-profile-dropdown-button\"\r\n id=\"user-menu\"\r\n aria-expanded=\"false\"\r\n aria-haspopup=\"true\">\r\n <span class=\"sr-only\">sign in</span>\r\n <span class=\"avatar-container\">\r\n <span class=\"avatar-text\"><i class=\"ms-Icon ms-Icon--Signin\"></i></span>\r\n </span>\r\n </button>\r\n\r\n <div *ngIf=\"userMenuExpanded\"\r\n [ngClass]=\"showUserNameOnHeader ? 'shell-header-profile-dropdown-with-username' : 'shell-header-profile-dropdown'\"\r\n role=\"menu\"\r\n aria-orientation=\"vertical\"\r\n aria-labelledby=\"user-menu\">\r\n <!-- <a href=\"#\" class=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">\u0391\u03C0\u03BF\u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7</a> -->\r\n <ng-container *ngFor=\"let link of links.profile\">\r\n <a [attr.href]=\"link.path\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\"\r\n [routerLinkActive]=\"['nav-link-profile-active']\"\r\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\r\n class=\"nav-link-profile\">\r\n {{ link.text }}\r\n </a>\r\n </ng-container>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mobile-menu-button-container\">\r\n <!-- Mobile menu button -->\r\n <button type=\"button\"\r\n (click)=\"mobileMenuExpanded = !mobileMenuExpanded\"\r\n class=\"mobile-menu-button\"\r\n aria-controls=\"mobile-menu\"\r\n [attr.aria-expanded]=\"mobileMenuExpanded\">\r\n <span class=\"sr-only\">Open main menu</span>\r\n <!--Heroicon name: outline/menu Menu open: \"hidden\", Menu closed: \"block\"-->\r\n <svg class=\"block h-6 w-6\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M4 6h16M4 12h16M4 18h16\" />\r\n </svg>\r\n <!--Heroicon name: outline/x Menu open: \"block\", Menu closed: \"hidden\"-->\r\n <svg class=\"hidden h-6 w-6\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Mobile menu, show/hide based on menu state. -->\r\n <div class=\"mobile-menu-container\"\r\n *ngIf=\"mobileMenuExpanded\"\r\n id=\"mobile-menu\">\r\n <div class=\"mobile-menu-link-container\">\r\n <ng-container *ngFor=\"let link of sectionLinks\">\r\n <a [attr.href]=\"link.path\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\"\r\n [routerLinkActive]=\"['nav-link-mobile-active']\"\r\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\r\n class=\"nav-link-mobile\">\r\n {{ link.text }}\r\n </a>\r\n </ng-container>\r\n <ng-container *ngIf=\"!user\">\r\n <a href=\"#\"\r\n (click)=\"signin($event)\"\r\n class=\"nav-link-mobile\">\r\n <i class=\"ms-Icon ms-Icon--Signin mr-2\"></i>\u03A3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7\r\n </a>\r\n </ng-container>\r\n </div>\r\n <div class=\"mobile-menu-user-info-container\"\r\n *ngIf=\"user\">\r\n <div class=\"mobile-menu-user-info-container-inner\">\r\n <div class=\"flex-shrink-0\">\r\n <span class=\"mobile-menu-avatar-container\">\r\n <span class=\"mobile-menu-avatar-name\">{{ this.avatarName }}</span>\r\n </span>\r\n </div>\r\n <div class=\"ml-3\">\r\n <div class=\"mobile-menu-user-name\">{{ user.profile.name }}</div>\r\n <div class=\"mobile-menu-user-email\">{{ user.profile.email }}</div>\r\n </div>\r\n <button class=\"mobile-menu-rounded-button\">\r\n <span class=\"sr-only\">View notifications</span>\r\n <!-- Heroicon name: outline/bell -->\r\n <svg class=\"mobile-menu-rounded-button-icon-style\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9\" />\r\n </svg>\r\n </button>\r\n </div>\r\n <div class=\"mobile-menu-link-container\">\r\n <ng-container *ngFor=\"let link of links.profile\">\r\n <a [attr.href]=\"link.path\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\"\r\n [routerLinkActive]=\"['nav-link-mobile-active']\"\r\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\r\n class=\"nav-link-mobile\">\r\n {{ link.text }}\r\n </a>\r\n </ng-container>\r\n <!-- <a href=\"#\" class=\"block px-3 py-2 rounded-sm text-base font-medium text-gray-400 hover:text-white hover:bg-gray-700\">\u0391\u03C0\u03BF\u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7</a> -->\r\n </div>\r\n </div>\r\n </div>\r\n</nav>"
|
|
84
|
+
},] }
|
|
85
|
+
];
|
|
86
|
+
ShellHeaderComponent.ctorParameters = () => [
|
|
87
|
+
{ type: AuthService, decorators: [{ type: Inject, args: [AuthService,] }] },
|
|
88
|
+
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
89
|
+
{ type: undefined, decorators: [{ type: Inject, args: [SHELL_CONFIG,] }] },
|
|
90
|
+
{ type: undefined, decorators: [{ type: Inject, args: [APP_LINKS,] }] }
|
|
91
|
+
];
|
|
92
|
+
ShellHeaderComponent.propDecorators = {
|
|
93
|
+
sectionLinksPath: [{ type: Input, args: ['section-links',] }],
|
|
94
|
+
profileMenuVisible: [{ type: Input, args: ['profile-menu',] }],
|
|
95
|
+
showUserNameOnHeader: [{ type: Input, args: ['show-userName',] }],
|
|
96
|
+
border: [{ type: Input }]
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hlbGwtaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25nLWNvbXBvbmVudHMvc3JjL2xpYi9sYXlvdXRzL3NoZWxsL3NoZWxsLWhlYWRlci9zaGVsbC1oZWFkZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFNUUsT0FBTyxFQUFTLGVBQWUsRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNqRSxPQUFPLEVBQUUsTU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N1cnJlbnRVc2VyKHVzZXIpO1xyXG4gICAgfSk7XHJcbiAgfVxyXG5cclxuICAvLyB0c2xpbnQ6ZGlzYWJsZS1uZXh0LWxpbmU6dHlwZWRlZlxyXG4gIHB1YmxpYyBvbkNsaWNrT3V0c2lkZSgkZXZlbnQ6IGFueSkge1xyXG4gICAgdGhpcy51c2VyTWVudUV4cGFuZGVkID0gZmFsc2U7XHJcbiAgfVxyXG5cclxuICBwdWJsaWMgc2lnbmluKGV2ZW50OiBhbnkgfCBudWxsIHwgdW5kZWZpbmVkKTogdm9pZCB7XHJcbiAgICBpZiAoZXZlbnQpIHtcclxuICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcclxuICAgIH1cclxuICAgIHRoaXMuYXV0aFNlcnZpY2Uuc3RhcnRBdXRoZW50aWNhdGlvbigpO1xyXG4gIH1cclxuXHJcbiAgcHJpdmF0ZSBzZXRDdXJyZW50VXNlcih1c2VyOiBhbnkpOiB2b2lkIHtcclxuICAgIHRoaXMudXNlciA9IHVzZXI7XHJcbiAgICBpZiAodGhpcy51c2VyICYmIHRoaXMudXNlci5wcm9maWxlKSB7XHJcbiAgICAgIHRoaXMuYXZhdGFyTmFtZSA9IGAke3RoaXMudXNlci5wcm9maWxlLmdpdmVuX25hbWU/LmNoYXJBdCgwKX0ke3RoaXMudXNlci5wcm9maWxlLmZhbWlseV9uYW1lPy5jaGFyQXQoMCl9YDtcclxuICAgICAgLy9jb25zb2xlLmxvZygnbG9hZCB1c2VyJywgdGhpcy5hdmF0YXJOYW1lKTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { SHELL_CONFIG } from './../../../tokens';
|
|
2
|
-
import { DefaultShellConfig } from './../../../types';
|
|
3
|
-
import { Component, Inject, ViewChildren } from '@angular/core';
|
|
4
|
-
import { DOCUMENT, Location } from '@angular/common';
|
|
5
|
-
import { ActivationStart, Router } from '@angular/router';
|
|
6
|
-
import { filter } from 'rxjs/operators';
|
|
7
|
-
import { DynamicComponentHostDirective } from '../../../directives/dynamic-component-host.directive';
|
|
8
|
-
import { ComponentLoaderFactory } from '../../../services/component-loader/component-loader.factory';
|
|
9
|
-
export class ShellLayoutComponent {
|
|
10
|
-
constructor(document, router, location, config, componentLoaderFactory) {
|
|
11
|
-
this.document = document;
|
|
12
|
-
this.router = router;
|
|
13
|
-
this.location = location;
|
|
14
|
-
this.config = config;
|
|
15
|
-
this.componentLoaderFactory = componentLoaderFactory;
|
|
16
|
-
this.dynamicComponentHosts = null;
|
|
17
|
-
this.showRightPaneSM = false;
|
|
18
|
-
this.routerSub$ = null;
|
|
19
|
-
this.activeConfig = new DefaultShellConfig();
|
|
20
|
-
if (!config) {
|
|
21
|
-
config = new DefaultShellConfig();
|
|
22
|
-
}
|
|
23
|
-
this.activeConfig = config;
|
|
24
|
-
}
|
|
25
|
-
ngOnInit() {
|
|
26
|
-
this.routerSub$ = this.router.events.pipe(filter((event) => event instanceof ActivationStart)).subscribe((e) => {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f;
|
|
28
|
-
// console.log('ShellLayoutComponent ActivationStart', e);
|
|
29
|
-
if ((_a = e) === null || _a === void 0 ? void 0 : _a.snapshot) {
|
|
30
|
-
// console.log('ShellLayoutComponent ActivationStart snapshot', (e as ActivationStart)?.snapshot);
|
|
31
|
-
if ((_c = (_b = e) === null || _b === void 0 ? void 0 : _b.snapshot) === null || _c === void 0 ? void 0 : _c.data) {
|
|
32
|
-
// console.log('ShellLayoutComponent ActivationStart snapshot data', (e as ActivationStart)?.snapshot.data);
|
|
33
|
-
if ((_e = (_d = e) === null || _d === void 0 ? void 0 : _d.snapshot) === null || _e === void 0 ? void 0 : _e.data.shell) {
|
|
34
|
-
// console.log('ShellLayoutComponent ActivationStart snapshot data shell params',
|
|
35
|
-
// (e as ActivationStart)?.snapshot.data.shell);
|
|
36
|
-
this.activeConfig = (_f = e) === null || _f === void 0 ? void 0 : _f.snapshot.data.shell;
|
|
37
|
-
// console.log('ShellLayoutComponent activeConfig from route: ', this.activeConfig);
|
|
38
|
-
if (this.activeConfig.customHeaderComponent) {
|
|
39
|
-
this.initCustomComponents();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.activeConfig = this.config ? this.config : new DefaultShellConfig();
|
|
44
|
-
// console.log('ShellLayoutComponent default activeConfig: ', this.activeConfig);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
ngAfterViewInit() {
|
|
51
|
-
this.initCustomComponents();
|
|
52
|
-
}
|
|
53
|
-
initCustomComponents() {
|
|
54
|
-
if (this.dynamicComponentHosts && this.dynamicComponentHosts.length > 0) {
|
|
55
|
-
this.loadCustomComponent(this.dynamicComponentHosts.find((_) => _.hostName === 'Header'));
|
|
56
|
-
// since you're not using it...
|
|
57
|
-
// this.loadCustomComponent(this.dynamicComponentHosts.find(_ => _.hostName === 'Footer'));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
ngOnDestroy() {
|
|
61
|
-
if (this.routerSub$) {
|
|
62
|
-
this.routerSub$.unsubscribe();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
loadCustomComponent(host) {
|
|
66
|
-
if (host) {
|
|
67
|
-
const viewContainerRef = host.viewContainerRef;
|
|
68
|
-
if (viewContainerRef && this.activeConfig.customHeaderComponent) {
|
|
69
|
-
const clf = this.componentLoaderFactory.createLoader(viewContainerRef);
|
|
70
|
-
const headerCompRef = clf.attach(this.activeConfig.customHeaderComponent).to(viewContainerRef.element).show();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
ShellLayoutComponent.decorators = [
|
|
76
|
-
{ type: Component, args: [{
|
|
77
|
-
// tslint:disable-next-line:component-selector
|
|
78
|
-
selector: 'lib-shell-layout',
|
|
79
|
-
template: "<div class=\"shell-container active-side-pane\">\n <div class=\"shell-header-container\"\n *ngIf=\"activeConfig.showHeader\">\n <div [class]=\"activeConfig.fluid ? 'shell-header-container-inner-fluid' : 'shell-header-container-inner'\">\n <ng-container *ngIf=\"activeConfig.customHeaderComponent\">\n <div appDynamicComponentHost\n hostName=\"Header\"></div>\n </ng-container>\n <lib-shell-header *ngIf=\"!activeConfig.customHeaderComponent\"\n [show-userName]=\"activeConfig.showUserNameOnHeader\"></lib-shell-header>\n </div>\n </div>\n <main [class]=\"activeConfig.showHeader ? 'shell-content-container' : 'shell-content-container-no-header'\">\n <div [class]=\"activeConfig.fluid ? 'shell-content-container-inner-fluid' : 'shell-content-container-inner'\">\n <router-outlet></router-outlet>\n </div>\n </main>\n <div class=\"shell-footer-container\"\n *ngIf=\"activeConfig.showFooter\">\n <div [class]=\"activeConfig.fluid ? 'shell-footer-container-inner-fluid' : 'shell-footer-container-inner'\">\n <ng-container *ngIf=\"activeConfig.customFooterComponent\">\n <div appDynamicComponentHost\n hostName=\"Footer\"></div>\n </ng-container>\n <lib-shell-footer *ngIf=\"!activeConfig.customFooterComponent\"></lib-shell-footer>\n </div>\n </div>\n <lib-side-pane #rightPane>\n <router-outlet name=\"rightpane\"\n (activate)=\"rightPane.onSidePaneActivated($event)\"\n (deactivate)=\"rightPane.onSidePaneDeactivated($event)\"></router-outlet>\n </lib-side-pane>\n <lib-toaster-container></lib-toaster-container>\n</div>"
|
|
80
|
-
},] }
|
|
81
|
-
];
|
|
82
|
-
ShellLayoutComponent.ctorParameters = () => [
|
|
83
|
-
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
84
|
-
{ type: Router },
|
|
85
|
-
{ type: Location },
|
|
86
|
-
{ type: undefined, decorators: [{ type: Inject, args: [SHELL_CONFIG,] }] },
|
|
87
|
-
{ type: ComponentLoaderFactory }
|
|
88
|
-
];
|
|
89
|
-
ShellLayoutComponent.propDecorators = {
|
|
90
|
-
dynamicComponentHosts: [{ type: ViewChildren, args: [DynamicComponentHostDirective,] }]
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { SHELL_CONFIG } from './../../../tokens';
|
|
2
|
+
import { DefaultShellConfig } from './../../../types';
|
|
3
|
+
import { Component, Inject, ViewChildren } from '@angular/core';
|
|
4
|
+
import { DOCUMENT, Location } from '@angular/common';
|
|
5
|
+
import { ActivationStart, Router } from '@angular/router';
|
|
6
|
+
import { filter } from 'rxjs/operators';
|
|
7
|
+
import { DynamicComponentHostDirective } from '../../../directives/dynamic-component-host.directive';
|
|
8
|
+
import { ComponentLoaderFactory } from '../../../services/component-loader/component-loader.factory';
|
|
9
|
+
export class ShellLayoutComponent {
|
|
10
|
+
constructor(document, router, location, config, componentLoaderFactory) {
|
|
11
|
+
this.document = document;
|
|
12
|
+
this.router = router;
|
|
13
|
+
this.location = location;
|
|
14
|
+
this.config = config;
|
|
15
|
+
this.componentLoaderFactory = componentLoaderFactory;
|
|
16
|
+
this.dynamicComponentHosts = null;
|
|
17
|
+
this.showRightPaneSM = false;
|
|
18
|
+
this.routerSub$ = null;
|
|
19
|
+
this.activeConfig = new DefaultShellConfig();
|
|
20
|
+
if (!config) {
|
|
21
|
+
config = new DefaultShellConfig();
|
|
22
|
+
}
|
|
23
|
+
this.activeConfig = config;
|
|
24
|
+
}
|
|
25
|
+
ngOnInit() {
|
|
26
|
+
this.routerSub$ = this.router.events.pipe(filter((event) => event instanceof ActivationStart)).subscribe((e) => {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
// console.log('ShellLayoutComponent ActivationStart', e);
|
|
29
|
+
if ((_a = e) === null || _a === void 0 ? void 0 : _a.snapshot) {
|
|
30
|
+
// console.log('ShellLayoutComponent ActivationStart snapshot', (e as ActivationStart)?.snapshot);
|
|
31
|
+
if ((_c = (_b = e) === null || _b === void 0 ? void 0 : _b.snapshot) === null || _c === void 0 ? void 0 : _c.data) {
|
|
32
|
+
// console.log('ShellLayoutComponent ActivationStart snapshot data', (e as ActivationStart)?.snapshot.data);
|
|
33
|
+
if ((_e = (_d = e) === null || _d === void 0 ? void 0 : _d.snapshot) === null || _e === void 0 ? void 0 : _e.data.shell) {
|
|
34
|
+
// console.log('ShellLayoutComponent ActivationStart snapshot data shell params',
|
|
35
|
+
// (e as ActivationStart)?.snapshot.data.shell);
|
|
36
|
+
this.activeConfig = (_f = e) === null || _f === void 0 ? void 0 : _f.snapshot.data.shell;
|
|
37
|
+
// console.log('ShellLayoutComponent activeConfig from route: ', this.activeConfig);
|
|
38
|
+
if (this.activeConfig.customHeaderComponent) {
|
|
39
|
+
this.initCustomComponents();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.activeConfig = this.config ? this.config : new DefaultShellConfig();
|
|
44
|
+
// console.log('ShellLayoutComponent default activeConfig: ', this.activeConfig);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
ngAfterViewInit() {
|
|
51
|
+
this.initCustomComponents();
|
|
52
|
+
}
|
|
53
|
+
initCustomComponents() {
|
|
54
|
+
if (this.dynamicComponentHosts && this.dynamicComponentHosts.length > 0) {
|
|
55
|
+
this.loadCustomComponent(this.dynamicComponentHosts.find((_) => _.hostName === 'Header'));
|
|
56
|
+
// since you're not using it...
|
|
57
|
+
// this.loadCustomComponent(this.dynamicComponentHosts.find(_ => _.hostName === 'Footer'));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
ngOnDestroy() {
|
|
61
|
+
if (this.routerSub$) {
|
|
62
|
+
this.routerSub$.unsubscribe();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
loadCustomComponent(host) {
|
|
66
|
+
if (host) {
|
|
67
|
+
const viewContainerRef = host.viewContainerRef;
|
|
68
|
+
if (viewContainerRef && this.activeConfig.customHeaderComponent) {
|
|
69
|
+
const clf = this.componentLoaderFactory.createLoader(viewContainerRef);
|
|
70
|
+
const headerCompRef = clf.attach(this.activeConfig.customHeaderComponent).to(viewContainerRef.element).show();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
ShellLayoutComponent.decorators = [
|
|
76
|
+
{ type: Component, args: [{
|
|
77
|
+
// tslint:disable-next-line:component-selector
|
|
78
|
+
selector: 'lib-shell-layout',
|
|
79
|
+
template: "<div class=\"shell-container active-side-pane\">\r\n <div class=\"shell-header-container\"\r\n *ngIf=\"activeConfig.showHeader\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-header-container-inner-fluid' : 'shell-header-container-inner'\">\r\n <ng-container *ngIf=\"activeConfig.customHeaderComponent\">\r\n <div appDynamicComponentHost\r\n hostName=\"Header\"></div>\r\n </ng-container>\r\n <lib-shell-header *ngIf=\"!activeConfig.customHeaderComponent\"\r\n [show-userName]=\"activeConfig.showUserNameOnHeader\"></lib-shell-header>\r\n </div>\r\n </div>\r\n <main [class]=\"activeConfig.showHeader ? 'shell-content-container' : 'shell-content-container-no-header'\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-content-container-inner-fluid' : 'shell-content-container-inner'\">\r\n <router-outlet></router-outlet>\r\n </div>\r\n </main>\r\n <div class=\"shell-footer-container\"\r\n *ngIf=\"activeConfig.showFooter\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-footer-container-inner-fluid' : 'shell-footer-container-inner'\">\r\n <ng-container *ngIf=\"activeConfig.customFooterComponent\">\r\n <div appDynamicComponentHost\r\n hostName=\"Footer\"></div>\r\n </ng-container>\r\n <lib-shell-footer *ngIf=\"!activeConfig.customFooterComponent\"></lib-shell-footer>\r\n </div>\r\n </div>\r\n <lib-side-pane #rightPane>\r\n <router-outlet name=\"rightpane\"\r\n (activate)=\"rightPane.onSidePaneActivated($event)\"\r\n (deactivate)=\"rightPane.onSidePaneDeactivated($event)\"></router-outlet>\r\n </lib-side-pane>\r\n <lib-toaster-container></lib-toaster-container>\r\n</div>"
|
|
80
|
+
},] }
|
|
81
|
+
];
|
|
82
|
+
ShellLayoutComponent.ctorParameters = () => [
|
|
83
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
84
|
+
{ type: Router },
|
|
85
|
+
{ type: Location },
|
|
86
|
+
{ type: undefined, decorators: [{ type: Inject, args: [SHELL_CONFIG,] }] },
|
|
87
|
+
{ type: ComponentLoaderFactory }
|
|
88
|
+
];
|
|
89
|
+
ShellLayoutComponent.propDecorators = {
|
|
90
|
+
dynamicComponentHosts: [{ type: ViewChildren, args: [DynamicComponentHostDirective,] }]
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hlbGwtbGF5b3V0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25nLWNvbXBvbmVudHMvc3JjL2xpYi9sYXlvdXRzL3NoZWxsL3NoZWxsLWxheW91dC9zaGVsbC1sYXlvdXQuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQWdCLGtCQUFrQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDcEUsT0FBTyxFQUFpQixTQUFTLEVBQXFCLE1BQU0sRUFBRSxZQUFZLEVBQTBDLE1BQU0sZUFBZSxDQUFDO0FBQzFJLE9BQU8sRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDckQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFeEMsT0FBTyxFQUFFLDZCQ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