@ngx-smz/layout 19.2.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.
Files changed (41) hide show
  1. package/README.md +63 -0
  2. package/fesm2022/ngx-smz-layout.mjs +1641 -0
  3. package/fesm2022/ngx-smz-layout.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/lib/config/config.d.ts +23 -0
  6. package/lib/config/index.d.ts +2 -0
  7. package/lib/config/provide.d.ts +4 -0
  8. package/lib/errors/access.d.ts +6 -0
  9. package/lib/errors/error.d.ts +6 -0
  10. package/lib/errors/errors-pages-service.d.ts +41 -0
  11. package/lib/errors/errors.routes.d.ts +2 -0
  12. package/lib/errors/notfound.d.ts +6 -0
  13. package/lib/layout/component/app.configurator.d.ts +97 -0
  14. package/lib/layout/component/app.floatingconfigurator.d.ts +9 -0
  15. package/lib/layout/component/app.footer.d.ts +21 -0
  16. package/lib/layout/component/app.layout.d.ts +31 -0
  17. package/lib/layout/component/app.menu.d.ts +8 -0
  18. package/lib/layout/component/app.menuitem.d.ts +26 -0
  19. package/lib/layout/component/app.sidebar.d.ts +8 -0
  20. package/lib/layout/component/app.topbar.d.ts +41 -0
  21. package/lib/layout/service/layout.service.d.ts +54 -0
  22. package/lib/shared/component-injector/directives/component-injector.directive.d.ts +20 -0
  23. package/lib/shared/component-injector/interfaces/inject-content.d.ts +8 -0
  24. package/lib/shared/component-injector/interfaces/injectable.d.ts +35 -0
  25. package/lib/shared/component-injector/services/inject-component.service.d.ts +12 -0
  26. package/package.json +26 -0
  27. package/public-api.d.ts +12 -0
  28. package/resources/layout/_core.scss +24 -0
  29. package/resources/layout/_footer.scss +8 -0
  30. package/resources/layout/_main.scss +13 -0
  31. package/resources/layout/_menu.scss +160 -0
  32. package/resources/layout/_mixins.scss +15 -0
  33. package/resources/layout/_preloading.scss +47 -0
  34. package/resources/layout/_responsive.scss +110 -0
  35. package/resources/layout/_topbar.scss +164 -0
  36. package/resources/layout/_typography.scss +68 -0
  37. package/resources/layout/_utils.scss +25 -0
  38. package/resources/layout/layout.scss +13 -0
  39. package/resources/layout/variables/_common.scss +20 -0
  40. package/resources/layout/variables/_dark.scss +5 -0
  41. package/resources/layout/variables/_light.scss +5 -0
