@mediusinc/mng-commons-layout 5.0.0-rc.0
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 +13 -0
- package/assets/fonts/poppins-v20-latin-500.woff +0 -0
- package/assets/fonts/poppins-v20-latin-500.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-600.woff +0 -0
- package/assets/fonts/poppins-v20-latin-600.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-700.woff +0 -0
- package/assets/fonts/poppins-v20-latin-700.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-regular.woff +0 -0
- package/assets/fonts/poppins-v20-latin-regular.woff2 +0 -0
- package/assets/images/effect-ondark.png +0 -0
- package/assets/images/effect-ondark.svg +38 -0
- package/assets/images/effect-ondark@2x.png +0 -0
- package/assets/images/effect-onlight.png +0 -0
- package/assets/images/effect-onlight.svg +38 -0
- package/assets/images/effect-onlight@2x.png +0 -0
- package/assets/images/pages/exception-ondark.png +0 -0
- package/assets/images/pages/exception-onlight.png +0 -0
- package/assets/images/pages/login-ondark.png +0 -0
- package/assets/images/pages/login-onlight.png +0 -0
- package/esm2022/index.mjs +23 -0
- package/esm2022/lib/components/breadcrumb.component.mjs +30 -0
- package/esm2022/lib/components/footer.component.mjs +28 -0
- package/esm2022/lib/components/main-layout.component.mjs +99 -0
- package/esm2022/lib/components/menu-item.component.mjs +275 -0
- package/esm2022/lib/components/menu.component.mjs +40 -0
- package/esm2022/lib/components/sidebar.component.mjs +61 -0
- package/esm2022/lib/components/topbar-user.component.mjs +39 -0
- package/esm2022/lib/components/topbar.component.mjs +57 -0
- package/esm2022/lib/components/version.component.mjs +63 -0
- package/esm2022/lib/helpers/route-builder.mjs +11 -0
- package/esm2022/lib/models/layout-state.model.mjs +2 -0
- package/esm2022/lib/models/menu.model.mjs +2 -0
- package/esm2022/lib/provide.mjs +23 -0
- package/esm2022/lib/services/layout-feature-config.token.mjs +3 -0
- package/esm2022/lib/services/main-layout.component.service.mjs +71 -0
- package/esm2022/lib/services/menu.service.mjs +120 -0
- package/esm2022/lib/services/version.service.mjs +45 -0
- package/esm2022/mediusinc-mng-commons-layout.mjs +5 -0
- package/fesm2022/mediusinc-mng-commons-layout.mjs +878 -0
- package/fesm2022/mediusinc-mng-commons-layout.mjs.map +1 -0
- package/index.d.ts +17 -0
- package/lib/components/breadcrumb.component.d.ts +10 -0
- package/lib/components/footer.component.d.ts +12 -0
- package/lib/components/main-layout.component.d.ts +27 -0
- package/lib/components/menu-item.component.d.ts +40 -0
- package/lib/components/menu.component.d.ts +14 -0
- package/lib/components/sidebar.component.d.ts +19 -0
- package/lib/components/topbar-user.component.d.ts +15 -0
- package/lib/components/topbar.component.d.ts +22 -0
- package/lib/components/version.component.d.ts +18 -0
- package/lib/helpers/route-builder.d.ts +6 -0
- package/lib/models/layout-state.model.d.ts +10 -0
- package/lib/models/menu.model.d.ts +4 -0
- package/lib/provide.d.ts +8 -0
- package/lib/services/layout-feature-config.token.d.ts +18 -0
- package/lib/services/main-layout.component.service.d.ts +17 -0
- package/lib/services/menu.service.d.ts +22 -0
- package/lib/services/version.service.d.ts +14 -0
- package/package.json +35 -0
- package/scss/commons-dark.scss +9 -0
- package/scss/commons-light.scss +9 -0
- package/scss/layout/_animation.scss +53 -0
- package/scss/layout/_breadcrumb.scss +97 -0
- package/scss/layout/_config.scss +42 -0
- package/scss/layout/_content.scss +3 -0
- package/scss/layout/_fonts.scss +40 -0
- package/scss/layout/_layout_dark.scss +12 -0
- package/scss/layout/_layout_light.scss +12 -0
- package/scss/layout/_main.scss +54 -0
- package/scss/layout/_profile.scss +10 -0
- package/scss/layout/_responsive.scss +131 -0
- package/scss/layout/_sidebar_drawer.scss +285 -0
- package/scss/layout/_sidebar_horizontal.scss +168 -0
- package/scss/layout/_sidebar_reveal.scss +203 -0
- package/scss/layout/_sidebar_slim.scss +157 -0
- package/scss/layout/_sidebar_slim_plus.scss +166 -0
- package/scss/layout/_sidebar_vertical.scss +178 -0
- package/scss/layout/_topbar.scss +174 -0
- package/scss/layout/_typography.scss +67 -0
- package/scss/layout/_utils.scss +33 -0
- package/scss/layout/layout.scss +24 -0
- package/scss/layout/mng/_mng_layout_footer.scss +39 -0
- package/scss/layout/mng/_mng_layout_menu.scss +10 -0
- package/scss/layout/mng/_mng_layout_styles.scss +3 -0
- package/scss/layout/mng/_mng_layout_topbar.scss +18 -0
- package/scss/layout/preloading.scss +84 -0
- package/scss/theme/extensions/_fullcalendar.scss +328 -0
- package/scss/theme/theme-base/_colors.scss +17 -0
- package/scss/theme/theme-base/_common.scss +76 -0
- package/scss/theme/theme-base/_components.scss +110 -0
- package/scss/theme/theme-base/_mixins.scss +337 -0
- package/scss/theme/theme-base/components/button/_button.scss +576 -0
- package/scss/theme/theme-base/components/button/_speeddial.scss +96 -0
- package/scss/theme/theme-base/components/button/_splitbutton.scss +348 -0
- package/scss/theme/theme-base/components/data/_carousel.scss +37 -0
- package/scss/theme/theme-base/components/data/_datatable.scss +338 -0
- package/scss/theme/theme-base/components/data/_dataview.scss +46 -0
- package/scss/theme/theme-base/components/data/_filter.scss +137 -0
- package/scss/theme/theme-base/components/data/_orderlist.scss +114 -0
- package/scss/theme/theme-base/components/data/_organizationchart.scss +50 -0
- package/scss/theme/theme-base/components/data/_paginator.scss +92 -0
- package/scss/theme/theme-base/components/data/_picklist.scss +114 -0
- package/scss/theme/theme-base/components/data/_timeline.scss +35 -0
- package/scss/theme/theme-base/components/data/_tree.scss +150 -0
- package/scss/theme/theme-base/components/data/_treetable.scss +255 -0
- package/scss/theme/theme-base/components/data/_virtualscroller.scss +28 -0
- package/scss/theme/theme-base/components/file/_fileupload.scss +64 -0
- package/scss/theme/theme-base/components/input/_autocomplete.scss +136 -0
- package/scss/theme/theme-base/components/input/_calendar.scss +267 -0
- package/scss/theme/theme-base/components/input/_cascadeselect.scss +135 -0
- package/scss/theme/theme-base/components/input/_checkbox.scss +94 -0
- package/scss/theme/theme-base/components/input/_chips.scss +65 -0
- package/scss/theme/theme-base/components/input/_colorpicker.scss +19 -0
- package/scss/theme/theme-base/components/input/_dropdown.scss +151 -0
- package/scss/theme/theme-base/components/input/_editor.scss +122 -0
- package/scss/theme/theme-base/components/input/_inputgroup.scss +74 -0
- package/scss/theme/theme-base/components/input/_inputmask.scss +16 -0
- package/scss/theme/theme-base/components/input/_inputnumber.scss +28 -0
- package/scss/theme/theme-base/components/input/_inputswitch.scss +60 -0
- package/scss/theme/theme-base/components/input/_inputtext.scss +100 -0
- package/scss/theme/theme-base/components/input/_listbox.scss +97 -0
- package/scss/theme/theme-base/components/input/_multiselect.scss +177 -0
- package/scss/theme/theme-base/components/input/_password.scss +52 -0
- package/scss/theme/theme-base/components/input/_radiobutton.scss +78 -0
- package/scss/theme/theme-base/components/input/_rating.scss +60 -0
- package/scss/theme/theme-base/components/input/_selectbutton.scss +50 -0
- package/scss/theme/theme-base/components/input/_slider.scss +75 -0
- package/scss/theme/theme-base/components/input/_togglebutton.scss +48 -0
- package/scss/theme/theme-base/components/input/_treeselect.scss +139 -0
- package/scss/theme/theme-base/components/menu/_breadcrumb.scss +42 -0
- package/scss/theme/theme-base/components/menu/_contextmenu.scss +39 -0
- package/scss/theme/theme-base/components/menu/_dock.scss +95 -0
- package/scss/theme/theme-base/components/menu/_megamenu.scss +55 -0
- package/scss/theme/theme-base/components/menu/_menu.scss +37 -0
- package/scss/theme/theme-base/components/menu/_menubar.scss +140 -0
- package/scss/theme/theme-base/components/menu/_panelmenu.scss +153 -0
- package/scss/theme/theme-base/components/menu/_slidemenu.scss +59 -0
- package/scss/theme/theme-base/components/menu/_steps.scss +56 -0
- package/scss/theme/theme-base/components/menu/_tabmenu.scss +73 -0
- package/scss/theme/theme-base/components/menu/_tieredmenu.scss +43 -0
- package/scss/theme/theme-base/components/messages/_inlinemessage.scss +69 -0
- package/scss/theme/theme-base/components/messages/_message.scss +107 -0
- package/scss/theme/theme-base/components/messages/_toast.scss +99 -0
- package/scss/theme/theme-base/components/misc/_avatar.scss +30 -0
- package/scss/theme/theme-base/components/misc/_badge.scss +48 -0
- package/scss/theme/theme-base/components/misc/_blockui.scss +0 -0
- package/scss/theme/theme-base/components/misc/_chip.scss +42 -0
- package/scss/theme/theme-base/components/misc/_inplace.scss +16 -0
- package/scss/theme/theme-base/components/misc/_progressbar.scss +17 -0
- package/scss/theme/theme-base/components/misc/_scrolltop.scss +25 -0
- package/scss/theme/theme-base/components/misc/_skeleton.scss +8 -0
- package/scss/theme/theme-base/components/misc/_tag.scss +40 -0
- package/scss/theme/theme-base/components/misc/_terminal.scss +12 -0
- package/scss/theme/theme-base/components/multimedia/_galleria.scss +155 -0
- package/scss/theme/theme-base/components/multimedia/_image.scss +49 -0
- package/scss/theme/theme-base/components/overlay/_confirmpopup.scss +70 -0
- package/scss/theme/theme-base/components/overlay/_dialog.scss +69 -0
- package/scss/theme/theme-base/components/overlay/_overlaypanel.scss +62 -0
- package/scss/theme/theme-base/components/overlay/_sidebar.scss +27 -0
- package/scss/theme/theme-base/components/overlay/_tooltip.scss +33 -0
- package/scss/theme/theme-base/components/panel/_accordion.scss +119 -0
- package/scss/theme/theme-base/components/panel/_card.scss +30 -0
- package/scss/theme/theme-base/components/panel/_divider.scss +31 -0
- package/scss/theme/theme-base/components/panel/_fieldset.scss +47 -0
- package/scss/theme/theme-base/components/panel/_panel.scss +63 -0
- package/scss/theme/theme-base/components/panel/_scrollpanel.scss +6 -0
- package/scss/theme/theme-base/components/panel/_splitter.scss +19 -0
- package/scss/theme/theme-base/components/panel/_tabview.scss +82 -0
- package/scss/theme/theme-base/components/panel/_toolbar.scss +11 -0
- package/scss/theme/theme-base/mng/_mng_mixins.scss +69 -0
- package/scss/theme/theme-base/mng/_mng_theme_autocomplete.scss +34 -0
- package/scss/theme/theme-base/mng/_mng_theme_button.scss +68 -0
- package/scss/theme/theme-base/mng/_mng_theme_datatable.scss +153 -0
- package/scss/theme/theme-base/mng/_mng_theme_datepicker.scss +21 -0
- package/scss/theme/theme-base/mng/_mng_theme_dialog.scss +206 -0
- package/scss/theme/theme-base/mng/_mng_theme_dropdown.scss +32 -0
- package/scss/theme/theme-base/mng/_mng_theme_fileupload.scss +24 -0
- package/scss/theme/theme-base/mng/_mng_theme_forms.scss +66 -0
- package/scss/theme/theme-base/mng/_mng_theme_image.scss +27 -0
- package/scss/theme/theme-base/mng/_mng_theme_input.scss +31 -0
- package/scss/theme/theme-base/mng/_mng_theme_menu.scss +5 -0
- package/scss/theme/theme-base/mng/_mng_theme_multiselect.scss +20 -0
- package/scss/theme/theme-base/mng/_mng_theme_styles.scss +17 -0
- package/scss/theme/theme-base/mng/_mng_theme_tableview.scss +97 -0
- package/scss/theme/theme-base/mng/_mng_theme_tabview.scss +14 -0
- package/scss/theme/theme-base/mng/_mng_theme_toast.scss +3 -0
- package/scss/theme/theme-base/mng/_mng_theme_toolbar.scss +5 -0
- package/scss/theme/theme-base/mng/_mng_variables.scss +15 -0
- package/scss/theme/theme-dark/_extensions.scss +109 -0
- package/scss/theme/theme-dark/_variables.scss +940 -0
- package/scss/theme/theme-dark/blue/theme.scss +14 -0
- package/scss/theme/theme-light/_extensions.scss +109 -0
- package/scss/theme/theme-light/_variables.scss +936 -0
- package/scss/theme/theme-light/blue/theme.scss +14 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
import { AsyncPipe, NgOptimizedImage, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, Injectable, Component, ChangeDetectionStrategy, Input, signal, Injector, DestroyRef, EventEmitter, effect, runInInjectionContext, HostBinding, Output, ViewChild, ElementRef, Renderer2 } from '@angular/core';
|
|
4
|
+
import * as i1$1 from '@ngx-translate/core';
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
|
+
import * as i2 from '@mediusinc/mng-commons/core';
|
|
7
|
+
import { LoggerService, CommonsService, ComponentDirective, CommonsRouterService, RouteUtil, PermissionService, EnumerateAsyncPipe, COMMONS_MODULE_CONFIG_IT, NotificationWrapperComponent, RouteBuilder, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
8
|
+
import { ReplaySubject, BehaviorSubject, take, Subject, Observable, from, of, combineLatest, distinctUntilChanged } from 'rxjs';
|
|
9
|
+
import * as i1 from '@angular/common/http';
|
|
10
|
+
import { ButtonModule } from 'primeng/button';
|
|
11
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
12
|
+
import { map, filter, first } from 'rxjs/operators';
|
|
13
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
|
+
import * as i1$3 from '@angular/router';
|
|
15
|
+
import { Router, NavigationEnd, ActivatedRoute, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
16
|
+
import * as i2$1 from '@angular/forms';
|
|
17
|
+
import { FormsModule } from '@angular/forms';
|
|
18
|
+
import * as i1$4 from 'primeng/dropdown';
|
|
19
|
+
import { DropdownModule } from 'primeng/dropdown';
|
|
20
|
+
import * as i1$2 from 'primeng/ripple';
|
|
21
|
+
import { RippleModule } from 'primeng/ripple';
|
|
22
|
+
import * as i3 from 'primeng/styleclass';
|
|
23
|
+
import { StyleClassModule } from 'primeng/styleclass';
|
|
24
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
25
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
26
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
27
|
+
|
|
28
|
+
const COMMONS_LAYOUT_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_LAYOUT_FEATURE_CONFIG');
|
|
29
|
+
|
|
30
|
+
class VersionService {
|
|
31
|
+
constructor(http, configurationService) {
|
|
32
|
+
this.http = http;
|
|
33
|
+
this.configurationService = configurationService;
|
|
34
|
+
this.logger = inject(LoggerService).create('VersionService');
|
|
35
|
+
this.cache = {};
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
loadVersion(path, baseConfigKey, jsonPath = '$') {
|
|
39
|
+
const urlSegments = [];
|
|
40
|
+
if (baseConfigKey) {
|
|
41
|
+
const baseUrl = this.configurationService.getConfigValue(baseConfigKey);
|
|
42
|
+
urlSegments.push(baseUrl.endsWith('/') ? baseUrl.substring(0, baseUrl.length - 1) : baseUrl);
|
|
43
|
+
}
|
|
44
|
+
if (path) {
|
|
45
|
+
urlSegments.push(!path.startsWith('/') ? `/${path}` : path);
|
|
46
|
+
}
|
|
47
|
+
const url = urlSegments.join('');
|
|
48
|
+
if (!this.cache[url]) {
|
|
49
|
+
this.cache[url] = new ReplaySubject(1);
|
|
50
|
+
this.http.get(urlSegments.join('')).subscribe({
|
|
51
|
+
next: res => {
|
|
52
|
+
this.cache[url].next(res);
|
|
53
|
+
},
|
|
54
|
+
error: err => {
|
|
55
|
+
this.logger.error('Version could not be retreived', err);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return this.cache[url].asObservable();
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: VersionService, deps: [{ token: i1.HttpClient }, { token: i2.CommonsConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
62
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: VersionService }); }
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: VersionService, decorators: [{
|
|
65
|
+
type: Injectable
|
|
66
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.CommonsConfigurationService }] });
|
|
67
|
+
|
|
68
|
+
class VersionComponent {
|
|
69
|
+
constructor(jsonPathPipe, versionService) {
|
|
70
|
+
this.jsonPathPipe = jsonPathPipe;
|
|
71
|
+
this.versionService = versionService;
|
|
72
|
+
this.loadingSubject = new BehaviorSubject(false);
|
|
73
|
+
this.loading$ = this.loadingSubject.asObservable();
|
|
74
|
+
}
|
|
75
|
+
ngOnInit() {
|
|
76
|
+
if (Array.isArray(this.initVersion)) {
|
|
77
|
+
this.versions = this.initVersion;
|
|
78
|
+
}
|
|
79
|
+
else if (typeof this.initVersion === 'string') {
|
|
80
|
+
this.displayVersion = this.initVersion;
|
|
81
|
+
}
|
|
82
|
+
else if (typeof this.initVersion !== 'undefined') {
|
|
83
|
+
if (this.initVersion['info'] || this.initVersion['urlPath']) {
|
|
84
|
+
const config = this.initVersion;
|
|
85
|
+
this.displayName = config.displayName;
|
|
86
|
+
if (config.urlPath) {
|
|
87
|
+
this.loadingSubject.next(true);
|
|
88
|
+
this.versionService
|
|
89
|
+
.loadVersion(config.urlPath, config.urlBaseConfigKey)
|
|
90
|
+
.pipe(take(1))
|
|
91
|
+
.subscribe({
|
|
92
|
+
next: res => {
|
|
93
|
+
this.displayVersion = this.jsonPathPipe.transform(res, config.infoJsonPath ?? '$');
|
|
94
|
+
this.loadingSubject.next(false);
|
|
95
|
+
},
|
|
96
|
+
error: () => {
|
|
97
|
+
this.displayVersion = '';
|
|
98
|
+
this.loadingSubject.next(false);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.displayVersion = this.jsonPathPipe.transform(config.info, config.infoJsonPath ?? '$.raw');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const info = this.initVersion;
|
|
108
|
+
this.displayVersion = this.jsonPathPipe.transform(info, '$.raw');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: VersionComponent, deps: [{ token: i2.JsonPathPipe }, { token: VersionService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: VersionComponent, isStandalone: true, selector: "mng-version", inputs: { initVersion: ["version", "initVersion"] }, ngImport: i0, template: "@if (versions) {\n @for (v of versions; track v; let last = $last) {\n <mng-version [version]=\"v\"></mng-version>\n @if (!last) {\n <br />\n }\n }\n} @else {\n @if (displayName) {\n {{ displayName }}:\n }\n @if ((loading$ | async) === false) {\n {{ displayVersion }}\n }\n}\n", dependencies: [{ kind: "component", type: VersionComponent, selector: "mng-version", inputs: ["version"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
114
|
+
}
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: VersionComponent, decorators: [{
|
|
116
|
+
type: Component,
|
|
117
|
+
args: [{ standalone: true, selector: 'mng-version', imports: [AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (versions) {\n @for (v of versions; track v; let last = $last) {\n <mng-version [version]=\"v\"></mng-version>\n @if (!last) {\n <br />\n }\n }\n} @else {\n @if (displayName) {\n {{ displayName }}:\n }\n @if ((loading$ | async) === false) {\n {{ displayVersion }}\n }\n}\n" }]
|
|
118
|
+
}], ctorParameters: () => [{ type: i2.JsonPathPipe }, { type: VersionService }], propDecorators: { initVersion: [{
|
|
119
|
+
type: Input,
|
|
120
|
+
args: ['version']
|
|
121
|
+
}] } });
|
|
122
|
+
|
|
123
|
+
class FooterComponent {
|
|
124
|
+
constructor() {
|
|
125
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
126
|
+
this.commons = inject(CommonsService);
|
|
127
|
+
this.currentYear = new Date().getFullYear();
|
|
128
|
+
this.versionComponent = VersionComponent;
|
|
129
|
+
}
|
|
130
|
+
ngOnInit() {
|
|
131
|
+
if (this.config?.components?.version !== undefined) {
|
|
132
|
+
this.versionComponent = this.config?.components?.version;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
136
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: FooterComponent, isStandalone: true, selector: "mng-footer", ngImport: i0, template: "<div class=\"layout-footer\">\n <div class=\"footer-logo-container\">\n <img id=\"footer-logo\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" alt=\"atlantis-layout\" />\n <span class=\"app-name\">{{ commons.appName | translate }}</span>\n </div>\n <div class=\"flex flex-column\">\n <div>\n <span class=\"copyright\">© {{ commons.appOwner | translate }} - {{ currentYear }}</span>\n </div>\n @if (versionComponent) {\n <div class=\"version\" [mngComponent]=\"versionComponent\" [inputs]=\"{version: commons.appVersion}\" [attachToHost]=\"true\"></div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "nodeInjector"], outputs: ["instanceCreated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
137
|
+
}
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FooterComponent, decorators: [{
|
|
139
|
+
type: Component,
|
|
140
|
+
args: [{ standalone: true, selector: 'mng-footer', imports: [TranslateModule, NgOptimizedImage, VersionComponent, ComponentDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-footer\">\n <div class=\"footer-logo-container\">\n <img id=\"footer-logo\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" alt=\"atlantis-layout\" />\n <span class=\"app-name\">{{ commons.appName | translate }}</span>\n </div>\n <div class=\"flex flex-column\">\n <div>\n <span class=\"copyright\">© {{ commons.appOwner | translate }} - {{ currentYear }}</span>\n </div>\n @if (versionComponent) {\n <div class=\"version\" [mngComponent]=\"versionComponent\" [inputs]=\"{version: commons.appVersion}\" [attachToHost]=\"true\"></div>\n }\n </div>\n</div>\n" }]
|
|
141
|
+
}] });
|
|
142
|
+
|
|
143
|
+
class BreadcrumbComponent {
|
|
144
|
+
constructor() {
|
|
145
|
+
this.commons = inject(CommonsService);
|
|
146
|
+
this.mappedBreadcrumbs$ = this.commons.breadcrumbs$.pipe(map((items) => items.map(el => this.mapMenuItem(el))));
|
|
147
|
+
}
|
|
148
|
+
mapMenuItem(item) {
|
|
149
|
+
return {
|
|
150
|
+
...item,
|
|
151
|
+
url: item.href,
|
|
152
|
+
badgeStyleClass: item.badgeClassName,
|
|
153
|
+
styleClass: item.className
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
157
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: BreadcrumbComponent, isStandalone: true, selector: "mng-breadcrumb", ngImport: i0, template: "<div class=\"layout-breadcrumb flex align-items-center relative h-3rem\">\n <nav>\n <ol class=\"relative z-2\">\n @for (item of mappedBreadcrumbs$ | async; track item; let last = $last) {\n <li>{{ item.label! | translate }}</li>\n @if (!last) {\n <li class=\"layout-breadcrumb-chevron\">/</li>\n }\n }\n </ol>\n </nav>\n</div>\n", dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
158
|
+
}
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
160
|
+
type: Component,
|
|
161
|
+
args: [{ standalone: true, selector: 'mng-breadcrumb', imports: [NgClass, InputTextModule, ButtonModule, AsyncPipe, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-breadcrumb flex align-items-center relative h-3rem\">\n <nav>\n <ol class=\"relative z-2\">\n @for (item of mappedBreadcrumbs$ | async; track item; let last = $last) {\n <li>{{ item.label! | translate }}</li>\n @if (!last) {\n <li class=\"layout-breadcrumb-chevron\">/</li>\n }\n }\n </ol>\n </nav>\n</div>\n" }]
|
|
162
|
+
}] });
|
|
163
|
+
|
|
164
|
+
class MainLayoutComponentService {
|
|
165
|
+
constructor() {
|
|
166
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
167
|
+
this.state = signal({
|
|
168
|
+
staticMenuDesktopInactive: false,
|
|
169
|
+
overlayMenuActive: false,
|
|
170
|
+
rightMenuActive: false,
|
|
171
|
+
configSidebarVisible: false,
|
|
172
|
+
staticMenuMobileActive: false,
|
|
173
|
+
menuHoverActive: false,
|
|
174
|
+
sidebarActive: false,
|
|
175
|
+
anchored: false
|
|
176
|
+
});
|
|
177
|
+
this.overlayOpen = new Subject();
|
|
178
|
+
this.overlayOpen$ = this.overlayOpen.asObservable();
|
|
179
|
+
}
|
|
180
|
+
onMenuToggle() {
|
|
181
|
+
if (this.isOverlay()) {
|
|
182
|
+
this.state.update(state => ({
|
|
183
|
+
...state,
|
|
184
|
+
overlayMenuActive: !state.overlayMenuActive
|
|
185
|
+
}));
|
|
186
|
+
if (this.state().overlayMenuActive) {
|
|
187
|
+
this.overlayOpen.next(null);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (this.isDesktop()) {
|
|
191
|
+
this.state.update(state => ({
|
|
192
|
+
...state,
|
|
193
|
+
staticMenuDesktopInactive: !state.staticMenuDesktopInactive
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
this.state.update(state => ({
|
|
198
|
+
...state,
|
|
199
|
+
staticMenuMobileActive: !state.staticMenuMobileActive
|
|
200
|
+
}));
|
|
201
|
+
if (this.state().staticMenuMobileActive) {
|
|
202
|
+
this.overlayOpen.next(null);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
onOverlaySubmenuOpen() {
|
|
207
|
+
this.overlayOpen.next(null);
|
|
208
|
+
}
|
|
209
|
+
isOverlay() {
|
|
210
|
+
return this.config?.menuMode === 'overlay';
|
|
211
|
+
}
|
|
212
|
+
isSlim() {
|
|
213
|
+
return this.config?.menuMode === 'slim';
|
|
214
|
+
}
|
|
215
|
+
isSlimPlus() {
|
|
216
|
+
return this.config?.menuMode === 'slim-plus';
|
|
217
|
+
}
|
|
218
|
+
isDesktop() {
|
|
219
|
+
return window.innerWidth > 991;
|
|
220
|
+
}
|
|
221
|
+
isMobile() {
|
|
222
|
+
return !this.isDesktop();
|
|
223
|
+
}
|
|
224
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MainLayoutComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
225
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MainLayoutComponentService }); }
|
|
226
|
+
}
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MainLayoutComponentService, decorators: [{
|
|
228
|
+
type: Injectable
|
|
229
|
+
}] });
|
|
230
|
+
|
|
231
|
+
class MenuService {
|
|
232
|
+
constructor() {
|
|
233
|
+
this.logger = LoggerService.create('MenuService');
|
|
234
|
+
this.router = inject(Router);
|
|
235
|
+
this.commonsRouter = inject(CommonsRouterService);
|
|
236
|
+
this.menuSource = new ReplaySubject(1);
|
|
237
|
+
this.resetSource = new Subject();
|
|
238
|
+
this.menuSource$ = this.menuSource.asObservable();
|
|
239
|
+
this.resetSource$ = this.resetSource.asObservable();
|
|
240
|
+
this.menuItems = [];
|
|
241
|
+
this.routeLoadedChildrenSubscriptions = [];
|
|
242
|
+
}
|
|
243
|
+
initialize(menuItems) {
|
|
244
|
+
this.menuItems = menuItems;
|
|
245
|
+
this.routeLoadedChildrenSubscriptions.forEach(s => s.unsubscribe());
|
|
246
|
+
this.routeLoadedChildrenSubscriptions = [];
|
|
247
|
+
this.generateMenuItemKeys(menuItems);
|
|
248
|
+
this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(e => {
|
|
249
|
+
this.findAndSetActiveMenuItem(e.urlAfterRedirects);
|
|
250
|
+
});
|
|
251
|
+
this.findAndSetActiveMenuItem(this.router.url);
|
|
252
|
+
}
|
|
253
|
+
generateMenuItemKeys(menuItems, parentKey = '') {
|
|
254
|
+
menuItems.forEach((item, idx) => {
|
|
255
|
+
if (!item.index) {
|
|
256
|
+
item.index = idx;
|
|
257
|
+
item.key = parentKey ? parentKey + '-' + idx : idx.toString();
|
|
258
|
+
}
|
|
259
|
+
if (item.items) {
|
|
260
|
+
this.generateMenuItemKeys(item.items, item.key);
|
|
261
|
+
}
|
|
262
|
+
else if (item.lazyChildren) {
|
|
263
|
+
this.listenToMenuItemLazyChildrenLoad(item);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
findAndSetActiveMenuItem(url) {
|
|
268
|
+
const matches = this.findActiveRouteMatches(this.menuItems, url);
|
|
269
|
+
if (matches.length === 0) {
|
|
270
|
+
this.reset();
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
const matchKey = matches[0][matches[0].length - 1].key;
|
|
274
|
+
if (matchKey) {
|
|
275
|
+
this.menuSource.next({
|
|
276
|
+
key: matchKey,
|
|
277
|
+
routeEvent: true
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
this.logger.warn(`Found active menu item for url ${url}, but item key is not present`, matches);
|
|
282
|
+
this.reset();
|
|
283
|
+
}
|
|
284
|
+
if (matches.length > 1) {
|
|
285
|
+
this.logger.warn(`Multiple active menu items found for url ${url}`, matches);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
listenToMenuItemLazyChildrenLoad(menuItem) {
|
|
290
|
+
this.routeLoadedChildrenSubscriptions.push(this.commonsRouter
|
|
291
|
+
.getRouteLoadedChildren$(menuItem.routerLink ?? '/')
|
|
292
|
+
.pipe(take(1))
|
|
293
|
+
.subscribe({
|
|
294
|
+
next: routes => {
|
|
295
|
+
let menuItems = routes
|
|
296
|
+
.filter(r => Array.isArray(r.data?.menuItems))
|
|
297
|
+
.flatMap(r => r.data.menuItems);
|
|
298
|
+
menuItems = RouteUtil.adjustMenuLazyChildrenRouterLinks(menuItem, menuItems);
|
|
299
|
+
menuItem.items = menuItems;
|
|
300
|
+
menuItem.lazyChildren = false;
|
|
301
|
+
this.generateMenuItemKeys(menuItem.items, menuItem.key);
|
|
302
|
+
this.findAndSetActiveMenuItem(this.router.url);
|
|
303
|
+
}
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
findActiveRouteMatches(menuItems, url) {
|
|
307
|
+
const matches = [];
|
|
308
|
+
for (const menuItem of menuItems) {
|
|
309
|
+
if (menuItem.routerLink) {
|
|
310
|
+
const isActive = RouteUtil.doesUrlMatchRouterLink(menuItem.routerLink, url);
|
|
311
|
+
if (isActive) {
|
|
312
|
+
if (Array.isArray(menuItem.items)) {
|
|
313
|
+
const itemsMatches = this.findActiveRouteMatches(menuItem.items, url);
|
|
314
|
+
if (itemsMatches.length > 0) {
|
|
315
|
+
matches.push(...itemsMatches.map(c => [menuItem, ...c]));
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
matches.push([menuItem]);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
matches.push([menuItem]);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else if (Array.isArray(menuItem.items)) {
|
|
327
|
+
const itemsMatches = this.findActiveRouteMatches(menuItem.items, url);
|
|
328
|
+
if (itemsMatches.length > 0) {
|
|
329
|
+
matches.push(...itemsMatches.map(c => [menuItem, ...c]));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return matches;
|
|
334
|
+
}
|
|
335
|
+
reset() {
|
|
336
|
+
this.resetSource.next(true);
|
|
337
|
+
}
|
|
338
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
339
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuService }); }
|
|
340
|
+
}
|
|
341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuService, decorators: [{
|
|
342
|
+
type: Injectable
|
|
343
|
+
}] });
|
|
344
|
+
|
|
345
|
+
class MenuItemComponent {
|
|
346
|
+
constructor() {
|
|
347
|
+
this.router = inject(Router);
|
|
348
|
+
this.injector = inject(Injector);
|
|
349
|
+
this.destroyRef = inject(DestroyRef);
|
|
350
|
+
this.route = inject(ActivatedRoute);
|
|
351
|
+
this.menuService = inject(MenuService);
|
|
352
|
+
this.authorization = inject(PermissionService);
|
|
353
|
+
this.layoutService = inject(MainLayoutComponentService);
|
|
354
|
+
this.isPermitted = signal(true);
|
|
355
|
+
this.guardsIsAllowed = signal(true);
|
|
356
|
+
this.childrenVisibilitySubject = [];
|
|
357
|
+
this.root = false;
|
|
358
|
+
this.visibleChangeEventEmitter = new EventEmitter();
|
|
359
|
+
this.active = signal(false);
|
|
360
|
+
this.visible = signal(false);
|
|
361
|
+
this.menuService.menuSource$.pipe(takeUntilDestroyed()).subscribe(value => {
|
|
362
|
+
setTimeout(() => {
|
|
363
|
+
this.active.set(this.item.key === value.key || value.key.startsWith((this.item.key ?? '') + '-'));
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
this.menuService.resetSource$.pipe(takeUntilDestroyed()).subscribe(() => {
|
|
367
|
+
this.active.set(false);
|
|
368
|
+
});
|
|
369
|
+
effect(() => {
|
|
370
|
+
if (this.isPermitted() && this.guardsIsAllowed()) {
|
|
371
|
+
this.active.set(false);
|
|
372
|
+
this.visible.set(true);
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
this.active.set(true);
|
|
376
|
+
this.visible.set(false);
|
|
377
|
+
}
|
|
378
|
+
}, { allowSignalWrites: true });
|
|
379
|
+
}
|
|
380
|
+
ngOnInit() {
|
|
381
|
+
if (this.item.routerLink) {
|
|
382
|
+
if (typeof this.item.routerLink === 'string') {
|
|
383
|
+
this.itemUrl = this.item.routerLink;
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
this.itemUrl = this.router.parseUrl(this.item.routerLink.join('/'));
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
this.routerEventsSubscription = this.router.events.subscribe(next => {
|
|
390
|
+
if (next instanceof GuardsCheckEnd && next.shouldActivate) {
|
|
391
|
+
this.checkIfMenuItemIsAllowedFromGuard(next.state);
|
|
392
|
+
}
|
|
393
|
+
else if (next instanceof NavigationEnd) {
|
|
394
|
+
if (!this.layoutService.isMobile()) {
|
|
395
|
+
this.active.set(false);
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
this.updateActiveStateFromRoute();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
if (this.item.permissions) {
|
|
403
|
+
this.authorization
|
|
404
|
+
.isPermitted(this.item.permissions)
|
|
405
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
406
|
+
.subscribe({
|
|
407
|
+
next: isPermitted => {
|
|
408
|
+
this.isPermitted.set(isPermitted);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
this.checkIfMenuItemIsAllowedFromGuard(this.router.routerState.snapshot);
|
|
413
|
+
this.processItemChildrenVisibility();
|
|
414
|
+
}
|
|
415
|
+
ngAfterViewChecked() {
|
|
416
|
+
if (this.root && this.active() && this.layoutService.isDesktop() && (this.layoutService.isSlim() || this.layoutService.isSlimPlus())) {
|
|
417
|
+
this.calculatePosition(this.submenu?.nativeElement, this.submenu?.nativeElement.parentElement);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
ngOnDestroy() {
|
|
421
|
+
this.routerEventsSubscription?.unsubscribe();
|
|
422
|
+
this.guardsIsAllowedSubscription?.unsubscribe();
|
|
423
|
+
}
|
|
424
|
+
get submenuAnimation() {
|
|
425
|
+
if (this.layoutService.isDesktop() && (this.layoutService.isSlim() || this.layoutService.isSlimPlus())) {
|
|
426
|
+
return this.active() ? 'visible' : 'hidden';
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
return this.root ? 'expanded' : this.active() ? 'expanded' : 'collapsed';
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
get activeClass() {
|
|
433
|
+
return this.active() && !this.root;
|
|
434
|
+
}
|
|
435
|
+
itemClick(event) {
|
|
436
|
+
// avoid processing disabled items
|
|
437
|
+
if (this.item.disabled) {
|
|
438
|
+
event.preventDefault();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
// toggle active state
|
|
442
|
+
if (this.item.items || this.item.lazyChildren) {
|
|
443
|
+
if ((this.root || this.active()) && (this.layoutService.isSlim() || this.layoutService.isSlimPlus())) {
|
|
444
|
+
this.layoutService.onOverlaySubmenuOpen();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
if (this.layoutService.isMobile()) {
|
|
449
|
+
this.layoutService.state.update(state => ({
|
|
450
|
+
...state,
|
|
451
|
+
staticMenuMobileActive: false
|
|
452
|
+
}));
|
|
453
|
+
}
|
|
454
|
+
if (this.layoutService.isSlim() || this.layoutService.isSlimPlus()) {
|
|
455
|
+
this.menuService.reset();
|
|
456
|
+
this.layoutService.state.update(state => ({
|
|
457
|
+
...state,
|
|
458
|
+
menuHoverActive: false
|
|
459
|
+
}));
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
onSubmenuAnimated(event) {
|
|
464
|
+
if (event.toState === 'visible' && this.layoutService.isDesktop() && (this.layoutService.isSlim() || this.layoutService.isSlimPlus())) {
|
|
465
|
+
const el = event.element;
|
|
466
|
+
const elParent = el.parentElement;
|
|
467
|
+
this.calculatePosition(el, elParent);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
onChildVisibleChange(visible, item, idx) {
|
|
471
|
+
this.childrenVisibilitySubject[idx].next(visible);
|
|
472
|
+
}
|
|
473
|
+
calculatePosition(overlay, target) {
|
|
474
|
+
if (overlay) {
|
|
475
|
+
const top = target.getBoundingClientRect().top;
|
|
476
|
+
const vHeight = window.innerHeight;
|
|
477
|
+
const oHeight = overlay.offsetHeight;
|
|
478
|
+
// reset
|
|
479
|
+
overlay.style.top = '';
|
|
480
|
+
overlay.style.left = '';
|
|
481
|
+
if (this.layoutService.isSlim() || this.layoutService.isSlimPlus()) {
|
|
482
|
+
const height = top + oHeight;
|
|
483
|
+
overlay.style.top = vHeight < height ? `${top - (height - vHeight)}px` : `${top}px`;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
checkIfMenuItemIsAllowedFromGuard(routerState) {
|
|
488
|
+
this.guardsIsAllowedSubscription?.unsubscribe();
|
|
489
|
+
if (this.item.guards?.length) {
|
|
490
|
+
const obs = [];
|
|
491
|
+
for (const guard of this.item.guards) {
|
|
492
|
+
if (guard && typeof guard === 'function') {
|
|
493
|
+
const guardFnInstance = guard;
|
|
494
|
+
runInInjectionContext(this.injector, () => {
|
|
495
|
+
const canActivateRes = guardFnInstance(this.route.snapshot, routerState);
|
|
496
|
+
let canActivateObs;
|
|
497
|
+
if (canActivateRes instanceof Observable) {
|
|
498
|
+
canActivateObs = canActivateRes;
|
|
499
|
+
}
|
|
500
|
+
else if (canActivateRes instanceof Promise) {
|
|
501
|
+
canActivateObs = from(canActivateRes);
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
canActivateObs = of(canActivateRes);
|
|
505
|
+
}
|
|
506
|
+
obs.push(canActivateObs.pipe(first(), map(res => res === true) // if url tree is present, that means redirect and implies not allowed
|
|
507
|
+
));
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
this.guardsIsAllowedSubscription = combineLatest(obs)
|
|
512
|
+
.pipe(first())
|
|
513
|
+
.subscribe(next => {
|
|
514
|
+
const result = next.every(n => n === true);
|
|
515
|
+
this.guardsIsAllowed.set(result);
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
this.guardsIsAllowed.set(true);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
updateActiveStateFromRoute() {
|
|
523
|
+
if (this.itemUrl) {
|
|
524
|
+
this.active.set(this.router.isActive(this.itemUrl, {
|
|
525
|
+
matrixParams: 'ignored',
|
|
526
|
+
queryParams: 'ignored',
|
|
527
|
+
paths: this.item.items ? 'subset' : 'exact',
|
|
528
|
+
fragment: 'ignored'
|
|
529
|
+
}));
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
this.active.set(false);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
processItemChildrenVisibility() {
|
|
536
|
+
if (this.item.items) {
|
|
537
|
+
this.childrenVisibilitySubject = this.item.items.map(() => new BehaviorSubject(true));
|
|
538
|
+
combineLatest(this.childrenVisibilitySubject.map(s => s.asObservable().pipe(distinctUntilChanged())))
|
|
539
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
540
|
+
.subscribe(visible => {
|
|
541
|
+
const anyChildVisible = visible.some(v => v === true);
|
|
542
|
+
this.active.set(!anyChildVisible);
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: MenuItemComponent, isStandalone: true, selector: "[mng-menuitem]", inputs: { item: "item", root: "root" }, outputs: { visibleChangeEventEmitter: "visibleChange" }, host: { properties: { "class.layout-root-menuitem": "this.root", "class.active-menuitem": "this.activeClass" } }, viewQueries: [{ propertyName: "submenu", first: true, predicate: ["submenu"], descendants: true }], ngImport: i0, template: "@if (visible()) {\n @if (root) {\n <div class=\"layout-menuitem-root-text\">\n {{ item.label! | translate }}\n </div>\n }\n @if (!item.href) {\n @if (!item.routerLink || item.items) {\n <a\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n } @else if (item.routerLink && !item.items) {\n <a\n (click)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? '' + (this.active() ? ' active-route' : '')\"\n [preserveFragment]=\"item.preserveFragment\"\n [skipLocationChange]=\"item.skipLocationChange\"\n [replaceUrl]=\"item.replaceUrl\"\n [queryParams]=\"item.queryParams\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n }\n } @else {\n @if (!item.items) {\n <a (click)=\"itemClick($event)\" [attr.href]=\"item.href\" [attr.target]=\"item.target\" [attr.tabindex]=\"0\" [ngClass]=\"item.className ?? ''\" pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n }\n }\n @if (item.items) {\n <ul #submenu [@children]=\"submenuAnimation\" (@children.done)=\"onSubmenuAnimated($event)\">\n @for (child of item.items; track child; let i = $index) {\n <li mng-menuitem [item]=\"child\" [class]=\"child.badgeClassName\" (visibleChange)=\"onChildVisibleChange($event, item, i)\"></li>\n }\n </ul>\n }\n}\n", dependencies: [{ kind: "component", type: MenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "root"], outputs: ["visibleChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RippleModule }, { kind: "directive", type: i1$2.Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], animations: [
|
|
548
|
+
trigger('children', [
|
|
549
|
+
state('collapsed', style({
|
|
550
|
+
height: '0'
|
|
551
|
+
})),
|
|
552
|
+
state('expanded', style({
|
|
553
|
+
height: '*'
|
|
554
|
+
})),
|
|
555
|
+
state('hidden', style({
|
|
556
|
+
display: 'none'
|
|
557
|
+
})),
|
|
558
|
+
state('visible', style({
|
|
559
|
+
display: 'block'
|
|
560
|
+
})),
|
|
561
|
+
transition('collapsed <=> expanded', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
|
|
562
|
+
])
|
|
563
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
564
|
+
}
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
566
|
+
type: Component,
|
|
567
|
+
args: [{ standalone: true, selector: '[mng-menuitem]', imports: [NgClass, RippleModule, TooltipModule, RouterModule, TranslateModule, AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
568
|
+
trigger('children', [
|
|
569
|
+
state('collapsed', style({
|
|
570
|
+
height: '0'
|
|
571
|
+
})),
|
|
572
|
+
state('expanded', style({
|
|
573
|
+
height: '*'
|
|
574
|
+
})),
|
|
575
|
+
state('hidden', style({
|
|
576
|
+
display: 'none'
|
|
577
|
+
})),
|
|
578
|
+
state('visible', style({
|
|
579
|
+
display: 'block'
|
|
580
|
+
})),
|
|
581
|
+
transition('collapsed <=> expanded', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
|
|
582
|
+
])
|
|
583
|
+
], template: "@if (visible()) {\n @if (root) {\n <div class=\"layout-menuitem-root-text\">\n {{ item.label! | translate }}\n </div>\n }\n @if (!item.href) {\n @if (!item.routerLink || item.items) {\n <a\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n } @else if (item.routerLink && !item.items) {\n <a\n (click)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? '' + (this.active() ? ' active-route' : '')\"\n [preserveFragment]=\"item.preserveFragment\"\n [skipLocationChange]=\"item.skipLocationChange\"\n [replaceUrl]=\"item.replaceUrl\"\n [queryParams]=\"item.queryParams\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n }\n } @else {\n @if (!item.items) {\n <a (click)=\"itemClick($event)\" [attr.href]=\"item.href\" [attr.target]=\"item.target\" [attr.tabindex]=\"0\" [ngClass]=\"item.className ?? ''\" pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n @if (item.items || item.lazyChildren) {\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\"></i>\n }\n @if (item.badge) {\n <span class=\"menuitem-badge\">{{ item.badge }}</span>\n }\n </a>\n }\n }\n @if (item.items) {\n <ul #submenu [@children]=\"submenuAnimation\" (@children.done)=\"onSubmenuAnimated($event)\">\n @for (child of item.items; track child; let i = $index) {\n <li mng-menuitem [item]=\"child\" [class]=\"child.badgeClassName\" (visibleChange)=\"onChildVisibleChange($event, item, i)\"></li>\n }\n </ul>\n }\n}\n" }]
|
|
584
|
+
}], ctorParameters: () => [], propDecorators: { item: [{
|
|
585
|
+
type: Input,
|
|
586
|
+
args: [{ required: true }]
|
|
587
|
+
}], root: [{
|
|
588
|
+
type: Input
|
|
589
|
+
}, {
|
|
590
|
+
type: HostBinding,
|
|
591
|
+
args: ['class.layout-root-menuitem']
|
|
592
|
+
}], visibleChangeEventEmitter: [{
|
|
593
|
+
type: Output,
|
|
594
|
+
args: ['visibleChange']
|
|
595
|
+
}], submenu: [{
|
|
596
|
+
type: ViewChild,
|
|
597
|
+
args: ['submenu']
|
|
598
|
+
}], activeClass: [{
|
|
599
|
+
type: HostBinding,
|
|
600
|
+
args: ['class.active-menuitem']
|
|
601
|
+
}] } });
|
|
602
|
+
|
|
603
|
+
class MenuComponent {
|
|
604
|
+
constructor() {
|
|
605
|
+
this.route = inject(ActivatedRoute);
|
|
606
|
+
this.menuService = inject(MenuService);
|
|
607
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
608
|
+
this.layoutService = inject(MainLayoutComponentService);
|
|
609
|
+
this.menuItems = [];
|
|
610
|
+
}
|
|
611
|
+
ngOnInit() {
|
|
612
|
+
if (this.config?.menuItems && Array.isArray(this.config.menuItems)) {
|
|
613
|
+
this.menuItems = this.wrapMenuItems(this.config.menuItems);
|
|
614
|
+
}
|
|
615
|
+
else if (Array.isArray(this.route.snapshot.data?.menuItems)) {
|
|
616
|
+
this.menuItems = this.wrapMenuItems(this.route.snapshot.data.menuItems);
|
|
617
|
+
}
|
|
618
|
+
this.menuService.initialize(this.menuItems);
|
|
619
|
+
}
|
|
620
|
+
wrapMenuItems(menuItems) {
|
|
621
|
+
if (this.layoutService.isSlim() || this.layoutService.isSlimPlus()) {
|
|
622
|
+
return menuItems;
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
return [{ items: menuItems }];
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: MenuComponent, isStandalone: true, selector: "mng-menu", ngImport: i0, template: "<ul class=\"layout-menu\">\n @for (item of menuItems; track item) {\n @if (!item.separator) {\n <li mng-menuitem [item]=\"item\" [root]=\"true\"></li>\n }\n @if (item.separator) {\n <li class=\"menu-separator\"></li>\n }\n }\n</ul>\n", dependencies: [{ kind: "component", type: MenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "root"], outputs: ["visibleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
630
|
+
}
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MenuComponent, decorators: [{
|
|
632
|
+
type: Component,
|
|
633
|
+
args: [{ standalone: true, selector: 'mng-menu', imports: [MenuItemComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"layout-menu\">\n @for (item of menuItems; track item) {\n @if (!item.separator) {\n <li mng-menuitem [item]=\"item\" [root]=\"true\"></li>\n }\n @if (item.separator) {\n <li class=\"menu-separator\"></li>\n }\n }\n</ul>\n" }]
|
|
634
|
+
}] });
|
|
635
|
+
|
|
636
|
+
class SidebarComponent {
|
|
637
|
+
constructor() {
|
|
638
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
639
|
+
this.commons = inject(CommonsService);
|
|
640
|
+
this.layoutService = inject(MainLayoutComponentService);
|
|
641
|
+
this.el = inject(ElementRef);
|
|
642
|
+
this.timeout = null;
|
|
643
|
+
this.menuComponent = MenuComponent;
|
|
644
|
+
}
|
|
645
|
+
ngOnInit() {
|
|
646
|
+
if (this.config?.components?.menu !== undefined) {
|
|
647
|
+
this.menuComponent = this.config.components.menu;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
onMouseEnter() {
|
|
651
|
+
if (!this.layoutService.state().anchored) {
|
|
652
|
+
if (this.timeout) {
|
|
653
|
+
clearTimeout(this.timeout);
|
|
654
|
+
this.timeout = null;
|
|
655
|
+
}
|
|
656
|
+
this.layoutService.state.update(state => ({
|
|
657
|
+
...state,
|
|
658
|
+
sidebarActive: true
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
onMouseLeave() {
|
|
663
|
+
if (!this.layoutService.state().anchored) {
|
|
664
|
+
if (!this.timeout) {
|
|
665
|
+
this.timeout = setTimeout(() => this.layoutService.state.update(state => ({
|
|
666
|
+
...state,
|
|
667
|
+
sidebarActive: false
|
|
668
|
+
})), 300);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
anchor() {
|
|
673
|
+
this.layoutService.state.update(state => ({
|
|
674
|
+
...state,
|
|
675
|
+
anchored: !state.anchored
|
|
676
|
+
}));
|
|
677
|
+
}
|
|
678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
679
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: SidebarComponent, isStandalone: true, selector: "mng-sidebar", viewQueries: [{ propertyName: "menuContainer", first: true, predicate: ["menuContainer"], descendants: true }], ngImport: i0, template: "<div class=\"layout-sidebar\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\n <div class=\"sidebar-header\">\n <a [routerLink]=\"['/']\" class=\"app-logo\">\n <div class=\"app-logo-small h-2rem\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" [alt]=\"'App logo'\" />\n </div>\n <div class=\"app-logo-normal\">\n <img class=\"h-2rem\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" [alt]=\"'App logo'\" />\n <img class=\"h-2rem ml-3\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" [alt]=\"'App name'\" />\n </div>\n </a>\n <button class=\"layout-sidebar-anchor p-link z-2\" type=\"button\" (click)=\"anchor()\"></button>\n </div>\n\n @if (menuComponent) {\n <div #menuContainer class=\"layout-menu-container\">\n <div [mngComponent]=\"menuComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "nodeInjector"], outputs: ["instanceCreated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
680
|
+
}
|
|
681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
682
|
+
type: Component,
|
|
683
|
+
args: [{ standalone: true, selector: 'mng-sidebar', imports: [RouterModule, MenuComponent, ComponentDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-sidebar\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\n <div class=\"sidebar-header\">\n <a [routerLink]=\"['/']\" class=\"app-logo\">\n <div class=\"app-logo-small h-2rem\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" [alt]=\"'App logo'\" />\n </div>\n <div class=\"app-logo-normal\">\n <img class=\"h-2rem\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" [alt]=\"'App logo'\" />\n <img class=\"h-2rem ml-3\" [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" [alt]=\"'App name'\" />\n </div>\n </a>\n <button class=\"layout-sidebar-anchor p-link z-2\" type=\"button\" (click)=\"anchor()\"></button>\n </div>\n\n @if (menuComponent) {\n <div #menuContainer class=\"layout-menu-container\">\n <div [mngComponent]=\"menuComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n</div>\n" }]
|
|
684
|
+
}], propDecorators: { menuContainer: [{
|
|
685
|
+
type: ViewChild,
|
|
686
|
+
args: ['menuContainer']
|
|
687
|
+
}] } });
|
|
688
|
+
|
|
689
|
+
class TopbarUserComponent {
|
|
690
|
+
constructor() {
|
|
691
|
+
this.destroyRef = inject(DestroyRef);
|
|
692
|
+
this.commons = inject(CommonsService);
|
|
693
|
+
this.hrefJsVoid = inject(DomSanitizer).bypassSecurityTrustUrl('javascript:void(0)');
|
|
694
|
+
}
|
|
695
|
+
ngOnInit() {
|
|
696
|
+
this.commons.user$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(u => {
|
|
697
|
+
this.user = u;
|
|
698
|
+
});
|
|
699
|
+
this.userRoles$ = this.commons.userRoles$;
|
|
700
|
+
}
|
|
701
|
+
logout(user, event) {
|
|
702
|
+
if (typeof user?.logout === 'function') {
|
|
703
|
+
event.preventDefault();
|
|
704
|
+
event.stopPropagation();
|
|
705
|
+
user.logout();
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: TopbarUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
709
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: TopbarUserComponent, isStandalone: true, selector: "mng-topbar-user-component", ngImport: i0, template: "<a\n class=\"cursor-pointer lg:pr-4\"\n pStyleClass=\"@next\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\"\n [hideOnOutsideClick]=\"true\"\n pRipple>\n <i class=\"pi pi-fw pi-user text-2xl\"></i>\n <span class=\"hidden sm:inline-block\"> {{ user?.displayName ?? user?.username }}</span>\n</a>\n<ul class=\"topbar-menu active-topbar-menu w-15rem z-5 ng-hidden border-round\">\n <li role=\"menuitem\">\n <a\n class=\"flex align-items-center transition-duration-200\"\n pStyleClass=\"@grandparent\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\">\n <i class=\"pi pi-fw pi-user text-base mr-2\"></i>\n <div>\n <strong>{{ user?.displayName ?? user?.username }}</strong>\n @if (((userRoles$ | async)?.length ?? 0) > 0) {\n <small>\n <br />\n {{ userRoles$ | mngEnumerateAsync: undefined : undefined : undefined : 'roles' | async }}\n </small>\n }\n </div>\n </a>\n </li>\n @if (user?.logout || user?.logoutUrl) {\n <li role=\"menuitem\">\n <a\n [href]=\"user?.logoutUrl ?? hrefJsVoid\"\n (click)=\"logout(user, $event)\"\n class=\"flex align-items-center hover:text-primary-500 transition-duration-200\"\n pStyleClass=\"@grandparent\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\">\n <i class=\"pi pi-fw pi-sign-out text-base mr-2\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: EnumerateAsyncPipe, name: "mngEnumerateAsync" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: RippleModule }, { kind: "directive", type: i1$2.Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: StyleClassModule }, { kind: "directive", type: i3.StyleClass, selector: "[pStyleClass]", inputs: ["pStyleClass", "enterClass", "enterFromClass", "enterActiveClass", "enterToClass", "leaveClass", "leaveFromClass", "leaveActiveClass", "leaveToClass", "hideOnOutsideClick", "toggleClass", "hideOnEscape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
710
|
+
}
|
|
711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: TopbarUserComponent, decorators: [{
|
|
712
|
+
type: Component,
|
|
713
|
+
args: [{ standalone: true, selector: 'mng-topbar-user-component', imports: [AsyncPipe, EnumerateAsyncPipe, TranslateModule, RippleModule, StyleClassModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"cursor-pointer lg:pr-4\"\n pStyleClass=\"@next\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\"\n [hideOnOutsideClick]=\"true\"\n pRipple>\n <i class=\"pi pi-fw pi-user text-2xl\"></i>\n <span class=\"hidden sm:inline-block\"> {{ user?.displayName ?? user?.username }}</span>\n</a>\n<ul class=\"topbar-menu active-topbar-menu w-15rem z-5 ng-hidden border-round\">\n <li role=\"menuitem\">\n <a\n class=\"flex align-items-center transition-duration-200\"\n pStyleClass=\"@grandparent\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\">\n <i class=\"pi pi-fw pi-user text-base mr-2\"></i>\n <div>\n <strong>{{ user?.displayName ?? user?.username }}</strong>\n @if (((userRoles$ | async)?.length ?? 0) > 0) {\n <small>\n <br />\n {{ userRoles$ | mngEnumerateAsync: undefined : undefined : undefined : 'roles' | async }}\n </small>\n }\n </div>\n </a>\n </li>\n @if (user?.logout || user?.logoutUrl) {\n <li role=\"menuitem\">\n <a\n [href]=\"user?.logoutUrl ?? hrefJsVoid\"\n (click)=\"logout(user, $event)\"\n class=\"flex align-items-center hover:text-primary-500 transition-duration-200\"\n pStyleClass=\"@grandparent\"\n enterFromClass=\"ng-hidden\"\n enterActiveClass=\"px-scalein\"\n leaveToClass=\"ng-hidden\"\n leaveActiveClass=\"px-fadeout\">\n <i class=\"pi pi-fw pi-sign-out text-base mr-2\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n }\n</ul>\n" }]
|
|
714
|
+
}] });
|
|
715
|
+
|
|
716
|
+
class TopbarComponent {
|
|
717
|
+
constructor() {
|
|
718
|
+
this.el = inject(ElementRef);
|
|
719
|
+
this.commons = inject(CommonsService);
|
|
720
|
+
this.mainLayoutService = inject(MainLayoutComponentService);
|
|
721
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
722
|
+
this.breadcrumbComponent = BreadcrumbComponent;
|
|
723
|
+
this.topbarUserComponent = TopbarUserComponent;
|
|
724
|
+
this.languages = ['en'];
|
|
725
|
+
this.selectedLanguage = 'en';
|
|
726
|
+
}
|
|
727
|
+
ngOnInit() {
|
|
728
|
+
if (this.config?.components?.topbarUser !== undefined) {
|
|
729
|
+
this.topbarUserComponent = this.config.components.topbarUser;
|
|
730
|
+
}
|
|
731
|
+
if (this.config?.components?.breadcrumb !== undefined) {
|
|
732
|
+
this.breadcrumbComponent = this.config.components.breadcrumb;
|
|
733
|
+
}
|
|
734
|
+
this.languages = this.commons.appLanguages;
|
|
735
|
+
this.selectedLanguage = this.commons.getOrInitLanguage();
|
|
736
|
+
}
|
|
737
|
+
onMenuButtonClick() {
|
|
738
|
+
this.mainLayoutService.onMenuToggle();
|
|
739
|
+
}
|
|
740
|
+
switchLanguage(language) {
|
|
741
|
+
this.commons.appLanguage = language;
|
|
742
|
+
}
|
|
743
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: TopbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
744
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: TopbarComponent, isStandalone: true, selector: "mng-topbar", viewQueries: [{ propertyName: "menuButton", first: true, predicate: ["menubutton"], descendants: true }, { propertyName: "appSidebar", first: true, predicate: SidebarComponent, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"topbar-start\">\n <button #menubutton type=\"button\" class=\"topbar-menubutton p-link p-trigger\" (click)=\"onMenuButtonClick()\">\n <i class=\"pi pi-bars\"></i>\n </button>\n\n @if (breadcrumbComponent) {\n <div class=\"topbar-breadcrumb\">\n <div [mngComponent]=\"breadcrumbComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n </div>\n <div class=\"layout-topbar-menu-section\">\n <mng-sidebar></mng-sidebar>\n </div>\n <div class=\"topbar-end\">\n <ul class=\"topbar-menu\">\n @if (languages.length > 1) {\n <li class=\"profile-item\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n }\n @if (topbarUserComponent) {\n <li #userMenuItem class=\"profile-item topbar-item mr-3\" [mngComponent]=\"topbarUserComponent\" [attachToHost]=\"true\"></li>\n }\n </ul>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: SidebarComponent, selector: "mng-sidebar" }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: StyleClassModule }, { kind: "ngmodule", type: RippleModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i1$4.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "nodeInjector"], outputs: ["instanceCreated"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
745
|
+
}
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: TopbarComponent, decorators: [{
|
|
747
|
+
type: Component,
|
|
748
|
+
args: [{ standalone: true, selector: 'mng-topbar', imports: [SidebarComponent, NgClass, ButtonModule, StyleClassModule, RippleModule, BreadcrumbComponent, AsyncPipe, DropdownModule, ComponentDirective, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-topbar\">\n <div class=\"topbar-start\">\n <button #menubutton type=\"button\" class=\"topbar-menubutton p-link p-trigger\" (click)=\"onMenuButtonClick()\">\n <i class=\"pi pi-bars\"></i>\n </button>\n\n @if (breadcrumbComponent) {\n <div class=\"topbar-breadcrumb\">\n <div [mngComponent]=\"breadcrumbComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n </div>\n <div class=\"layout-topbar-menu-section\">\n <mng-sidebar></mng-sidebar>\n </div>\n <div class=\"topbar-end\">\n <ul class=\"topbar-menu\">\n @if (languages.length > 1) {\n <li class=\"profile-item\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n }\n @if (topbarUserComponent) {\n <li #userMenuItem class=\"profile-item topbar-item mr-3\" [mngComponent]=\"topbarUserComponent\" [attachToHost]=\"true\"></li>\n }\n </ul>\n </div>\n</div>\n" }]
|
|
749
|
+
}], propDecorators: { menuButton: [{
|
|
750
|
+
type: ViewChild,
|
|
751
|
+
args: ['menubutton']
|
|
752
|
+
}], appSidebar: [{
|
|
753
|
+
type: ViewChild,
|
|
754
|
+
args: [SidebarComponent]
|
|
755
|
+
}] } });
|
|
756
|
+
|
|
757
|
+
class MainLayoutComponent {
|
|
758
|
+
constructor() {
|
|
759
|
+
this.commonsConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
760
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
761
|
+
this.layoutService = inject(MainLayoutComponentService);
|
|
762
|
+
this.menuService = inject(MenuService);
|
|
763
|
+
this.renderer = inject(Renderer2);
|
|
764
|
+
this.colorScheme = signal(this.commonsConfig?.app?.colorScheme ?? 'light');
|
|
765
|
+
this.menuMode = signal(this.config?.menuMode ?? 'static');
|
|
766
|
+
this.ripple = signal(this.config?.ripple ?? true);
|
|
767
|
+
this.useNotificationWrapper = true;
|
|
768
|
+
this.topbarComponent = TopbarComponent;
|
|
769
|
+
this.breadcrumbsComponent = BreadcrumbComponent;
|
|
770
|
+
this.footerComponent = FooterComponent;
|
|
771
|
+
this.layoutService.overlayOpen$.pipe(takeUntilDestroyed()).subscribe(() => {
|
|
772
|
+
if (!this.menuOutsideClickListener) {
|
|
773
|
+
this.menuOutsideClickListener = this.renderer.listen('document', 'click', event => {
|
|
774
|
+
const isOutsideClicked = !(this.appTopbar?.nativeElement.isSameNode(event.target) || this.appTopbar?.nativeElement.contains(event.target));
|
|
775
|
+
if (isOutsideClicked) {
|
|
776
|
+
this.hideMenu();
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
if (this.layoutService.state().staticMenuMobileActive) {
|
|
781
|
+
this.blockBodyScroll();
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
ngOnInit() {
|
|
786
|
+
this.useNotificationWrapper = !this.config?.disableNotificationWrapper;
|
|
787
|
+
if (this.config?.components?.topbar !== undefined) {
|
|
788
|
+
this.topbarComponent = this.config.components.topbar;
|
|
789
|
+
}
|
|
790
|
+
if (this.config?.components?.breadcrumb !== undefined) {
|
|
791
|
+
this.breadcrumbsComponent = this.config.components.breadcrumb;
|
|
792
|
+
}
|
|
793
|
+
if (this.config?.components?.footer !== undefined) {
|
|
794
|
+
this.footerComponent = this.config.components.footer;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
blockBodyScroll() {
|
|
798
|
+
if (document.body.classList) {
|
|
799
|
+
document.body.classList.add('blocked-scroll');
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
document.body.className += ' blocked-scroll';
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
unblockBodyScroll() {
|
|
806
|
+
if (document.body.classList) {
|
|
807
|
+
document.body.classList.remove('blocked-scroll');
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
document.body.className = document.body.className.replace(new RegExp('(^|\\b)' + 'blocked-scroll'.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
hideMenu() {
|
|
814
|
+
this.layoutService.state.update(state => ({
|
|
815
|
+
...state,
|
|
816
|
+
overlayMenuActive: false,
|
|
817
|
+
staticMenuMobileActive: false,
|
|
818
|
+
menuHoverActive: false
|
|
819
|
+
}));
|
|
820
|
+
this.menuService.reset();
|
|
821
|
+
if (this.menuOutsideClickListener) {
|
|
822
|
+
this.menuOutsideClickListener();
|
|
823
|
+
this.menuOutsideClickListener = null;
|
|
824
|
+
}
|
|
825
|
+
this.unblockBodyScroll();
|
|
826
|
+
}
|
|
827
|
+
ngOnDestroy() {
|
|
828
|
+
if (this.menuOutsideClickListener) {
|
|
829
|
+
this.menuOutsideClickListener();
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MainLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
833
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: MainLayoutComponent, isStandalone: true, selector: "mng-main-layout", providers: [MainLayoutComponentService], viewQueries: [{ propertyName: "appTopbar", first: true, predicate: ["topbarCmp"], descendants: true }], ngImport: i0, template: "@if (useNotificationWrapper) {\n <mng-notification-wrapper>\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </mng-notification-wrapper>\n} @else {\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n}\n\n<ng-template #content>\n <div\n class=\"layout-container\"\n [ngClass]=\"{\n 'layout-light': colorScheme() === 'light',\n 'layout-dark': colorScheme() === 'dark',\n 'layout-overlay': menuMode() === 'overlay',\n 'layout-static': menuMode() === 'static',\n 'layout-reveal': menuMode() === 'reveal',\n 'layout-drawer': menuMode() === 'drawer',\n 'layout-slim': menuMode() === 'slim',\n 'layout-slim-plus': menuMode() === 'slim-plus',\n 'layout-static-inactive': layoutService.state().staticMenuDesktopInactive && menuMode() === 'static',\n 'layout-overlay-active': layoutService.state().overlayMenuActive,\n 'layout-mobile-active': layoutService.state().staticMenuMobileActive,\n 'p-ripple-disabled': !ripple(),\n 'layout-sidebar-active': layoutService.state().sidebarActive,\n 'layout-sidebar-anchored': layoutService.state().anchored\n }\">\n <div class=\"layout-content-wrapper\">\n @if (topbarComponent) {\n <div #topbarCmp class=\"layout-topbar-wrapper\" [mngComponent]=\"topbarComponent\" [attachToHost]=\"true\"></div>\n }\n @if (breadcrumbsComponent) {\n <div class=\"content-breadcrumb\">\n <div [mngComponent]=\"breadcrumbsComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n <div class=\"layout-content\">\n <router-outlet></router-outlet>\n </div>\n <div class=\"layout-mask\"></div>\n @if (footerComponent) {\n <div [mngComponent]=\"footerComponent\" [attachToHost]=\"true\"></div>\n }\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "nodeInjector"], outputs: ["instanceCreated"] }, { kind: "component", type: NotificationWrapperComponent, selector: "mng-notification-wrapper" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
834
|
+
}
|
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MainLayoutComponent, decorators: [{
|
|
836
|
+
type: Component,
|
|
837
|
+
args: [{ standalone: true, selector: 'mng-main-layout', imports: [NgClass, RouterModule, TopbarComponent, BreadcrumbComponent, ComponentDirective, AsyncPipe, NotificationWrapperComponent, NgTemplateOutlet], providers: [MainLayoutComponentService], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (useNotificationWrapper) {\n <mng-notification-wrapper>\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </mng-notification-wrapper>\n} @else {\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n}\n\n<ng-template #content>\n <div\n class=\"layout-container\"\n [ngClass]=\"{\n 'layout-light': colorScheme() === 'light',\n 'layout-dark': colorScheme() === 'dark',\n 'layout-overlay': menuMode() === 'overlay',\n 'layout-static': menuMode() === 'static',\n 'layout-reveal': menuMode() === 'reveal',\n 'layout-drawer': menuMode() === 'drawer',\n 'layout-slim': menuMode() === 'slim',\n 'layout-slim-plus': menuMode() === 'slim-plus',\n 'layout-static-inactive': layoutService.state().staticMenuDesktopInactive && menuMode() === 'static',\n 'layout-overlay-active': layoutService.state().overlayMenuActive,\n 'layout-mobile-active': layoutService.state().staticMenuMobileActive,\n 'p-ripple-disabled': !ripple(),\n 'layout-sidebar-active': layoutService.state().sidebarActive,\n 'layout-sidebar-anchored': layoutService.state().anchored\n }\">\n <div class=\"layout-content-wrapper\">\n @if (topbarComponent) {\n <div #topbarCmp class=\"layout-topbar-wrapper\" [mngComponent]=\"topbarComponent\" [attachToHost]=\"true\"></div>\n }\n @if (breadcrumbsComponent) {\n <div class=\"content-breadcrumb\">\n <div [mngComponent]=\"breadcrumbsComponent\" [attachToHost]=\"true\"></div>\n </div>\n }\n <div class=\"layout-content\">\n <router-outlet></router-outlet>\n </div>\n <div class=\"layout-mask\"></div>\n @if (footerComponent) {\n <div [mngComponent]=\"footerComponent\" [attachToHost]=\"true\"></div>\n }\n </div>\n </div>\n</ng-template>\n" }]
|
|
838
|
+
}], ctorParameters: () => [], propDecorators: { appTopbar: [{
|
|
839
|
+
type: ViewChild,
|
|
840
|
+
args: ['topbarCmp']
|
|
841
|
+
}] } });
|
|
842
|
+
|
|
843
|
+
class LayoutRouteBuilder {
|
|
844
|
+
static create(path) {
|
|
845
|
+
return RouteBuilder.create(path, MainLayoutComponent);
|
|
846
|
+
}
|
|
847
|
+
static fromComponent(path, component) {
|
|
848
|
+
return RouteBuilder.create(path, component);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Prepares providers for usage of the layout functionalities.
|
|
854
|
+
*
|
|
855
|
+
* @returns {CommonsFeature} The `CommonsFeature` object with the layout configuration.
|
|
856
|
+
*/
|
|
857
|
+
function withLayout(config) {
|
|
858
|
+
return {
|
|
859
|
+
type: CommonsFeatureTypeEnum.Layout,
|
|
860
|
+
providers: [
|
|
861
|
+
MenuService,
|
|
862
|
+
VersionService,
|
|
863
|
+
{
|
|
864
|
+
provide: COMMONS_LAYOUT_FEATURE_CONFIG_IT,
|
|
865
|
+
useValue: config
|
|
866
|
+
}
|
|
867
|
+
]
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// components
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Generated bundle index. Do not edit.
|
|
875
|
+
*/
|
|
876
|
+
|
|
877
|
+
export { BreadcrumbComponent, COMMONS_LAYOUT_FEATURE_CONFIG_IT, FooterComponent, LayoutRouteBuilder, MainLayoutComponent, MainLayoutComponentService, MenuComponent, MenuItemComponent, MenuService, SidebarComponent, TopbarComponent, TopbarUserComponent, VersionComponent, VersionService, withLayout };
|
|
878
|
+
//# sourceMappingURL=mediusinc-mng-commons-layout.mjs.map
|