@praxisui/dynamic-fields 8.0.0-beta.6 → 8.0.0-beta.61
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 +19 -0
- package/docs/dynamic-fields-field-catalog.md +217 -0
- package/docs/dynamic-fields-field-selection-guide.md +204 -0
- package/docs/dynamic-fields-host-custom-field-guide.md +252 -0
- package/docs/dynamic-fields-host-custom-field-troubleshooting.md +160 -0
- package/docs/dynamic-fields-inline-components-guide.md +582 -0
- package/docs/dynamic-fields-inline-filter-catalog.md +502 -0
- package/docs/dynamic-fields-inline-filter-custom-component-guide.md +241 -0
- package/docs/dynamic-fields-inline-filter-inventory.md +247 -0
- package/docs/dynamic-fields-inline-filter-runtime-contract.md +391 -0
- package/docs/dynamic-fields-inline-filter-selection-guide.md +419 -0
- package/docs/dynamic-fields-inline-filter-troubleshooting.md +201 -0
- package/docs/dynamic-fields-inventory.md +206 -0
- package/docs/dynamic-fields-playground-catalog-plan.md +243 -0
- package/docs/generic-crud-service.md +152 -0
- package/fesm2022/praxisui-dynamic-fields-index-CBogy3si.mjs +1 -0
- package/fesm2022/praxisui-dynamic-fields-index-CWPZdn1Y.mjs +6 -0
- package/fesm2022/praxisui-dynamic-fields-index-CrHhyUMO.mjs +1 -0
- package/fesm2022/praxisui-dynamic-fields-index-DhGo5In4.mjs +6 -0
- package/fesm2022/praxisui-dynamic-fields.mjs +19551 -10669
- package/package.json +14 -13
- package/src/lib/base/pdx-base-input-runtime-contract.json-api.md +526 -0
- package/src/lib/base/pdx-base-select-runtime-contract.json-api.md +474 -0
- package/src/lib/components/color-input/pdx-color-input.json-api.md +573 -0
- package/src/lib/components/color-picker/pdx-color-picker.json-api.md +686 -0
- package/src/lib/components/date-input/pdx-date-input.json-api.md +581 -0
- package/src/lib/components/datetime-local-input/pdx-datetime-local-input.json-api.md +560 -0
- package/src/lib/components/email-input/pdx-email-input.json-api.md +546 -0
- package/src/lib/components/field-shell/praxis-field-shell.json-api.md +523 -0
- package/src/lib/components/inline-async-select/pdx-inline-async-select.json-api.md +566 -0
- package/src/lib/components/inline-autocomplete/pdx-inline-autocomplete.json-api.md +554 -0
- package/src/lib/components/inline-color-label/pdx-inline-color-label.json-api.md +615 -0
- package/src/lib/components/inline-currency/pdx-inline-currency.json-api.md +542 -0
- package/src/lib/components/inline-currency-range/pdx-inline-currency-range.json-api.md +630 -0
- package/src/lib/components/inline-date/pdx-inline-date.json-api.md +529 -0
- package/src/lib/components/inline-date-range/pdx-inline-date-range.json-api.md +592 -0
- package/src/lib/components/inline-distance-radius/pdx-inline-distance-radius.json-api.md +649 -0
- package/src/lib/components/inline-entity-lookup/pdx-inline-entity-lookup.json-api.md +656 -0
- package/src/lib/components/inline-input/pdx-inline-input.json-api.md +538 -0
- package/src/lib/components/inline-multi-select/pdx-inline-multi-select.json-api.md +566 -0
- package/src/lib/components/inline-number/pdx-inline-number.json-api.md +533 -0
- package/src/lib/components/inline-pipeline-status/pdx-inline-pipeline-status.json-api.md +619 -0
- package/src/lib/components/inline-range-slider/pdx-inline-range-slider.json-api.md +605 -0
- package/src/lib/components/inline-rating/pdx-inline-rating.json-api.md +594 -0
- package/src/lib/components/inline-relative-period/pdx-inline-relative-period.json-api.md +623 -0
- package/src/lib/components/inline-score-priority/pdx-inline-score-priority.json-api.md +632 -0
- package/src/lib/components/inline-searchable-select/pdx-inline-searchable-select.json-api.md +564 -0
- package/src/lib/components/inline-select/pdx-inline-select.json-api.md +571 -0
- package/src/lib/components/inline-sentiment/pdx-inline-sentiment.json-api.md +661 -0
- package/src/lib/components/inline-time/pdx-inline-time.json-api.md +573 -0
- package/src/lib/components/inline-time-range/pdx-inline-time-range.json-api.md +635 -0
- package/src/lib/components/inline-toggle/pdx-inline-toggle.json-api.md +516 -0
- package/src/lib/components/inline-tree-select/pdx-inline-tree-select.json-api.md +637 -0
- package/src/lib/components/material-async-select/pdx-material-async-select.json-api.md +566 -0
- package/src/lib/components/material-autocomplete/pdx-material-autocomplete.json-api.md +561 -0
- package/src/lib/components/material-avatar/pdx-material-avatar.json-api.md +670 -0
- package/src/lib/components/material-button/pdx-material-button.json-api.md +572 -0
- package/src/lib/components/material-button-toggle/pdx-material-button-toggle.json-api.md +577 -0
- package/src/lib/components/material-checkbox-group/pdx-material-checkbox-group.json-api.md +611 -0
- package/src/lib/components/material-chips/pdx-material-chips.json-api.md +601 -0
- package/src/lib/components/material-colorpicker/pdx-material-colorpicker.json-api.md +545 -0
- package/src/lib/components/material-cpf-cnpj-input/pdx-material-cpf-cnpj-input.json-api.md +531 -0
- package/src/lib/components/material-currency/pdx-material-currency.json-api.md +569 -0
- package/src/lib/components/material-date-range/pdx-material-date-range.json-api.md +636 -0
- package/src/lib/components/material-datepicker/pdx-material-datepicker.json-api.md +551 -0
- package/src/lib/components/material-file-upload/pdx-material-file-upload.json-api.md +511 -0
- package/src/lib/components/material-multi-select/pdx-material-multi-select.json-api.md +596 -0
- package/src/lib/components/material-multi-select-tree/pdx-material-multi-select-tree.json-api.md +623 -0
- package/src/lib/components/material-price-range/pdx-material-price-range.json-api.md +619 -0
- package/src/lib/components/material-radio-group/pdx-material-radio-group.json-api.md +585 -0
- package/src/lib/components/material-range-slider/pdx-material-range-slider.json-api.md +664 -0
- package/src/lib/components/material-rating/pdx-material-rating.json-api.md +551 -0
- package/src/lib/components/material-searchable-select/pdx-material-searchable-select.json-api.md +602 -0
- package/src/lib/components/material-select/pdx-material-select.json-api.md +601 -0
- package/src/lib/components/material-selection-list/pdx-material-selection-list.json-api.md +607 -0
- package/src/lib/components/material-slide-toggle/pdx-material-slide-toggle.json-api.md +522 -0
- package/src/lib/components/material-slider/pdx-material-slider.json-api.md +602 -0
- package/src/lib/components/material-textarea/pdx-material-textarea.json-api.md +598 -0
- package/src/lib/components/material-timepicker/pdx-material-timepicker.json-api.md +554 -0
- package/src/lib/components/material-transfer-list/pdx-material-transfer-list.json-api.md +614 -0
- package/src/lib/components/material-tree-select/pdx-material-tree-select.json-api.md +649 -0
- package/src/lib/components/month-input/pdx-month-input.json-api.md +527 -0
- package/src/lib/components/number-input/pdx-number-input.json-api.md +594 -0
- package/src/lib/components/password-input/pdx-password-input.json-api.md +574 -0
- package/src/lib/components/pdx-material-time-range/pdx-material-time-range.json-api.md +592 -0
- package/src/lib/components/pdx-year-input/pdx-year-input.json-api.md +543 -0
- package/src/lib/components/phone-input/pdx-phone-input.json-api.md +583 -0
- package/src/lib/components/preload-status/pdx-preload-status.json-api.md +455 -0
- package/src/lib/components/search-input/pdx-search-input.json-api.md +536 -0
- package/src/lib/components/text-input/pdx-text-input.json-api.md +600 -0
- package/src/lib/components/time-input/pdx-time-input.json-api.md +546 -0
- package/src/lib/components/url-input/pdx-url-input.json-api.md +542 -0
- package/src/lib/components/week-input/pdx-week-input.json-api.md +533 -0
- package/{index.d.ts → types/praxisui-dynamic-fields.d.ts} +874 -440
- package/fesm2022/praxisui-dynamic-fields-index-C9IUU4lo.mjs +0 -1
- package/fesm2022/praxisui-dynamic-fields-index-GJtthzkD.mjs +0 -1
- package/fesm2022/praxisui-dynamic-fields-index-XvVS6lAQ.mjs +0 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Dynamic Fields Host Custom Field Guide"
|
|
3
|
+
slug: "dynamic-fields-host-custom-field-guide"
|
|
4
|
+
description: "Guia enterprise para criar, registrar e operar fields custom no host usando @praxisui/dynamic-fields."
|
|
5
|
+
doc_type: "guide"
|
|
6
|
+
document_kind: "host-guide"
|
|
7
|
+
component: "dynamic-fields"
|
|
8
|
+
category: "components"
|
|
9
|
+
audience:
|
|
10
|
+
- "host"
|
|
11
|
+
- "frontend"
|
|
12
|
+
- "architect"
|
|
13
|
+
level: "advanced"
|
|
14
|
+
status: "active"
|
|
15
|
+
owner: "praxis-ui"
|
|
16
|
+
tags:
|
|
17
|
+
- "dynamic-fields"
|
|
18
|
+
- "host extension"
|
|
19
|
+
- "custom field"
|
|
20
|
+
- "environment initializer"
|
|
21
|
+
order: 36
|
|
22
|
+
icon: "extension"
|
|
23
|
+
toc: true
|
|
24
|
+
sidebar: true
|
|
25
|
+
search_boost: 1.1
|
|
26
|
+
reading_time: 20
|
|
27
|
+
estimated_setup_time: 35
|
|
28
|
+
version: "1.0"
|
|
29
|
+
related_docs:
|
|
30
|
+
- "dynamic-fields-field-catalog"
|
|
31
|
+
- "dynamic-fields-field-selection-guide"
|
|
32
|
+
- "dynamic-fields-host-custom-field-troubleshooting"
|
|
33
|
+
- "dynamic-fields-inventory"
|
|
34
|
+
- "dynamic-form-overview"
|
|
35
|
+
keywords:
|
|
36
|
+
- "ComponentRegistryService.register"
|
|
37
|
+
- "ComponentMetadataRegistry.register"
|
|
38
|
+
- "ENVIRONMENT_INITIALIZER"
|
|
39
|
+
- "custom controlType"
|
|
40
|
+
last_updated: "2026-03-07"
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
# Dynamic Fields Host Custom Field Guide
|
|
44
|
+
|
|
45
|
+
## Objetivo
|
|
46
|
+
|
|
47
|
+
Permitir que times host criem novos fields sem forkar `@praxisui/dynamic-fields` ou `@praxisui/dynamic-form`.
|
|
48
|
+
|
|
49
|
+
## Pre-requisitos
|
|
50
|
+
|
|
51
|
+
- Host Angular com `ApplicationConfig` ou bootstrap equivalente.
|
|
52
|
+
- `@praxisui/dynamic-fields` instalado com providers ativos.
|
|
53
|
+
- Familiaridade basica com `FieldMetadata`, `controlType` e Angular Forms.
|
|
54
|
+
|
|
55
|
+
## Contract for a good custom field
|
|
56
|
+
|
|
57
|
+
Um field custom enterprise precisa atender quatro camadas:
|
|
58
|
+
|
|
59
|
+
1. `runtime render`: o registry precisa saber qual componente carregar para o `controlType`.
|
|
60
|
+
2. `forms integration`: o componente precisa funcionar com `ControlValueAccessor` e/ou `[formControl]`.
|
|
61
|
+
3. `metadata editor`: o editor precisa saber nome amigavel, icone e metadados do componente.
|
|
62
|
+
4. `hot metadata`: o componente precisa responder a patches sem rebuild global sempre que possivel.
|
|
63
|
+
|
|
64
|
+
## Runtime registry vs metadata registry
|
|
65
|
+
|
|
66
|
+
### Runtime registry
|
|
67
|
+
|
|
68
|
+
Responsavel por renderizar o componente no loader:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
ComponentRegistryService.register('my-custom', () =>
|
|
72
|
+
import('./my-custom-field.component').then((m) => m.MyCustomFieldComponent),
|
|
73
|
+
);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Metadata registry
|
|
77
|
+
|
|
78
|
+
Responsavel por:
|
|
79
|
+
|
|
80
|
+
- nome amigavel no editor;
|
|
81
|
+
- icone;
|
|
82
|
+
- superficie editorial associada ao `controlType`.
|
|
83
|
+
|
|
84
|
+
O `ComponentDocMeta.id` precisa bater com o `controlType` de runtime.
|
|
85
|
+
|
|
86
|
+
## Canonical package-owned fields vs host custom fields
|
|
87
|
+
|
|
88
|
+
Regra de fronteira:
|
|
89
|
+
|
|
90
|
+
- fields mantidos por `@praxisui/dynamic-fields` devem entrar pela trilha canonica da lib: descriptor editorial + metadata derivado + catalogo derivado;
|
|
91
|
+
- fields custom do host continuam suportados via `ComponentMetadataRegistry.register(ComponentDocMeta)`;
|
|
92
|
+
- o host nao precisa copiar a trilha inteira da lib para continuar funcionando no `dynamic-form`;
|
|
93
|
+
- se o host quiser semantica editorial propria, ela deve nascer no seu proprio registry/contrato, nao por override local de catalogo ou patch no `dynamic-form`.
|
|
94
|
+
|
|
95
|
+
Na pratica, o `dynamic-form` tenta primeiro a resolucao canonica editorial e, se ela nao existir para um `controlType` do host, usa o `ComponentDocMeta` registrado pelo proprio host como fallback tecnico controlado.
|
|
96
|
+
|
|
97
|
+
## Minimal component requirements
|
|
98
|
+
|
|
99
|
+
### Forms compatibility
|
|
100
|
+
|
|
101
|
+
O componente host deve:
|
|
102
|
+
|
|
103
|
+
- implementar `ControlValueAccessor`, ou
|
|
104
|
+
- aceitar `[formControl]`/`formControlName` de forma correta.
|
|
105
|
+
|
|
106
|
+
Sem isso, o field pode ate renderizar, mas quebra integracao com o formulario dinamico.
|
|
107
|
+
|
|
108
|
+
### Hot metadata compatibility
|
|
109
|
+
|
|
110
|
+
Com base no runtime documentado em `hot-metadata-updates.md`, prefira:
|
|
111
|
+
|
|
112
|
+
- `setInputMetadata(metadata)` no componente, ou
|
|
113
|
+
- um `WritableSignal` para metadata.
|
|
114
|
+
|
|
115
|
+
Isso permite que o dynamic form reaplique metadata viva sem rebuild estrutural sempre que a mudanca nao for estrutural.
|
|
116
|
+
Use como referencia operacional governada o arquivo `projects/praxis-dynamic-form/docs/hot-metadata-updates.md`.
|
|
117
|
+
|
|
118
|
+
## Example: ApplicationConfig with ENVIRONMENT_INITIALIZER
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
import { ApplicationConfig, ENVIRONMENT_INITIALIZER, inject } from '@angular/core';
|
|
122
|
+
import { providePraxisDynamicFields } from '@praxisui/dynamic-fields';
|
|
123
|
+
import { ComponentRegistryService } from '@praxisui/dynamic-fields';
|
|
124
|
+
import { ComponentMetadataRegistry, type ComponentDocMeta } from '@praxisui/core';
|
|
125
|
+
|
|
126
|
+
const myCustomMeta: ComponentDocMeta = {
|
|
127
|
+
id: 'my-custom',
|
|
128
|
+
title: 'My Custom Field',
|
|
129
|
+
icon: 'extension',
|
|
130
|
+
category: 'host-fields',
|
|
131
|
+
description: 'Field custom do host para selecionar SLA operacional.',
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const appConfig: ApplicationConfig = {
|
|
135
|
+
providers: [
|
|
136
|
+
...providePraxisDynamicFields(),
|
|
137
|
+
{
|
|
138
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
139
|
+
multi: true,
|
|
140
|
+
useValue: () => {
|
|
141
|
+
const registry = inject(ComponentRegistryService);
|
|
142
|
+
registry.register('my-custom', () =>
|
|
143
|
+
import('./fields/my-custom-field.component').then((m) => m.MyCustomFieldComponent),
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
149
|
+
multi: true,
|
|
150
|
+
useValue: () => {
|
|
151
|
+
const metadataRegistry = inject(ComponentMetadataRegistry);
|
|
152
|
+
metadataRegistry.register(myCustomMeta);
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Example: component skeleton
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { Component, input, signal } from '@angular/core';
|
|
163
|
+
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
164
|
+
import type { FieldMetadata } from '@praxisui/core';
|
|
165
|
+
|
|
166
|
+
@Component({
|
|
167
|
+
selector: 'app-my-custom-field',
|
|
168
|
+
standalone: true,
|
|
169
|
+
imports: [ReactiveFormsModule],
|
|
170
|
+
providers: [
|
|
171
|
+
{
|
|
172
|
+
provide: NG_VALUE_ACCESSOR,
|
|
173
|
+
multi: true,
|
|
174
|
+
useExisting: MyCustomFieldComponent,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
template: `
|
|
178
|
+
<input [formControl]="control" />
|
|
179
|
+
`,
|
|
180
|
+
})
|
|
181
|
+
export class MyCustomFieldComponent implements ControlValueAccessor {
|
|
182
|
+
readonly control = new FormControl('');
|
|
183
|
+
readonly metadata = signal<FieldMetadata | null>(null);
|
|
184
|
+
|
|
185
|
+
setInputMetadata(metadata: FieldMetadata): void {
|
|
186
|
+
this.metadata.set(metadata);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
writeValue(value: unknown): void {
|
|
190
|
+
this.control.setValue(value, { emitEvent: false });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
registerOnChange(fn: (value: unknown) => void): void {
|
|
194
|
+
this.control.valueChanges.subscribe(fn);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
registerOnTouched(fn: () => void): void {
|
|
198
|
+
// ligue ao blur/touch do host
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
setDisabledState(disabled: boolean): void {
|
|
202
|
+
disabled ? this.control.disable({ emitEvent: false }) : this.control.enable({ emitEvent: false });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Using the custom field in form contract
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
const fieldMetadata = [
|
|
211
|
+
{
|
|
212
|
+
name: 'sla',
|
|
213
|
+
label: 'SLA operacional',
|
|
214
|
+
controlType: 'my-custom',
|
|
215
|
+
},
|
|
216
|
+
];
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Provider defaults vs no-defaults
|
|
220
|
+
|
|
221
|
+
### `providePraxisDynamicFields()`
|
|
222
|
+
|
|
223
|
+
- registra providers core;
|
|
224
|
+
- inclui defaults do selector registry;
|
|
225
|
+
- e a escolha comum para host app padrao.
|
|
226
|
+
|
|
227
|
+
### `providePraxisDynamicFieldsNoDefaults()`
|
|
228
|
+
|
|
229
|
+
- desabilita o mapa default de selector -> controlType;
|
|
230
|
+
- use apenas quando o host quer governar totalmente o mapa base.
|
|
231
|
+
|
|
232
|
+
## Selector registry / aliases
|
|
233
|
+
|
|
234
|
+
Nao confunda:
|
|
235
|
+
|
|
236
|
+
- `ComponentRegistryService.register(...)`: carrega o componente Angular real.
|
|
237
|
+
- `ComponentMetadataRegistry.register(...)`: registra nome/icone/superficie editorial.
|
|
238
|
+
- `FieldSelectorRegistry` / aliases: resolve seletor/roteamento complementar em modo config-first.
|
|
239
|
+
|
|
240
|
+
Em cenarios enterprise:
|
|
241
|
+
|
|
242
|
+
- prefira `controlType` estavel e unico;
|
|
243
|
+
- use aliases apenas quando um programa de migracao exigir compatibilidade.
|
|
244
|
+
|
|
245
|
+
## Checklist for host teams
|
|
246
|
+
|
|
247
|
+
- `runtime registra`: `ComponentRegistryService.register(...)`.
|
|
248
|
+
- `metadata registra`: `ComponentMetadataRegistry.register(...)`.
|
|
249
|
+
- `controlType alinhado`: o mesmo id em runtime e metadata.
|
|
250
|
+
- `forms compatível`: CVA ou `[formControl]`.
|
|
251
|
+
- `hot update compatível`: `setInputMetadata` e/ou signal metadata.
|
|
252
|
+
- `tema/tokens`: sem quebrar contraste, estados e largura no host.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Dynamic Fields Host Custom Field Troubleshooting"
|
|
3
|
+
slug: "dynamic-fields-host-custom-field-troubleshooting"
|
|
4
|
+
description: "Troubleshooting guide para criacao e registro de fields custom no host com @praxisui/dynamic-fields."
|
|
5
|
+
doc_type: "guide"
|
|
6
|
+
document_kind: "runbook"
|
|
7
|
+
component: "dynamic-fields"
|
|
8
|
+
category: "components"
|
|
9
|
+
audience:
|
|
10
|
+
- "host"
|
|
11
|
+
- "frontend"
|
|
12
|
+
- "ops"
|
|
13
|
+
level: "advanced"
|
|
14
|
+
status: "active"
|
|
15
|
+
owner: "praxis-ui"
|
|
16
|
+
tags:
|
|
17
|
+
- "dynamic-fields"
|
|
18
|
+
- "troubleshooting"
|
|
19
|
+
- "custom field"
|
|
20
|
+
- "host"
|
|
21
|
+
order: 37
|
|
22
|
+
icon: "build"
|
|
23
|
+
toc: true
|
|
24
|
+
sidebar: true
|
|
25
|
+
search_boost: 1.05
|
|
26
|
+
reading_time: 12
|
|
27
|
+
estimated_setup_time: 20
|
|
28
|
+
version: "1.0"
|
|
29
|
+
related_docs:
|
|
30
|
+
- "dynamic-fields-host-custom-field-guide"
|
|
31
|
+
- "dynamic-fields-field-selection-guide"
|
|
32
|
+
- "dynamic-fields-inventory"
|
|
33
|
+
keywords:
|
|
34
|
+
- "field not render"
|
|
35
|
+
- "controlType not registered"
|
|
36
|
+
- "hot update"
|
|
37
|
+
- "CVA error"
|
|
38
|
+
last_updated: "2026-03-07"
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# Dynamic Fields Host Custom Field Troubleshooting
|
|
42
|
+
|
|
43
|
+
## Objetivo
|
|
44
|
+
|
|
45
|
+
Fornecer resposta operacional rapida para falhas comuns na extensao de fields custom no host.
|
|
46
|
+
|
|
47
|
+
## Resposta operacional
|
|
48
|
+
|
|
49
|
+
1. confirme o `controlType` do contrato;
|
|
50
|
+
2. confirme runtime registry e metadata registry;
|
|
51
|
+
3. confirme compatibilidade com Angular Forms;
|
|
52
|
+
4. confirme se a falha e estrutural ou apenas de metadata/hot update;
|
|
53
|
+
5. confirme escopo correto de providers.
|
|
54
|
+
|
|
55
|
+
## 1. Field nao renderiza
|
|
56
|
+
|
|
57
|
+
### Check
|
|
58
|
+
|
|
59
|
+
- o `controlType` do contrato bate com o id registrado?
|
|
60
|
+
- o `ENVIRONMENT_INITIALIZER` roda no root app?
|
|
61
|
+
- o import dinamico retorna o componente certo?
|
|
62
|
+
|
|
63
|
+
### Typical root cause
|
|
64
|
+
|
|
65
|
+
`ComponentRegistryService.register(...)` nao foi executado ou foi executado em escopo errado.
|
|
66
|
+
|
|
67
|
+
## 2. controlType nao registrado
|
|
68
|
+
|
|
69
|
+
### Symptom
|
|
70
|
+
|
|
71
|
+
O runtime loga que o componente nao esta registrado.
|
|
72
|
+
|
|
73
|
+
### Fix
|
|
74
|
+
|
|
75
|
+
- registre o `controlType` exato;
|
|
76
|
+
- evite drift entre `my-custom`, `myCustom` e `my-custom-field`;
|
|
77
|
+
- mantenha um id canônico e unificado.
|
|
78
|
+
|
|
79
|
+
## 3. Editor nao mostra nome ou icone
|
|
80
|
+
|
|
81
|
+
### Root cause
|
|
82
|
+
|
|
83
|
+
O componente foi registrado no runtime, mas nao no `ComponentMetadataRegistry`.
|
|
84
|
+
|
|
85
|
+
### Fix
|
|
86
|
+
|
|
87
|
+
Registre um `ComponentDocMeta` com `id` identico ao `controlType`.
|
|
88
|
+
|
|
89
|
+
## 4. Hot update nao aplica
|
|
90
|
+
|
|
91
|
+
### Check
|
|
92
|
+
|
|
93
|
+
- o componente expoe `setInputMetadata(metadata)`?
|
|
94
|
+
- ou mantem metadata em signal reativa?
|
|
95
|
+
- a mudanca foi estrutural (`controlType`, add/remove field) ou apenas comportamental?
|
|
96
|
+
|
|
97
|
+
### Important
|
|
98
|
+
|
|
99
|
+
Mudancas estruturais ainda podem exigir refresh do loader. Hot update otimiza principalmente mudancas comportamentais/validacao.
|
|
100
|
+
|
|
101
|
+
## 5. Erro de forms / CVA
|
|
102
|
+
|
|
103
|
+
### Symptom
|
|
104
|
+
|
|
105
|
+
- valor nao propaga;
|
|
106
|
+
- touched nao propaga;
|
|
107
|
+
- disabled nao sincroniza;
|
|
108
|
+
- Angular reclama de value accessor.
|
|
109
|
+
|
|
110
|
+
### Fix
|
|
111
|
+
|
|
112
|
+
- implemente `ControlValueAccessor`, ou
|
|
113
|
+
- aceite `[formControl]` corretamente;
|
|
114
|
+
- propague `writeValue`, `registerOnChange`, `registerOnTouched`, `setDisabledState`.
|
|
115
|
+
|
|
116
|
+
## 6. Alias / selectors em conflito
|
|
117
|
+
|
|
118
|
+
### Symptom
|
|
119
|
+
|
|
120
|
+
Um alias antigo aponta para componente inesperado.
|
|
121
|
+
|
|
122
|
+
### Fix
|
|
123
|
+
|
|
124
|
+
- revise `FieldSelectorRegistry` e base/overrides;
|
|
125
|
+
- use `providePraxisDynamicFieldsNoDefaults()` apenas quando realmente quiser substituir a base;
|
|
126
|
+
- evite colisao de alias entre bibliotecas internas do host.
|
|
127
|
+
|
|
128
|
+
## 7. Provider em escopo errado
|
|
129
|
+
|
|
130
|
+
### Root cause
|
|
131
|
+
|
|
132
|
+
`FIELD_SELECTOR_REGISTRY_DISABLE_DEFAULTS` ou inicializadores foram fornecidos em modulo lazy, mas o singleton efetivo nasceu no root.
|
|
133
|
+
|
|
134
|
+
### Fix
|
|
135
|
+
|
|
136
|
+
Registre providers de governanca no root injector.
|
|
137
|
+
|
|
138
|
+
## 8. Tokens / tema quebram UX
|
|
139
|
+
|
|
140
|
+
### Symptom
|
|
141
|
+
|
|
142
|
+
- contraste ruim;
|
|
143
|
+
- largura inconsistente;
|
|
144
|
+
- estados de foco ilegiveis.
|
|
145
|
+
|
|
146
|
+
### Fix
|
|
147
|
+
|
|
148
|
+
- valide tokens M3 do host;
|
|
149
|
+
- garanta que tema e componentes compartilham o mesmo escopo;
|
|
150
|
+
- nao dependa de estilos locais fora dos contratos do design system.
|
|
151
|
+
|
|
152
|
+
## Final checklist
|
|
153
|
+
|
|
154
|
+
- `controlType` correto e unico.
|
|
155
|
+
- runtime registry ativo.
|
|
156
|
+
- metadata registry ativo.
|
|
157
|
+
- forms integration valida.
|
|
158
|
+
- hot update tratado.
|
|
159
|
+
- providers no root.
|
|
160
|
+
- tokens e tema validados.
|