@seniorsistemas/scala-ng 2.1.0 → 2.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.
- package/README.md +4 -5
- package/avatar-summary/README.md +6 -2
- package/avatar-summary/public-api.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
- package/banner/README.md +13 -9
- package/banner/public-api.d.ts +1 -1
- package/breadcrumb/README.md +15 -8
- package/breadcrumb/public-api.d.ts +3 -3
- package/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.d.ts +1 -0
- package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +7 -1
- package/card/README.md +1 -0
- package/checkbox/README.md +3 -1
- package/date-picker/README.md +1 -0
- package/date-picker/public-api.d.ts +1 -1
- package/drawer/README.md +4 -0
- package/empty-state/README.md +17 -11
- package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
- package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/avatar-summary/public-api.mjs +1 -1
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +2 -2
- package/esm2022/banner/public-api.mjs +2 -2
- package/esm2022/banner/src/banner/banner.component.mjs +4 -4
- package/esm2022/breadcrumb/public-api.mjs +2 -2
- package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +4 -4
- package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +6 -3
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.mjs +1 -1
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +23 -6
- package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +2 -2
- package/esm2022/card/src/card/card.component.mjs +4 -4
- package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/date-picker/public-api.mjs +2 -2
- package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +4 -4
- package/esm2022/drawer/src/drawer/drawer.component.mjs +3 -3
- package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +4 -4
- package/esm2022/input/src/input/input.component.mjs +3 -4
- package/esm2022/item-strip/public-api.mjs +1 -1
- package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +59 -11
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +97 -9
- package/esm2022/lib/chip/chip.utils.mjs +2 -2
- package/esm2022/lib/overlay/scroll-lock.utils.mjs +1 -1
- package/esm2022/lib/theme/theme.service.mjs +2 -2
- package/esm2022/list/public-api.mjs +1 -1
- package/esm2022/list/src/list/list.component.mjs +3 -3
- package/esm2022/list/src/list/list.models.mjs +1 -1
- package/esm2022/list/src/list-item/list-item.component.mjs +26 -5
- package/esm2022/locale/fallback.mjs +1 -2
- package/esm2022/page-header/src/page-header/page-header.component.mjs +8 -6
- package/esm2022/paginator/src/paginator/paginator.component.mjs +2 -2
- package/esm2022/panel/src/panel/panel.component.mjs +4 -4
- package/esm2022/public-api.mjs +5 -5
- package/esm2022/radio-button/public-api.mjs +2 -2
- package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/select/src/select/select.component.mjs +5 -5
- package/esm2022/select-button/src/select-button/select-button.component.mjs +4 -4
- package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +5 -28
- package/esm2022/switch/src/switch/switch.component.mjs +3 -3
- package/esm2022/table/public-api.mjs +1 -1
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +10 -5
- package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +1 -1
- package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +2 -2
- package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +3 -3
- package/esm2022/table/src/directives/table-container.directive.mjs +3 -3
- package/esm2022/table/src/table/table.component.mjs +3 -3
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/esm2022/table/src/utils/table-lazy-event.utils.mjs +1 -1
- package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +32 -0
- package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +5 -3
- package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +77 -23
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs +53 -53
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +30 -11
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-card.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +154 -18
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-list.mjs +27 -6
- package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs +0 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +7 -5
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select.mjs +4 -4
- package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +4 -27
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs} +10 -5
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs.map +1 -0
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs} +3 -3
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs.map → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map} +1 -1
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +21 -21
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +109 -24
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng.mjs +55 -55
- package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
- package/filter-tag/README.md +2 -1
- package/item-strip/README.md +11 -4
- package/item-strip/public-api.d.ts +1 -1
- package/item-strip/src/item-strip/item-strip.component.d.ts +12 -1
- package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +32 -3
- package/list/README.md +17 -0
- package/list/public-api.d.ts +1 -1
- package/list/src/list/list.models.d.ts +19 -0
- package/list/src/list-item/list-item.component.d.ts +15 -2
- package/package.json +1 -7
- package/page-header/README.md +68 -24
- package/page-header/src/page-header/page-header.component.d.ts +5 -3
- package/panel/README.md +5 -1
- package/public-api.d.ts +7 -7
- package/radio-button/README.md +8 -1
- package/radio-button/public-api.d.ts +2 -2
- package/schematics/ng-add/index.js +39 -23
- package/schematics/ng-add/index.js.map +1 -1
- package/select/src/select/select.component.d.ts +3 -3
- package/select-button/README.md +1 -0
- package/selection-chip/README.md +1 -0
- package/stats-card/README.md +35 -29
- package/stats-card/src/stats-card/stats-card.component.d.ts +18 -31
- package/styles/tailwind-tokens.js +103 -1
- package/styles/tokens/radius.scss +0 -2
- package/styles/tokens/spacing.scss +0 -2
- package/styles/tokens/typography.scss +0 -2
- package/styles.scss +2 -0
- package/switch/README.md +7 -1
- package/table/README.md +21 -10
- package/table/public-api.d.ts +4 -4
- package/table/src/table/table.models.d.ts +2 -1
- package/tooltip/README.md +15 -5
- package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +16 -0
- package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +3 -1
- package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +21 -5
- package/avatar-profile/README.md +0 -204
- package/avatar-profile/index.d.ts +0 -5
- package/avatar-profile/package.json +0 -3
- package/avatar-profile/public-api.d.ts +0 -1
- package/avatar-profile/src/avatar-profile/avatar-profile.component.d.ts +0 -21
- package/esm2022/avatar-profile/public-api.mjs +0 -2
- package/esm2022/avatar-profile/seniorsistemas-scala-ng-avatar-profile.mjs +0 -5
- package/esm2022/avatar-profile/src/avatar-profile/avatar-profile.component.mjs +0 -33
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs +0 -40
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs.map +0 -1
package/avatar-profile/README.md
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# SdsAvatarProfileComponent
|
|
2
|
-
|
|
3
|
-
> Scala Design System — `@seniorsistemas/scala-ng/avatar-profile`
|
|
4
|
-
|
|
5
|
-
Avatar clicável da Topbar que abre o menu de conta do usuário logado. Compõe um `SdsAvatarSummaryComponent` dentro de uma área de clique circular de 40×40 e abre um painel com o resumo do usuário (avatar, nome e e-mail) seguido dos itens de menu.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
Use `sds-avatar-profile` como ponto de entrada da área do usuário na Topbar. Ele tem a mesma altura do campo de busca e do Workspace Switch (40px), deixando 12px livres acima e abaixo numa barra de 64px.
|
|
12
|
-
|
|
13
|
-
O painel é o mesmo do `sdsTieredMenu` (`@seniorsistemas/scala-ng/tiered-menu`): os itens usam o modelo `SdsTieredMenuItem` (ícone, separador, destrutivo, desabilitado, submenu) e a ação de cada item é o seu `command`. O componente só acrescenta o trigger circular, o resumo do usuário no topo do painel e o alinhamento pela borda direita.
|
|
14
|
-
|
|
15
|
-
Apenas o layout **Compact** (só o avatar) está implementado. O layout Expanded descrito no Figma (avatar + nome + e-mail + chevron) ainda não tem variante desenhada.
|
|
16
|
-
|
|
17
|
-
## Anatomy
|
|
18
|
-
|
|
19
|
-
| Elemento | Papel |
|
|
20
|
-
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
-
| `<button>` (trigger) | Área de clique circular 40×40 (`radius-full`, 4px de respiro); dona dos estados de hover e foco |
|
|
22
|
-
| `sds-avatar-summary` do trigger | Avatar `medium` (32px) com foto, iniciais ou ícone; decorativo (`aria-hidden`) |
|
|
23
|
-
| Painel (`sds-tiered-menu-panel`) | Superfície flutuante do tiered-menu, aberta 16px abaixo do trigger e alinhada pela borda direita |
|
|
24
|
-
| Resumo do usuário (header) | Avatar `medium` + nome (Label/Medium) + e-mail (Body/Small), em Inter; 280px (min 240 / max 480); 12px de respiro; sem divisória antes dos itens; não focável |
|
|
25
|
-
| Itens (`button[sdsTieredMenuItemRow]`) | Ações do menu de conta (`role="menuitem"`), com ícone opcional à esquerda |
|
|
26
|
-
|
|
27
|
-
## Behavior
|
|
28
|
-
|
|
29
|
-
O trigger segue o conceito dos containers de input seletores: foco e painel aberto são o mesmo estado visual.
|
|
30
|
-
|
|
31
|
-
- **Default**: fundo transparente, só o avatar.
|
|
32
|
-
- **Hover**: fundo `background-interactive-secondary-hovered`.
|
|
33
|
-
- **Focus/Active**: anel `border-focused` de 2px para dentro (`outline-offset: -2px`) mais a sombra de foco, com o fundo de volta ao repouso. Aplicado tanto em foco por teclado (`:focus-visible`) quanto enquanto o painel estiver aberto (`aria-expanded="true"`). Clique de mouse sem painel não mostra o anel.
|
|
34
|
-
- **Abertura**: clique, Enter, Espaço ou ↓ abrem o painel e movem o foco para o primeiro item.
|
|
35
|
-
- **Itens**: acionar um item (clique, Enter ou Espaço) chama o seu `command` e fecha o painel. Item com `items` abre um submenu em vez de chamar o `command`.
|
|
36
|
-
- **Fechamento**: Esc, clique fora ou o acionamento de um item fecham o painel; Esc devolve o foco ao avatar.
|
|
37
|
-
- **Posição**: o painel abre alinhado pela borda direita do trigger, 16px abaixo (logo abaixo da Topbar). Sem espaço embaixo, abre para cima.
|
|
38
|
-
- **Truncamento**: nome e e-mail truncam com reticências em uma linha cada; o valor completo pertence à tela de perfil.
|
|
39
|
-
- **Fallback do avatar**: foto → iniciais (se a imagem falhar) → ícone genérico, com a cor categórica derivada do nome (regras do `SdsAvatarSummaryComponent`).
|
|
40
|
-
- **Nome vazio**: se `name` vier vazio ou só com espaços, o rótulo do botão e o nome no painel passam a ser "Usuário não identificado".
|
|
41
|
-
|
|
42
|
-
## Accessibility
|
|
43
|
-
|
|
44
|
-
O trigger é um `<button type="button">` nativo e o painel herda o comportamento de menu do `@angular/cdk/menu` via `sdsTieredMenu`.
|
|
45
|
-
|
|
46
|
-
- **Nome acessível**: `aria-label` com o nome do usuário (não há texto visível no layout Compact). Nunca fica vazio: sem nome, usa "Usuário não identificado".
|
|
47
|
-
- **Popup**: `aria-haspopup="menu"`, `aria-expanded` e `aria-controls` no trigger, aplicados pelo CDK.
|
|
48
|
-
- **Menu**: `role="menu"` com `aria-label` traduzido ("Menu da conta") e `aria-describedby` apontando para o resumo do usuário, para que o leitor de tela anuncie nome e e-mail ao abrir. Itens com `role="menuitem"` e `aria-disabled` quando desabilitados.
|
|
49
|
-
- **Resumo do usuário**: é conteúdo, não item acionável — fica fora do `role="menu"`, não recebe foco e não entra na navegação por setas.
|
|
50
|
-
- **Avatar**: decorativo (`aria-hidden="true"`, imagem com `alt=""`); o nome já está no rótulo do botão.
|
|
51
|
-
- **Teclado**: Tab foca o avatar; Enter/Espaço/↓ abrem; ↑/↓ navegam entre os itens (pulando separadores); Esc fecha e devolve o foco. Tab/Shift+Tab dentro do menu aberto navegam entre os itens (trap de foco herdado do tiered-menu, divergência documentada do WAI-ARIA).
|
|
52
|
-
- **Foco visível**: anel via `outline`, que continua visível no modo de alto contraste do Windows.
|
|
53
|
-
- **Área de toque**: 40×40px, acima do mínimo de 24×24px (WCAG 2.5.8).
|
|
54
|
-
- **Contraste**: tokens semânticos (`border-focused`, `text-neutral-*`, `background-highlight-*`) em Light e Dark; WCAG 1.4.3 e 1.4.11.
|
|
55
|
-
|
|
56
|
-
## Best Practices
|
|
57
|
-
|
|
58
|
-
**Quando usar**
|
|
59
|
-
|
|
60
|
-
- Como entrada da área de conta do usuário logado na Topbar.
|
|
61
|
-
- Para agrupar ações pessoais: editar perfil, preferências, sair.
|
|
62
|
-
|
|
63
|
-
**Quando não usar**
|
|
64
|
-
|
|
65
|
-
- Para exibir um avatar sem ação — use `SdsAvatarSummaryComponent`.
|
|
66
|
-
- Para menus de ações de uma entidade ou registro — use `sdsTieredMenu` num `sdsButton`.
|
|
67
|
-
- Para trocar de workspace ou organização — use o Workspace Switch.
|
|
68
|
-
|
|
69
|
-
**Antipadrões comuns**
|
|
70
|
-
|
|
71
|
-
- Não estilizar hover ou foco no `sds-avatar-summary` interno; esses estados pertencem ao trigger.
|
|
72
|
-
- Não transformar o resumo do usuário em item clicável. Se o nome precisar levar ao perfil, use um item de menu ("Editar perfil").
|
|
73
|
-
- Não repetir nome ou e-mail como itens do menu; eles já estão no resumo.
|
|
74
|
-
- Não usar mais de um `sds-avatar-profile` na mesma tela.
|
|
75
|
-
|
|
76
|
-
## Content Guidelines
|
|
77
|
-
|
|
78
|
-
- Itens com verbos no infinitivo e curtos: "Editar perfil", "Preferências", "Sair".
|
|
79
|
-
- Coloque "Sair" por último, com `destructive: true`: texto e ícone ficam na cor destrutiva, com o mesmo fundo e hover dos demais itens.
|
|
80
|
-
- Use ícones em todos os itens ou em nenhum, para manter o alinhamento dos rótulos.
|
|
81
|
-
- Passe o nome completo em `name` — as iniciais e a cor do avatar são calculadas a partir dele.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Installation
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm install @seniorsistemas/scala-ng
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Importe o componente diretamente no seu standalone component:
|
|
92
|
-
|
|
93
|
-
```typescript
|
|
94
|
-
import { SdsAvatarProfileComponent } from "@seniorsistemas/scala-ng/avatar-profile";
|
|
95
|
-
|
|
96
|
-
@Component({
|
|
97
|
-
imports: [SdsAvatarProfileComponent],
|
|
98
|
-
})
|
|
99
|
-
export class MyComponent {}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Properties
|
|
103
|
-
|
|
104
|
-
| Propriedade | Tipo | Padrão | Obrigatório | Descrição |
|
|
105
|
-
| ----------- | --------------------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- |
|
|
106
|
-
| `name` | `string` | — | Sim | Nome do usuário logado; define as iniciais e a cor do avatar e o rótulo acessível do botão |
|
|
107
|
-
| `email` | `string` | `''` | Não | E-mail do usuário logado, exibido abaixo do nome no resumo do painel; omitido quando vazio |
|
|
108
|
-
| `imageUrl` | `string` | `undefined` | Não | URL da foto do usuário; cai para as iniciais quando ausente ou quebrada |
|
|
109
|
-
| `items` | `SdsTieredMenuItem[]` | — | Sim | Itens do menu de conta, em ordem (ícone, separador, destrutivo, desabilitado e `command` suportados) |
|
|
110
|
-
|
|
111
|
-
### Outputs
|
|
112
|
-
|
|
113
|
-
| Evento | Payload | Descrição |
|
|
114
|
-
| ---------- | ------- | ------------------------------------ |
|
|
115
|
-
| `(opened)` | `void` | Emitido quando o menu de conta abre |
|
|
116
|
-
| `(closed)` | `void` | Emitido quando o menu de conta fecha |
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Examples
|
|
121
|
-
|
|
122
|
-
### Topbar
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
import { Component, inject } from "@angular/core";
|
|
126
|
-
import { Router } from "@angular/router";
|
|
127
|
-
import { SdsAvatarProfileComponent } from "@seniorsistemas/scala-ng/avatar-profile";
|
|
128
|
-
import type { SdsTieredMenuItem } from "@seniorsistemas/scala-ng/tiered-menu";
|
|
129
|
-
|
|
130
|
-
@Component({
|
|
131
|
-
standalone: true,
|
|
132
|
-
imports: [SdsAvatarProfileComponent],
|
|
133
|
-
template: `
|
|
134
|
-
<header class="flex h-[64px] items-center justify-end px-space-2">
|
|
135
|
-
<sds-avatar-profile
|
|
136
|
-
name="Nome Sobrenome"
|
|
137
|
-
email="nome.sobrenome@empresa.com"
|
|
138
|
-
[items]="items"
|
|
139
|
-
/>
|
|
140
|
-
</header>
|
|
141
|
-
`,
|
|
142
|
-
})
|
|
143
|
-
export class TopbarComponent {
|
|
144
|
-
private readonly router = inject(Router);
|
|
145
|
-
|
|
146
|
-
protected readonly items: SdsTieredMenuItem[] = [
|
|
147
|
-
{
|
|
148
|
-
label: "Editar perfil",
|
|
149
|
-
icon: "fa-solid fa-pen",
|
|
150
|
-
command: () => this.router.navigate(["/perfil"]),
|
|
151
|
-
},
|
|
152
|
-
{ separator: true },
|
|
153
|
-
{
|
|
154
|
-
label: "Sair",
|
|
155
|
-
icon: "fa-solid fa-arrow-right-from-bracket",
|
|
156
|
-
command: () => this.logout(),
|
|
157
|
-
},
|
|
158
|
-
];
|
|
159
|
-
|
|
160
|
-
private logout(): void {
|
|
161
|
-
// ...
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Com foto
|
|
167
|
-
|
|
168
|
-
```html
|
|
169
|
-
<sds-avatar-profile
|
|
170
|
-
name="Ana Beatriz Ferreira"
|
|
171
|
-
email="ana.ferreira@empresa.com"
|
|
172
|
-
imageUrl="https://example.com/ana.png"
|
|
173
|
-
[items]="items"
|
|
174
|
-
/>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Reagindo à abertura e ao fechamento
|
|
178
|
-
|
|
179
|
-
```html
|
|
180
|
-
<sds-avatar-profile
|
|
181
|
-
name="Nome Sobrenome"
|
|
182
|
-
[items]="items"
|
|
183
|
-
(opened)="trackAccountMenuOpened()"
|
|
184
|
-
(closed)="trackAccountMenuClosed()"
|
|
185
|
-
/>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Patch Notes
|
|
191
|
-
|
|
192
|
-
### 1.0.0 — 2026-10-08
|
|
193
|
-
|
|
194
|
-
#### Added
|
|
195
|
-
|
|
196
|
-
- Versão inicial do `SdsAvatarProfileComponent` no layout Compact: trigger circular 40×40 com Avatar Summary `medium`, estados Default, Hover e Focus/Active (foco por teclado ou painel aberto).
|
|
197
|
-
- Painel do `sdsTieredMenu` alinhado pela borda direita, 16px abaixo do trigger, com resumo do usuário (avatar, nome e e-mail truncados) acima dos itens.
|
|
198
|
-
- Inputs `name`, `email`, `imageUrl` e `items`; outputs `opened` e `closed`.
|
|
199
|
-
- Acessibilidade: rótulo do botão com o nome do usuário (fallback "Usuário não identificado"), menu rotulado "Menu da conta" e descrito pelo resumo do usuário.
|
|
200
|
-
|
|
201
|
-
#### Changed
|
|
202
|
-
|
|
203
|
-
- Resumo do usuário em Inter, com 12px de respiro em todos os lados e sem a divisória antes dos itens (QA de design).
|
|
204
|
-
- "Sair" passa a ser destrutivo nos exemplos, como no Figma.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SdsAvatarProfileComponent } from "./src/avatar-profile/avatar-profile.component";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ConnectedPosition } from "@angular/cdk/overlay";
|
|
2
|
-
import { type SdsTieredMenuItem } from "@seniorsistemas/scala-ng/tiered-menu";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SdsAvatarProfileComponent {
|
|
5
|
-
/** Logged-in user's name; drives the avatar initials and color and the trigger's accessible label. */
|
|
6
|
-
readonly name: import("@angular/core").InputSignal<string>;
|
|
7
|
-
/** Logged-in user's e-mail, shown under the name in the panel header. */
|
|
8
|
-
readonly email: import("@angular/core").InputSignal<string>;
|
|
9
|
-
/** Photo URL of the logged-in user; falls back to initials when missing or broken. */
|
|
10
|
-
readonly imageUrl: import("@angular/core").InputSignal<string | undefined>;
|
|
11
|
-
/** Account menu items, in order (icon, separator, destructive, disabled and `command` supported). */
|
|
12
|
-
readonly items: import("@angular/core").InputSignal<SdsTieredMenuItem[]>;
|
|
13
|
-
/** Emitted when the account menu opens. */
|
|
14
|
-
readonly opened: import("@angular/core").OutputEmitterRef<void>;
|
|
15
|
-
/** Emitted when the account menu closes. */
|
|
16
|
-
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
17
|
-
protected readonly panelPositions: ConnectedPosition[];
|
|
18
|
-
protected readonly hasName: import("@angular/core").Signal<boolean>;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SdsAvatarProfileComponent, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsAvatarProfileComponent, "sds-avatar-profile", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "email": { "alias": "email"; "required": false; "isSignal": true; }; "imageUrl": { "alias": "imageUrl"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": true; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
21
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { SdsAvatarProfileComponent } from "./src/avatar-profile/avatar-profile.component";
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3NjYWxhLW5nL2F2YXRhci1wcm9maWxlL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sK0NBQStDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBTZHNBdmF0YXJQcm9maWxlQ29tcG9uZW50IH0gZnJvbSBcIi4vc3JjL2F2YXRhci1wcm9maWxlL2F2YXRhci1wcm9maWxlLmNvbXBvbmVudFwiO1xuIl19
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuaW9yc2lzdGVtYXMtc2NhbGEtbmctYXZhdGFyLXByb2ZpbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9zY2FsYS1uZy9hdmF0YXItcHJvZmlsZS9zZW5pb3JzaXN0ZW1hcy1zY2FsYS1uZy1hdmF0YXItcHJvZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component, computed, input, output } from "@angular/core";
|
|
2
|
-
import { TranslatePipe } from "@ngx-translate/core";
|
|
3
|
-
import { SdsAvatarSummaryComponent } from "@seniorsistemas/scala-ng/avatar-summary";
|
|
4
|
-
import { SdsTieredMenuDirective, } from "@seniorsistemas/scala-ng/tiered-menu";
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
// The panel opens right-aligned, 16px below the 40px trigger: right under the 64px Topbar.
|
|
7
|
-
const PANEL_POSITIONS = [
|
|
8
|
-
{ originX: "end", originY: "bottom", overlayX: "end", overlayY: "top", offsetY: 16 },
|
|
9
|
-
{ originX: "end", originY: "top", overlayX: "end", overlayY: "bottom", offsetY: -16 },
|
|
10
|
-
];
|
|
11
|
-
export class SdsAvatarProfileComponent {
|
|
12
|
-
/** Logged-in user's name; drives the avatar initials and color and the trigger's accessible label. */
|
|
13
|
-
name = input.required();
|
|
14
|
-
/** Logged-in user's e-mail, shown under the name in the panel header. */
|
|
15
|
-
email = input("");
|
|
16
|
-
/** Photo URL of the logged-in user; falls back to initials when missing or broken. */
|
|
17
|
-
imageUrl = input();
|
|
18
|
-
/** Account menu items, in order (icon, separator, destructive, disabled and `command` supported). */
|
|
19
|
-
items = input.required();
|
|
20
|
-
/** Emitted when the account menu opens. */
|
|
21
|
-
opened = output();
|
|
22
|
-
/** Emitted when the account menu closes. */
|
|
23
|
-
closed = output();
|
|
24
|
-
panelPositions = PANEL_POSITIONS;
|
|
25
|
-
hasName = computed(() => !!this.name().trim());
|
|
26
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsAvatarProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsAvatarProfileComponent, isStandalone: true, selector: "sds-avatar-profile", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, email: { classPropertyName: "email", publicName: "email", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, host: { classAttribute: "inline-flex" }, ngImport: i0, template: "@let displayName =\n hasName() ? name() : (\"platform.scala-ng.avatar_summary_unknown_person\" | translate);\n\n<!--\n Focus/Active covers both keyboard focus and the open panel (aria-expanded), like the selector\n inputs; the background returns to rest in that state.\n-->\n<button\n type=\"button\"\n class=\"flex rounded-radius-full p-space-0-50 outline-none hover:bg-color-background-interactive-secondary-hovered focus-visible:bg-transparent focus-visible:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused aria-expanded:bg-transparent aria-expanded:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] aria-expanded:outline aria-expanded:outline-2 aria-expanded:outline-offset-[-2px] aria-expanded:outline-color-border-focused\"\n [attr.aria-label]=\"displayName\"\n [sdsTieredMenu]=\"items()\"\n [sdsTieredMenuHeader]=\"userSummary\"\n [sdsTieredMenuPosition]=\"panelPositions\"\n [ariaLabel]=\"'platform.scala-ng.avatar_profile_menu_label' | translate\"\n (sdsTieredMenuOpened)=\"opened.emit()\"\n (sdsTieredMenuClosed)=\"closed.emit()\"\n>\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n</button>\n\n<ng-template #userSummary>\n <div class=\"flex w-[280px] min-w-[240px] max-w-[480px] items-center gap-space-1 p-space-1-5\">\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-space-0-25\">\n <span\n class=\"truncate text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >{{ displayName }}</span\n >\n @if (email()) {\n <span\n class=\"truncate text-font-size-1 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >{{ email() }}</span\n >\n }\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: SdsAvatarSummaryComponent, selector: "sds-avatar-summary", inputs: ["type", "size", "name", "imageUrl", "icon", "disabled"] }, { kind: "directive", type: SdsTieredMenuDirective, selector: "button[sdsTieredMenu], a[sdsTieredMenu]", inputs: ["sdsTieredMenu", "sdsTieredMenuHeader", "ariaLabel", "secondaryActionLabel", "primaryActionLabel"], outputs: ["secondaryAction", "primaryAction"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
28
|
-
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsAvatarProfileComponent, decorators: [{
|
|
30
|
-
type: Component,
|
|
31
|
-
args: [{ selector: "sds-avatar-profile", standalone: true, imports: [SdsAvatarSummaryComponent, SdsTieredMenuDirective, TranslatePipe], host: { class: "inline-flex" }, template: "@let displayName =\n hasName() ? name() : (\"platform.scala-ng.avatar_summary_unknown_person\" | translate);\n\n<!--\n Focus/Active covers both keyboard focus and the open panel (aria-expanded), like the selector\n inputs; the background returns to rest in that state.\n-->\n<button\n type=\"button\"\n class=\"flex rounded-radius-full p-space-0-50 outline-none hover:bg-color-background-interactive-secondary-hovered focus-visible:bg-transparent focus-visible:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused aria-expanded:bg-transparent aria-expanded:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] aria-expanded:outline aria-expanded:outline-2 aria-expanded:outline-offset-[-2px] aria-expanded:outline-color-border-focused\"\n [attr.aria-label]=\"displayName\"\n [sdsTieredMenu]=\"items()\"\n [sdsTieredMenuHeader]=\"userSummary\"\n [sdsTieredMenuPosition]=\"panelPositions\"\n [ariaLabel]=\"'platform.scala-ng.avatar_profile_menu_label' | translate\"\n (sdsTieredMenuOpened)=\"opened.emit()\"\n (sdsTieredMenuClosed)=\"closed.emit()\"\n>\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n</button>\n\n<ng-template #userSummary>\n <div class=\"flex w-[280px] min-w-[240px] max-w-[480px] items-center gap-space-1 p-space-1-5\">\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-space-0-25\">\n <span\n class=\"truncate text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >{{ displayName }}</span\n >\n @if (email()) {\n <span\n class=\"truncate text-font-size-1 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >{{ email() }}</span\n >\n }\n </div>\n </div>\n</ng-template>\n" }]
|
|
32
|
-
}] });
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLXByb2ZpbGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2NhbGEtbmcvYXZhdGFyLXByb2ZpbGUvc3JjL2F2YXRhci1wcm9maWxlL2F2YXRhci1wcm9maWxlLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3NjYWxhLW5nL2F2YXRhci1wcm9maWxlL3NyYy9hdmF0YXItcHJvZmlsZS9hdmF0YXItcHJvZmlsZS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25FLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNwRCxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUNwRixPQUFPLEVBQ0wsc0JBQXNCLEdBRXZCLE1BQU0sc0NBQXNDLENBQUM7O0FBRTlDLDJGQUEyRjtBQUMzRixNQUFNLGVBQWUsR0FBd0I7SUFDM0MsRUFBRSxPQUFPLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRSxFQUFFLEVBQUU7SUFDcEYsRUFBRSxPQUFPLEVBQUUsS0FBSyxF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kaXY+XG4gIDwvZGl2PlxuPC9uZy10ZW1wbGF0ZT5cbiJdfQ==
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, Component } from '@angular/core';
|
|
3
|
-
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
|
-
import { SdsAvatarSummaryComponent } from '@seniorsistemas/scala-ng/avatar-summary';
|
|
5
|
-
import { SdsTieredMenuDirective } from '@seniorsistemas/scala-ng/tiered-menu';
|
|
6
|
-
|
|
7
|
-
// The panel opens right-aligned, 16px below the 40px trigger: right under the 64px Topbar.
|
|
8
|
-
const PANEL_POSITIONS = [
|
|
9
|
-
{ originX: "end", originY: "bottom", overlayX: "end", overlayY: "top", offsetY: 16 },
|
|
10
|
-
{ originX: "end", originY: "top", overlayX: "end", overlayY: "bottom", offsetY: -16 },
|
|
11
|
-
];
|
|
12
|
-
class SdsAvatarProfileComponent {
|
|
13
|
-
/** Logged-in user's name; drives the avatar initials and color and the trigger's accessible label. */
|
|
14
|
-
name = input.required();
|
|
15
|
-
/** Logged-in user's e-mail, shown under the name in the panel header. */
|
|
16
|
-
email = input("");
|
|
17
|
-
/** Photo URL of the logged-in user; falls back to initials when missing or broken. */
|
|
18
|
-
imageUrl = input();
|
|
19
|
-
/** Account menu items, in order (icon, separator, destructive, disabled and `command` supported). */
|
|
20
|
-
items = input.required();
|
|
21
|
-
/** Emitted when the account menu opens. */
|
|
22
|
-
opened = output();
|
|
23
|
-
/** Emitted when the account menu closes. */
|
|
24
|
-
closed = output();
|
|
25
|
-
panelPositions = PANEL_POSITIONS;
|
|
26
|
-
hasName = computed(() => !!this.name().trim());
|
|
27
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsAvatarProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsAvatarProfileComponent, isStandalone: true, selector: "sds-avatar-profile", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, email: { classPropertyName: "email", publicName: "email", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, host: { classAttribute: "inline-flex" }, ngImport: i0, template: "@let displayName =\n hasName() ? name() : (\"platform.scala-ng.avatar_summary_unknown_person\" | translate);\n\n<!--\n Focus/Active covers both keyboard focus and the open panel (aria-expanded), like the selector\n inputs; the background returns to rest in that state.\n-->\n<button\n type=\"button\"\n class=\"flex rounded-radius-full p-space-0-50 outline-none hover:bg-color-background-interactive-secondary-hovered focus-visible:bg-transparent focus-visible:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused aria-expanded:bg-transparent aria-expanded:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] aria-expanded:outline aria-expanded:outline-2 aria-expanded:outline-offset-[-2px] aria-expanded:outline-color-border-focused\"\n [attr.aria-label]=\"displayName\"\n [sdsTieredMenu]=\"items()\"\n [sdsTieredMenuHeader]=\"userSummary\"\n [sdsTieredMenuPosition]=\"panelPositions\"\n [ariaLabel]=\"'platform.scala-ng.avatar_profile_menu_label' | translate\"\n (sdsTieredMenuOpened)=\"opened.emit()\"\n (sdsTieredMenuClosed)=\"closed.emit()\"\n>\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n</button>\n\n<ng-template #userSummary>\n <div class=\"flex w-[280px] min-w-[240px] max-w-[480px] items-center gap-space-1 p-space-1-5\">\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-space-0-25\">\n <span\n class=\"truncate text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >{{ displayName }}</span\n >\n @if (email()) {\n <span\n class=\"truncate text-font-size-1 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >{{ email() }}</span\n >\n }\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: SdsAvatarSummaryComponent, selector: "sds-avatar-summary", inputs: ["type", "size", "name", "imageUrl", "icon", "disabled"] }, { kind: "directive", type: SdsTieredMenuDirective, selector: "button[sdsTieredMenu], a[sdsTieredMenu]", inputs: ["sdsTieredMenu", "sdsTieredMenuHeader", "ariaLabel", "secondaryActionLabel", "primaryActionLabel"], outputs: ["secondaryAction", "primaryAction"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
29
|
-
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsAvatarProfileComponent, decorators: [{
|
|
31
|
-
type: Component,
|
|
32
|
-
args: [{ selector: "sds-avatar-profile", standalone: true, imports: [SdsAvatarSummaryComponent, SdsTieredMenuDirective, TranslatePipe], host: { class: "inline-flex" }, template: "@let displayName =\n hasName() ? name() : (\"platform.scala-ng.avatar_summary_unknown_person\" | translate);\n\n<!--\n Focus/Active covers both keyboard focus and the open panel (aria-expanded), like the selector\n inputs; the background returns to rest in that state.\n-->\n<button\n type=\"button\"\n class=\"flex rounded-radius-full p-space-0-50 outline-none hover:bg-color-background-interactive-secondary-hovered focus-visible:bg-transparent focus-visible:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused aria-expanded:bg-transparent aria-expanded:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] aria-expanded:outline aria-expanded:outline-2 aria-expanded:outline-offset-[-2px] aria-expanded:outline-color-border-focused\"\n [attr.aria-label]=\"displayName\"\n [sdsTieredMenu]=\"items()\"\n [sdsTieredMenuHeader]=\"userSummary\"\n [sdsTieredMenuPosition]=\"panelPositions\"\n [ariaLabel]=\"'platform.scala-ng.avatar_profile_menu_label' | translate\"\n (sdsTieredMenuOpened)=\"opened.emit()\"\n (sdsTieredMenuClosed)=\"closed.emit()\"\n>\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n</button>\n\n<ng-template #userSummary>\n <div class=\"flex w-[280px] min-w-[240px] max-w-[480px] items-center gap-space-1 p-space-1-5\">\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-space-0-25\">\n <span\n class=\"truncate text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >{{ displayName }}</span\n >\n @if (email()) {\n <span\n class=\"truncate text-font-size-1 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >{{ email() }}</span\n >\n }\n </div>\n </div>\n</ng-template>\n" }]
|
|
33
|
-
}] });
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Generated bundle index. Do not edit.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
export { SdsAvatarProfileComponent };
|
|
40
|
-
//# sourceMappingURL=seniorsistemas-scala-ng-avatar-profile.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng-avatar-profile.mjs","sources":["../../projects/scala-ng/avatar-profile/src/avatar-profile/avatar-profile.component.ts","../../projects/scala-ng/avatar-profile/src/avatar-profile/avatar-profile.component.html","../../projects/scala-ng/avatar-profile/seniorsistemas-scala-ng-avatar-profile.ts"],"sourcesContent":["import type { ConnectedPosition } from \"@angular/cdk/overlay\";\nimport { Component, computed, input, output } from \"@angular/core\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsAvatarSummaryComponent } from \"@seniorsistemas/scala-ng/avatar-summary\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\n\n// The panel opens right-aligned, 16px below the 40px trigger: right under the 64px Topbar.\nconst PANEL_POSITIONS: ConnectedPosition[] = [\n { originX: \"end\", originY: \"bottom\", overlayX: \"end\", overlayY: \"top\", offsetY: 16 },\n { originX: \"end\", originY: \"top\", overlayX: \"end\", overlayY: \"bottom\", offsetY: -16 },\n];\n\n@Component({\n selector: \"sds-avatar-profile\",\n standalone: true,\n imports: [SdsAvatarSummaryComponent, SdsTieredMenuDirective, TranslatePipe],\n templateUrl: \"./avatar-profile.component.html\",\n host: { class: \"inline-flex\" },\n})\nexport class SdsAvatarProfileComponent {\n /** Logged-in user's name; drives the avatar initials and color and the trigger's accessible label. */\n readonly name = input.required<string>();\n\n /** Logged-in user's e-mail, shown under the name in the panel header. */\n readonly email = input<string>(\"\");\n\n /** Photo URL of the logged-in user; falls back to initials when missing or broken. */\n readonly imageUrl = input<string>();\n\n /** Account menu items, in order (icon, separator, destructive, disabled and `command` supported). */\n readonly items = input.required<SdsTieredMenuItem[]>();\n\n /** Emitted when the account menu opens. */\n readonly opened = output<void>();\n\n /** Emitted when the account menu closes. */\n readonly closed = output<void>();\n\n protected readonly panelPositions = PANEL_POSITIONS;\n\n protected readonly hasName = computed(() => !!this.name().trim());\n}\n","@let displayName =\n hasName() ? name() : (\"platform.scala-ng.avatar_summary_unknown_person\" | translate);\n\n<!--\n Focus/Active covers both keyboard focus and the open panel (aria-expanded), like the selector\n inputs; the background returns to rest in that state.\n-->\n<button\n type=\"button\"\n class=\"flex rounded-radius-full p-space-0-50 outline-none hover:bg-color-background-interactive-secondary-hovered focus-visible:bg-transparent focus-visible:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused aria-expanded:bg-transparent aria-expanded:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] aria-expanded:outline aria-expanded:outline-2 aria-expanded:outline-offset-[-2px] aria-expanded:outline-color-border-focused\"\n [attr.aria-label]=\"displayName\"\n [sdsTieredMenu]=\"items()\"\n [sdsTieredMenuHeader]=\"userSummary\"\n [sdsTieredMenuPosition]=\"panelPositions\"\n [ariaLabel]=\"'platform.scala-ng.avatar_profile_menu_label' | translate\"\n (sdsTieredMenuOpened)=\"opened.emit()\"\n (sdsTieredMenuClosed)=\"closed.emit()\"\n>\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n</button>\n\n<ng-template #userSummary>\n <div class=\"flex w-[280px] min-w-[240px] max-w-[480px] items-center gap-space-1 p-space-1-5\">\n <sds-avatar-summary\n size=\"medium\"\n aria-hidden=\"true\"\n [name]=\"name()\"\n [imageUrl]=\"imageUrl()\"\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-space-0-25\">\n <span\n class=\"truncate text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >{{ displayName }}</span\n >\n @if (email()) {\n <span\n class=\"truncate text-font-size-1 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >{{ email() }}</span\n >\n }\n </div>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AASA;AACA,MAAM,eAAe,GAAwB;AAC3C,IAAA,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACpF,EAAE,OAAO,EAAE,KAAK,EAA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EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAClB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,yBAAyB,EAAE,sBAAsB,EAAE,aAAa,CAAC,EAErE,IAAA,EAAA,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,QAAA,EAAA,+kEAAA,EAAA,CAAA;;;AEpBhC;;AAEG;;;;"}
|
package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs","sources":["../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.ts","../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.html"],"sourcesContent":["import { Component, computed, input } from \"@angular/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\nimport { SdsTooltipDirective } from \"@seniorsistemas/scala-ng/tooltip\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport type { ActionButton } from \"../../table/table.models\";\n\nexport const TABLE_ACTIONS_MAX_INLINE = 3;\n\n@Component({\n selector: \"sds-table-actions-cell\",\n standalone: true,\n imports: [SdsButtonComponent, SdsTieredMenuDirective, SdsTooltipDirective, TranslatePipe],\n templateUrl: \"./table-actions-cell.component.html\",\n host: { class: \"flex items-center justify-end gap-space-0-50\" },\n})\nexport class SdsTableActionsCellComponent<T> {\n readonly actions = input.required<ActionButton<T>[]>();\n readonly row = input.required<T>();\n\n // Destructive actions go last, preserving the declared order otherwise.\n protected readonly visibleActions = computed<ActionButton<T>[]>(() => {\n const visible = this.actions().filter((action) => action.visible?.(this.row()) ?? true);\n return [\n ...visible.filter((action) => !action.destructive),\n ...visible.filter((action) => action.destructive),\n ];\n });\n\n protected readonly isInline = computed(\n () => this.visibleActions().length <= TABLE_ACTIONS_MAX_INLINE,\n );\n\n protected readonly menuItems = computed<SdsTieredMenuItem[]>(() =>\n this.visibleActions().map((action) => ({\n label: action.label,\n icon: action.icon,\n disabled: action.disabled?.(this.row()) ?? false,\n command: () => action.onClick(this.row()),\n })),\n );\n\n protected isDisabled(action: ActionButton<T>): boolean {\n return action.disabled?.(this.row()) ?? false;\n }\n}\n","@if (isInline()) {\n @for (action of visibleActions(); track action.label) {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [destructive]=\"!!action.destructive\"\n [disabled]=\"isDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n [sdsTooltip]=\"action.label\"\n (click)=\"action.onClick(row())\"\n >\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n} @else {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [sdsTieredMenu]=\"menuItems()\"\n [attr.aria-label]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n [sdsTooltip]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis-vertical\"\n aria-hidden=\"true\"\n ></i>\n </button>\n}\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,wBAAwB,GAAG,EAAE;MAS7B,4BAA4B,CAAA;AAC9B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAqB,CAAC;AAC9C,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAK,CAAC;;AAGhB,IAAA,cAAc,GAAG,QAAQ,CAAoB,MAAK;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;QACxF,OAAO;AACL,YAAA,GAAG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