@mediusinc/mng-commons-layout 5.3.0-rc.0 → 5.3.0-rc.2
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/esm2022/index.mjs +4 -2
- package/esm2022/lib/components/footer.component.mjs +5 -3
- package/esm2022/lib/components/main-layout.component.mjs +11 -12
- package/esm2022/lib/components/menu-item.component.mjs +13 -13
- package/esm2022/lib/components/menu.component.mjs +4 -4
- package/esm2022/lib/components/pages/error/error.page.component.mjs +20 -0
- package/esm2022/lib/components/pages/not-found/not-found.page.component.mjs +20 -0
- package/esm2022/lib/components/settings.component.mjs +46 -8
- package/esm2022/lib/components/sidebar.component.mjs +11 -12
- package/esm2022/lib/components/topbar-user.component.mjs +11 -5
- package/esm2022/lib/components/topbar.component.mjs +4 -4
- package/esm2022/lib/helpers/menu-items.mjs +2 -2
- package/esm2022/lib/provide.mjs +3 -1
- package/esm2022/lib/services/layout-feature-config.token.mjs +1 -1
- package/esm2022/lib/services/layout.service.mjs +166 -0
- package/esm2022/lib/services/menu.service.mjs +2 -2
- package/fesm2022/mediusinc-mng-commons-layout.mjs +284 -143
- package/fesm2022/mediusinc-mng-commons-layout.mjs.map +1 -1
- package/index.d.ts +3 -1
- package/lib/components/footer.component.d.ts +2 -0
- package/lib/components/main-layout.component.d.ts +2 -4
- package/lib/components/menu-item.component.d.ts +1 -1
- package/lib/components/menu.component.d.ts +1 -1
- package/lib/components/pages/error/error.page.component.d.ts +7 -0
- package/lib/components/pages/not-found/not-found.page.component.d.ts +7 -0
- package/lib/components/settings.component.d.ts +11 -3
- package/lib/components/sidebar.component.d.ts +2 -4
- package/lib/components/topbar-user.component.d.ts +2 -0
- package/lib/components/topbar.component.d.ts +2 -2
- package/lib/services/layout-feature-config.token.d.ts +72 -0
- package/lib/services/layout.service.d.ts +46 -0
- package/package.json +2 -2
- package/scss/theme/theme-base/_components.scss +2 -2
- package/scss/theme/theme-base/mng/_mng_theme_datatable.scss +4 -0
- package/scss/theme/theme-base/mng/_mng_theme_input.scss +5 -0
- package/scss/theme/theme-base/mng/_mng_theme_styles.scss +1 -0
- package/scss/theme/theme-base/mng/_mng_theme_tableview.scss +4 -0
- package/scss/theme/theme-base/mng/_mng_theme_tag.scss +11 -0
- package/version-info.json +5 -5
- package/esm2022/lib/services/main-layout.component.service.mjs +0 -91
- package/lib/services/main-layout.component.service.d.ts +0 -26
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { AsyncPipe, NgOptimizedImage, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject,
|
|
2
|
+
import { InjectionToken, inject, PLATFORM_ID, signal, computed, afterNextRender, effect, Injectable, Component, ChangeDetectionStrategy, DestroyRef, input, output, viewChild, untracked, ElementRef, Injector, Renderer2 } from '@angular/core';
|
|
3
|
+
import * as i1$4 from '@angular/router';
|
|
4
|
+
import { RouterLink, Router, NavigationEnd, RouterModule, ActivatedRoute } from '@angular/router';
|
|
4
5
|
import * as i1$1 from '@ngx-translate/core';
|
|
5
6
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
7
|
+
import * as i1 from 'primeng/button';
|
|
8
|
+
import { ButtonModule, Button } from 'primeng/button';
|
|
9
|
+
import { DOCUMENT, AsyncPipe, NgOptimizedImage, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
10
|
+
import { Subject, ReplaySubject, catchError, of, switchMap, take, startWith, distinctUntilChanged } from 'rxjs';
|
|
6
11
|
import * as i2 from '@mediusinc/mng-commons/core';
|
|
7
|
-
import { LoggerService, JsonPathPipe, CommonsService, ComponentDirective,
|
|
12
|
+
import { COMMONS_MODULE_CONFIG_IT, CommonsStorageService, LoggerService, JsonPathPipe, CommonsService, ComponentDirective, CommonsRouterService, adjustRouteMenuLazyChildrenRouterLinks, doesUrlMatchRouterLink, PermissionService, toObservable as toObservable$1, EnumerateAsyncPipe, NotificationWrapperComponent, createRoute, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
8
13
|
import { toObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { ReplaySubject, catchError, of, switchMap, take, Subject, startWith, distinctUntilChanged } from 'rxjs';
|
|
10
14
|
import { map, filter } from 'rxjs/operators';
|
|
11
|
-
import * as i1 from '@angular/common/http';
|
|
12
|
-
import * as i1$3 from '@angular/router';
|
|
13
|
-
import { Router, NavigationEnd, RouterModule, ActivatedRoute } from '@angular/router';
|
|
15
|
+
import * as i1$2 from '@angular/common/http';
|
|
14
16
|
import * as i3 from '@angular/forms';
|
|
15
17
|
import { FormsModule } from '@angular/forms';
|
|
16
|
-
import { Button, ButtonModule } from 'primeng/button';
|
|
17
18
|
import * as i4 from 'primeng/dropdown';
|
|
18
19
|
import { DropdownModule } from 'primeng/dropdown';
|
|
19
|
-
import * as i1$
|
|
20
|
+
import * as i1$3 from 'primeng/ripple';
|
|
20
21
|
import { RippleModule } from 'primeng/ripple';
|
|
21
22
|
import * as i3$1 from 'primeng/styleclass';
|
|
22
23
|
import { StyleClassModule } from 'primeng/styleclass';
|
|
@@ -24,11 +25,198 @@ import { trigger, state, style, transition, animate } from '@angular/animations'
|
|
|
24
25
|
import { TooltipModule } from 'primeng/tooltip';
|
|
25
26
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
26
27
|
import { DynamicDialogConfig, DynamicDialogRef, DialogService } from 'primeng/dynamicdialog';
|
|
28
|
+
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
27
29
|
import * as i2$1 from 'primeng/radiobutton';
|
|
28
30
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
31
|
+
import * as i5 from 'primeng/selectbutton';
|
|
32
|
+
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
29
33
|
|
|
30
34
|
const COMMONS_LAYOUT_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_LAYOUT_FEATURE_CONFIG');
|
|
31
35
|
|
|
36
|
+
class LayoutService {
|
|
37
|
+
getInitColorScheme() {
|
|
38
|
+
let colorScheme = this.storageService.getItem(this.typeName, this.storageColorSchemeKey);
|
|
39
|
+
if (colorScheme == null || !['dark', 'light', 'auto'].includes(colorScheme)) {
|
|
40
|
+
colorScheme = this.getDefaultColorScheme();
|
|
41
|
+
}
|
|
42
|
+
return colorScheme;
|
|
43
|
+
}
|
|
44
|
+
getInitActualColorScheme(colorScheme) {
|
|
45
|
+
if (colorScheme === 'auto') {
|
|
46
|
+
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return colorScheme;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
getDefaultColorScheme() {
|
|
53
|
+
return this.config?.colorScheme ?? this.commonsConfig?.app?.colorScheme ?? 'auto';
|
|
54
|
+
}
|
|
55
|
+
setColorScheme(scheme) {
|
|
56
|
+
const defaultColorScheme = this.getDefaultColorScheme();
|
|
57
|
+
if (scheme === defaultColorScheme) {
|
|
58
|
+
this.storageService.removeItem(this.typeName, this.storageColorSchemeKey);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.storageService.setItem(this.typeName, this.storageColorSchemeKey, scheme);
|
|
62
|
+
}
|
|
63
|
+
this._colorSchemeSetting.set(scheme);
|
|
64
|
+
this._colorScheme.set(this.getInitActualColorScheme(scheme));
|
|
65
|
+
}
|
|
66
|
+
constructor() {
|
|
67
|
+
this.typeName = 'MainLayoutComponentService';
|
|
68
|
+
this.storageMenuModeKey = 'menuMode';
|
|
69
|
+
this.storageColorSchemeKey = 'colorScheme';
|
|
70
|
+
this.platformId = inject(PLATFORM_ID);
|
|
71
|
+
this.document = inject(DOCUMENT);
|
|
72
|
+
this.commonsConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
73
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
74
|
+
this.storageService = inject(CommonsStorageService);
|
|
75
|
+
this.state = signal({
|
|
76
|
+
staticMenuDesktopInactive: false,
|
|
77
|
+
overlayMenuActive: false,
|
|
78
|
+
rightMenuActive: false,
|
|
79
|
+
configSidebarVisible: false,
|
|
80
|
+
staticMenuMobileActive: false,
|
|
81
|
+
menuHoverActive: false,
|
|
82
|
+
sidebarActive: false,
|
|
83
|
+
anchored: false
|
|
84
|
+
});
|
|
85
|
+
this.overlayOpen = new Subject();
|
|
86
|
+
this.overlayOpen$ = this.overlayOpen.asObservable();
|
|
87
|
+
// color scheme
|
|
88
|
+
this._colorSchemeSetting = signal(this.getInitColorScheme());
|
|
89
|
+
this.colorSchemeSetting = this._colorSchemeSetting.asReadonly();
|
|
90
|
+
this._colorScheme = signal(this.getInitActualColorScheme(this.colorSchemeSetting()));
|
|
91
|
+
this.colorScheme = this._colorScheme.asReadonly();
|
|
92
|
+
this.colorSchemeIsLight = computed(() => this._colorScheme() === 'light');
|
|
93
|
+
// menu mode
|
|
94
|
+
this.menuModes = this.config?.menuModes ?? ['static', 'overlay', 'reveal', 'drawer', 'slim', 'slim-plus'];
|
|
95
|
+
this._menuMode = signal(this.initMenuMode());
|
|
96
|
+
this.menuMode = this._menuMode.asReadonly();
|
|
97
|
+
// logos
|
|
98
|
+
this.appLogoLight = signal(this.config?.logoPathLight ?? this.commonsConfig?.app?.logoPathLight ?? this.config?.logoPath ?? this.commonsConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
|
|
99
|
+
this.appLogoDark = signal(this.config?.logoPathLight ?? this.commonsConfig?.app?.logoPathDark ?? this.config?.logoPath ?? this.commonsConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
|
|
100
|
+
this.appLogo = computed(() => (this.colorSchemeIsLight() ? this.appLogoLight() : this.appLogoDark()));
|
|
101
|
+
this.appLogoNameLight = signal(this.config?.logoNamePathLight ??
|
|
102
|
+
this.commonsConfig?.app?.logoNamePathLight ??
|
|
103
|
+
this.config?.logoNamePath ??
|
|
104
|
+
this.commonsConfig?.app?.logoNamePath ??
|
|
105
|
+
'assets/layout/images/logo-appname.png');
|
|
106
|
+
this.appLogoNameDark = signal(this.config?.logoNamePathDark ??
|
|
107
|
+
this.commonsConfig?.app?.logoNamePathDark ??
|
|
108
|
+
this.config?.logoNamePath ??
|
|
109
|
+
this.commonsConfig?.app?.logoNamePath ??
|
|
110
|
+
'assets/layout/images/logo-appname.png');
|
|
111
|
+
this.appLogoName = computed(() => (this.colorSchemeIsLight() ? this.appLogoNameLight() : this.appLogoNameDark()));
|
|
112
|
+
// overlays
|
|
113
|
+
this.isOverlay = computed(() => this.menuMode() === 'overlay');
|
|
114
|
+
this.isSlim = computed(() => this.menuMode() === 'slim');
|
|
115
|
+
this.isSlimPlus = computed(() => this.menuMode() === 'slim-plus');
|
|
116
|
+
afterNextRender(() => {
|
|
117
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
|
118
|
+
if (this.colorSchemeSetting() === 'auto') {
|
|
119
|
+
const newColorScheme = event.matches ? 'dark' : 'light';
|
|
120
|
+
this._colorScheme.set(newColorScheme);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
effect(() => {
|
|
125
|
+
const colorScheme = this._colorScheme();
|
|
126
|
+
const linkElement = this.document.getElementById('app-theme');
|
|
127
|
+
if (colorScheme === 'dark' && linkElement.href.includes('light')) {
|
|
128
|
+
linkElement.href = 'theme-dark.css';
|
|
129
|
+
}
|
|
130
|
+
else if (colorScheme === 'light' && linkElement.href.includes('dark')) {
|
|
131
|
+
linkElement.href = 'theme-light.css';
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
onMenuModeChange(mode) {
|
|
136
|
+
if (!this.menuModes.includes(mode)) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (mode === this.config?.menuMode) {
|
|
140
|
+
this.storageService.removeItem(this.typeName, this.storageMenuModeKey);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.storageService.setItem(this.typeName, this.storageMenuModeKey, mode);
|
|
144
|
+
}
|
|
145
|
+
this._menuMode.set(mode);
|
|
146
|
+
}
|
|
147
|
+
onMenuToggle() {
|
|
148
|
+
if (this.isOverlay()) {
|
|
149
|
+
this.state.update(state => ({
|
|
150
|
+
...state,
|
|
151
|
+
overlayMenuActive: !state.overlayMenuActive
|
|
152
|
+
}));
|
|
153
|
+
if (this.state().overlayMenuActive) {
|
|
154
|
+
this.overlayOpen.next(null);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (this.isDesktop()) {
|
|
158
|
+
this.state.update(state => ({
|
|
159
|
+
...state,
|
|
160
|
+
staticMenuDesktopInactive: !state.staticMenuDesktopInactive
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.state.update(state => ({
|
|
165
|
+
...state,
|
|
166
|
+
staticMenuMobileActive: !state.staticMenuMobileActive
|
|
167
|
+
}));
|
|
168
|
+
if (this.state().staticMenuMobileActive) {
|
|
169
|
+
this.overlayOpen.next(null);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
onOverlaySubmenuOpen() {
|
|
174
|
+
this.overlayOpen.next(null);
|
|
175
|
+
}
|
|
176
|
+
isDesktop() {
|
|
177
|
+
return window.innerWidth > 991;
|
|
178
|
+
}
|
|
179
|
+
isMobile() {
|
|
180
|
+
return !this.isDesktop();
|
|
181
|
+
}
|
|
182
|
+
initMenuMode() {
|
|
183
|
+
const lsMode = this.storageService.getItem(this.typeName, this.storageMenuModeKey);
|
|
184
|
+
if (lsMode && this.menuModes.includes(lsMode)) {
|
|
185
|
+
return lsMode;
|
|
186
|
+
}
|
|
187
|
+
return this.config?.menuMode ?? 'static';
|
|
188
|
+
}
|
|
189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: LayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
190
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: LayoutService }); }
|
|
191
|
+
}
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: LayoutService, decorators: [{
|
|
193
|
+
type: Injectable
|
|
194
|
+
}], ctorParameters: () => [] });
|
|
195
|
+
|
|
196
|
+
class ErrorPageComponent {
|
|
197
|
+
constructor() {
|
|
198
|
+
this.layout = inject(LayoutService);
|
|
199
|
+
}
|
|
200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ErrorPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
201
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (layout.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"layout.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"layout.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
202
|
+
}
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ErrorPageComponent, decorators: [{
|
|
204
|
+
type: Component,
|
|
205
|
+
args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (layout.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"layout.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"layout.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
|
|
206
|
+
}] });
|
|
207
|
+
|
|
208
|
+
class NotFoundPageComponent {
|
|
209
|
+
constructor() {
|
|
210
|
+
this.layout = inject(LayoutService);
|
|
211
|
+
}
|
|
212
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: NotFoundPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
213
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (layout.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"layout.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"layout.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: 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" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
214
|
+
}
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: NotFoundPageComponent, decorators: [{
|
|
216
|
+
type: Component,
|
|
217
|
+
args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (layout.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"layout.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"layout.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
|
|
218
|
+
}] });
|
|
219
|
+
|
|
32
220
|
class VersionService {
|
|
33
221
|
constructor(http, configurationService) {
|
|
34
222
|
this.http = http;
|
|
@@ -60,12 +248,12 @@ class VersionService {
|
|
|
60
248
|
}
|
|
61
249
|
return this.cache[url].asObservable();
|
|
62
250
|
}
|
|
63
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: VersionService, deps: [{ token: i1.HttpClient }, { token: i2.CommonsConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: VersionService, deps: [{ token: i1$2.HttpClient }, { token: i2.CommonsConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
64
252
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: VersionService }); }
|
|
65
253
|
}
|
|
66
254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: VersionService, decorators: [{
|
|
67
255
|
type: Injectable
|
|
68
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.CommonsConfigurationService }] });
|
|
256
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i2.CommonsConfigurationService }] });
|
|
69
257
|
|
|
70
258
|
class VersionComponent {
|
|
71
259
|
constructor() {
|
|
@@ -149,16 +337,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
149
337
|
class FooterComponent {
|
|
150
338
|
constructor() {
|
|
151
339
|
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
340
|
+
this.layout = inject(LayoutService);
|
|
152
341
|
this.commons = inject(CommonsService);
|
|
153
342
|
this.currentYear = signal(new Date().getFullYear());
|
|
154
343
|
this.versionComponent = signal(this.config?.components?.version === false ? undefined : this.config?.components?.version ?? VersionComponent);
|
|
155
344
|
}
|
|
156
345
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
157
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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]=\"
|
|
346
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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]=\"layout.appLogo()\" 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", "parentInjector"], outputs: ["instanceCreated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
158
347
|
}
|
|
159
348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FooterComponent, decorators: [{
|
|
160
349
|
type: Component,
|
|
161
|
-
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]=\"
|
|
350
|
+
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]=\"layout.appLogo()\" 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" }]
|
|
162
351
|
}] });
|
|
163
352
|
|
|
164
353
|
class BreadcrumbComponent {
|
|
@@ -185,92 +374,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
185
374
|
args: [{ standalone: true, selector: 'mng-breadcrumb', imports: [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(); track item.id; 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" }]
|
|
186
375
|
}] });
|
|
187
376
|
|
|
188
|
-
class MainLayoutComponentService {
|
|
189
|
-
constructor() {
|
|
190
|
-
this.typeName = 'MainLayoutComponentService';
|
|
191
|
-
this.storageMenuModeKey = 'menuMode';
|
|
192
|
-
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
193
|
-
this.storageService = inject(LocalStorageService);
|
|
194
|
-
this.state = signal({
|
|
195
|
-
staticMenuDesktopInactive: false,
|
|
196
|
-
overlayMenuActive: false,
|
|
197
|
-
rightMenuActive: false,
|
|
198
|
-
configSidebarVisible: false,
|
|
199
|
-
staticMenuMobileActive: false,
|
|
200
|
-
menuHoverActive: false,
|
|
201
|
-
sidebarActive: false,
|
|
202
|
-
anchored: false
|
|
203
|
-
});
|
|
204
|
-
this.overlayOpen = new Subject();
|
|
205
|
-
this.overlayOpen$ = this.overlayOpen.asObservable();
|
|
206
|
-
this.menuModes = this.config?.menuModes ?? ['static', 'overlay', 'reveal', 'drawer', 'slim', 'slim-plus'];
|
|
207
|
-
this._menuMode = signal(this.initMenuMode());
|
|
208
|
-
this.menuMode = this._menuMode.asReadonly();
|
|
209
|
-
this.isOverlay = computed(() => this.menuMode() === 'overlay');
|
|
210
|
-
this.isSlim = computed(() => this.menuMode() === 'slim');
|
|
211
|
-
this.isSlimPlus = computed(() => this.menuMode() === 'slim-plus');
|
|
212
|
-
}
|
|
213
|
-
onMenuModeChange(mode) {
|
|
214
|
-
if (!this.menuModes.includes(mode)) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (mode === this.config?.menuMode) {
|
|
218
|
-
this.storageService.removeItem(this.typeName, this.storageMenuModeKey);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
this.storageService.setItem(this.typeName, this.storageMenuModeKey, mode);
|
|
222
|
-
}
|
|
223
|
-
this._menuMode.set(mode);
|
|
224
|
-
}
|
|
225
|
-
onMenuToggle() {
|
|
226
|
-
if (this.isOverlay()) {
|
|
227
|
-
this.state.update(state => ({
|
|
228
|
-
...state,
|
|
229
|
-
overlayMenuActive: !state.overlayMenuActive
|
|
230
|
-
}));
|
|
231
|
-
if (this.state().overlayMenuActive) {
|
|
232
|
-
this.overlayOpen.next(null);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if (this.isDesktop()) {
|
|
236
|
-
this.state.update(state => ({
|
|
237
|
-
...state,
|
|
238
|
-
staticMenuDesktopInactive: !state.staticMenuDesktopInactive
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
this.state.update(state => ({
|
|
243
|
-
...state,
|
|
244
|
-
staticMenuMobileActive: !state.staticMenuMobileActive
|
|
245
|
-
}));
|
|
246
|
-
if (this.state().staticMenuMobileActive) {
|
|
247
|
-
this.overlayOpen.next(null);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
onOverlaySubmenuOpen() {
|
|
252
|
-
this.overlayOpen.next(null);
|
|
253
|
-
}
|
|
254
|
-
isDesktop() {
|
|
255
|
-
return window.innerWidth > 991;
|
|
256
|
-
}
|
|
257
|
-
isMobile() {
|
|
258
|
-
return !this.isDesktop();
|
|
259
|
-
}
|
|
260
|
-
initMenuMode() {
|
|
261
|
-
const lsMode = this.storageService.getItem(this.typeName, this.storageMenuModeKey);
|
|
262
|
-
if (lsMode && this.menuModes.includes(lsMode)) {
|
|
263
|
-
return lsMode;
|
|
264
|
-
}
|
|
265
|
-
return this.config?.menuMode ?? 'static';
|
|
266
|
-
}
|
|
267
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MainLayoutComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
268
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MainLayoutComponentService }); }
|
|
269
|
-
}
|
|
270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MainLayoutComponentService, decorators: [{
|
|
271
|
-
type: Injectable
|
|
272
|
-
}] });
|
|
273
|
-
|
|
274
377
|
function prepareMenuItemsToInternal(menuItems, parentKey = '') {
|
|
275
378
|
const newItems = menuItems.map((item, idx) => {
|
|
276
379
|
const itemsProp = signal([]);
|
|
@@ -289,7 +392,7 @@ function prepareMenuItemsToInternal(menuItems, parentKey = '') {
|
|
|
289
392
|
};
|
|
290
393
|
if (Array.isArray(item.items) && item.items.length > 0) {
|
|
291
394
|
newItem.items.set(prepareMenuItemsToInternal(item.items, newItem.key));
|
|
292
|
-
newItem.itemsVisibility.set(newItem.items()?.map(
|
|
395
|
+
newItem.itemsVisibility.set(newItem.items()?.map(() => signal(true)));
|
|
293
396
|
}
|
|
294
397
|
return newItem;
|
|
295
398
|
});
|
|
@@ -364,7 +467,7 @@ class MenuService {
|
|
|
364
467
|
const menuItems = adjustRouteMenuLazyChildrenRouterLinks(menuItem, menuItemsFromRoutes);
|
|
365
468
|
menuItem.items.set(prepareMenuItemsToInternal(menuItems, menuItem.key));
|
|
366
469
|
this.appendListenersToLazyChildren(menuItem.items());
|
|
367
|
-
menuItem.itemsVisibility.set(menuItem.items()?.map(
|
|
470
|
+
menuItem.itemsVisibility.set(menuItem.items()?.map(() => signal(true)));
|
|
368
471
|
menuItem.lazyChildren.set(false);
|
|
369
472
|
this.findAndSetActiveMenuItem(this.router.url);
|
|
370
473
|
}
|
|
@@ -416,7 +519,7 @@ class MenuItemComponent {
|
|
|
416
519
|
constructor() {
|
|
417
520
|
this.menuService = inject(MenuService);
|
|
418
521
|
this.permissionService = inject(PermissionService);
|
|
419
|
-
this.
|
|
522
|
+
this.layout = inject(LayoutService);
|
|
420
523
|
this.item = input.required();
|
|
421
524
|
this.root = input(false);
|
|
422
525
|
this.visibleChange = output();
|
|
@@ -455,13 +558,13 @@ class MenuItemComponent {
|
|
|
455
558
|
return true;
|
|
456
559
|
});
|
|
457
560
|
effect(() => {
|
|
458
|
-
if (this.root() && this.active() && this.
|
|
561
|
+
if (this.root() && this.active() && this.layout.isDesktop() && (this.layout.isSlim() || this.layout.isSlimPlus())) {
|
|
459
562
|
this.calculatePosition(this.submenuElRef()?.nativeElement, this.submenuElRef()?.nativeElement.parentElement);
|
|
460
563
|
}
|
|
461
564
|
});
|
|
462
565
|
}
|
|
463
566
|
get submenuAnimation() {
|
|
464
|
-
if (this.
|
|
567
|
+
if (this.layout.isDesktop() && (this.layout.isSlim() || this.layout.isSlimPlus())) {
|
|
465
568
|
return this.active() ? 'visible' : 'hidden';
|
|
466
569
|
}
|
|
467
570
|
else {
|
|
@@ -477,20 +580,20 @@ class MenuItemComponent {
|
|
|
477
580
|
}
|
|
478
581
|
// toggle active state
|
|
479
582
|
if (item.hasItemsOrLazyChildren()) {
|
|
480
|
-
if ((this.root() || this.active()) && (this.
|
|
481
|
-
this.
|
|
583
|
+
if ((this.root() || this.active()) && (this.layout.isSlim() || this.layout.isSlimPlus())) {
|
|
584
|
+
this.layout.onOverlaySubmenuOpen();
|
|
482
585
|
}
|
|
483
586
|
}
|
|
484
587
|
else {
|
|
485
|
-
if (this.
|
|
486
|
-
this.
|
|
588
|
+
if (this.layout.isMobile()) {
|
|
589
|
+
this.layout.state.update(state => ({
|
|
487
590
|
...state,
|
|
488
591
|
staticMenuMobileActive: false
|
|
489
592
|
}));
|
|
490
593
|
}
|
|
491
|
-
if (this.
|
|
594
|
+
if (this.layout.isSlim() || this.layout.isSlimPlus()) {
|
|
492
595
|
this.menuService.reset();
|
|
493
|
-
this.
|
|
596
|
+
this.layout.state.update(state => ({
|
|
494
597
|
...state,
|
|
495
598
|
menuHoverActive: false
|
|
496
599
|
}));
|
|
@@ -498,7 +601,7 @@ class MenuItemComponent {
|
|
|
498
601
|
}
|
|
499
602
|
}
|
|
500
603
|
onSubmenuAnimated(event) {
|
|
501
|
-
if (event.toState === 'visible' && this.
|
|
604
|
+
if (event.toState === 'visible' && this.layout.isDesktop() && (this.layout.isSlim() || this.layout.isSlimPlus())) {
|
|
502
605
|
const el = event.element;
|
|
503
606
|
const elParent = el.parentElement;
|
|
504
607
|
this.calculatePosition(el, elParent);
|
|
@@ -515,14 +618,14 @@ class MenuItemComponent {
|
|
|
515
618
|
// reset
|
|
516
619
|
overlay.style.top = '';
|
|
517
620
|
overlay.style.left = '';
|
|
518
|
-
if (this.
|
|
621
|
+
if (this.layout.isSlim() || this.layout.isSlimPlus()) {
|
|
519
622
|
const height = top + oHeight;
|
|
520
623
|
overlay.style.top = vHeight < height ? `${top - (height - vHeight)}px` : `${top}px`;
|
|
521
624
|
}
|
|
522
625
|
}
|
|
523
626
|
}
|
|
524
627
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
525
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: MenuItemComponent, isStandalone: true, selector: "[mng-menuitem]", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, root: { classPropertyName: "root", publicName: "root", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { properties: { "class.active-menuitem": "!root() && active()", "class.layout-root-menuitem": "root()" } }, providers: [PermissionService], viewQueries: [{ propertyName: "submenuElRef", first: true, predicate: ["submenu"], descendants: true, isSignal: 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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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, child, 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$
|
|
628
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: MenuItemComponent, isStandalone: true, selector: "[mng-menuitem]", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, root: { classPropertyName: "root", publicName: "root", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { properties: { "class.active-menuitem": "!root() && active()", "class.layout-root-menuitem": "root()" } }, providers: [PermissionService], viewQueries: [{ propertyName: "submenuElRef", first: true, predicate: ["submenu"], descendants: true, isSignal: 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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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().hasItemsOrLazyChildren()) {\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().hasItems()) {\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, child, 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$3.Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$4.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: [
|
|
526
629
|
trigger('children', [
|
|
527
630
|
state('collapsed', style({
|
|
528
631
|
height: '0'
|
|
@@ -568,7 +671,7 @@ class MenuComponent {
|
|
|
568
671
|
constructor() {
|
|
569
672
|
this.route = inject(ActivatedRoute);
|
|
570
673
|
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
571
|
-
this.
|
|
674
|
+
this.layout = inject(LayoutService);
|
|
572
675
|
this.menuService = inject(MenuService);
|
|
573
676
|
this.routeData = toSignal(this.route.data);
|
|
574
677
|
effect(() => {
|
|
@@ -580,7 +683,7 @@ class MenuComponent {
|
|
|
580
683
|
items = this.routeData().menuItems;
|
|
581
684
|
}
|
|
582
685
|
// Wraps menu items
|
|
583
|
-
if (!(this.
|
|
686
|
+
if (!(this.layout.isSlim() || this.layout.isSlimPlus())) {
|
|
584
687
|
items = [{ items }];
|
|
585
688
|
}
|
|
586
689
|
untracked(() => this.menuService.setItems(items));
|
|
@@ -597,28 +700,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
597
700
|
class SidebarComponent {
|
|
598
701
|
constructor() {
|
|
599
702
|
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
600
|
-
this.
|
|
601
|
-
this.layoutService = inject(MainLayoutComponentService);
|
|
703
|
+
this.layout = inject(LayoutService);
|
|
602
704
|
this.el = inject(ElementRef);
|
|
603
705
|
this.menuComponent = signal(this.config?.components?.menu === false ? undefined : this.config?.components?.menu ?? MenuComponent);
|
|
604
706
|
this.timeout = null;
|
|
605
707
|
}
|
|
606
708
|
onMouseEnter() {
|
|
607
|
-
if (!this.
|
|
709
|
+
if (!this.layout.state().anchored) {
|
|
608
710
|
if (this.timeout) {
|
|
609
711
|
clearTimeout(this.timeout);
|
|
610
712
|
this.timeout = null;
|
|
611
713
|
}
|
|
612
|
-
this.
|
|
714
|
+
this.layout.state.update(state => ({
|
|
613
715
|
...state,
|
|
614
716
|
sidebarActive: true
|
|
615
717
|
}));
|
|
616
718
|
}
|
|
617
719
|
}
|
|
618
720
|
onMouseLeave() {
|
|
619
|
-
if (!this.
|
|
721
|
+
if (!this.layout.state().anchored) {
|
|
620
722
|
if (!this.timeout) {
|
|
621
|
-
this.timeout = setTimeout(() => this.
|
|
723
|
+
this.timeout = setTimeout(() => this.layout.state.update(state => ({
|
|
622
724
|
...state,
|
|
623
725
|
sidebarActive: false
|
|
624
726
|
})), 300);
|
|
@@ -626,34 +728,65 @@ class SidebarComponent {
|
|
|
626
728
|
}
|
|
627
729
|
}
|
|
628
730
|
anchor() {
|
|
629
|
-
this.
|
|
731
|
+
this.layout.state.update(state => ({
|
|
630
732
|
...state,
|
|
631
733
|
anchored: !state.anchored
|
|
632
734
|
}));
|
|
633
735
|
}
|
|
634
736
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
635
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: SidebarComponent, isStandalone: true, selector: "mng-sidebar", 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]=\"
|
|
737
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: SidebarComponent, isStandalone: true, selector: "mng-sidebar", 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]=\"layout.appLogo()\" [alt]=\"'App logo'\" />\n </div>\n <div class=\"app-logo-normal\">\n <img class=\"h-2rem\" [src]=\"layout.appLogo()\" [alt]=\"'App logo'\" />\n <img class=\"h-2rem ml-3\" [src]=\"layout.appLogoName()\" [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$4.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", "parentInjector"], outputs: ["instanceCreated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
636
738
|
}
|
|
637
739
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
638
740
|
type: Component,
|
|
639
|
-
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]=\"
|
|
741
|
+
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]=\"layout.appLogo()\" [alt]=\"'App logo'\" />\n </div>\n <div class=\"app-logo-normal\">\n <img class=\"h-2rem\" [src]=\"layout.appLogo()\" [alt]=\"'App logo'\" />\n <img class=\"h-2rem ml-3\" [src]=\"layout.appLogoName()\" [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" }]
|
|
640
742
|
}] });
|
|
641
743
|
|
|
744
|
+
const defaultColorSchemeOpts = [
|
|
745
|
+
{
|
|
746
|
+
value: 'auto',
|
|
747
|
+
label: 'system'
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
value: 'light',
|
|
751
|
+
label: 'light'
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
value: 'dark',
|
|
755
|
+
label: 'dark'
|
|
756
|
+
}
|
|
757
|
+
];
|
|
642
758
|
class SettingsComponent {
|
|
643
759
|
constructor() {
|
|
760
|
+
this.document = inject(DOCUMENT);
|
|
644
761
|
this.dynamicDialogConfig = inject(DynamicDialogConfig);
|
|
645
762
|
this.dynamicDialogRef = inject(DynamicDialogRef);
|
|
763
|
+
this.colorSchemeOptions = signal(defaultColorSchemeOpts);
|
|
646
764
|
this.injector = this.dynamicDialogConfig.data.injector;
|
|
647
765
|
this.translate = this.injector.get(TranslateService);
|
|
648
766
|
this.commons = this.injector.get(CommonsService);
|
|
649
|
-
this.
|
|
650
|
-
this.menuModes = this.
|
|
767
|
+
this.layout = this.injector.get(LayoutService);
|
|
768
|
+
this.menuModes = this.layout.menuModes;
|
|
651
769
|
this.translate
|
|
652
770
|
.stream('mngSettings.title')
|
|
653
771
|
.pipe(takeUntilDestroyed())
|
|
654
772
|
.subscribe(t => {
|
|
655
773
|
setTimeout(() => (this.dynamicDialogConfig.header = t));
|
|
656
774
|
});
|
|
775
|
+
const translateKey = 'mngSettings.colorScheme.options';
|
|
776
|
+
this.translate
|
|
777
|
+
.stream('mngSettings.colorScheme.options')
|
|
778
|
+
.pipe(takeUntilDestroyed())
|
|
779
|
+
.subscribe(t => {
|
|
780
|
+
if (t === translateKey) {
|
|
781
|
+
this.colorSchemeOptions.set(defaultColorSchemeOpts);
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
this.colorSchemeOptions.update(options => options.map(o => ({
|
|
785
|
+
value: o.value,
|
|
786
|
+
label: `${t[o.value]}`
|
|
787
|
+
})));
|
|
788
|
+
}
|
|
789
|
+
});
|
|
657
790
|
}
|
|
658
791
|
switchLocale(language) {
|
|
659
792
|
this.commons.setAppLocale(language);
|
|
@@ -662,17 +795,20 @@ class SettingsComponent {
|
|
|
662
795
|
this.commons.setAppDataLocale(language);
|
|
663
796
|
}
|
|
664
797
|
onMenuModeChange(mode) {
|
|
665
|
-
this.
|
|
798
|
+
this.layout.onMenuModeChange(mode);
|
|
799
|
+
}
|
|
800
|
+
onColorSchemeChange(scheme) {
|
|
801
|
+
this.layout.setColorScheme(scheme);
|
|
666
802
|
}
|
|
667
803
|
closeDialog() {
|
|
668
804
|
this.dynamicDialogRef.close();
|
|
669
805
|
}
|
|
670
806
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SettingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
671
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: SettingsComponent, isStandalone: true, selector: "mng-settings", ngImport: i0, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1 mng-action-editor-form-container\">\n @if (commons.appLocales().length > 1 || commons.appDataLocales().length > 1) {\n <h5>{{ 'mngSettings.locales' | translate }}</h5>\n <div class=\"formgrid grid\">\n @if (commons.appLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"commons.appLocale()\" [options]=\"commons.appLocales()\" (onChange)=\"switchLocale($event.value)\"></p-dropdown>\n </div>\n }\n @if (commons.appDataLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-database\"></i>\n <p-dropdown [ngModel]=\"commons.appDataLocale()\" [options]=\"commons.appDataLocales()\" (onChange)=\"switchDataLocale($event.value)\"></p-dropdown>\n </div>\n }\n </div>\n }\n\n @if (menuModes.length > 1) {\n <h5>{{ 'mngSettings.menuMode.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n @for (mode of menuModes; track mode) {\n <div class=\"field-radiobutton col-6 md:col-4\">\n <p-radioButton name=\"category\" [value]=\"mode\" [ngModel]=\"
|
|
807
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: SettingsComponent, isStandalone: true, selector: "mng-settings", ngImport: i0, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1 mng-action-editor-form-container\">\n @if (commons.appLocales().length > 1 || commons.appDataLocales().length > 1) {\n <h5>{{ 'mngSettings.locales' | translate }}</h5>\n <div class=\"formgrid grid\">\n @if (commons.appLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"commons.appLocale()\" [options]=\"commons.appLocales()\" (onChange)=\"switchLocale($event.value)\"></p-dropdown>\n </div>\n }\n @if (commons.appDataLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-database\"></i>\n <p-dropdown [ngModel]=\"commons.appDataLocale()\" [options]=\"commons.appDataLocales()\" (onChange)=\"switchDataLocale($event.value)\"></p-dropdown>\n </div>\n }\n </div>\n }\n\n <h5>{{ 'mngSettings.colorScheme.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n <p-selectButton\n [options]=\"colorSchemeOptions()\"\n [ngModel]=\"layout.colorSchemeSetting()\"\n (ngModelChange)=\"onColorSchemeChange($event)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n allowEmpty=\"false\" />\n </div>\n\n @if (menuModes.length > 1) {\n <h5>{{ 'mngSettings.menuMode.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n @for (mode of menuModes; track mode) {\n <div class=\"field-radiobutton col-6 md:col-4\">\n <p-radioButton name=\"category\" [value]=\"mode\" [ngModel]=\"layout.menuMode()\" (ngModelChange)=\"onMenuModeChange(mode)\" />\n <label [for]=\"mode\" class=\"ml-2\">\n {{ 'mngSettings.menuMode.' + mode | translate }}\n </label>\n </div>\n }\n </div>\n }\n\n <div class=\"flex flex-row justify-content-between mng-action-editor-footer-container\">\n <div></div>\n <div>\n <p-button (onClick)=\"closeDialog()\" [label]=\"'general.close' | translate\" icon=\"pi pi-times\" styleClass=\"p-button-primary p-button-text\" />\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: RadioButtonModule }, { kind: "component", type: i2$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "variant", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i4.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "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: "ngmodule", type: InputSwitchModule }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i5.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
672
808
|
}
|
|
673
809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SettingsComponent, decorators: [{
|
|
674
810
|
type: Component,
|
|
675
|
-
args: [{ standalone: true, selector: 'mng-settings', imports: [TranslateModule, RadioButtonModule, FormsModule, Button, DropdownModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1 mng-action-editor-form-container\">\n @if (commons.appLocales().length > 1 || commons.appDataLocales().length > 1) {\n <h5>{{ 'mngSettings.locales' | translate }}</h5>\n <div class=\"formgrid grid\">\n @if (commons.appLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"commons.appLocale()\" [options]=\"commons.appLocales()\" (onChange)=\"switchLocale($event.value)\"></p-dropdown>\n </div>\n }\n @if (commons.appDataLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-database\"></i>\n <p-dropdown [ngModel]=\"commons.appDataLocale()\" [options]=\"commons.appDataLocales()\" (onChange)=\"switchDataLocale($event.value)\"></p-dropdown>\n </div>\n }\n </div>\n }\n\n @if (menuModes.length > 1) {\n <h5>{{ 'mngSettings.menuMode.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n @for (mode of menuModes; track mode) {\n <div class=\"field-radiobutton col-6 md:col-4\">\n <p-radioButton name=\"category\" [value]=\"mode\" [ngModel]=\"
|
|
811
|
+
args: [{ standalone: true, selector: 'mng-settings', imports: [TranslateModule, RadioButtonModule, FormsModule, Button, DropdownModule, InputSwitchModule, SelectButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1 mng-action-editor-form-container\">\n @if (commons.appLocales().length > 1 || commons.appDataLocales().length > 1) {\n <h5>{{ 'mngSettings.locales' | translate }}</h5>\n <div class=\"formgrid grid\">\n @if (commons.appLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"commons.appLocale()\" [options]=\"commons.appLocales()\" (onChange)=\"switchLocale($event.value)\"></p-dropdown>\n </div>\n }\n @if (commons.appDataLocales().length > 1) {\n <div class=\"field pr-4\">\n <i class=\"pi pi-fw pi-database\"></i>\n <p-dropdown [ngModel]=\"commons.appDataLocale()\" [options]=\"commons.appDataLocales()\" (onChange)=\"switchDataLocale($event.value)\"></p-dropdown>\n </div>\n }\n </div>\n }\n\n <h5>{{ 'mngSettings.colorScheme.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n <p-selectButton\n [options]=\"colorSchemeOptions()\"\n [ngModel]=\"layout.colorSchemeSetting()\"\n (ngModelChange)=\"onColorSchemeChange($event)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n allowEmpty=\"false\" />\n </div>\n\n @if (menuModes.length > 1) {\n <h5>{{ 'mngSettings.menuMode.title' | translate }}</h5>\n <div class=\"formgrid grid\">\n @for (mode of menuModes; track mode) {\n <div class=\"field-radiobutton col-6 md:col-4\">\n <p-radioButton name=\"category\" [value]=\"mode\" [ngModel]=\"layout.menuMode()\" (ngModelChange)=\"onMenuModeChange(mode)\" />\n <label [for]=\"mode\" class=\"ml-2\">\n {{ 'mngSettings.menuMode.' + mode | translate }}\n </label>\n </div>\n }\n </div>\n }\n\n <div class=\"flex flex-row justify-content-between mng-action-editor-footer-container\">\n <div></div>\n <div>\n <p-button (onClick)=\"closeDialog()\" [label]=\"'general.close' | translate\" icon=\"pi pi-times\" styleClass=\"p-button-primary p-button-text\" />\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
676
812
|
}], ctorParameters: () => [] });
|
|
677
813
|
|
|
678
814
|
class TopbarUserComponent {
|
|
@@ -681,8 +817,10 @@ class TopbarUserComponent {
|
|
|
681
817
|
this.dialogService = inject(DialogService);
|
|
682
818
|
this.commons = inject(CommonsService);
|
|
683
819
|
this.hrefJsVoid = inject(DomSanitizer).bypassSecurityTrustUrl('javascript:void(0)');
|
|
820
|
+
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
684
821
|
this.user = computed(() => this.commons.user());
|
|
685
822
|
this.userRoles = computed(() => this.commons.userRoles());
|
|
823
|
+
this.settingsDisabled = signal(this.config?.components?.settings === false);
|
|
686
824
|
}
|
|
687
825
|
logout(user, event) {
|
|
688
826
|
if (typeof user?.logout === 'function') {
|
|
@@ -692,7 +830,10 @@ class TopbarUserComponent {
|
|
|
692
830
|
}
|
|
693
831
|
}
|
|
694
832
|
openSettings() {
|
|
695
|
-
this.
|
|
833
|
+
if (this.config?.components?.settings === false) {
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
this.dialogService.open(this.config?.components?.settings ?? SettingsComponent, {
|
|
696
837
|
modal: true,
|
|
697
838
|
styleClass: 'mng-dialog mng-action-editor-dialog mng-dialog-xs',
|
|
698
839
|
data: {
|
|
@@ -701,24 +842,24 @@ class TopbarUserComponent {
|
|
|
701
842
|
});
|
|
702
843
|
}
|
|
703
844
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TopbarUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
704
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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().length > 0) {\n <small>\n <br />\n {{ userRoles() }}\n </small>\n }\n </div>\n </a>\n </li>\n <li role=\"menuitem\">\n
|
|
845
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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().length > 0) {\n <small>\n <br />\n {{ userRoles() }}\n </small>\n }\n </div>\n </a>\n </li>\n @if (!settingsDisabled()) {\n <li role=\"menuitem\">\n <a\n [href]=\"hrefJsVoid\"\n (click)=\"openSettings()\"\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-cog text-base mr-2\"></i>\n {{ 'mngSettings.title' | translate }}\n </a>\n </li>\n }\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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: RippleModule }, { kind: "directive", type: i1$3.Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: StyleClassModule }, { kind: "directive", type: i3$1.StyleClass, selector: "[pStyleClass]", inputs: ["pStyleClass", "enterClass", "enterFromClass", "enterActiveClass", "enterToClass", "leaveClass", "leaveFromClass", "leaveActiveClass", "leaveToClass", "hideOnOutsideClick", "toggleClass", "hideOnEscape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
705
846
|
}
|
|
706
847
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TopbarUserComponent, decorators: [{
|
|
707
848
|
type: Component,
|
|
708
|
-
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().length > 0) {\n <small>\n <br />\n {{ userRoles() }}\n </small>\n }\n </div>\n </a>\n </li>\n <li role=\"menuitem\">\n
|
|
849
|
+
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().length > 0) {\n <small>\n <br />\n {{ userRoles() }}\n </small>\n }\n </div>\n </a>\n </li>\n @if (!settingsDisabled()) {\n <li role=\"menuitem\">\n <a\n [href]=\"hrefJsVoid\"\n (click)=\"openSettings()\"\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-cog text-base mr-2\"></i>\n {{ 'mngSettings.title' | translate }}\n </a>\n </li>\n }\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" }]
|
|
709
850
|
}] });
|
|
710
851
|
|
|
711
852
|
class TopbarComponent {
|
|
712
853
|
constructor() {
|
|
713
854
|
this.el = inject(ElementRef);
|
|
714
855
|
this.commons = inject(CommonsService);
|
|
715
|
-
this.
|
|
856
|
+
this.layout = inject(LayoutService);
|
|
716
857
|
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
717
858
|
this.topbarUserComponent = signal(this.config?.components?.topbarUser === false ? undefined : this.config?.components?.topbarUser ?? TopbarUserComponent);
|
|
718
859
|
this.breadcrumbComponent = signal(this.config?.components?.breadcrumb === false ? undefined : this.config?.components?.breadcrumb ?? BreadcrumbComponent);
|
|
719
860
|
}
|
|
720
861
|
onMenuButtonClick() {
|
|
721
|
-
this.
|
|
862
|
+
this.layout.onMenuToggle();
|
|
722
863
|
}
|
|
723
864
|
switchLocale(language) {
|
|
724
865
|
this.commons.setAppLocale(language);
|
|
@@ -733,19 +874,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
733
874
|
|
|
734
875
|
class MainLayoutComponent {
|
|
735
876
|
constructor() {
|
|
736
|
-
|
|
877
|
+
// private readonly commonsService = inject(CommonsService);
|
|
737
878
|
this.config = inject(COMMONS_LAYOUT_FEATURE_CONFIG_IT, { optional: true });
|
|
738
|
-
this.
|
|
879
|
+
this.layout = inject(LayoutService);
|
|
739
880
|
this.menuService = inject(MenuService);
|
|
740
881
|
this.renderer = inject(Renderer2);
|
|
741
882
|
this.appTopbar = viewChild('topbarCmp');
|
|
742
|
-
this.colorScheme = computed(() => this.commonsService.colorScheme() ?? 'light');
|
|
743
883
|
this.ripple = signal(this.config?.ripple ?? true);
|
|
744
884
|
this.topbarComponent = signal(this.config?.components?.topbar === false ? undefined : this.config?.components?.topbar ?? TopbarComponent);
|
|
745
885
|
this.breadcrumbsComponent = signal(this.config?.components?.breadcrumb === false ? undefined : this.config?.components?.breadcrumb ?? BreadcrumbComponent);
|
|
746
886
|
this.footerComponent = signal(this.config?.components?.footer === false ? undefined : this.config?.components?.footer ?? FooterComponent);
|
|
747
887
|
this.useNotificationWrapper = signal(!this.config?.disableNotificationWrapper);
|
|
748
|
-
this.
|
|
888
|
+
this.layout.overlayOpen$.pipe(takeUntilDestroyed()).subscribe(() => {
|
|
749
889
|
if (!this.menuOutsideClickListener) {
|
|
750
890
|
this.menuOutsideClickListener = this.renderer.listen('document', 'click', event => {
|
|
751
891
|
const isOutsideClicked = !(this.appTopbar()?.nativeElement.isSameNode(event.target) || this.appTopbar()?.nativeElement.contains(event.target));
|
|
@@ -754,7 +894,7 @@ class MainLayoutComponent {
|
|
|
754
894
|
}
|
|
755
895
|
});
|
|
756
896
|
}
|
|
757
|
-
if (this.
|
|
897
|
+
if (this.layout.state().staticMenuMobileActive) {
|
|
758
898
|
this.blockBodyScroll();
|
|
759
899
|
}
|
|
760
900
|
});
|
|
@@ -776,7 +916,7 @@ class MainLayoutComponent {
|
|
|
776
916
|
}
|
|
777
917
|
}
|
|
778
918
|
hideMenu() {
|
|
779
|
-
this.
|
|
919
|
+
this.layout.state.update(state => ({
|
|
780
920
|
...state,
|
|
781
921
|
overlayMenuActive: false,
|
|
782
922
|
staticMenuMobileActive: false,
|
|
@@ -795,11 +935,11 @@ class MainLayoutComponent {
|
|
|
795
935
|
}
|
|
796
936
|
}
|
|
797
937
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MainLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
798
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: MainLayoutComponent, isStandalone: true, selector: "mng-main-layout",
|
|
938
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: MainLayoutComponent, isStandalone: true, selector: "mng-main-layout", viewQueries: [{ propertyName: "appTopbar", first: true, predicate: ["topbarCmp"], descendants: true, isSignal: 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': layout.colorScheme() === 'light',\n 'layout-dark': layout.colorScheme() === 'dark',\n 'layout-overlay': layout.menuMode() === 'overlay',\n 'layout-static': layout.menuMode() === 'static',\n 'layout-reveal': layout.menuMode() === 'reveal',\n 'layout-drawer': layout.menuMode() === 'drawer',\n 'layout-slim': layout.menuMode() === 'slim',\n 'layout-slim-plus': layout.menuMode() === 'slim-plus',\n 'layout-static-inactive': layout.state().staticMenuDesktopInactive && layout.menuMode() === 'static',\n 'layout-overlay-active': layout.state().overlayMenuActive,\n 'layout-mobile-active': layout.state().staticMenuMobileActive,\n 'p-ripple-disabled': !ripple(),\n 'layout-sidebar-active': layout.state().sidebarActive,\n 'layout-sidebar-anchored': layout.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$4.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "component", type: NotificationWrapperComponent, selector: "mng-notification-wrapper" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
799
939
|
}
|
|
800
940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: MainLayoutComponent, decorators: [{
|
|
801
941
|
type: Component,
|
|
802
|
-
args: [{ standalone: true, selector: 'mng-main-layout', imports: [NgClass, RouterModule, TopbarComponent, BreadcrumbComponent, ComponentDirective, AsyncPipe, NotificationWrapperComponent, NgTemplateOutlet],
|
|
942
|
+
args: [{ standalone: true, selector: 'mng-main-layout', imports: [NgClass, RouterModule, TopbarComponent, BreadcrumbComponent, ComponentDirective, AsyncPipe, NotificationWrapperComponent, NgTemplateOutlet], 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': layout.colorScheme() === 'light',\n 'layout-dark': layout.colorScheme() === 'dark',\n 'layout-overlay': layout.menuMode() === 'overlay',\n 'layout-static': layout.menuMode() === 'static',\n 'layout-reveal': layout.menuMode() === 'reveal',\n 'layout-drawer': layout.menuMode() === 'drawer',\n 'layout-slim': layout.menuMode() === 'slim',\n 'layout-slim-plus': layout.menuMode() === 'slim-plus',\n 'layout-static-inactive': layout.state().staticMenuDesktopInactive && layout.menuMode() === 'static',\n 'layout-overlay-active': layout.state().overlayMenuActive,\n 'layout-mobile-active': layout.state().staticMenuMobileActive,\n 'p-ripple-disabled': !ripple(),\n 'layout-sidebar-active': layout.state().sidebarActive,\n 'layout-sidebar-anchored': layout.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" }]
|
|
803
943
|
}], ctorParameters: () => [] });
|
|
804
944
|
|
|
805
945
|
/**
|
|
@@ -823,6 +963,7 @@ function withLayout(config) {
|
|
|
823
963
|
providers: [
|
|
824
964
|
MenuService,
|
|
825
965
|
VersionService,
|
|
966
|
+
LayoutService,
|
|
826
967
|
{
|
|
827
968
|
provide: COMMONS_LAYOUT_FEATURE_CONFIG_IT,
|
|
828
969
|
useValue: config
|
|
@@ -837,5 +978,5 @@ function withLayout(config) {
|
|
|
837
978
|
* Generated bundle index. Do not edit.
|
|
838
979
|
*/
|
|
839
980
|
|
|
840
|
-
export { BreadcrumbComponent, COMMONS_LAYOUT_FEATURE_CONFIG_IT, FooterComponent,
|
|
981
|
+
export { BreadcrumbComponent, COMMONS_LAYOUT_FEATURE_CONFIG_IT, ErrorPageComponent, FooterComponent, LayoutService, MainLayoutComponent, MenuComponent, MenuItemComponent, MenuService, NotFoundPageComponent, SettingsComponent, SidebarComponent, TopbarComponent, TopbarUserComponent, VersionComponent, VersionService, createLayoutRoute, withLayout };
|
|
841
982
|
//# sourceMappingURL=mediusinc-mng-commons-layout.mjs.map
|