@praxisui/dynamic-form 9.0.62 → 9.0.63
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 +44 -1
- package/ai/component-registry.json +108 -83
- package/fesm2022/praxisui-dynamic-form.mjs +59 -10
- package/package.json +8 -8
- package/types/praxisui-dynamic-form.d.ts +35 -4
package/README.md
CHANGED
|
@@ -254,9 +254,15 @@ Recommended defaults:
|
|
|
254
254
|
- create/edit: `layoutPolicy.source = "schema"`, `intent = "command"`, `preset = "groupedCommand"`, `persistence = "transient"` and a request schema;
|
|
255
255
|
- `groupedCommand` expands a single orphan `md`/`lg` field to the full row by default. Set `layoutPolicy.groupedCommand.orphanFieldExpansion = "preserve"` for intentionally compact rows, or `"all"` to expand orphan `xs`/`sm` fields too;
|
|
256
256
|
- `layoutPolicy.groupedCommand.partialRowStrategy = "fill-compatible"` projects every eligible visual row, including rows created by responsive visibility, CSS `order` and wrapping, to the canonical 12-column grid per container breakpoint, while the default `"preserve"` retains intentional whitespace;
|
|
257
|
+
- generated `groupedCommand` sections are untitled by default, avoiding a generic `Informações` heading beneath an already contextual action title. Explicit semantic group titles published by the schema remain authoritative;
|
|
257
258
|
- dense command drawers: `helpPresentation.display = "auto"` with popover preference for select, checkbox, toggle, date and numeric controls;
|
|
258
259
|
- operational input-heavy forms: `fieldIconPolicy = "presentation-only"` unless the icon is part of the actual affordance.
|
|
259
260
|
|
|
261
|
+
On narrow viewports, the standard form action footer stacks validation guidance
|
|
262
|
+
above the command CTA and keeps the action full width. This is presentation
|
|
263
|
+
behavior only; submit labels, visibility and confirmation still come from the
|
|
264
|
+
host or discovered action contract.
|
|
265
|
+
|
|
260
266
|
Schema-driven command forms do not need to declare empty manual sections. Keep host config focused on behavior, messages, actions and field metadata that is genuinely local:
|
|
261
267
|
|
|
262
268
|
```ts
|
|
@@ -287,7 +293,7 @@ Common inputs:
|
|
|
287
293
|
|
|
288
294
|
- `config`, `formId`, `componentInstanceId`
|
|
289
295
|
- `mode`: `create | edit | view`
|
|
290
|
-
- `resourcePath`, `resourceId`, `initialValue`
|
|
296
|
+
- `resourcePath`, `resourceId`, `initialValue`, `emptyState`
|
|
291
297
|
- `schemaUrl`, `readUrl`, `submitUrl`, `submitMethod`, `responseSchemaUrl`
|
|
292
298
|
- `apiEndpointKey`, `apiUrlEntry`
|
|
293
299
|
- `actions`, `layout`, `backConfig`, `hooks`
|
|
@@ -297,6 +303,11 @@ Common inputs:
|
|
|
297
303
|
- `domainRules`
|
|
298
304
|
- `editorialContext`
|
|
299
305
|
|
|
306
|
+
`actions` is also a registered Dynamic Page input. A host or surface
|
|
307
|
+
materializer may use it for presentation affordances such as a contextual
|
|
308
|
+
submit label and button visibility. It must not use that input to replace the
|
|
309
|
+
schema, method, endpoint or authorization decision discovered from the backend.
|
|
310
|
+
|
|
300
311
|
In `edit` and `view`, `resourceId` identifies the remote entity to hydrate. In
|
|
301
312
|
`create`, it is contextual only (for example, the employee targeted by an
|
|
302
313
|
item-scoped command) and never starts an entity read; provide command defaults
|
|
@@ -304,6 +315,38 @@ through `initialValue`. Component metadata publishes `resourceId` as a public
|
|
|
304
315
|
input port so top-level and nested `UiCompositionPlan` links are validated by
|
|
305
316
|
the same registry contract used at runtime.
|
|
306
317
|
|
|
318
|
+
When neither `readUrl` nor `resourcePath` is configured, `initialValue` is the
|
|
319
|
+
authoritative local snapshot: replacing it replaces the whole form value and
|
|
320
|
+
`null` clears stale fields. This is the Dynamic Page composition contract used
|
|
321
|
+
by local master-detail/detail surfaces. With a remote read source, the backend
|
|
322
|
+
entity remains canonical; a later `initialValue` change never resets hydrated
|
|
323
|
+
fields or pending user edits. Change `resourceId` to load another remote entity.
|
|
324
|
+
|
|
325
|
+
For local master-detail views, `emptyState` is the canonical opt-in placeholder
|
|
326
|
+
while neither `resourceId` nor a non-empty `initialValue` identifies a record.
|
|
327
|
+
The Dynamic Form replaces its field surface with the shared
|
|
328
|
+
`praxis-empty-state-card` only in `mode="view"`; create and edit flows are never
|
|
329
|
+
hidden. The host or `UiCompositionPlan` owns the business-specific copy, while
|
|
330
|
+
the component owns the deterministic transition between "select a record" and
|
|
331
|
+
the presentation-only form. Do not duplicate that state with a consumer-local
|
|
332
|
+
card or keep an empty form visible behind it.
|
|
333
|
+
|
|
334
|
+
```html
|
|
335
|
+
<praxis-dynamic-form
|
|
336
|
+
mode="view"
|
|
337
|
+
[initialValue]="selectedRecord"
|
|
338
|
+
[emptyState]="{
|
|
339
|
+
icon: 'touch_app',
|
|
340
|
+
title: 'Selecione um registro',
|
|
341
|
+
description: 'Selecione uma linha na tabela para consultar os detalhes.',
|
|
342
|
+
variant: 'transparent',
|
|
343
|
+
alignment: 'center',
|
|
344
|
+
density: 'compact',
|
|
345
|
+
iconContainer: 'circle'
|
|
346
|
+
}"
|
|
347
|
+
/>
|
|
348
|
+
```
|
|
349
|
+
|
|
307
350
|
Common outputs:
|
|
308
351
|
|
|
309
352
|
- `formSubmit`, `formCancel`, `formReset`
|