@ngx-smz/layout 21.10.0-next.25 → 21.10.0-next.27

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.
@@ -0,0 +1,78 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { Router } from '@angular/router';
4
+ import { SMZ_GALLERY_SCENE, SmzGalleryCaseComponent, SmzGallerySectionComponent } from '@ngx-smz/core';
5
+ import { G as GALLERY_FOOTER, a as GALLERY_TOPBAR, g as galleryMenu, S as SmzLayoutGalleryStageComponent } from './ngx-smz-layout-layout-gallery.fixtures-yel7nOYX.mjs';
6
+
7
+ /**
8
+ * Galeria: `<app-layout>` inteiro (topbar, sidebar, área principal e rodapé) dentro de uma caixa com a
9
+ * altura da viewport. Uma cena por modo/estado de menu, porque cada `<app-layout>` traz um `<router-outlet>`.
10
+ * A área principal fica vazia: o conteúdo do shell vem do `<router-outlet>`, que aqui não tem rota filha.
11
+ * As regras de `max-width: 991px` (menu móvel) dependem da viewport, não da caixa, e não são cobertas.
12
+ */
13
+ class LayoutShellGalleryEntryComponent {
14
+ scene = inject(SMZ_GALLERY_SCENE);
15
+ path = inject(Router).url.split(/[?#]/)[0];
16
+ base = {
17
+ sidebar: galleryMenu(this.path),
18
+ topbar: GALLERY_TOPBAR,
19
+ footer: GALLERY_FOOTER,
20
+ pageTitle: 'Categorias',
21
+ };
22
+ scenes = {
23
+ default: {
24
+ section: 'Menu estático',
25
+ label: 'menuMode static · sidebar visível',
26
+ config: { ...this.base, layout: { menuMode: 'static' } },
27
+ },
28
+ 'static-inactive': {
29
+ section: 'Menu estático recolhido',
30
+ label: 'menuMode static · staticMenuDesktopInactive',
31
+ config: { ...this.base, layout: { menuMode: 'static' }, state: { staticMenuDesktopInactive: true } },
32
+ },
33
+ overlay: {
34
+ section: 'Menu overlay fechado',
35
+ label: 'menuMode overlay',
36
+ config: { ...this.base, layout: { menuMode: 'overlay' } },
37
+ },
38
+ 'overlay-active': {
39
+ section: 'Menu overlay aberto',
40
+ label: 'menuMode overlay · overlayMenuActive',
41
+ config: { ...this.base, layout: { menuMode: 'overlay' }, state: { overlayMenuActive: true } },
42
+ },
43
+ 'no-sidebar': {
44
+ section: 'Sem sidebar',
45
+ label: 'showSidebar false · topbar sem alternador de menu',
46
+ config: { ...this.base, topbar: { ...GALLERY_TOPBAR, showMenuToggle: false }, layout: { menuMode: 'static', showSidebar: false } },
47
+ },
48
+ };
49
+ // A entrada é recriada a cada troca de cena (o host da galeria recarrega o componente).
50
+ current = this.scenes[this.scene()] ?? this.scenes['default'];
51
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LayoutShellGalleryEntryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
52
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: LayoutShellGalleryEntryComponent, isStandalone: true, selector: "smz-gallery-layout-shell-entry", host: { classAttribute: "flex flex-col gap-8" }, ngImport: i0, template: `
53
+ <smz-gallery-section [label]="current.section" [columns]="1">
54
+ <smz-gallery-case [label]="current.label">
55
+ <smz-gallery-layout-stage piece="layout" height="100vh" [config]="current.config" />
56
+ </smz-gallery-case>
57
+ </smz-gallery-section>
58
+ `, isInline: true, dependencies: [{ kind: "component", type: SmzGalleryCaseComponent, selector: "smz-gallery-case", inputs: ["label", "force", "target"] }, { kind: "component", type: SmzGallerySectionComponent, selector: "smz-gallery-section", inputs: ["label", "columns"] }, { kind: "component", type: SmzLayoutGalleryStageComponent, selector: "smz-gallery-layout-stage", inputs: ["piece", "config", "width", "height", "scale"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LayoutShellGalleryEntryComponent, decorators: [{
61
+ type: Component,
62
+ args: [{
63
+ selector: 'smz-gallery-layout-shell-entry',
64
+ changeDetection: ChangeDetectionStrategy.OnPush,
65
+ imports: [SmzGalleryCaseComponent, SmzGallerySectionComponent, SmzLayoutGalleryStageComponent],
66
+ host: { class: 'flex flex-col gap-8' },
67
+ template: `
68
+ <smz-gallery-section [label]="current.section" [columns]="1">
69
+ <smz-gallery-case [label]="current.label">
70
+ <smz-gallery-layout-stage piece="layout" height="100vh" [config]="current.config" />
71
+ </smz-gallery-case>
72
+ </smz-gallery-section>
73
+ `,
74
+ }]
75
+ }] });
76
+
77
+ export { LayoutShellGalleryEntryComponent };
78
+ //# sourceMappingURL=ngx-smz-layout-layout-shell.entry-CWxnFneU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-smz-layout-layout-shell.entry-CWxnFneU.mjs","sources":["../../../projects/ngx-smz-ui-layout/src/lib/gallery/entries/layout-shell.entry.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { SMZ_GALLERY_SCENE, SmzGalleryCaseComponent, SmzGallerySectionComponent } from '@ngx-smz/core';\nimport { SmzLayoutGalleryStageComponent, SmzLayoutGalleryStageConfig } from '../layout-gallery-stage.component';\nimport { GALLERY_FOOTER, GALLERY_TOPBAR, galleryMenu } from '../layout-gallery.fixtures';\n\ninterface ShellScene {\n section: string;\n label: string;\n config: SmzLayoutGalleryStageConfig;\n}\n\n/**\n * Galeria: `<app-layout>` inteiro (topbar, sidebar, área principal e rodapé) dentro de uma caixa com a\n * altura da viewport. Uma cena por modo/estado de menu, porque cada `<app-layout>` traz um `<router-outlet>`.\n * A área principal fica vazia: o conteúdo do shell vem do `<router-outlet>`, que aqui não tem rota filha.\n * As regras de `max-width: 991px` (menu móvel) dependem da viewport, não da caixa, e não são cobertas.\n */\n@Component({\n selector: 'smz-gallery-layout-shell-entry',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SmzGalleryCaseComponent, SmzGallerySectionComponent, SmzLayoutGalleryStageComponent],\n host: { class: 'flex flex-col gap-8' },\n template: `\n <smz-gallery-section [label]=\"current.section\" [columns]=\"1\">\n <smz-gallery-case [label]=\"current.label\">\n <smz-gallery-layout-stage piece=\"layout\" height=\"100vh\" [config]=\"current.config\" />\n </smz-gallery-case>\n </smz-gallery-section>\n `,\n})\nexport class LayoutShellGalleryEntryComponent {\n protected readonly scene = inject(SMZ_GALLERY_SCENE);\n\n private readonly path = inject(Router).url.split(/[?#]/)[0];\n private readonly base: SmzLayoutGalleryStageConfig = {\n sidebar: galleryMenu(this.path),\n topbar: GALLERY_TOPBAR,\n footer: GALLERY_FOOTER,\n pageTitle: 'Categorias',\n };\n\n private readonly scenes: Record<string, ShellScene> = {\n default: {\n section: 'Menu estático',\n label: 'menuMode static · sidebar visível',\n config: { ...this.base, layout: { menuMode: 'static' } },\n },\n 'static-inactive': {\n section: 'Menu estático recolhido',\n label: 'menuMode static · staticMenuDesktopInactive',\n config: { ...this.base, layout: { menuMode: 'static' }, state: { staticMenuDesktopInactive: true } },\n },\n overlay: {\n section: 'Menu overlay fechado',\n label: 'menuMode overlay',\n config: { ...this.base, layout: { menuMode: 'overlay' } },\n },\n 'overlay-active': {\n section: 'Menu overlay aberto',\n label: 'menuMode overlay · overlayMenuActive',\n config: { ...this.base, layout: { menuMode: 'overlay' }, state: { overlayMenuActive: true } },\n },\n 'no-sidebar': {\n section: 'Sem sidebar',\n label: 'showSidebar false · topbar sem alternador de menu',\n config: { ...this.base, topbar: { ...GALLERY_TOPBAR, showMenuToggle: false }, layout: { menuMode: 'static', showSidebar: false } },\n },\n };\n\n // A entrada é recriada a cada troca de cena (o host da galeria recarrega o componente).\n protected readonly current = this.scenes[this.scene()] ?? this.scenes['default'];\n}\n"],"names":[],"mappings":";;;;;;AAYA;;;;;AAKG;MAcU,gCAAgC,CAAA;AACxB,IAAA,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEnC,IAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,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QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAUlF,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAb5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;oBAC1C,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,EAAE,8BAA8B,CAAC;AAC9F,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE;AACtC,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,164 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { SmzGalleryCaseComponent, SmzGallerySectionComponent } from '@ngx-smz/core';
4
+ import { b as GALLERY_AVATAR, c as GALLERY_LOGO, S as SmzLayoutGalleryStageComponent } from './ngx-smz-layout-layout-gallery.fixtures-yel7nOYX.mjs';
5
+
6
+ function noop() { }
7
+ /**
8
+ * Galeria: topbar isolada (`app-topbar`), um caso por combinação do contrato `Topbar`. O título da página e
9
+ * o botão voltar dependem de `PageTitleService` e `NavigationService`; o palco os fixa por `pageTitle` e
10
+ * `canGoBack`. Os menus de perfil (popup) ficam fechados. `showConfigurator` fica de fora: o `AppConfigurator`
11
+ * chama `SmzThemeService.reset()` ao nascer e apagaria as sobrescritas de tema feitas pela galeria.
12
+ */
13
+ class LayoutTopbarGalleryEntryComponent {
14
+ profileItems = [
15
+ { label: 'Meu perfil', icon: 'fa-solid fa-user' },
16
+ { label: 'Sair', icon: 'fa-solid fa-right-from-bracket' },
17
+ ];
18
+ menuItems = [
19
+ { icon: 'fa-solid fa-bell', label: 'Notificações', tooltip: 'Notificações', callback: noop },
20
+ { icon: 'fa-solid fa-circle-question', label: 'Ajuda', tooltip: 'Ajuda', callback: noop },
21
+ { icon: 'fa-solid fa-gear', label: 'Preferências', tooltip: 'Preferências', callback: noop },
22
+ ];
23
+ iconFeature = {
24
+ icon: signal('fa-solid fa-user'),
25
+ label: 'Maria Souza',
26
+ tooltip: 'Maria Souza',
27
+ menuItems: this.profileItems,
28
+ };
29
+ avatarFeature = {
30
+ avatar: signal(GALLERY_AVATAR),
31
+ placeholder: GALLERY_AVATAR,
32
+ label: 'Maria Souza',
33
+ tooltip: 'Maria Souza',
34
+ menuItems: this.profileItems,
35
+ };
36
+ brand = [
37
+ { label: 'alternador de menu, logotipo e nome do app', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, appName: 'Gestão Comercial' } } },
38
+ { label: 'logotipo e nome do app, sem alternador', config: { topbar: { showMenuToggle: false, logoPath: GALLERY_LOGO, appName: 'Gestão Comercial' } } },
39
+ { label: 'só logotipo', config: { topbar: { logoPath: GALLERY_LOGO } } },
40
+ { label: 'só nome do app', config: { topbar: { appName: 'Gestão Comercial' } } },
41
+ { label: 'alternador de menu sem marca', config: { topbar: { showMenuToggle: true } } },
42
+ ];
43
+ navigation = [
44
+ { label: 'título da página', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO }, pageTitle: 'Clientes' } },
45
+ { label: 'showBackButton com histórico e título', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true }, pageTitle: 'Clientes', canGoBack: true } },
46
+ { label: 'showBackButton sem histórico (só o separador)', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true } } },
47
+ { label: 'showBackButton com histórico, sem título', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true }, canGoBack: true } },
48
+ ];
49
+ actions = [
50
+ { label: 'menuItems (ícone; rótulo só no menu móvel)', config: { topbar: { logoPath: GALLERY_LOGO, menuItems: this.menuItems } } },
51
+ { label: 'showDarkModeToggle', config: { topbar: { logoPath: GALLERY_LOGO, showDarkModeToggle: true } } },
52
+ { label: 'perfil com ícone', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.iconFeature] } } },
53
+ { label: 'perfil com avatar', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.avatarFeature] } } },
54
+ { label: 'dois recursos de perfil (avatar e ícone)', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.avatarFeature, this.iconFeature] } } },
55
+ { label: 'showProfileMenu false (perfil configurado, oculto)', config: { topbar: { logoPath: GALLERY_LOGO, showProfileMenu: false, features: [this.avatarFeature] } } },
56
+ ];
57
+ complete = {
58
+ topbar: {
59
+ showMenuToggle: true,
60
+ showBackButton: true,
61
+ showDarkModeToggle: true,
62
+ showProfileMenu: true,
63
+ logoPath: GALLERY_LOGO,
64
+ appName: 'Gestão Comercial',
65
+ menuItems: this.menuItems,
66
+ features: [this.avatarFeature],
67
+ },
68
+ pageTitle: 'Clientes',
69
+ canGoBack: true,
70
+ };
71
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LayoutTopbarGalleryEntryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
72
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: LayoutTopbarGalleryEntryComponent, isStandalone: true, selector: "smz-gallery-layout-topbar-entry", host: { classAttribute: "flex flex-col gap-8" }, ngImport: i0, template: `
73
+ <smz-gallery-section label="Marca: alternador de menu, logotipo e nome" [columns]="1">
74
+ @for (item of brand; track item.label) {
75
+ <smz-gallery-case [label]="item.label">
76
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
77
+ </smz-gallery-case>
78
+ }
79
+ </smz-gallery-section>
80
+
81
+ <smz-gallery-section label="Navegação: voltar e título da página" [columns]="1">
82
+ @for (item of navigation; track item.label) {
83
+ <smz-gallery-case [label]="item.label">
84
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
85
+ </smz-gallery-case>
86
+ }
87
+ </smz-gallery-section>
88
+
89
+ <smz-gallery-section label="Ações à direita" [columns]="1">
90
+ @for (item of actions; track item.label) {
91
+ <smz-gallery-case [label]="item.label">
92
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
93
+ </smz-gallery-case>
94
+ }
95
+ </smz-gallery-section>
96
+
97
+ <smz-gallery-section label="Estados de uma ação" [columns]="1">
98
+ <smz-gallery-case label="hover no alternador de menu" force="hover" target=".layout-menu-button">
99
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
100
+ </smz-gallery-case>
101
+ <smz-gallery-case label="foco visível no alternador de menu" force="focus-visible" target=".layout-menu-button">
102
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
103
+ </smz-gallery-case>
104
+ <smz-gallery-case label="hover em ação de menuItems" force="hover" target=".layout-topbar-menu-content .layout-topbar-action">
105
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
106
+ </smz-gallery-case>
107
+ <smz-gallery-case label="foco visível no logotipo" force="focus-visible" target=".layout-topbar-logo">
108
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
109
+ </smz-gallery-case>
110
+ </smz-gallery-section>
111
+ `, isInline: true, dependencies: [{ kind: "component", type: SmzGalleryCaseComponent, selector: "smz-gallery-case", inputs: ["label", "force", "target"] }, { kind: "component", type: SmzGallerySectionComponent, selector: "smz-gallery-section", inputs: ["label", "columns"] }, { kind: "component", type: SmzLayoutGalleryStageComponent, selector: "smz-gallery-layout-stage", inputs: ["piece", "config", "width", "height", "scale"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: LayoutTopbarGalleryEntryComponent, decorators: [{
114
+ type: Component,
115
+ args: [{
116
+ selector: 'smz-gallery-layout-topbar-entry',
117
+ changeDetection: ChangeDetectionStrategy.OnPush,
118
+ imports: [SmzGalleryCaseComponent, SmzGallerySectionComponent, SmzLayoutGalleryStageComponent],
119
+ host: { class: 'flex flex-col gap-8' },
120
+ template: `
121
+ <smz-gallery-section label="Marca: alternador de menu, logotipo e nome" [columns]="1">
122
+ @for (item of brand; track item.label) {
123
+ <smz-gallery-case [label]="item.label">
124
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
125
+ </smz-gallery-case>
126
+ }
127
+ </smz-gallery-section>
128
+
129
+ <smz-gallery-section label="Navegação: voltar e título da página" [columns]="1">
130
+ @for (item of navigation; track item.label) {
131
+ <smz-gallery-case [label]="item.label">
132
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
133
+ </smz-gallery-case>
134
+ }
135
+ </smz-gallery-section>
136
+
137
+ <smz-gallery-section label="Ações à direita" [columns]="1">
138
+ @for (item of actions; track item.label) {
139
+ <smz-gallery-case [label]="item.label">
140
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="item.config" />
141
+ </smz-gallery-case>
142
+ }
143
+ </smz-gallery-section>
144
+
145
+ <smz-gallery-section label="Estados de uma ação" [columns]="1">
146
+ <smz-gallery-case label="hover no alternador de menu" force="hover" target=".layout-menu-button">
147
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
148
+ </smz-gallery-case>
149
+ <smz-gallery-case label="foco visível no alternador de menu" force="focus-visible" target=".layout-menu-button">
150
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
151
+ </smz-gallery-case>
152
+ <smz-gallery-case label="hover em ação de menuItems" force="hover" target=".layout-topbar-menu-content .layout-topbar-action">
153
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
154
+ </smz-gallery-case>
155
+ <smz-gallery-case label="foco visível no logotipo" force="focus-visible" target=".layout-topbar-logo">
156
+ <smz-gallery-layout-stage piece="topbar" height="4rem" [config]="complete" />
157
+ </smz-gallery-case>
158
+ </smz-gallery-section>
159
+ `,
160
+ }]
161
+ }] });
162
+
163
+ export { LayoutTopbarGalleryEntryComponent };
164
+ //# sourceMappingURL=ngx-smz-layout-layout-topbar.entry-CfSpHt5E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-smz-layout-layout-topbar.entry-CfSpHt5E.mjs","sources":["../../../projects/ngx-smz-ui-layout/src/lib/gallery/entries/layout-topbar.entry.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { SmzGalleryCaseComponent, SmzGallerySectionComponent } from '@ngx-smz/core';\nimport { SmzUiMenuItem } from '@ngx-smz/ui-kit';\nimport { Topbar } from '../../layout/component/app.topbar';\nimport { SmzLayoutGalleryStageComponent, SmzLayoutGalleryStageConfig } from '../layout-gallery-stage.component';\nimport { GALLERY_AVATAR, GALLERY_LOGO } from '../layout-gallery.fixtures';\n\ninterface TopbarCase {\n label: string;\n config: SmzLayoutGalleryStageConfig;\n}\n\nfunction noop(): void {}\n\n/**\n * Galeria: topbar isolada (`app-topbar`), um caso por combinação do contrato `Topbar`. O título da página e\n * o botão voltar dependem de `PageTitleService` e `NavigationService`; o palco os fixa por `pageTitle` e\n * `canGoBack`. Os menus de perfil (popup) ficam fechados. `showConfigurator` fica de fora: o `AppConfigurator`\n * chama `SmzThemeService.reset()` ao nascer e apagaria as sobrescritas de tema feitas pela galeria.\n */\n@Component({\n selector: 'smz-gallery-layout-topbar-entry',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SmzGalleryCaseComponent, SmzGallerySectionComponent, SmzLayoutGalleryStageComponent],\n host: { class: 'flex flex-col gap-8' },\n template: `\n <smz-gallery-section label=\"Marca: alternador de menu, logotipo e nome\" [columns]=\"1\">\n @for (item of brand; track item.label) {\n <smz-gallery-case [label]=\"item.label\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"item.config\" />\n </smz-gallery-case>\n }\n </smz-gallery-section>\n\n <smz-gallery-section label=\"Navegação: voltar e título da página\" [columns]=\"1\">\n @for (item of navigation; track item.label) {\n <smz-gallery-case [label]=\"item.label\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"item.config\" />\n </smz-gallery-case>\n }\n </smz-gallery-section>\n\n <smz-gallery-section label=\"Ações à direita\" [columns]=\"1\">\n @for (item of actions; track item.label) {\n <smz-gallery-case [label]=\"item.label\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"item.config\" />\n </smz-gallery-case>\n }\n </smz-gallery-section>\n\n <smz-gallery-section label=\"Estados de uma ação\" [columns]=\"1\">\n <smz-gallery-case label=\"hover no alternador de menu\" force=\"hover\" target=\".layout-menu-button\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"complete\" />\n </smz-gallery-case>\n <smz-gallery-case label=\"foco visível no alternador de menu\" force=\"focus-visible\" target=\".layout-menu-button\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"complete\" />\n </smz-gallery-case>\n <smz-gallery-case label=\"hover em ação de menuItems\" force=\"hover\" target=\".layout-topbar-menu-content .layout-topbar-action\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"complete\" />\n </smz-gallery-case>\n <smz-gallery-case label=\"foco visível no logotipo\" force=\"focus-visible\" target=\".layout-topbar-logo\">\n <smz-gallery-layout-stage piece=\"topbar\" height=\"4rem\" [config]=\"complete\" />\n </smz-gallery-case>\n </smz-gallery-section>\n `,\n})\nexport class LayoutTopbarGalleryEntryComponent {\n private readonly profileItems: SmzUiMenuItem[] = [\n { label: 'Meu perfil', icon: 'fa-solid fa-user' },\n { label: 'Sair', icon: 'fa-solid fa-right-from-bracket' },\n ];\n\n private readonly menuItems: Topbar['menuItems'] = [\n { icon: 'fa-solid fa-bell', label: 'Notificações', tooltip: 'Notificações', callback: noop },\n { icon: 'fa-solid fa-circle-question', label: 'Ajuda', tooltip: 'Ajuda', callback: noop },\n { icon: 'fa-solid fa-gear', label: 'Preferências', tooltip: 'Preferências', callback: noop },\n ];\n\n private readonly iconFeature: NonNullable<Topbar['features']>[number] = {\n icon: signal('fa-solid fa-user'),\n label: 'Maria Souza',\n tooltip: 'Maria Souza',\n menuItems: this.profileItems,\n };\n\n private readonly avatarFeature: NonNullable<Topbar['features']>[number] = {\n avatar: signal(GALLERY_AVATAR),\n placeholder: GALLERY_AVATAR,\n label: 'Maria Souza',\n tooltip: 'Maria Souza',\n menuItems: this.profileItems,\n };\n\n protected readonly brand: TopbarCase[] = [\n { label: 'alternador de menu, logotipo e nome do app', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, appName: 'Gestão Comercial' } } },\n { label: 'logotipo e nome do app, sem alternador', config: { topbar: { showMenuToggle: false, logoPath: GALLERY_LOGO, appName: 'Gestão Comercial' } } },\n { label: 'só logotipo', config: { topbar: { logoPath: GALLERY_LOGO } } },\n { label: 'só nome do app', config: { topbar: { appName: 'Gestão Comercial' } } },\n { label: 'alternador de menu sem marca', config: { topbar: { showMenuToggle: true } } },\n ];\n\n protected readonly navigation: TopbarCase[] = [\n { label: 'título da página', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO }, pageTitle: 'Clientes' } },\n { label: 'showBackButton com histórico e título', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true }, pageTitle: 'Clientes', canGoBack: true } },\n { label: 'showBackButton sem histórico (só o separador)', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true } } },\n { label: 'showBackButton com histórico, sem título', config: { topbar: { showMenuToggle: true, logoPath: GALLERY_LOGO, showBackButton: true }, canGoBack: true } },\n ];\n\n protected readonly actions: TopbarCase[] = [\n { label: 'menuItems (ícone; rótulo só no menu móvel)', config: { topbar: { logoPath: GALLERY_LOGO, menuItems: this.menuItems } } },\n { label: 'showDarkModeToggle', config: { topbar: { logoPath: GALLERY_LOGO, showDarkModeToggle: true } } },\n { label: 'perfil com ícone', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.iconFeature] } } },\n { label: 'perfil com avatar', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.avatarFeature] } } },\n { label: 'dois recursos de perfil (avatar e ícone)', config: { topbar: { logoPath: GALLERY_LOGO, features: [this.avatarFeature, this.iconFeature] } } },\n { label: 'showProfileMenu false (perfil configurado, oculto)', config: { topbar: { logoPath: GALLERY_LOGO, showProfileMenu: false, features: [this.avatarFeature] } } },\n ];\n\n protected readonly complete: SmzLayoutGalleryStageConfig = {\n topbar: {\n showMenuToggle: true,\n showBackButton: true,\n showDarkModeToggle: true,\n showProfileMenu: true,\n logoPath: GALLERY_LOGO,\n appName: 'Gestão Comercial',\n menuItems: this.menuItems,\n features: [this.avatarFeature],\n },\n pageTitle: 'Clientes',\n canGoBack: true,\n };\n}\n"],"names":[],"mappings":";;;;;AAYA,SAAS,IAAI,KAAU;AAEvB;;;;;AAKG;MA+CU,iCAAiC,CAAA;AAC3B,IAAA,YAAY,GAAoB;AAC/C,QAAA,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE;AACjD,QAAA,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,EAAE;KAC1D;AAEgB,IAAA,SAAS,GAAwB;AAChD,QAAA,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;AAC5F,QAAA,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;AACzF,QAAA,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC7F;AAEgB,IAAA,WAAW,GAA4C;AACtE,QAAA,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAC;AAChC,QAAA,KAAK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