@@ -0,0 +1,1641 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, Injectable, InjectionToken, provideAppInitializer, inject, makeEnvironmentProviders, computed, effect, PLATFORM_ID, Component, EventEmitter, Output, Input, Directive, HostBinding, ViewChild } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i1$1 from '@angular/router';
6
+ import { Router, RouterModule, NavigationEnd } from '@angular/router';
7
+ import { Subject, filter as filter$1 } from 'rxjs';
8
+ import * as i3$1 from 'primeng/styleclass';
9
+ import { StyleClassModule } from 'primeng/styleclass';
10
+ import * as i2 from '@angular/forms';
11
+ import { FormsModule } from '@angular/forms';
12
+ import { updatePreset, updateSurfacePalette, $t } from '@primeng/themes';
13
+ import Aura from '@primeng/themes/aura';
14
+ import Lara from '@primeng/themes/lara';
15
+ import Nora from '@primeng/themes/nora';
16
+ import { PrimeNG } from 'primeng/config';
17
+ import * as i3 from 'primeng/selectbutton';
18
+ import { SelectButtonModule } from 'primeng/selectbutton';
19
+ import { takeWhile, filter } from 'rxjs/operators';
20
+ import * as i4 from 'primeng/tooltip';
21
+ import { TooltipModule } from 'primeng/tooltip';
22
+ import * as i5 from 'primeng/menu';
23
+ import { MenuModule } from 'primeng/menu';
24
+ import * as i2$1 from 'primeng/button';
25
+ import { ButtonModule } from 'primeng/button';
26
+ import { trigger, state, transition, style, animate } from '@angular/animations';
27
+ import * as i4$1 from 'primeng/ripple';
28
+ import { RippleModule } from 'primeng/ripple';
29
+
30
+ class SmzUILayout {
31
+ sidebar = signal([]);
32
+ footer = signal({});
33
+ topbar = signal({
34
+ showMenuToggle: true,
35
+ });
36
+ layout = signal({
37
+ preset: 'Aura',
38
+ primary: 'orange',
39
+ surface: null,
40
+ darkTheme: false,
41
+ menuMode: 'static'
42
+ });
43
+ state = signal({
44
+ staticMenuDesktopInactive: false,
45
+ overlayMenuActive: false,
46
+ configSidebarVisible: false,
47
+ staticMenuMobileActive: false,
48
+ menuHoverActive: false
49
+ });
50
+ setConfig(config) {
51
+ const { sidebar, footer, topbar } = config || {};
52
+ if (sidebar) {
53
+ this.sidebar = sidebar;
54
+ }
55
+ ;
56
+ if (footer) {
57
+ this.footer = footer;
58
+ }
59
+ ;
60
+ if (topbar) {
61
+ this.topbar = topbar;
62
+ }
63
+ ;
64
+ }
65
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SmzUILayout, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
66
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SmzUILayout, providedIn: 'root' });
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SmzUILayout, decorators: [{
69
+ type: Injectable,
70
+ args: [{ providedIn: 'root' }]
71
+ }] });
72
+
73
+ const SMZ_UI_LAYOUT_CONFIG = new InjectionToken('SMZ_UI_LAYOUT_CONFIG');
74
+ function provideSmzUILayout(initializers) {
75
+ const features = initializers();
76
+ const providers = features?.map((feature) => ({
77
+ provide: SMZ_UI_LAYOUT_CONFIG,
78
+ useValue: feature,
79
+ multi: false
80
+ }));
81
+ const initializer = provideAppInitializer(() => {
82
+ const SmzUILayoutConfig = inject(SmzUILayout);
83
+ features?.forEach((feature) => SmzUILayoutConfig.setConfig(feature));
84
+ return;
85
+ });
86
+ return makeEnvironmentProviders([...providers, initializer]);
87
+ }
88
+
89
+ class LayoutService {
90
+ config = inject(SMZ_UI_LAYOUT_CONFIG);
91
+ layoutConfig = this.config.layout;
92
+ layoutState = this.config.state;
93
+ configUpdate = new Subject();
94
+ overlayOpen = new Subject();
95
+ menuSource = new Subject();
96
+ resetSource = new Subject();
97
+ menuSource$ = this.menuSource.asObservable();
98
+ resetSource$ = this.resetSource.asObservable();
99
+ configUpdate$ = this.configUpdate.asObservable();
100
+ overlayOpen$ = this.overlayOpen.asObservable();
101
+ theme = computed(() => (this.layoutConfig()?.darkTheme ? 'light' : 'dark'));
102
+ isSidebarActive = computed(() => this.layoutState().overlayMenuActive || this.layoutState().staticMenuMobileActive);
103
+ isDarkTheme = computed(() => this.layoutConfig().darkTheme);
104
+ getPrimary = computed(() => this.layoutConfig().primary);
105
+ getSurface = computed(() => this.layoutConfig().surface);
106
+ isOverlay = computed(() => this.layoutConfig().menuMode === 'overlay');
107
+ transitionComplete = signal(false);
108
+ initialized = false;
109
+ constructor() {
110
+ effect(() => {
111
+ const config = this.layoutConfig();
112
+ if (config) {
113
+ this.onConfigUpdate();
114
+ }
115
+ });
116
+ effect(() => {
117
+ const config = this.layoutConfig();
118
+ if (!this.initialized || !config) {
119
+ this.initialized = true;
120
+ return;
121
+ }
122
+ this.handleDarkModeTransition(config);
123
+ });
124
+ }
125
+ handleDarkModeTransition(config) {
126
+ if (document.startViewTransition) {
127
+ this.startViewTransition(config);
128
+ }
129
+ else {
130
+ this.toggleDarkMode(config);
131
+ this.onTransitionEnd();
132
+ }
133
+ }
134
+ startViewTransition(config) {
135
+ const transition = document.startViewTransition(() => {
136
+ this.toggleDarkMode(config);
137
+ });
138
+ transition.ready
139
+ .then(() => {
140
+ this.onTransitionEnd();
141
+ })
142
+ .catch(() => { });
143
+ }
144
+ toggleDarkMode(config) {
145
+ const _config = config || this.layoutConfig();
146
+ if (_config.darkTheme) {
147
+ document.documentElement.classList.add('app-dark');
148
+ }
149
+ else {
150
+ document.documentElement.classList.remove('app-dark');
151
+ }
152
+ }
153
+ onTransitionEnd() {
154
+ this.transitionComplete.set(true);
155
+ setTimeout(() => {
156
+ this.transitionComplete.set(false);
157
+ });
158
+ }
159
+ onMenuToggle() {
160
+ if (this.isOverlay()) {
161
+ this.layoutState.update((prev) => ({ ...prev, overlayMenuActive: !this.layoutState().overlayMenuActive }));
162
+ if (this.layoutState().overlayMenuActive) {
163
+ this.overlayOpen.next(null);
164
+ }
165
+ }
166
+ if (this.isDesktop()) {
167
+ this.layoutState.update((prev) => ({ ...prev, staticMenuDesktopInactive: !this.layoutState().staticMenuDesktopInactive }));
168
+ }
169
+ else {
170
+ this.layoutState.update((prev) => ({ ...prev, staticMenuMobileActive: !this.layoutState().staticMenuMobileActive }));
171
+ if (this.layoutState().staticMenuMobileActive) {
172
+ this.overlayOpen.next(null);
173
+ }
174
+ }
175
+ }
176
+ isDesktop() {
177
+ return window.innerWidth > 991;
178
+ }
179
+ isMobile() {
180
+ return !this.isDesktop();
181
+ }
182
+ onConfigUpdate() {
183
+ this.configUpdate.next(this.layoutConfig());
184
+ }
185
+ onMenuStateChange(event) {
186
+ this.menuSource.next(event);
187
+ }
188
+ reset() {
189
+ this.resetSource.next(true);
190
+ }
191
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: LayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
192
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: LayoutService, providedIn: 'root' });
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: LayoutService, decorators: [{
195
+ type: Injectable,
196
+ args: [{
197
+ providedIn: 'root'
198
+ }]
199
+ }], ctorParameters: () => [] });
200
+
201
+ const presets = {
202
+ Aura,
203
+ Lara,
204
+ Nora
205
+ };
206
+ class AppConfigurator {
207
+ router = inject(Router);
208
+ config = inject(PrimeNG);
209
+ layoutService = inject(LayoutService);
210
+ platformId = inject(PLATFORM_ID);
211
+ primeNG = inject(PrimeNG);
212
+ presets = Object.keys(presets);
213
+ showMenuModeButton = signal(!this.router.url.includes('auth'));
214
+ menuModeOptions = [
215
+ { label: 'Static', value: 'static' },
216
+ { label: 'Overlay', value: 'overlay' }
217
+ ];
218
+ ngOnInit() {
219
+ // console.log(this.primeNG.theme());
220
+ // if (isPlatformBrowser(this.platformId)) {
221
+ // this.onPresetChange(this.layoutService.layoutConfig().preset);
222
+ // }
223
+ }
224
+ surfaces = [
225
+ {
226
+ name: 'slate',
227
+ palette: {
228
+ 0: '#ffffff',
229
+ 50: '#f8fafc',
230
+ 100: '#f1f5f9',
231
+ 200: '#e2e8f0',
232
+ 300: '#cbd5e1',
233
+ 400: '#94a3b8',
234
+ 500: '#64748b',
235
+ 600: '#475569',
236
+ 700: '#334155',
237
+ 800: '#1e293b',
238
+ 900: '#0f172a',
239
+ 950: '#020617'
240
+ }
241
+ },
242
+ {
243
+ name: 'gray',
244
+ palette: {
245
+ 0: '#ffffff',
246
+ 50: '#f9fafb',
247
+ 100: '#f3f4f6',
248
+ 200: '#e5e7eb',
249
+ 300: '#d1d5db',
250
+ 400: '#9ca3af',
251
+ 500: '#6b7280',
252
+ 600: '#4b5563',
253
+ 700: '#374151',
254
+ 800: '#1f2937',
255
+ 900: '#111827',
256
+ 950: '#030712'
257
+ }
258
+ },
259
+ {
260
+ name: 'zinc',
261
+ palette: {
262
+ 0: '#ffffff',
263
+ 50: '#fafafa',
264
+ 100: '#f4f4f5',
265
+ 200: '#e4e4e7',
266
+ 300: '#d4d4d8',
267
+ 400: '#a1a1aa',
268
+ 500: '#71717a',
269
+ 600: '#52525b',
270
+ 700: '#3f3f46',
271
+ 800: '#27272a',
272
+ 900: '#18181b',
273
+ 950: '#09090b'
274
+ }
275
+ },
276
+ {
277
+ name: 'neutral',
278
+ palette: {
279
+ 0: '#ffffff',
280
+ 50: '#fafafa',
281
+ 100: '#f5f5f5',
282
+ 200: '#e5e5e5',
283
+ 300: '#d4d4d4',
284
+ 400: '#a3a3a3',
285
+ 500: '#737373',
286
+ 600: '#525252',
287
+ 700: '#404040',
288
+ 800: '#262626',
289
+ 900: '#171717',
290
+ 950: '#0a0a0a'
291
+ }
292
+ },
293
+ {
294
+ name: 'stone',
295
+ palette: {
296
+ 0: '#ffffff',
297
+ 50: '#fafaf9',
298
+ 100: '#f5f5f4',
299
+ 200: '#e7e5e4',
300
+ 300: '#d6d3d1',
301
+ 400: '#a8a29e',
302
+ 500: '#78716c',
303
+ 600: '#57534e',
304
+ 700: '#44403c',
305
+ 800: '#292524',
306
+ 900: '#1c1917',
307
+ 950: '#0c0a09'
308
+ }
309
+ },
310
+ {
311
+ name: 'soho',
312
+ palette: {
313
+ 0: '#ffffff',
314
+ 50: '#ececec',
315
+ 100: '#dedfdf',
316
+ 200: '#c4c4c6',
317
+ 300: '#adaeb0',
318
+ 400: '#97979b',
319
+ 500: '#7f8084',
320
+ 600: '#6a6b70',
321
+ 700: '#55565b',
322
+ 800: '#3f4046',
323
+ 900: '#2c2c34',
324
+ 950: '#16161d'
325
+ }
326
+ },
327
+ {
328
+ name: 'viva',
329
+ palette: {
330
+ 0: '#ffffff',
331
+ 50: '#f3f3f3',
332
+ 100: '#e7e7e8',
333
+ 200: '#cfd0d0',
334
+ 300: '#b7b8b9',
335
+ 400: '#9fa1a1',
336
+ 500: '#87898a',
337
+ 600: '#6e7173',
338
+ 700: '#565a5b',
339
+ 800: '#3e4244',
340
+ 900: '#262b2c',
341
+ 950: '#0e1315'
342
+ }
343
+ },
344
+ {
345
+ name: 'ocean',
346
+ palette: {
347
+ 0: '#ffffff',
348
+ 50: '#fbfcfc',
349
+ 100: '#F7F9F8',
350
+ 200: '#EFF3F2',
351
+ 300: '#DADEDD',
352
+ 400: '#B1B7B6',
353
+ 500: '#828787',
354
+ 600: '#5F7274',
355
+ 700: '#415B61',
356
+ 800: '#29444E',
357
+ 900: '#183240',
358
+ 950: '#0c1920'
359
+ }
360
+ }
361
+ ];
362
+ selectedPrimaryColor = computed(() => {
363
+ return this.layoutService.layoutConfig().primary;
364
+ });
365
+ selectedSurfaceColor = computed(() => this.layoutService.layoutConfig().surface);
366
+ selectedPreset = computed(() => this.layoutService.layoutConfig().preset);
367
+ menuMode = computed(() => this.layoutService.layoutConfig().menuMode);
368
+ primaryColors = computed(() => {
369
+ const presetPalette = presets[this.layoutService.layoutConfig().preset].primitive;
370
+ const colors = ['emerald', 'green', 'lime', 'orange', 'amber', 'yellow', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose'];
371
+ const palettes = [{ name: 'noir', palette: {} }];
372
+ colors.forEach((color) => {
373
+ palettes.push({
374
+ name: color,
375
+ palette: presetPalette?.[color]
376
+ });
377
+ });
378
+ return palettes;
379
+ });
380
+ getPresetExt() {
381
+ const color = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor()) || {};
382
+ const preset = this.layoutService.layoutConfig().preset;
383
+ if (color.name === 'noir') {
384
+ return {
385
+ semantic: {
386
+ primary: {
387
+ 50: '{surface.50}',
388
+ 100: '{surface.100}',
389
+ 200: '{surface.200}',
390
+ 300: '{surface.300}',
391
+ 400: '{surface.400}',
392
+ 500: '{surface.500}',
393
+ 600: '{surface.600}',
394
+ 700: '{surface.700}',
395
+ 800: '{surface.800}',
396
+ 900: '{surface.900}',
397
+ 950: '{surface.950}'
398
+ },
399
+ colorScheme: {
400
+ light: {
401
+ primary: {
402
+ color: '{primary.950}',
403
+ contrastColor: '#ffffff',
404
+ hoverColor: '{primary.800}',
405
+ activeColor: '{primary.700}'
406
+ },
407
+ highlight: {
408
+ background: '{primary.950}',
409
+ focusBackground: '{primary.700}',
410
+ color: '#ffffff',
411
+ focusColor: '#ffffff'
412
+ }
413
+ },
414
+ dark: {
415
+ primary: {
416
+ color: '{primary.50}',
417
+ contrastColor: '{primary.950}',
418
+ hoverColor: '{primary.200}',
419
+ activeColor: '{primary.300}'
420
+ },
421
+ highlight: {
422
+ background: '{primary.50}',
423
+ focusBackground: '{primary.300}',
424
+ color: '{primary.950}',
425
+ focusColor: '{primary.950}'
426
+ }
427
+ }
428
+ }
429
+ }
430
+ };
431
+ }
432
+ else {
433
+ if (preset === 'Nora') {
434
+ return {
435
+ semantic: {
436
+ primary: color.palette,
437
+ colorScheme: {
438
+ light: {
439
+ primary: {
440
+ color: '{primary.600}',
441
+ contrastColor: '#ffffff',
442
+ hoverColor: '{primary.700}',
443
+ activeColor: '{primary.800}'
444
+ },
445
+ highlight: {
446
+ background: '{primary.600}',
447
+ focusBackground: '{primary.700}',
448
+ color: '#ffffff',
449
+ focusColor: '#ffffff'
450
+ }
451
+ },
452
+ dark: {
453
+ primary: {
454
+ color: '{primary.500}',
455
+ contrastColor: '{surface.900}',
456
+ hoverColor: '{primary.400}',
457
+ activeColor: '{primary.300}'
458
+ },
459
+ highlight: {
460
+ background: '{primary.500}',
461
+ focusBackground: '{primary.400}',
462
+ color: '{surface.900}',
463
+ focusColor: '{surface.900}'
464
+ }
465
+ }
466
+ }
467
+ }
468
+ };
469
+ }
470
+ else {
471
+ return {
472
+ semantic: {
473
+ primary: color.palette,
474
+ colorScheme: {
475
+ light: {
476
+ primary: {
477
+ color: '{primary.500}',
478
+ contrastColor: '#ffffff',
479
+ hoverColor: '{primary.600}',
480
+ activeColor: '{primary.700}'
481
+ },
482
+ highlight: {
483
+ background: '{primary.50}',
484
+ focusBackground: '{primary.100}',
485
+ color: '{primary.700}',
486
+ focusColor: '{primary.800}'
487
+ }
488
+ },
489
+ dark: {
490
+ primary: {
491
+ color: '{primary.400}',
492
+ contrastColor: '{surface.900}',
493
+ hoverColor: '{primary.300}',
494
+ activeColor: '{primary.200}'
495
+ },
496
+ highlight: {
497
+ background: 'color-mix(in srgb, {primary.400}, transparent 84%)',
498
+ focusBackground: 'color-mix(in srgb, {primary.400}, transparent 76%)',
499
+ color: 'rgba(255,255,255,.87)',
500
+ focusColor: 'rgba(255,255,255,.87)'
501
+ }
502
+ }
503
+ }
504
+ }
505
+ };
506
+ }
507
+ }
508
+ }
509
+ updateColors(event, type, color) {
510
+ if (type === 'primary') {
511
+ this.layoutService.layoutConfig.update((state) => ({ ...state, primary: color.name }));
512
+ }
513
+ else if (type === 'surface') {
514
+ this.layoutService.layoutConfig.update((state) => ({ ...state, surface: color.name }));
515
+ }
516
+ this.applyTheme(type, color);
517
+ event.stopPropagation();
518
+ }
519
+ applyTheme(type, color) {
520
+ if (type === 'primary') {
521
+ updatePreset(this.getPresetExt());
522
+ }
523
+ else if (type === 'surface') {
524
+ updateSurfacePalette(color.palette);
525
+ }
526
+ }
527
+ onPresetChange(event) {
528
+ this.layoutService.layoutConfig.update((state) => ({ ...state, preset: event }));
529
+ const preset = presets[event];
530
+ const surfacePalette = this.surfaces.find((s) => s.name === this.selectedSurfaceColor())?.palette;
531
+ $t().preset(preset).preset(this.getPresetExt()).surfacePalette(surfacePalette).use({ useDefaultOptions: true });
532
+ }
533
+ onMenuModeChange(event) {
534
+ this.layoutService.layoutConfig.update((prev) => ({ ...prev, menuMode: event }));
535
+ }
536
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppConfigurator, deps: [], target: i0.ɵɵFactoryTarget.Component });
537
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AppConfigurator, isStandalone: true, selector: "app-configurator", host: { classAttribute: "hidden absolute top-[3.25rem] right-0 w-72 p-4 bg-surface-0 dark:bg-surface-900 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)]" }, ngImport: i0, template: `
538
+ <div class="flex flex-col gap-4">
539
+ <div>
540
+ <span class="text-sm text-muted-color font-semibold">Primary</span>
541
+ <div class="pt-2 flex gap-2 flex-wrap justify-start">
542
+ @for (primaryColor of primaryColors(); track primaryColor.name) {
543
+ <button
544
+ type="button"
545
+ [title]="primaryColor.name"
546
+ (click)="updateColors($event, 'primary', primaryColor)"
547
+ [ngClass]="{ 'outline-primary': primaryColor.name === selectedPrimaryColor() }"
548
+ class="border-none w-5 h-5 rounded-full p-0 cursor-pointer outline-none outline-offset-1"
549
+ [style]="{
550
+ 'background-color': primaryColor?.name === 'noir' ? 'var(--text-color)' : primaryColor?.palette?.['500']
551
+ }"
552
+ ></button>
553
+ }
554
+ </div>
555
+ </div>
556
+ <div>
557
+ <span class="text-sm text-muted-color font-semibold">Surface</span>
558
+ <div class="pt-2 flex gap-2 flex-wrap justify-start">
559
+ @for (surface of surfaces; track surface.name) {
560
+ <button
561
+ type="button"
562
+ [title]="surface.name"
563
+ (click)="updateColors($event, 'surface', surface)"
564
+ [ngClass]="{ 'outline-primary': selectedSurfaceColor() ? selectedSurfaceColor() === surface.name : layoutService.layoutConfig().darkTheme ? surface.name === 'zinc' : surface.name === 'slate' }"
565
+ class="border-none w-5 h-5 rounded-full p-0 cursor-pointer outline-none outline-offset-1"
566
+ [style]="{
567
+ 'background-color': surface?.name === 'noir' ? 'var(--text-color)' : surface?.palette?.['500']
568
+ }"
569
+ ></button>
570
+ }
571
+ </div>
572
+ </div>
573
+ <div class="flex flex-col gap-2">
574
+ <span class="text-sm text-muted-color font-semibold">Presets</span>
575
+ <p-selectbutton [options]="presets" [ngModel]="selectedPreset()" (ngModelChange)="onPresetChange($event)" [allowEmpty]="false" size="small" />
576
+ </div>
577
+ <div *ngIf="showMenuModeButton()" class="flex flex-col gap-2">
578
+ <span class="text-sm text-muted-color font-semibold">Menu Mode</span>
579
+ <p-selectbutton [ngModel]="menuMode()" (ngModelChange)="onMenuModeChange($event)" [options]="menuModeOptions" [allowEmpty]="false" size="small" />
580
+ </div>
581
+ </div>
582
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i3.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }] });
583
+ }
584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppConfigurator, decorators: [{
585
+ type: Component,
586
+ args: [{
587
+ selector: 'app-configurator',
588
+ standalone: true,
589
+ imports: [CommonModule, FormsModule, SelectButtonModule],
590
+ template: `
591
+ <div class="flex flex-col gap-4">
592
+ <div>
593
+ <span class="text-sm text-muted-color font-semibold">Primary</span>
594
+ <div class="pt-2 flex gap-2 flex-wrap justify-start">
595
+ @for (primaryColor of primaryColors(); track primaryColor.name) {
596
+ <button
597
+ type="button"
598
+ [title]="primaryColor.name"
599
+ (click)="updateColors($event, 'primary', primaryColor)"
600
+ [ngClass]="{ 'outline-primary': primaryColor.name === selectedPrimaryColor() }"
601
+ class="border-none w-5 h-5 rounded-full p-0 cursor-pointer outline-none outline-offset-1"
602
+ [style]="{
603
+ 'background-color': primaryColor?.name === 'noir' ? 'var(--text-color)' : primaryColor?.palette?.['500']
604
+ }"
605
+ ></button>
606
+ }
607
+ </div>
608
+ </div>
609
+ <div>
610
+ <span class="text-sm text-muted-color font-semibold">Surface</span>
611
+ <div class="pt-2 flex gap-2 flex-wrap justify-start">
612
+ @for (surface of surfaces; track surface.name) {
613
+ <button
614
+ type="button"
615
+ [title]="surface.name"
616
+ (click)="updateColors($event, 'surface', surface)"
617
+ [ngClass]="{ 'outline-primary': selectedSurfaceColor() ? selectedSurfaceColor() === surface.name : layoutService.layoutConfig().darkTheme ? surface.name === 'zinc' : surface.name === 'slate' }"
618
+ class="border-none w-5 h-5 rounded-full p-0 cursor-pointer outline-none outline-offset-1"
619
+ [style]="{
620
+ 'background-color': surface?.name === 'noir' ? 'var(--text-color)' : surface?.palette?.['500']
621
+ }"
622
+ ></button>
623
+ }
624
+ </div>
625
+ </div>
626
+ <div class="flex flex-col gap-2">
627
+ <span class="text-sm text-muted-color font-semibold">Presets</span>
628
+ <p-selectbutton [options]="presets" [ngModel]="selectedPreset()" (ngModelChange)="onPresetChange($event)" [allowEmpty]="false" size="small" />
629
+ </div>
630
+ <div *ngIf="showMenuModeButton()" class="flex flex-col gap-2">
631
+ <span class="text-sm text-muted-color font-semibold">Menu Mode</span>
632
+ <p-selectbutton [ngModel]="menuMode()" (ngModelChange)="onMenuModeChange($event)" [options]="menuModeOptions" [allowEmpty]="false" size="small" />
633
+ </div>
634
+ </div>
635
+ `,
636
+ host: {
637
+ class: 'hidden absolute top-[3.25rem] right-0 w-72 p-4 bg-surface-0 dark:bg-surface-900 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)]'
638
+ }
639
+ }]
640
+ }] });
641
+
642
+ class InjectComponentService {
643
+ componentRefs = new Map();
644
+ setComponent(key, ref) {
645
+ this.componentRefs.set(key, ref);
646
+ }
647
+ updateComponent(key, input, value) {
648
+ const component = this.componentRefs.get(key);
649
+ if (component) {
650
+ component.instance[input] = value;
651
+ }
652
+ }
653
+ deleteComponent(key) {
654
+ this.componentRefs.delete(key);
655
+ }
656
+ getComponent(key) {
657
+ return this.componentRefs.get(key);
658
+ }
659
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InjectComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
660
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InjectComponentService, providedIn: 'root' });
661
+ }
662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InjectComponentService, decorators: [{
663
+ type: Injectable,
664
+ args: [{
665
+ providedIn: 'root'
666
+ }]
667
+ }] });
668
+
669
+ class ComponentInjectorDirective {
670
+ viewContainerRef;
671
+ service;
672
+ componentInjector;
673
+ context;
674
+ componentCreated = new EventEmitter();
675
+ isActive = true;
676
+ constructor(viewContainerRef, service) {
677
+ this.viewContainerRef = viewContainerRef;
678
+ this.service = service;
679
+ }
680
+ ngAfterContentInit() {
681
+ if (this.componentInjector != null && this.componentInjector.component != null) {
682
+ setTimeout(() => {
683
+ this.addComp();
684
+ }, 0);
685
+ }
686
+ }
687
+ addComp() {
688
+ const componentRef = this.viewContainerRef.createComponent(this.componentInjector.component, {});
689
+ if (this.componentInjector.styleClass != null) {
690
+ componentRef.location.nativeElement.classList.add(...this.componentInjector.styleClass.split(' '));
691
+ }
692
+ this.componentInjector.inputs.forEach((i) => {
693
+ Reflect.set(componentRef.instance, i.key, i.data);
694
+ });
695
+ if (this.componentInjector.outputs != null) {
696
+ this.componentInjector.outputs.forEach((output) => {
697
+ const instance = componentRef.instance;
698
+ const instanceOutput = Reflect.get(instance, output.key);
699
+ if (instanceOutput != null) {
700
+ instanceOutput
701
+ .pipe(takeWhile(x => this.isActive))
702
+ .subscribe((event) => {
703
+ if (output.callback != null)
704
+ output.callback(event);
705
+ });
706
+ }
707
+ });
708
+ }
709
+ this.componentInjector.ref = { componentRef: componentRef };
710
+ this.service.setComponent(this.componentInjector.componentId ?? '', componentRef);
711
+ componentRef.hostView.detectChanges();
712
+ this.componentCreated.emit(componentRef);
713
+ }
714
+ removeComp() {
715
+ this.isActive = false;
716
+ this.viewContainerRef.remove();
717
+ }
718
+ ngOnDestroy() {
719
+ this.removeComp();
720
+ }
721
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ComponentInjectorDirective, deps: [{ token: i0.ViewContainerRef }, { token: InjectComponentService }], target: i0.ɵɵFactoryTarget.Directive });
722
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: ComponentInjectorDirective, isStandalone: true, selector: "ng-template[componentInjector]", inputs: { componentInjector: "componentInjector", context: "context" }, outputs: { componentCreated: "componentCreated" }, ngImport: i0 });
723
+ }
724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ComponentInjectorDirective, decorators: [{
725
+ type: Directive,
726
+ args: [{
727
+ selector: 'ng-template[componentInjector]',
728
+ standalone: true,
729
+ }]
730
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: InjectComponentService }], propDecorators: { componentInjector: [{
731
+ type: Input
732
+ }], context: [{
733
+ type: Input
734
+ }], componentCreated: [{
735
+ type: Output
736
+ }] } });
737
+
738
+ class AppTopbar {
739
+ primeNG = inject(PrimeNG);
740
+ data = inject(SMZ_UI_LAYOUT_CONFIG).topbar;
741
+ layoutService = inject(LayoutService);
742
+ toggleDarkMode() {
743
+ this.layoutService.layoutConfig.update((state) => ({ ...state, darkTheme: !state.darkTheme }));
744
+ }
745
+ handleMissingImage(event, placeholder) {
746
+ event.target.src = placeholder;
747
+ }
748
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppTopbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
749
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AppTopbar, isStandalone: true, selector: "app-topbar", ngImport: i0, template: `
750
+ <ng-container *ngIf="data() as topbar">
751
+ <div class="layout-topbar">
752
+ <div class="layout-topbar-logo-container">
753
+
754
+ @if (topbar.showMenuToggle) {
755
+ <button class="layout-menu-button layout-topbar-action" (click)="layoutService.onMenuToggle()">
756
+ <i class="pi pi-bars"></i>
757
+ </button>
758
+ }
759
+
760
+ <a class="layout-topbar-logo" routerLink="/">
761
+ @if (topbar.logoPath?.light && !layoutService.isDarkTheme()) {
762
+ <img [src]="topbar.logoPath?.light" [alt]="topbar.logoPath?.light" class="max-h-9 min-h-8" />
763
+ }
764
+ @if (topbar.logoPath?.dark && layoutService.isDarkTheme()) {
765
+ <img [src]="topbar.logoPath?.dark" [alt]="topbar.logoPath?.dark" class="max-h-9 min-h-8" />
766
+ }
767
+ @if (topbar.appName) {
768
+ <span>{{ topbar.appName }}</span>
769
+ }
770
+ </a>
771
+
772
+ </div>
773
+
774
+ <div class="layout-topbar-actions">
775
+
776
+ <button class="layout-topbar-menu-button layout-topbar-action" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true">
777
+ <i class="pi pi-ellipsis-v"></i>
778
+ </button>
779
+
780
+ <div class="layout-topbar-menu hidden lg:block">
781
+ <div class="layout-topbar-menu-content">
782
+ @for (item of topbar.menuItems; track item) {
783
+ @if (item.component != null) {
784
+ <ng-template [componentInjector]="item.component"></ng-template>
785
+ }
786
+ @else {
787
+ <button type="button" class="layout-topbar-action" (click)="item.callback()" [routerLink]="item.routerLink" [pTooltip]="item.tooltip">
788
+ <i [ngClass]="item.icon"></i>
789
+ <span>{{ item.label }}</span>
790
+ </button>
791
+ }
792
+ }
793
+ </div>
794
+ </div>
795
+
796
+ <div class="layout-config-menu">
797
+ @if (topbar.showDarkModeToggle) {
798
+ <button type="button" class="layout-topbar-action" (click)="toggleDarkMode()" pTooltip="Dark/Light">
799
+ <i [ngClass]="{ 'pi ': true, 'pi-moon': layoutService.isDarkTheme(), 'pi-sun': !layoutService.isDarkTheme() }"></i>
800
+ </button>
801
+ }
802
+
803
+ @if (topbar.showConfigurator) {
804
+ <div class="relative">
805
+ <button class="layout-topbar-action layout-topbar-action-highlight" pTooltip="Configurações" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true">
806
+ <i class="pi pi-palette"></i>
807
+ </button>
808
+ <app-configurator></app-configurator>
809
+ </div>
810
+ }
811
+
812
+ @for (feature of topbar.features; track feature) {
813
+ <p-menu #menu [model]="feature.menuItems" [popup]="true" />
814
+
815
+ @if (feature.avatar && feature.avatar() != null) {
816
+ <img [src]="feature.avatar()" [alt]="feature.label" class="layout-topbar-action w-8 h-8 rounded-full" (click)="menu.toggle($event)" [pTooltip]="feature.tooltip" (error)="handleMissingImage($event, feature.placeholder)"/>
817
+ }
818
+ @else {
819
+ <button type="button" class="layout-topbar-action" (click)="menu.toggle($event)" [pTooltip]="feature.tooltip">
820
+ <i [ngClass]="feature.icon()"></i>
821
+ </button>
822
+ }
823
+ }
824
+ </div>
825
+
826
+ </div>
827
+ </div>
828
+ </ng-container>`, isInline: true, dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"] }, { kind: "component", type: AppConfigurator, selector: "app-configurator" }, { kind: "directive", type: ComponentInjectorDirective, selector: "ng-template[componentInjector]", inputs: ["componentInjector", "context"], outputs: ["componentCreated"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: MenuModule }, { kind: "component", type: i5.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "ngmodule", type: ButtonModule }] });
829
+ }
830
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppTopbar, decorators: [{
831
+ type: Component,
832
+ args: [{
833
+ selector: 'app-topbar',
834
+ standalone: true,
835
+ imports: [RouterModule, CommonModule, StyleClassModule, AppConfigurator, ComponentInjectorDirective, TooltipModule, MenuModule, ButtonModule],
836
+ template: `
837
+ <ng-container *ngIf="data() as topbar">
838
+ <div class="layout-topbar">
839
+ <div class="layout-topbar-logo-container">
840
+
841
+ @if (topbar.showMenuToggle) {
842
+ <button class="layout-menu-button layout-topbar-action" (click)="layoutService.onMenuToggle()">
843
+ <i class="pi pi-bars"></i>
844
+ </button>
845
+ }
846
+
847
+ <a class="layout-topbar-logo" routerLink="/">
848
+ @if (topbar.logoPath?.light && !layoutService.isDarkTheme()) {
849
+ <img [src]="topbar.logoPath?.light" [alt]="topbar.logoPath?.light" class="max-h-9 min-h-8" />
850
+ }
851
+ @if (topbar.logoPath?.dark && layoutService.isDarkTheme()) {
852
+ <img [src]="topbar.logoPath?.dark" [alt]="topbar.logoPath?.dark" class="max-h-9 min-h-8" />
853
+ }
854
+ @if (topbar.appName) {
855
+ <span>{{ topbar.appName }}</span>
856
+ }
857
+ </a>
858
+
859
+ </div>
860
+
861
+ <div class="layout-topbar-actions">
862
+
863
+ <button class="layout-topbar-menu-button layout-topbar-action" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true">
864
+ <i class="pi pi-ellipsis-v"></i>
865
+ </button>
866
+
867
+ <div class="layout-topbar-menu hidden lg:block">
868
+ <div class="layout-topbar-menu-content">
869
+ @for (item of topbar.menuItems; track item) {
870
+ @if (item.component != null) {
871
+ <ng-template [componentInjector]="item.component"></ng-template>
872
+ }
873
+ @else {
874
+ <button type="button" class="layout-topbar-action" (click)="item.callback()" [routerLink]="item.routerLink" [pTooltip]="item.tooltip">
875
+ <i [ngClass]="item.icon"></i>
876
+ <span>{{ item.label }}</span>
877
+ </button>
878
+ }
879
+ }
880
+ </div>
881
+ </div>
882
+
883
+ <div class="layout-config-menu">
884
+ @if (topbar.showDarkModeToggle) {
885
+ <button type="button" class="layout-topbar-action" (click)="toggleDarkMode()" pTooltip="Dark/Light">
886
+ <i [ngClass]="{ 'pi ': true, 'pi-moon': layoutService.isDarkTheme(), 'pi-sun': !layoutService.isDarkTheme() }"></i>
887
+ </button>
888
+ }
889
+
890
+ @if (topbar.showConfigurator) {
891
+ <div class="relative">
892
+ <button class="layout-topbar-action layout-topbar-action-highlight" pTooltip="Configurações" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true">
893
+ <i class="pi pi-palette"></i>
894
+ </button>
895
+ <app-configurator></app-configurator>
896
+ </div>
897
+ }
898
+
899
+ @for (feature of topbar.features; track feature) {
900
+ <p-menu #menu [model]="feature.menuItems" [popup]="true" />
901
+
902
+ @if (feature.avatar && feature.avatar() != null) {
903
+ <img [src]="feature.avatar()" [alt]="feature.label" class="layout-topbar-action w-8 h-8 rounded-full" (click)="menu.toggle($event)" [pTooltip]="feature.tooltip" (error)="handleMissingImage($event, feature.placeholder)"/>
904
+ }
905
+ @else {
906
+ <button type="button" class="layout-topbar-action" (click)="menu.toggle($event)" [pTooltip]="feature.tooltip">
907
+ <i [ngClass]="feature.icon()"></i>
908
+ </button>
909
+ }
910
+ }
911
+ </div>
912
+
913
+ </div>
914
+ </div>
915
+ </ng-container>`
916
+ }]
917
+ }] });
918
+
919
+ class AppMenuitem {
920
+ router;
921
+ layoutService;
922
+ item;
923
+ index;
924
+ root;
925
+ parentKey;
926
+ active = false;
927
+ menuSourceSubscription;
928
+ menuResetSubscription;
929
+ key = '';
930
+ constructor(router, layoutService) {
931
+ this.router = router;
932
+ this.layoutService = layoutService;
933
+ this.menuSourceSubscription = this.layoutService.menuSource$.subscribe((value) => {
934
+ Promise.resolve(null).then(() => {
935
+ if (value.routeEvent) {
936
+ this.active = value.key === this.key || value.key.startsWith(this.key + '-') ? true : false;
937
+ }
938
+ else {
939
+ if (value.key !== this.key && !value.key.startsWith(this.key + '-')) {
940
+ this.active = false;
941
+ }
942
+ }
943
+ });
944
+ });
945
+ this.menuResetSubscription = this.layoutService.resetSource$.subscribe(() => {
946
+ this.active = false;
947
+ });
948
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((params) => {
949
+ if (this.item.routerLink) {
950
+ this.updateActiveStateFromRoute();
951
+ }
952
+ });
953
+ }
954
+ ngOnInit() {
955
+ this.key = this.parentKey ? this.parentKey + '-' + this.index : String(this.index);
956
+ if (this.item.routerLink) {
957
+ this.updateActiveStateFromRoute();
958
+ }
959
+ }
960
+ updateActiveStateFromRoute() {
961
+ let activeRoute = this.router.isActive(this.item.routerLink[0], { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' });
962
+ if (activeRoute) {
963
+ this.layoutService.onMenuStateChange({ key: this.key, routeEvent: true });
964
+ }
965
+ }
966
+ itemClick(event) {
967
+ // avoid processing disabled items
968
+ if (this.item.disabled) {
969
+ event.preventDefault();
970
+ return;
971
+ }
972
+ // execute command
973
+ if (this.item.command) {
974
+ this.item.command({ originalEvent: event, item: this.item });
975
+ }
976
+ // toggle active state
977
+ if (this.item.items) {
978
+ this.active = !this.active;
979
+ }
980
+ this.layoutService.onMenuStateChange({ key: this.key });
981
+ }
982
+ get submenuAnimation() {
983
+ return this.root ? 'expanded' : this.active ? 'expanded' : 'collapsed';
984
+ }
985
+ get activeClass() {
986
+ return this.active && !this.root;
987
+ }
988
+ ngOnDestroy() {
989
+ if (this.menuSourceSubscription) {
990
+ this.menuSourceSubscription.unsubscribe();
991
+ }
992
+ if (this.menuResetSubscription) {
993
+ this.menuResetSubscription.unsubscribe();
994
+ }
995
+ }
996
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppMenuitem, deps: [{ token: i1$1.Router }, { token: LayoutService }], target: i0.ɵɵFactoryTarget.Component });
997
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AppMenuitem, isStandalone: true, selector: "[app-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "this.root", "class.active-menuitem": "this.activeClass" } }, ngImport: i0, template: `
998
+ <ng-container>
999
+ <div *ngIf="root && item.visible !== false" class="layout-menuitem-root-text">{{ item.label }}</div>
1000
+ <a *ngIf="(!item.routerLink || item.items) && item.visible !== false" [attr.href]="item.url" (click)="itemClick($event)" [ngClass]="item.styleClass" [attr.target]="item.target" tabindex="0" pRipple>
1001
+ <i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
1002
+ <span class="layout-menuitem-text">{{ item.label }}</span>
1003
+ <i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
1004
+ </a>
1005
+ <a
1006
+ *ngIf="item.routerLink && !item.items && item.visible !== false"
1007
+ (click)="itemClick($event)"
1008
+ [ngClass]="item.styleClass"
1009
+ [routerLink]="item.routerLink"
1010
+ routerLinkActive="active-route"
1011
+ [routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
1012
+ [fragment]="item.fragment"
1013
+ [queryParamsHandling]="item.queryParamsHandling"
1014
+ [preserveFragment]="item.preserveFragment"
1015
+ [skipLocationChange]="item.skipLocationChange"
1016
+ [replaceUrl]="item.replaceUrl"
1017
+ [state]="item.state"
1018
+ [queryParams]="item.queryParams"
1019
+ [attr.target]="item.target"
1020
+ tabindex="0"
1021
+ pRipple
1022
+ >
1023
+ <i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
1024
+ <span class="layout-menuitem-text">{{ item.label }}</span>
1025
+ <i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
1026
+ </a>
1027
+
1028
+ <ul *ngIf="item.items && item.visible !== false" [@children]="submenuAnimation">
1029
+ <ng-template ngFor let-child let-i="index" [ngForOf]="item.items">
1030
+ <li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child['badgeClass']"></li>
1031
+ </ng-template>
1032
+ </ul>
1033
+ </ng-container>
1034
+ `, isInline: true, dependencies: [{ kind: "component", type: AppMenuitem, selector: "[app-menuitem]", inputs: ["item", "index", "root", "parentKey"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: RippleModule }, { kind: "directive", type: i4$1.Ripple, selector: "[pRipple]" }], animations: [
1035
+ trigger('children', [
1036
+ state('collapsed', style({
1037
+ height: '0'
1038
+ })),
1039
+ state('expanded', style({
1040
+ height: '*'
1041
+ })),
1042
+ transition('collapsed <=> expanded', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
1043
+ ])
1044
+ ] });
1045
+ }
1046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppMenuitem, decorators: [{
1047
+ type: Component,
1048
+ args: [{
1049
+ // eslint-disable-next-line @angular-eslint/component-selector
1050
+ selector: '[app-menuitem]',
1051
+ imports: [CommonModule, RouterModule, RippleModule],
1052
+ template: `
1053
+ <ng-container>
1054
+ <div *ngIf="root && item.visible !== false" class="layout-menuitem-root-text">{{ item.label }}</div>
1055
+ <a *ngIf="(!item.routerLink || item.items) && item.visible !== false" [attr.href]="item.url" (click)="itemClick($event)" [ngClass]="item.styleClass" [attr.target]="item.target" tabindex="0" pRipple>
1056
+ <i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
1057
+ <span class="layout-menuitem-text">{{ item.label }}</span>
1058
+ <i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
1059
+ </a>
1060
+ <a
1061
+ *ngIf="item.routerLink && !item.items && item.visible !== false"
1062
+ (click)="itemClick($event)"
1063
+ [ngClass]="item.styleClass"
1064
+ [routerLink]="item.routerLink"
1065
+ routerLinkActive="active-route"
1066
+ [routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
1067
+ [fragment]="item.fragment"
1068
+ [queryParamsHandling]="item.queryParamsHandling"
1069
+ [preserveFragment]="item.preserveFragment"
1070
+ [skipLocationChange]="item.skipLocationChange"
1071
+ [replaceUrl]="item.replaceUrl"
1072
+ [state]="item.state"
1073
+ [queryParams]="item.queryParams"
1074
+ [attr.target]="item.target"
1075
+ tabindex="0"
1076
+ pRipple
1077
+ >
1078
+ <i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
1079
+ <span class="layout-menuitem-text">{{ item.label }}</span>
1080
+ <i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
1081
+ </a>
1082
+
1083
+ <ul *ngIf="item.items && item.visible !== false" [@children]="submenuAnimation">
1084
+ <ng-template ngFor let-child let-i="index" [ngForOf]="item.items">
1085
+ <li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child['badgeClass']"></li>
1086
+ </ng-template>
1087
+ </ul>
1088
+ </ng-container>
1089
+ `,
1090
+ animations: [
1091
+ trigger('children', [
1092
+ state('collapsed', style({
1093
+ height: '0'
1094
+ })),
1095
+ state('expanded', style({
1096
+ height: '*'
1097
+ })),
1098
+ transition('collapsed <=> expanded', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
1099
+ ])
1100
+ ],
1101
+ // providers: [LayoutService]
1102
+ }]
1103
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: LayoutService }], propDecorators: { item: [{
1104
+ type: Input
1105
+ }], index: [{
1106
+ type: Input
1107
+ }], root: [{
1108
+ type: Input
1109
+ }, {
1110
+ type: HostBinding,
1111
+ args: ['class.layout-root-menuitem']
1112
+ }], parentKey: [{
1113
+ type: Input
1114
+ }], activeClass: [{
1115
+ type: HostBinding,
1116
+ args: ['class.active-menuitem']
1117
+ }] } });
1118
+
1119
+ class AppMenu {
1120
+ model = inject(SMZ_UI_LAYOUT_CONFIG).sidebar;
1121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
1122
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AppMenu, isStandalone: true, selector: "app-menu", ngImport: i0, template: `<ul class="layout-menu">
1123
+ <ng-container *ngFor="let item of model(); let i = index">
1124
+ <li app-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
1125
+ <li *ngIf="item.separator" class="menu-separator"></li>
1126
+ </ng-container>
1127
+ </ul> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AppMenuitem, selector: "[app-menuitem]", inputs: ["item", "index", "root", "parentKey"] }, { kind: "ngmodule", type: RouterModule }] });
1128
+ }
1129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppMenu, decorators: [{
1130
+ type: Component,
1131
+ args: [{
1132
+ selector: 'app-menu',
1133
+ standalone: true,
1134
+ imports: [CommonModule, AppMenuitem, RouterModule],
1135
+ template: `<ul class="layout-menu">
1136
+ <ng-container *ngFor="let item of model(); let i = index">
1137
+ <li app-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
1138
+ <li *ngIf="item.separator" class="menu-separator"></li>
1139
+ </ng-container>
1140
+ </ul> `
1141
+ }]
1142
+ }] });
1143
+
1144
+ class AppSidebar {
1145
+ el;
1146
+ constructor(el) {
1147
+ this.el = el;
1148
+ }
1149
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppSidebar, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AppSidebar, isStandalone: true, selector: "app-sidebar", ngImport: i0, template: ` <div class="layout-sidebar">
1151
+ <app-menu></app-menu>
1152
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: AppMenu, selector: "app-menu" }] });
1153
+ }
1154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppSidebar, decorators: [{
1155
+ type: Component,
1156
+ args: [{
1157
+ selector: 'app-sidebar',
1158
+ standalone: true,
1159
+ imports: [AppMenu],
1160
+ template: ` <div class="layout-sidebar">
1161
+ <app-menu></app-menu>
1162
+ </div>`
1163
+ }]
1164
+ }], ctorParameters: () => [{ type: i0.ElementRef }] });
1165
+
1166
+ class AppFooter {
1167
+ data = inject(SMZ_UI_LAYOUT_CONFIG).footer;
1168
+ layoutService = inject(LayoutService);
1169
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppFooter, deps: [], target: i0.ɵɵFactoryTarget.Component });
1170
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AppFooter, isStandalone: true, selector: "app-footer", ngImport: i0, template: `
1171
+ <ng-container *ngIf="data() as footer">
1172
+ <div class="flex items-center justify-between px-0 py-4 gap-4 border-t border-surface-border">
1173
+ @if (footer.leftLogoPath?.light && !layoutService.isDarkTheme()) {
1174
+ <img [src]="footer.leftLogoPath?.light" [alt]="footer.leftLogoPath?.light" class="max-h-7" />
1175
+ }
1176
+ @if (footer.leftLogoPath?.dark && layoutService.isDarkTheme()) {
1177
+ <img [src]="footer.leftLogoPath?.dark" [alt]="footer.leftLogoPath?.dark" class="max-h-7" />
1178
+ }
1179
+ <div class="flex-1"></div>
1180
+ @if (footer.rightLogoPath?.light && !layoutService.isDarkTheme()) {
1181
+ <img [src]="footer.rightLogoPath?.light" [alt]="footer.rightLogoPath?.light" class="max-h-7" />
1182
+ }
1183
+ @if (footer.rightLogoPath?.dark && layoutService.isDarkTheme()) {
1184
+ <img [src]="footer.rightLogoPath?.dark" [alt]="footer.rightLogoPath?.dark" class="max-h-7" />
1185
+ }
1186
+ @if (footer.version) {
1187
+ <span class="font-medium text-sm">{{ footer.version }}</span>
1188
+ }
1189
+ @if (footer.copyright) {
1190
+ <span class="font-medium text-sm">{{ footer.copyright }}</span>
1191
+ }
1192
+ </div>
1193
+ </ng-container>
1194
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1195
+ }
1196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppFooter, decorators: [{
1197
+ type: Component,
1198
+ args: [{
1199
+ standalone: true,
1200
+ selector: 'app-footer',
1201
+ imports: [CommonModule],
1202
+ template: `
1203
+ <ng-container *ngIf="data() as footer">
1204
+ <div class="flex items-center justify-between px-0 py-4 gap-4 border-t border-surface-border">
1205
+ @if (footer.leftLogoPath?.light && !layoutService.isDarkTheme()) {
1206
+ <img [src]="footer.leftLogoPath?.light" [alt]="footer.leftLogoPath?.light" class="max-h-7" />
1207
+ }
1208
+ @if (footer.leftLogoPath?.dark && layoutService.isDarkTheme()) {
1209
+ <img [src]="footer.leftLogoPath?.dark" [alt]="footer.leftLogoPath?.dark" class="max-h-7" />
1210
+ }
1211
+ <div class="flex-1"></div>
1212
+ @if (footer.rightLogoPath?.light && !layoutService.isDarkTheme()) {
1213
+ <img [src]="footer.rightLogoPath?.light" [alt]="footer.rightLogoPath?.light" class="max-h-7" />
1214
+ }
1215
+ @if (footer.rightLogoPath?.dark && layoutService.isDarkTheme()) {
1216
+ <img [src]="footer.rightLogoPath?.dark" [alt]="footer.rightLogoPath?.dark" class="max-h-7" />
1217
+ }
1218
+ @if (footer.version) {
1219
+ <span class="font-medium text-sm">{{ footer.version }}</span>
1220
+ }
1221
+ @if (footer.copyright) {
1222
+ <span class="font-medium text-sm">{{ footer.copyright }}</span>
1223
+ }
1224
+ </div>
1225
+ </ng-container>
1226
+ `
1227
+ }]
1228
+ }] });
1229
+
1230
+ class AppLayout {
1231
+ layoutService;
1232
+ renderer;
1233
+ router;
1234
+ overlayMenuOpenSubscription;
1235
+ menuOutsideClickListener;
1236
+ appSidebar;
1237
+ appTopBar;
1238
+ constructor(layoutService, renderer, router) {
1239
+ this.layoutService = layoutService;
1240
+ this.renderer = renderer;
1241
+ this.router = router;
1242
+ this.overlayMenuOpenSubscription = this.layoutService.overlayOpen$.subscribe(() => {
1243
+ if (!this.menuOutsideClickListener) {
1244
+ this.menuOutsideClickListener = this.renderer.listen('document', 'click', (event) => {
1245
+ if (this.isOutsideClicked(event)) {
1246
+ this.hideMenu();
1247
+ }
1248
+ });
1249
+ }
1250
+ if (this.layoutService.layoutState().staticMenuMobileActive) {
1251
+ this.blockBodyScroll();
1252
+ }
1253
+ });
1254
+ this.router.events.pipe(filter$1((event) => event instanceof NavigationEnd)).subscribe(() => {
1255
+ this.hideMenu();
1256
+ });
1257
+ }
1258
+ isOutsideClicked(event) {
1259
+ const sidebarEl = document.querySelector('.layout-sidebar');
1260
+ const topbarEl = document.querySelector('.layout-menu-button');
1261
+ const eventTarget = event.target;
1262
+ return !(sidebarEl?.isSameNode(eventTarget) || sidebarEl?.contains(eventTarget) || topbarEl?.isSameNode(eventTarget) || topbarEl?.contains(eventTarget));
1263
+ }
1264
+ hideMenu() {
1265
+ this.layoutService.layoutState.update((prev) => ({ ...prev, overlayMenuActive: false, staticMenuMobileActive: false, menuHoverActive: false }));
1266
+ if (this.menuOutsideClickListener) {
1267
+ this.menuOutsideClickListener();
1268
+ this.menuOutsideClickListener = null;
1269
+ }
1270
+ this.unblockBodyScroll();
1271
+ }
1272
+ blockBodyScroll() {
1273
+ if (document.body.classList) {
1274
+ document.body.classList.add('blocked-scroll');
1275
+ }
1276
+ else {
1277
+ document.body.className += ' blocked-scroll';
1278
+ }
1279
+ }
1280
+ unblockBodyScroll() {
1281
+ if (document.body.classList) {
1282
+ document.body.classList.remove('blocked-scroll');
1283
+ }
1284
+ else {
1285
+ document.body.className = document.body.className.replace(new RegExp('(^|\\b)' + 'blocked-scroll'.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
1286
+ }
1287
+ }
1288
+ get containerClass() {
1289
+ return {
1290
+ 'layout-overlay': this.layoutService.layoutConfig().menuMode === 'overlay',
1291
+ 'layout-static': this.layoutService.layoutConfig().menuMode === 'static',
1292
+ 'layout-static-inactive': this.layoutService.layoutState().staticMenuDesktopInactive && this.layoutService.layoutConfig().menuMode === 'static',
1293
+ 'layout-overlay-active': this.layoutService.layoutState().overlayMenuActive,
1294
+ 'layout-mobile-active': this.layoutService.layoutState().staticMenuMobileActive
1295
+ };
1296
+ }
1297
+ ngOnDestroy() {
1298
+ if (this.overlayMenuOpenSubscription) {
1299
+ this.overlayMenuOpenSubscription.unsubscribe();
1300
+ }
1301
+ if (this.menuOutsideClickListener) {
1302
+ this.menuOutsideClickListener();
1303
+ }
1304
+ }
1305
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppLayout, deps: [{ token: LayoutService }, { token: i0.Renderer2 }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
1306
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AppLayout, isStandalone: true, selector: "app-layout", viewQueries: [{ propertyName: "appSidebar", first: true, predicate: AppSidebar, descendants: true }, { propertyName: "appTopBar", first: true, predicate: AppTopbar, descendants: true }], ngImport: i0, template: `<div class="layout-wrapper" [ngClass]="containerClass">
1307
+ <app-topbar></app-topbar>
1308
+ <app-sidebar></app-sidebar>
1309
+ <div class="layout-main-container">
1310
+ <div class="layout-main relative">
1311
+ <router-outlet></router-outlet>
1312
+ </div>
1313
+ <app-footer></app-footer>
1314
+ </div>
1315
+ <div class="layout-mask animate-fadein"></div>
1316
+ </div> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AppTopbar, selector: "app-topbar" }, { kind: "component", type: AppSidebar, selector: "app-sidebar" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: AppFooter, selector: "app-footer" }] });
1317
+ }
1318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppLayout, decorators: [{
1319
+ type: Component,
1320
+ args: [{
1321
+ selector: 'app-layout',
1322
+ standalone: true,
1323
+ imports: [CommonModule, AppTopbar, AppSidebar, RouterModule, AppFooter],
1324
+ template: `<div class="layout-wrapper" [ngClass]="containerClass">
1325
+ <app-topbar></app-topbar>
1326
+ <app-sidebar></app-sidebar>
1327
+ <div class="layout-main-container">
1328
+ <div class="layout-main relative">
1329
+ <router-outlet></router-outlet>
1330
+ </div>
1331
+ <app-footer></app-footer>
1332
+ </div>
1333
+ <div class="layout-mask animate-fadein"></div>
1334
+ </div> `
1335
+ }]
1336
+ }], ctorParameters: () => [{ type: LayoutService }, { type: i0.Renderer2 }, { type: i1$1.Router }], propDecorators: { appSidebar: [{
1337
+ type: ViewChild,
1338
+ args: [AppSidebar]
1339
+ }], appTopBar: [{
1340
+ type: ViewChild,
1341
+ args: [AppTopbar]
1342
+ }] } });
1343
+
1344
+ class AppFloatingConfigurator {
1345
+ LayoutService = inject(LayoutService);
1346
+ isDarkTheme = computed(() => this.LayoutService.layoutConfig().darkTheme);
1347
+ toggleDarkMode() {
1348
+ this.LayoutService.layoutConfig.update((state) => ({ ...state, darkTheme: !state.darkTheme }));
1349
+ }
1350
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppFloatingConfigurator, deps: [], target: i0.ɵɵFactoryTarget.Component });
1351
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AppFloatingConfigurator, isStandalone: true, selector: "app-floating-configurator", ngImport: i0, template: `
1352
+ <div class="fixed flex gap-4 top-8 right-8">
1353
+ <p-button type="button" (onClick)="toggleDarkMode()" [rounded]="true" [icon]="isDarkTheme() ? 'pi pi-moon' : 'pi pi-sun'" severity="secondary" />
1354
+ <div class="relative">
1355
+ <p-button icon="pi pi-palette" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true" type="button" rounded />
1356
+ <app-configurator />
1357
+ </div>
1358
+ </div>
1359
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { 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"] }, { kind: "component", type: AppConfigurator, selector: "app-configurator" }] });
1360
+ }
1361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AppFloatingConfigurator, decorators: [{
1362
+ type: Component,
1363
+ args: [{
1364
+ selector: 'app-floating-configurator',
1365
+ imports: [ButtonModule, StyleClassModule, AppConfigurator],
1366
+ template: `
1367
+ <div class="fixed flex gap-4 top-8 right-8">
1368
+ <p-button type="button" (onClick)="toggleDarkMode()" [rounded]="true" [icon]="isDarkTheme() ? 'pi pi-moon' : 'pi pi-sun'" severity="secondary" />
1369
+ <div class="relative">
1370
+ <p-button icon="pi pi-palette" pStyleClass="@next" enterFromClass="hidden" enterActiveClass="animate-scalein" leaveToClass="hidden" leaveActiveClass="animate-fadeout" [hideOnOutsideClick]="true" type="button" rounded />
1371
+ <app-configurator />
1372
+ </div>
1373
+ </div>
1374
+ `
1375
+ }]
1376
+ }] });
1377
+
1378
+ class ErrorPagesConfigService {
1379
+ // Criando um signal com a configuração padrão inicial
1380
+ config = signal({
1381
+ notfound: {
1382
+ code: 404,
1383
+ title: 'Página não encontrada',
1384
+ message: 'A página que você está procurando não foi encontrada.',
1385
+ links: [],
1386
+ buttons: [
1387
+ {
1388
+ label: 'Voltar para a home',
1389
+ url: '/',
1390
+ command: () => { },
1391
+ severity: 'warn'
1392
+ }
1393
+ ]
1394
+ },
1395
+ access: {
1396
+ icon: 'pi pi-fw pi-lock',
1397
+ title: 'Acesso restrito',
1398
+ message: 'Acesso restrito',
1399
+ imagePath: 'asset-access.svg',
1400
+ buttons: [
1401
+ {
1402
+ label: 'Voltar para a home',
1403
+ url: '/',
1404
+ command: () => { },
1405
+ severity: 'warn'
1406
+ }
1407
+ ]
1408
+ },
1409
+ error: {
1410
+ icon: 'pi pi-fw pi-exclamation-circle',
1411
+ title: 'Ocorreu um erro',
1412
+ message: 'Ocorreu um erro ao carregar a página.',
1413
+ imagePath: 'asset-error.svg',
1414
+ buttons: [
1415
+ {
1416
+ label: 'Voltar para a home',
1417
+ url: '/',
1418
+ command: () => { },
1419
+ severity: 'danger'
1420
+ },
1421
+ ]
1422
+ }
1423
+ });
1424
+ // Método para atualizar dinamicamente a configuração de forma merge
1425
+ updateConfig(newConfig) {
1426
+ this.config.update((currentConfig) => ({
1427
+ ...currentConfig,
1428
+ ...newConfig,
1429
+ // Faz merge interno para cada seção, preservando os valores não alterados
1430
+ notfound: { ...currentConfig.notfound, ...newConfig.notfound },
1431
+ access: { ...currentConfig.access, ...newConfig.access },
1432
+ error: { ...currentConfig.error, ...newConfig.error }
1433
+ }));
1434
+ }
1435
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ErrorPagesConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1436
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ErrorPagesConfigService, providedIn: 'root' });
1437
+ }
1438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ErrorPagesConfigService, decorators: [{
1439
+ type: Injectable,
1440
+ args: [{ providedIn: 'root' }]
1441
+ }] });
1442
+
1443
+ class AccessPageComponent {
1444
+ config = inject(ErrorPagesConfigService).config();
1445
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccessPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1446
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AccessPageComponent, isStandalone: true, selector: "app-access", ngImport: i0, template: `
1447
+ <div class="bg-surface-50 dark:bg-surface-950 flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden">
1448
+ <div class="flex flex-col items-center justify-center">
1449
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, rgba(247, 149, 48, 0.4) 10%, rgba(247, 149, 48, 0) 30%)">
1450
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1451
+ <div class="gap-4 flex flex-col items-center">
1452
+ <div class="flex justify-center items-center border-2 border-orange-500 rounded-full" style="width: 3.2rem; height: 3.2rem">
1453
+ <i class="text-orange-500 !text-2xl" [ngClass]="config.access.icon"></i>
1454
+ </div>
1455
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-4xl lg:text-5xl mb-2">{{ config.access.title }}</h1>
1456
+ <span class="text-muted-color mb-8">{{ config.access.message }}</span>
1457
+ <img [src]="config.access.imagePath" alt="Access denied" class="mb-8" width="80%" />
1458
+ @for (button of config.access.buttons; track button.url) {
1459
+ <div class="col-span-12 mt-8 text-center">
1460
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1461
+ </div>
1462
+ }
1463
+ </div>
1464
+ </div>
1465
+ </div>
1466
+ </div>
1467
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: RippleModule }] });
1468
+ }
1469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccessPageComponent, decorators: [{
1470
+ type: Component,
1471
+ args: [{
1472
+ selector: 'app-access',
1473
+ standalone: true,
1474
+ imports: [CommonModule, ButtonModule, RouterModule, RippleModule, ButtonModule],
1475
+ template: `
1476
+ <div class="bg-surface-50 dark:bg-surface-950 flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden">
1477
+ <div class="flex flex-col items-center justify-center">
1478
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, rgba(247, 149, 48, 0.4) 10%, rgba(247, 149, 48, 0) 30%)">
1479
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1480
+ <div class="gap-4 flex flex-col items-center">
1481
+ <div class="flex justify-center items-center border-2 border-orange-500 rounded-full" style="width: 3.2rem; height: 3.2rem">
1482
+ <i class="text-orange-500 !text-2xl" [ngClass]="config.access.icon"></i>
1483
+ </div>
1484
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-4xl lg:text-5xl mb-2">{{ config.access.title }}</h1>
1485
+ <span class="text-muted-color mb-8">{{ config.access.message }}</span>
1486
+ <img [src]="config.access.imagePath" alt="Access denied" class="mb-8" width="80%" />
1487
+ @for (button of config.access.buttons; track button.url) {
1488
+ <div class="col-span-12 mt-8 text-center">
1489
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1490
+ </div>
1491
+ }
1492
+ </div>
1493
+ </div>
1494
+ </div>
1495
+ </div>
1496
+ </div>`
1497
+ }]
1498
+ }] });
1499
+
1500
+ class ErrorPageComponent {
1501
+ config = inject(ErrorPagesConfigService).config();
1502
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ErrorPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1503
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: ErrorPageComponent, isStandalone: true, selector: "app-error", ngImport: i0, template: `
1504
+ <div class="bg-surface-50 dark:bg-surface-950 flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden">
1505
+ <div class="flex flex-col items-center justify-center">
1506
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, rgba(233, 30, 99, 0.4) 10%, rgba(33, 150, 243, 0) 30%)">
1507
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1508
+ <div class="gap-4 flex flex-col items-center">
1509
+ <div class="flex justify-center items-center border-2 border-pink-500 rounded-full" style="height: 3.2rem; width: 3.2rem">
1510
+ <i class="!text-2xl text-pink-500" [ngClass]="config.error.icon"></i>
1511
+ </div>
1512
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-5xl mb-2">{{ config.error.title }}</h1>
1513
+ <span class="text-muted-color mb-8">{{ config.error.message }}</span>
1514
+ <img [src]="config.error.imagePath" alt="Error" class="mb-8" width="80%" />
1515
+ @for (button of config.error.buttons; track button.url) {
1516
+ <div class="col-span-12 mt-4 text-center">
1517
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1518
+ </div>
1519
+ }
1520
+ </div>
1521
+ </div>
1522
+ </div>
1523
+ </div>
1524
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: RippleModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
1525
+ }
1526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ErrorPageComponent, decorators: [{
1527
+ type: Component,
1528
+ args: [{
1529
+ selector: 'app-error',
1530
+ imports: [CommonModule, ButtonModule, RippleModule, RouterModule, ButtonModule],
1531
+ standalone: true,
1532
+ template: `
1533
+ <div class="bg-surface-50 dark:bg-surface-950 flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden">
1534
+ <div class="flex flex-col items-center justify-center">
1535
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, rgba(233, 30, 99, 0.4) 10%, rgba(33, 150, 243, 0) 30%)">
1536
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1537
+ <div class="gap-4 flex flex-col items-center">
1538
+ <div class="flex justify-center items-center border-2 border-pink-500 rounded-full" style="height: 3.2rem; width: 3.2rem">
1539
+ <i class="!text-2xl text-pink-500" [ngClass]="config.error.icon"></i>
1540
+ </div>
1541
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-5xl mb-2">{{ config.error.title }}</h1>
1542
+ <span class="text-muted-color mb-8">{{ config.error.message }}</span>
1543
+ <img [src]="config.error.imagePath" alt="Error" class="mb-8" width="80%" />
1544
+ @for (button of config.error.buttons; track button.url) {
1545
+ <div class="col-span-12 mt-4 text-center">
1546
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1547
+ </div>
1548
+ }
1549
+ </div>
1550
+ </div>
1551
+ </div>
1552
+ </div>
1553
+ </div>`
1554
+ }]
1555
+ }] });
1556
+
1557
+ class NotfoundPageComponent {
1558
+ config = inject(ErrorPagesConfigService).config();
1559
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NotfoundPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1560
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: NotfoundPageComponent, isStandalone: true, selector: "app-notfound", ngImport: i0, template: `
1561
+ <div class="flex items-center justify-center min-h-screen overflow-hidden">
1562
+ <div class="flex flex-col items-center justify-center">
1563
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color), transparent 60%) 10%, var(--surface-ground) 30%)">
1564
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1565
+ <span class="text-primary font-bold text-3xl">{{ config.notfound.code }}</span>
1566
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-3xl lg:text-5xl mb-2">{{ config.notfound.title }}</h1>
1567
+ <div class="text-surface-600 dark:text-surface-200 mb-8">{{ config.notfound.message }}</div>
1568
+
1569
+ @for (link of config.notfound.links; track link.url) {
1570
+ <a [routerLink]="link.url" class="w-full flex items-center py-8 border-surface-300 dark:border-surface-500 border-b">
1571
+ <span class="flex justify-center items-center border-2 border-primary text-primary rounded-border" style="height: 3.5rem; width: 3.5rem">
1572
+ <i class="!text-2xl" [ngClass]="link.icon"></i>
1573
+ </span>
1574
+ <span class="ml-6 flex flex-col">
1575
+ <span class="text-surface-900 dark:text-surface-0 lg:text-xl font-medium mb-0 block">{{ link.title }}</span>
1576
+ <span class="text-surface-600 dark:text-surface-200 lg:text-xl">{{ link.description }}</span>
1577
+ </span>
1578
+ </a>
1579
+ }
1580
+
1581
+ @for (button of config.notfound.buttons; track button.url) {
1582
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1583
+ }
1584
+ </div>
1585
+ </div>
1586
+ </div>
1587
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] });
1588
+ }
1589
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NotfoundPageComponent, decorators: [{
1590
+ type: Component,
1591
+ args: [{
1592
+ selector: 'app-notfound',
1593
+ standalone: true,
1594
+ imports: [CommonModule, RouterModule, ButtonModule],
1595
+ template: `
1596
+ <div class="flex items-center justify-center min-h-screen overflow-hidden">
1597
+ <div class="flex flex-col items-center justify-center">
1598
+ <div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color), transparent 60%) 10%, var(--surface-ground) 30%)">
1599
+ <div class="w-full bg-surface-0 dark:bg-surface-900 py-20 px-8 sm:px-20 flex flex-col items-center" style="border-radius: 53px">
1600
+ <span class="text-primary font-bold text-3xl">{{ config.notfound.code }}</span>
1601
+ <h1 class="text-surface-900 dark:text-surface-0 font-bold text-3xl lg:text-5xl mb-2">{{ config.notfound.title }}</h1>
1602
+ <div class="text-surface-600 dark:text-surface-200 mb-8">{{ config.notfound.message }}</div>
1603
+
1604
+ @for (link of config.notfound.links; track link.url) {
1605
+ <a [routerLink]="link.url" class="w-full flex items-center py-8 border-surface-300 dark:border-surface-500 border-b">
1606
+ <span class="flex justify-center items-center border-2 border-primary text-primary rounded-border" style="height: 3.5rem; width: 3.5rem">
1607
+ <i class="!text-2xl" [ngClass]="link.icon"></i>
1608
+ </span>
1609
+ <span class="ml-6 flex flex-col">
1610
+ <span class="text-surface-900 dark:text-surface-0 lg:text-xl font-medium mb-0 block">{{ link.title }}</span>
1611
+ <span class="text-surface-600 dark:text-surface-200 lg:text-xl">{{ link.description }}</span>
1612
+ </span>
1613
+ </a>
1614
+ }
1615
+
1616
+ @for (button of config.notfound.buttons; track button.url) {
1617
+ <p-button [label]="button.label" [routerLink]="button.url" (onClick)="button.command()" class="mt-8" [severity]="button.severity" />
1618
+ }
1619
+ </div>
1620
+ </div>
1621
+ </div>
1622
+ </div>`
1623
+ }]
1624
+ }] });
1625
+
1626
+ const ErrorsRoutes = [
1627
+ { path: 'access', component: AccessPageComponent },
1628
+ { path: 'error', component: ErrorPageComponent },
1629
+ { path: 'notfound', component: NotfoundPageComponent }
1630
+ ];
1631
+
1632
+ /*
1633
+ * Public API Surface of ngx-smz-ui-layout
1634
+ */
1635
+
1636
+ /**
1637
+ * Generated bundle index. Do not edit.
1638
+ */
1639
+
1640
+ export { AccessPageComponent, AppFloatingConfigurator, AppLayout, ErrorPageComponent, ErrorPagesConfigService, ErrorsRoutes, LayoutService, NotfoundPageComponent, SMZ_UI_LAYOUT_CONFIG, SmzUILayout, provideSmzUILayout };
1641
+ //# sourceMappingURL=ngx-smz-layout.mjs.map