@praxisui/dynamic-fields 9.0.0-beta.17 → 9.0.0-beta.19
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/ai/component-registry.json +112 -112
- package/docs/dynamic-fields-field-catalog.md +1 -2
- package/fesm2022/praxisui-dynamic-fields.mjs +426 -63
- package/package.json +3 -3
- package/src/lib/components/material-file-upload/pdx-material-file-upload.json-api.md +58 -27
- package/types/praxisui-dynamic-fields.d.ts +51 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/dynamic-fields",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.19",
|
|
4
4
|
"description": "Angular Material-based dynamic form fields for Praxis UI with lazy loading and metadata-driven rendering.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@angular/platform-browser": "^21.0.0",
|
|
12
12
|
"@angular/router": "^21.0.0",
|
|
13
13
|
"rxjs": "^7.8.0",
|
|
14
|
-
"@praxisui/core": "^9.0.0-beta.
|
|
15
|
-
"@praxisui/cron-builder": "^9.0.0-beta.
|
|
14
|
+
"@praxisui/core": "^9.0.0-beta.19",
|
|
15
|
+
"@praxisui/cron-builder": "^9.0.0-beta.19"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"libphonenumber-js": "^1.12.41",
|
|
@@ -21,8 +21,8 @@ source_of_truth:
|
|
|
21
21
|
- "projects/praxis-dynamic-fields/src/lib/components/material-file-upload/material-file-upload.metadata.ts"
|
|
22
22
|
- "projects/praxis-dynamic-fields/src/lib/components/material-file-upload/material-file-upload.component.ts"
|
|
23
23
|
- "projects/praxis-dynamic-fields/src/lib/base/simple-base-input.component.ts"
|
|
24
|
-
source_of_truth_last_verified: "2026-
|
|
25
|
-
last_updated: "2026-
|
|
24
|
+
source_of_truth_last_verified: "2026-06-24"
|
|
25
|
+
last_updated: "2026-06-24"
|
|
26
26
|
toc: true
|
|
27
27
|
sidebar: true
|
|
28
28
|
tags:
|
|
@@ -149,10 +149,14 @@ Nao ha paths experimentais confirmados no contrato publico desta revisao.
|
|
|
149
149
|
| `metadata.hint` | string | false | n/a | component-defined | Partial; verify per source_of_truth. |
|
|
150
150
|
| `metadata.placeholder` | string | false | n/a | component-defined | Partial; verify per source_of_truth. |
|
|
151
151
|
| `metadata.validators.*` | object | false | n/a | component-defined | Partial; verify per source_of_truth. |
|
|
152
|
-
| `metadata.accept` | string | false | n/a |
|
|
153
|
-
| `metadata.multiple` | boolean | false |
|
|
154
|
-
| `metadata.maxFileSize` | number | false | n/a |
|
|
152
|
+
| `metadata.accept` | string | false | n/a | comma-separated extensions or MIME patterns | Active; applied to native input and local file validation. |
|
|
153
|
+
| `metadata.multiple` | boolean | false | `false` | boolean | Active; selected value is `File[]` when true and `File | null` otherwise. |
|
|
154
|
+
| `metadata.maxFileSize` | number | false | n/a | positive byte count | Active; rejects selected files above the configured limit. |
|
|
155
|
+
| `metadata.maxFiles` | number | false | n/a | positive integer | Active; rejects selections above the configured number of files. |
|
|
155
156
|
| `metadata.allowedTypes` | string[] | false | n/a | component-defined | Partial; verify per source_of_truth. |
|
|
157
|
+
| `metadata.imagePreview` | boolean | false | `false` | boolean | Active; renders local image preview for selected image files. |
|
|
158
|
+
| `metadata.preview` | string | false | n/a | `image` | Active; `image` is an alias for local image preview. |
|
|
159
|
+
| `metadata.previewAlt` | string | false | localized fallback | component-defined | Active; accessible alt text for the local preview image. |
|
|
156
160
|
|
|
157
161
|
### Input bindings (inbound data)
|
|
158
162
|
|
|
@@ -268,12 +272,13 @@ Em conflito entre alias legado e path canonico, priorizar path canonico e regist
|
|
|
268
272
|
### Preserved technical reference (normalized from previous revision)
|
|
269
273
|
|
|
270
274
|
### 1. Visao Geral e Quando Usar
|
|
271
|
-
`pdx-material-file-upload` e um upload basico
|
|
275
|
+
`pdx-material-file-upload` e um upload basico de campo com `<input type="file">`, integracao CVA, validacao local de tipo/tamanho e preview local de imagem.
|
|
272
276
|
|
|
273
277
|
Use quando precisar:
|
|
274
278
|
- prototipar upload rapido no form;
|
|
275
|
-
- capturar um
|
|
276
|
-
-
|
|
279
|
+
- capturar um arquivo selecionado ou uma lista curta de arquivos;
|
|
280
|
+
- mostrar preview local para fluxos de foto/avatar antes da persistencia;
|
|
281
|
+
- delegar persistencia, presign, progresso, conflito e storage governado para a camada canonica de upload.
|
|
277
282
|
|
|
278
283
|
### 2. API do Componente (Inputs/Outputs)
|
|
279
284
|
| Propriedade | Tipo | Padrao | Obrigatorio | Comportamento |
|
|
@@ -283,7 +288,7 @@ Use quando precisar:
|
|
|
283
288
|
| `disabledMode` | `boolean` | `false` | Nao | Sobrescreve disabled no host. |
|
|
284
289
|
| `visible` | `boolean` | `true` | Nao | Controla exibicao no host. |
|
|
285
290
|
| `presentationMode` | `boolean` | `false` | Nao | Modo apresentacao sem edicao. |
|
|
286
|
-
| `valueChange` | `File \| null` | - | Output base input | Arquivo selecionado no input. |
|
|
291
|
+
| `valueChange` | `File \| File[] \| null` | - | Output base input | Arquivo selecionado no input; quando `multiple=true`, emite array. |
|
|
287
292
|
|
|
288
293
|
### 3. Matriz de Cobertura JSON (Completa)
|
|
289
294
|
#### 3.1 Campos especificos do componente
|
|
@@ -294,25 +299,29 @@ Use quando precisar:
|
|
|
294
299
|
| `metadata.hint` | `string` | Ativo | Mensagem de apoio quando sem erro. |
|
|
295
300
|
| `metadata.placeholder` | `string` | Parcial | `setFileUploadMetadata` remove placeholder do estado efetivo. |
|
|
296
301
|
| `metadata.validators.*` | `object` | Parcial | Validacoes basicas do `SimpleBaseInput` podem atuar no control, sem parser de arquivo dedicado. |
|
|
297
|
-
| `metadata.accept` | `string` |
|
|
298
|
-
| `metadata.multiple` | `boolean` |
|
|
299
|
-
| `metadata.maxFileSize` | `number` |
|
|
302
|
+
| `metadata.accept` | `string` | Ativo | Aplicado ao atributo `accept` e validado localmente por extensao/MIME antes de atualizar o control. |
|
|
303
|
+
| `metadata.multiple` | `boolean` | Ativo | Permite selecionar varios arquivos e atualiza o valor como `File[]`. |
|
|
304
|
+
| `metadata.maxFileSize` | `number` | Ativo | Rejeita arquivos acima do limite em bytes antes de atualizar o control. |
|
|
305
|
+
| `metadata.maxFiles` | `number` | Ativo | Rejeita selecoes acima da quantidade maxima configurada. |
|
|
300
306
|
| `metadata.allowedTypes` | `string[]` | Declared-only | Nao ha filtro dedicado por tipo no componente atual. |
|
|
307
|
+
| `metadata.imagePreview` | `boolean` | Ativo | Mostra preview local para o primeiro arquivo de imagem selecionado. |
|
|
308
|
+
| `metadata.preview` | `'image'` | Ativo | Alias declarativo para habilitar preview local de imagem. |
|
|
309
|
+
| `metadata.previewAlt` | `string` | Ativo | Texto alternativo do preview local. |
|
|
301
310
|
|
|
302
311
|
#### 3.2 Campos herdados compartilhados (exaustivo)
|
|
303
312
|
Contrato compartilhado de input base:
|
|
304
313
|
- [pdx-base-input-runtime-contract.json-api.md](projects/praxis-dynamic-fields/src/lib/base/pdx-base-input-runtime-contract.json-api.md)
|
|
305
314
|
|
|
306
315
|
Resumo de composicao deste componente:
|
|
307
|
-
- `Ativo`: fluxo basico de selecao de
|
|
316
|
+
- `Ativo`: fluxo basico de selecao, bind no control, preview local de imagem e validacao local de tipo/tamanho/quantidade.
|
|
308
317
|
- `Parcial`: placeholder e validacoes genericas do base.
|
|
309
|
-
- `Declared-only`:
|
|
318
|
+
- `Declared-only`: politica avancada por `allowedTypes`.
|
|
310
319
|
|
|
311
320
|
### 4. Mapeamento de Comportamento
|
|
312
|
-
- Selecao: ao `change`,
|
|
313
|
-
- Valor:
|
|
314
|
-
- Renderizacao: label
|
|
315
|
-
-
|
|
321
|
+
- Selecao: ao `change`, valida arquivos e grava `File` ou `File[]` no control.
|
|
322
|
+
- Valor: `File | null` quando `multiple` esta ausente/falso; `File[]` quando `multiple=true`.
|
|
323
|
+
- Renderizacao: label, input file, resumo da selecao, preview local de imagem, erro/hint e acao de limpar.
|
|
324
|
+
- Persistencia corporativa: fora deste componente. Use `@praxisui/files-upload` para presign, progresso, conflito, retry e storage governado.
|
|
316
325
|
|
|
317
326
|
### 5. Exemplo Minimo (JSON + Uso)
|
|
318
327
|
```json
|
|
@@ -345,12 +354,30 @@ Uso: captura um arquivo unico para envio posterior.
|
|
|
345
354
|
```
|
|
346
355
|
Uso: etapa inicial de upload, deixando validacoes profundas para API backend.
|
|
347
356
|
|
|
357
|
+
### 6.1 Exemplo para troca de avatar (JSON + Uso)
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"componentId": "pdx-material-file-upload",
|
|
361
|
+
"metadata": {
|
|
362
|
+
"name": "profileImageFile",
|
|
363
|
+
"label": "Foto de perfil",
|
|
364
|
+
"controlType": "upload",
|
|
365
|
+
"accept": "image/*",
|
|
366
|
+
"maxFileSize": 4194304,
|
|
367
|
+
"maxFiles": 1,
|
|
368
|
+
"imagePreview": true,
|
|
369
|
+
"hint": "Escolha uma imagem para revisar antes de salvar a foto do perfil."
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
Uso: combine este campo com `pdx-material-avatar` para preview/display e com a capability canonica de persistencia de arquivo para publicar a URL final consumida pelo avatar.
|
|
374
|
+
|
|
348
375
|
### 7. Troubleshooting e Armadilhas Comuns
|
|
349
|
-
1. Esperar
|
|
350
|
-
Correcao: componente
|
|
376
|
+
1. Esperar persistencia automatica.
|
|
377
|
+
Correcao: este componente escolhe e valida localmente; persistencia pertence ao host ou a `@praxisui/files-upload`.
|
|
351
378
|
|
|
352
|
-
2. Esperar
|
|
353
|
-
Correcao: nao
|
|
379
|
+
2. Esperar crop/zoom.
|
|
380
|
+
Correcao: preview local nao e editor de imagem. Crop deve nascer em contrato proprio de avatar/image authoring.
|
|
354
381
|
|
|
355
382
|
3. Placeholder nao aparece.
|
|
356
383
|
Correcao: `setFileUploadMetadata` remove placeholder explicitamente.
|
|
@@ -358,8 +385,8 @@ Correcao: `setFileUploadMetadata` remove placeholder explicitamente.
|
|
|
358
385
|
4. Arquivo nao persiste no payload final.
|
|
359
386
|
Correcao: verificar serializacao de `File` no host e estrategia de envio multipart.
|
|
360
387
|
|
|
361
|
-
5. Necessidade de
|
|
362
|
-
Correcao:
|
|
388
|
+
5. Necessidade de progresso/chunk/presign.
|
|
389
|
+
Correcao: usar `@praxisui/files-upload`, que e a fronteira canonica de upload operacional.
|
|
363
390
|
|
|
364
391
|
### 8. Cross-links
|
|
365
392
|
- `projects/praxis-dynamic-fields/src/lib/base/pdx-base-input-runtime-contract.json-api.md`
|
|
@@ -388,10 +415,14 @@ Correcao: esse renderer e baseline; implementar camada avancada para cenarios en
|
|
|
388
415
|
| `metadata.hint` | string | false | n/a | Partial | See Detailed API reference. |
|
|
389
416
|
| `metadata.placeholder` | string | false | n/a | Partial | See Detailed API reference. |
|
|
390
417
|
| `metadata.validators.*` | object | false | n/a | Partial | See Detailed API reference. |
|
|
391
|
-
| `metadata.accept` | string | false | n/a |
|
|
392
|
-
| `metadata.multiple` | boolean | false |
|
|
393
|
-
| `metadata.maxFileSize` | number | false | n/a |
|
|
418
|
+
| `metadata.accept` | string | false | n/a | Active | Applied to native input and local type validation. |
|
|
419
|
+
| `metadata.multiple` | boolean | false | `false` | Active | Emits `File[]` when true. |
|
|
420
|
+
| `metadata.maxFileSize` | number | false | n/a | Active | Rejects files above the byte limit. |
|
|
421
|
+
| `metadata.maxFiles` | number | false | n/a | Active | Rejects selections above the configured number of files. |
|
|
394
422
|
| `metadata.allowedTypes` | string[] | false | n/a | Partial | See Detailed API reference. |
|
|
423
|
+
| `metadata.imagePreview` | boolean | false | `false` | Active | Enables local image preview. |
|
|
424
|
+
| `metadata.preview` | string | false | n/a | Active | `image` enables local image preview. |
|
|
425
|
+
| `metadata.previewAlt` | string | false | localized fallback | Active | Accessible alt text for preview image. |
|
|
395
426
|
|
|
396
427
|
## Events reference (obrigatorio)
|
|
397
428
|
|
|
@@ -241,6 +241,18 @@ interface PraxisDynamicFieldsI18nOverrides {
|
|
|
241
241
|
validation?: {
|
|
242
242
|
genericFailed?: PraxisDynamicFieldText;
|
|
243
243
|
};
|
|
244
|
+
fileUpload?: {
|
|
245
|
+
emptySummary?: PraxisDynamicFieldText;
|
|
246
|
+
multipleSummary?: PraxisDynamicFieldText;
|
|
247
|
+
clearSelection?: PraxisDynamicFieldText;
|
|
248
|
+
clearSelectionAriaLabel?: PraxisDynamicFieldText;
|
|
249
|
+
selectedSummaryAriaLabel?: PraxisDynamicFieldText;
|
|
250
|
+
previewAlt?: PraxisDynamicFieldText;
|
|
251
|
+
sizeUnitBytes?: PraxisDynamicFieldText;
|
|
252
|
+
sizeUnitKb?: PraxisDynamicFieldText;
|
|
253
|
+
sizeUnitMb?: PraxisDynamicFieldText;
|
|
254
|
+
sizeUnitGb?: PraxisDynamicFieldText;
|
|
255
|
+
};
|
|
244
256
|
select?: {
|
|
245
257
|
loadSchemaError?: PraxisDynamicFieldText;
|
|
246
258
|
loadOptionsError?: PraxisDynamicFieldText;
|
|
@@ -6068,17 +6080,22 @@ declare class MaterialSelectionListComponent extends SimpleBaseSelectComponent i
|
|
|
6068
6080
|
}
|
|
6069
6081
|
|
|
6070
6082
|
/**
|
|
6071
|
-
*
|
|
6083
|
+
* Baseline file upload field.
|
|
6072
6084
|
*
|
|
6073
|
-
*
|
|
6074
|
-
*
|
|
6075
|
-
*
|
|
6085
|
+
* This component owns local file selection, validation and preview. Persisting
|
|
6086
|
+
* the selected file remains a host/backend concern; use @praxisui/files-upload
|
|
6087
|
+
* when the flow needs presign, progress, conflict policy or storage events.
|
|
6076
6088
|
*/
|
|
6077
|
-
declare class MaterialFileUploadComponent extends SimpleBaseInputComponent {
|
|
6089
|
+
declare class MaterialFileUploadComponent extends SimpleBaseInputComponent implements OnDestroy {
|
|
6078
6090
|
readonlyMode: boolean;
|
|
6079
6091
|
disabledMode: boolean;
|
|
6080
6092
|
visible: boolean;
|
|
6081
6093
|
presentationMode: boolean;
|
|
6094
|
+
readonly selectedFiles: _angular_core.WritableSignal<File[]>;
|
|
6095
|
+
readonly previewUrl: _angular_core.WritableSignal<string | null>;
|
|
6096
|
+
private externalValueSyncSubscription;
|
|
6097
|
+
readonly selectedSummaryText: _angular_core.Signal<string>;
|
|
6098
|
+
readonly selectedDetailText: _angular_core.Signal<string>;
|
|
6082
6099
|
/**
|
|
6083
6100
|
* Updates the control value when the user selects a file.
|
|
6084
6101
|
*/
|
|
@@ -6089,12 +6106,41 @@ declare class MaterialFileUploadComponent extends SimpleBaseInputComponent {
|
|
|
6089
6106
|
setFileUploadMetadata(metadata: ComponentMetadata): void;
|
|
6090
6107
|
fileAccept(): string | null;
|
|
6091
6108
|
allowsMultiple(): boolean;
|
|
6109
|
+
imagePreviewEnabled(): boolean;
|
|
6092
6110
|
isInteractionDisabled(): boolean;
|
|
6111
|
+
clearSelectedFiles(options?: {
|
|
6112
|
+
resetInput?: boolean;
|
|
6113
|
+
}): void;
|
|
6114
|
+
clearLabel(): string;
|
|
6115
|
+
clearAriaLabel(): string;
|
|
6116
|
+
selectedSummaryAriaLabel(): string;
|
|
6117
|
+
fileInputDescribedBy(): string | null;
|
|
6118
|
+
hintId(): string;
|
|
6119
|
+
errorId(): string;
|
|
6120
|
+
previewAltText(): string;
|
|
6121
|
+
writeValue(value: unknown): void;
|
|
6122
|
+
ngOnDestroy(): void;
|
|
6093
6123
|
/**
|
|
6094
6124
|
* CSS classes specific to the file upload wrapper.
|
|
6095
6125
|
*/
|
|
6096
6126
|
protected getSpecificCssClasses(): string[];
|
|
6127
|
+
protected onActiveControlChanged(previousControl: FormControl, currentControl: FormControl): void;
|
|
6097
6128
|
private metadataRecord;
|
|
6129
|
+
private updatePreview;
|
|
6130
|
+
private clearPreview;
|
|
6131
|
+
private validateSelectedFiles;
|
|
6132
|
+
private isAcceptedFile;
|
|
6133
|
+
private maxFileSize;
|
|
6134
|
+
private maxFiles;
|
|
6135
|
+
private applyFileError;
|
|
6136
|
+
private clearFileErrors;
|
|
6137
|
+
private syncSelectedFilesFromValue;
|
|
6138
|
+
private extractFilesFromValue;
|
|
6139
|
+
private isFile;
|
|
6140
|
+
private isImageFile;
|
|
6141
|
+
private hasKnownImageExtension;
|
|
6142
|
+
private formatBytes;
|
|
6143
|
+
private dynamicFieldsText;
|
|
6098
6144
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaterialFileUploadComponent, never>;
|
|
6099
6145
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaterialFileUploadComponent, "pdx-material-file-upload", never, { "readonlyMode": { "alias": "readonlyMode"; "required": false; }; "disabledMode": { "alias": "disabledMode"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "presentationMode": { "alias": "presentationMode"; "required": false; }; }, {}, never, never, true, never>;
|
|
6100
6146
|
}
|