@praxisui/dynamic-form 1.0.0-beta.58 → 1.0.0-beta.60
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 +85 -0
- package/fesm2022/praxisui-dynamic-form.mjs +227 -11
- package/fesm2022/praxisui-dynamic-form.mjs.map +1 -1
- package/index.d.ts +38 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -153,6 +153,91 @@ Alternatively, when `editModeEnabled` is true, `praxis-dynamic-form` renders a g
|
|
|
153
153
|
- Utilities: form rule converters, normalize date arrays, **FormRulesService** (aplica regras de propriedades)
|
|
154
154
|
- Metadata helpers: `providePraxisDynamicFormMetadata`
|
|
155
155
|
|
|
156
|
+
## Editorial Hosting (Foundation)
|
|
157
|
+
|
|
158
|
+
O `@praxisui/dynamic-form` agora aceita uma surface fundacional para hospedar blocos editoriais ao redor do formulario, sem misturar esses blocos com `fieldMetadata` nem com `formData`.
|
|
159
|
+
|
|
160
|
+
Inputs relevantes:
|
|
161
|
+
- `config.formBlocksBefore?: WidgetDefinition[]`
|
|
162
|
+
- `config.formBlocksAfter?: WidgetDefinition[]`
|
|
163
|
+
- `config.editorialContext?: Record<string, unknown>`
|
|
164
|
+
- `[editorialContext]?: Record<string, unknown>`
|
|
165
|
+
|
|
166
|
+
Precedencia de contexto editorial:
|
|
167
|
+
1. runtime base do form
|
|
168
|
+
2. `config.editorialContext`
|
|
169
|
+
3. input host `[editorialContext]`
|
|
170
|
+
|
|
171
|
+
As camadas posteriores sobrescrevem as anteriores.
|
|
172
|
+
|
|
173
|
+
Exemplo minimo:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import type { FormConfig } from '@praxisui/core';
|
|
177
|
+
|
|
178
|
+
const formConfig: FormConfig = {
|
|
179
|
+
editorialContext: {
|
|
180
|
+
accountName: 'Helena Costa',
|
|
181
|
+
accountRole: 'Gestora financeira',
|
|
182
|
+
},
|
|
183
|
+
formBlocksBefore: [
|
|
184
|
+
{
|
|
185
|
+
id: 'praxis-wizard-content',
|
|
186
|
+
inputs: {
|
|
187
|
+
blockId: 'editorial:before:hero:1',
|
|
188
|
+
title: 'Praxis Summit 2026',
|
|
189
|
+
subtitle: 'Inscricao institucional',
|
|
190
|
+
text: 'Placeholder fundacional para hero/rich text enquanto os widgets editoriais definitivos ainda nao existem.',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
formBlocksAfter: [
|
|
195
|
+
{
|
|
196
|
+
id: 'praxis-wizard-inline-notice',
|
|
197
|
+
inputs: {
|
|
198
|
+
blockId: 'editorial:after:legal:1',
|
|
199
|
+
tone: 'info',
|
|
200
|
+
text: 'Placeholder fundacional para legal-notice.',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
sections: [
|
|
205
|
+
{
|
|
206
|
+
id: 'registration',
|
|
207
|
+
title: 'Dados da inscricao',
|
|
208
|
+
rows: [
|
|
209
|
+
{
|
|
210
|
+
columns: [
|
|
211
|
+
{ fields: ['fullName'] },
|
|
212
|
+
{ fields: ['workEmail'] },
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
fieldMetadata: [
|
|
219
|
+
{ name: 'fullName', label: 'Nome completo', controlType: 'input', required: true },
|
|
220
|
+
{ name: 'workEmail', label: 'E-mail corporativo', controlType: 'email', required: true },
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Uso no host:
|
|
226
|
+
|
|
227
|
+
```html
|
|
228
|
+
<praxis-dynamic-form
|
|
229
|
+
[config]="formConfig"
|
|
230
|
+
[editorialContext]="{ accountName: 'Helena Costa', accountRole: 'Host override' }"
|
|
231
|
+
(widgetEvent)="onWidgetEvent($event)"
|
|
232
|
+
></praxis-dynamic-form>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Notas:
|
|
236
|
+
- `formBlocksBefore` e `formBlocksAfter` nao entram em `formData`.
|
|
237
|
+
- `widgetEvent` reemite eventos dos widgets hospedados com `placement` (`before` ou `after`).
|
|
238
|
+
- `editorialContext` deve ser tratado como imutavel; mutacoes in-place nao invalidam o cache do host.
|
|
239
|
+
- No ciclo fundacional, exemplos podem usar widgets existentes como placeholders visuais para hero, rich text, legal notice, user context summary e footer links.
|
|
240
|
+
|
|
156
241
|
See public exports: `projects/praxis-dynamic-form/src/public-api.ts`.
|
|
157
242
|
|
|
158
243
|
## Documentacao Tecnica da Lib
|