@praxisui/dynamic-fields 1.0.0-beta.3 → 1.0.0-beta.30
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 +60 -0
- package/fesm2022/praxisui-dynamic-fields.mjs +458 -10
- package/fesm2022/praxisui-dynamic-fields.mjs.map +1 -1
- package/index.d.ts +69 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @praxisui/dynamic-fields — Dynamic Form Fields
|
|
2
2
|
|
|
3
|
+
## 🔰 Exemplos / Quickstart
|
|
4
|
+
|
|
5
|
+
Para ver esta biblioteca em funcionamento em uma aplicação completa, utilize o projeto de exemplo (Quickstart):
|
|
6
|
+
|
|
7
|
+
- Repositório: https://github.com/codexrodrigues/praxis-ui-quickstart
|
|
8
|
+
- O Quickstart demonstra a integração das bibliotecas `@praxisui/*` em um app Angular, incluindo instalação, configuração e uso em telas reais.
|
|
9
|
+
|
|
3
10
|
### Concept Usage
|
|
4
11
|
|
|
5
12
|
- [Dynamic Component Rendering](../../../../docs/concepts/dynamic-component-rendering.md)
|
|
@@ -14,6 +21,20 @@ Biblioteca de campos dinâmicos para aplicações Angular (v20+) com Material De
|
|
|
14
21
|
npm install @praxisui/dynamic-fields
|
|
15
22
|
```
|
|
16
23
|
|
|
24
|
+
### Estilos e tokens (opcional)
|
|
25
|
+
|
|
26
|
+
- Largura dos campos: quando o host usa `providePraxisDynamicFields()`, a lib injeta um estilo escopado que garante `mat-form-field { width: 100% }` dentro dos componentes. Não é necessário repetir no app.
|
|
27
|
+
- Gradiente de inputs/toolbar (se desejar): o host pode definir um gradiente de marca que alguns detalhes visuais consomem (ex.: inputs com gradiente configurado e toolbars de edição):
|
|
28
|
+
|
|
29
|
+
```scss
|
|
30
|
+
:root {
|
|
31
|
+
--p-primary-gradient: linear-gradient(90deg, #1f8a8a, #6c63ff);
|
|
32
|
+
--p-input-gradient: var(--p-primary-gradient);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Sem essas variáveis, a aparência deriva do tema M3 (tokens `--mat-sys-*` / `--md-sys-*`).
|
|
37
|
+
|
|
17
38
|
Peers (instale no app host):
|
|
18
39
|
- `@angular/core` `^20.1.0`, `@angular/common` `^20.1.0`, `@angular/forms` `^20.1.0`
|
|
19
40
|
- `@angular/material` `^20.1.0`, `@angular/cdk` `^20.1.0`, `@angular/router` `^20.1.0`
|
|
@@ -71,6 +92,7 @@ O sistema usa as constantes do `@praxisui/core` para garantir consistência:
|
|
|
71
92
|
- `FieldControlType.TIME_PICKER` - Seletor de horário
|
|
72
93
|
- `FieldControlType.RATING` - Classificação por estrelas
|
|
73
94
|
- `FieldControlType.COLOR_PICKER` - Seletor de cores
|
|
95
|
+
- `FieldControlType.AVATAR` - Avatar visual (imagem/ícone/iniciais)
|
|
74
96
|
|
|
75
97
|
Campos com `FieldControlType.AUTO_COMPLETE` utilizam internamente o `MaterialSearchableSelectComponent`, habilitando busca automaticamente.
|
|
76
98
|
|
|
@@ -101,6 +123,44 @@ Grupo de botões de rádio que consome metadados ou dados remotos para criar sel
|
|
|
101
123
|
- **Carregamento Dinâmico**: mesmas chaves de configuração de `MaterialSelectComponent` para buscar opções.
|
|
102
124
|
- **Layout Flexível**: configuração de orientação, `labelPosition` e `color` segundo a [documentação oficial](https://material.angular.dev/components/radio/overview).
|
|
103
125
|
|
|
126
|
+
## 🧩 Avatar Field
|
|
127
|
+
|
|
128
|
+
Componente visual para exibir representação de usuário/entidade/estado, com prioridade de conteúdo:
|
|
129
|
+
|
|
130
|
+
- imageSrc > icon > initials > ng-content
|
|
131
|
+
|
|
132
|
+
Propriedades principais: `themeColor`, `rounded`, `size`, `fillMode`, `border`, `tooltip`, `ariaLabel`.
|
|
133
|
+
|
|
134
|
+
Exemplos:
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<pdx-material-avatar [imageSrc]="user.img" size="large" themeColor="tertiary"></pdx-material-avatar>
|
|
138
|
+
<pdx-material-avatar initials="MB" themeColor="secondary"></pdx-material-avatar>
|
|
139
|
+
<pdx-material-avatar icon="person" fillMode="outline"></pdx-material-avatar>
|
|
140
|
+
<pdx-material-avatar><app-status-badge></app-status-badge></pdx-material-avatar>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Uso em formulários dinâmicos (via metadata):
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import { FieldControlType, type FieldMetadata } from '@praxisui/core';
|
|
147
|
+
|
|
148
|
+
const fields: FieldMetadata[] = [
|
|
149
|
+
{
|
|
150
|
+
name: 'avatar',
|
|
151
|
+
label: 'Avatar',
|
|
152
|
+
controlType: FieldControlType.AVATAR,
|
|
153
|
+
// opções específicas via `extra` (quando aplicável)
|
|
154
|
+
extra: { imageSrc: 'https://example.com/u/42.png', size: 'large' }
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Tokens M3 aplicados:
|
|
160
|
+
|
|
161
|
+
- `--pfx-avatar-bg`, `--pfx-avatar-fg`, `--pfx-avatar-border-color`, `--pfx-avatar-border-w`
|
|
162
|
+
- `--pfx-avatar-size`, `--pfx-avatar-radius-[full|lg|md|sm]`
|
|
163
|
+
|
|
104
164
|
## 📦 Instalação
|
|
105
165
|
|
|
106
166
|
```bash
|