@praxisui/crud 10.0.0-rc.56 → 10.0.0-rc.58
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 +33 -3
- package/ai/component-registry.json +450 -101
- package/fesm2022/{praxisui-crud-crud-route-form.component-BDtPEq6c.mjs → praxisui-crud-crud-route-form.component-CgyIg2u1.mjs} +1 -1
- package/fesm2022/{praxisui-crud-praxisui-crud-CPteTjgI.mjs → praxisui-crud-praxisui-crud-BvwkbuR5.mjs} +6782 -406
- package/fesm2022/praxisui-crud.mjs +1 -1
- package/package.json +7 -7
- package/types/praxisui-crud-drawer-adapter.d.ts +14 -1
- package/types/praxisui-crud.d.ts +571 -7
package/README.md
CHANGED
|
@@ -156,6 +156,7 @@ It emits:
|
|
|
156
156
|
- `configureRequested`
|
|
157
157
|
- `afterOpen`, `afterClose`, `afterSave`, `afterDelete`
|
|
158
158
|
- `reactiveDeterminationExecuted` (metadata-only evidence with action context), `reactiveDeterminationPendingChange`, and `reactiveDeterminationStabilityChange`. The aggregate stability output preserves `action` and distinguishes `pending`, `settled-satisfied`, and `settled-unsatisfied`; “settled” alone is never a success signal.
|
|
159
|
+
- `formStepTelemetry` (`CrudFormStepTelemetryEvent`: `{ action, openMode, event: FormStepTelemetryEvent }`), forwarding metadata-only step transitions (`next`, `previous`, `header`, `review-edit`, `validation-recovery`, `http-422-recovery`, `draft-restored`) from the hosted Dynamic Form across `modal`, `drawer`, nested `surfaceRuntime` frame, and seeded `route` handoffs without exposing field values.
|
|
159
160
|
- `error`
|
|
160
161
|
- `resourceEvent` is the canonical output for governed host composition and preserves `kind`, `resourcePath`, `resourceId`, `payload` and runtime context from the internal table. The legacy `rowClick`, `rowAction` and `selectionChange` outputs remain available; `rowAction` preserves the table envelope (`row`, `action`, `resourceIdentity`) without forcing visual row selection.
|
|
161
162
|
- `tableRuntimeConfigChange`
|
|
@@ -172,7 +173,7 @@ ignored. Use only `metadata.data` for a local-data preview.
|
|
|
172
173
|
|
|
173
174
|
The component keeps `crudContext` stable for change detection and refreshes the table after successful save/delete flows.
|
|
174
175
|
|
|
175
|
-
Built-in modal, drawer and nested surface-frame form hosts do not close or complete save while a child Reactive Determination is pending or when its latest generation settled unsatisfied; cancel waits for bounded successful stabilization and stays open on timeout/failure. A custom `CrudDrawerAdapter` must bind `onReactiveDetermination`, `onReactiveDeterminationPendingChange`, and `
|
|
176
|
+
Built-in modal, drawer and nested surface-frame form hosts do not close or complete save while a child Reactive Determination is pending or when its latest generation settled unsatisfied; cancel waits for bounded successful stabilization and stays open on timeout/failure. When `config.behavior.draftPersistence === true` in `mode='create'`, dirty cancel/close confirmation (`canLeaveForm()` / `onCancel()`) informs the operator that the session draft remains saved locally (`crud.dialog.leaveWithDraft*`, `"Sair e manter rascunho"`) and flushes any debounced keystrokes via `flushSessionDraft()` before closing so the draft can be resumed on the next `create` open. A custom `CrudDrawerAdapter` must bind `onReactiveDetermination`, `onReactiveDeterminationPendingChange`, `onReactiveDeterminationStabilityChange`, and `onStepTelemetry`, use the child Dynamic Form stability API, and refuse every adapter-owned close/submit while pending or unsatisfied. These callbacks are runtime-only and must never be persisted in CRUD metadata.
|
|
176
177
|
|
|
177
178
|
## Metadata Boundaries
|
|
178
179
|
|
|
@@ -292,6 +293,14 @@ drawer adapters receive the same `resourceIdentity` context and the
|
|
|
292
293
|
`showResourceIdentityKey` presentation preference. They must keep the identity
|
|
293
294
|
outside form inputs and retain responsibility for presenting its readable title.
|
|
294
295
|
|
|
296
|
+
For read-only overlays (`DynamicFormDialogHostComponent`), `action: 'view'` defaults
|
|
297
|
+
to `presentationModeGlobal = true` (Presentation/Dossier mode) for backward compatibility,
|
|
298
|
+
while setting `action.form.presentationModeGlobal = false` keeps blocked input fields.
|
|
299
|
+
Actions using `'presentation'` or `'dossier'` also retain read-only behavior (suppressing
|
|
300
|
+
submit actions and preserving `resourceIdentity`), and `action.form.presentationPreset` /
|
|
301
|
+
`action.form.presentation` forward preset and 3-tier density (`'comfortable' | 'cozy' | 'compact'`)
|
|
302
|
+
without leaking into `initialValue`.
|
|
303
|
+
|
|
295
304
|
Related operations also receive `contextIdentity` when the governed surface
|
|
296
305
|
publishes `context.operation.taskScope`. The default host labels it as “Related
|
|
297
306
|
to” and keeps it distinct from the current child record. Both identities stay
|
|
@@ -457,12 +466,33 @@ The package publishes the CRUD-specific authoring surface:
|
|
|
457
466
|
- **Filter Bar (`filterBar`)**: toggle advanced filter visibility (`showAdvanced`), select inline filter fields (`inlineFields`), configure quick filter pills (`quickFilters` with `id`, `label`, `icon`, and `filter` criteria), and control `placement` (`'table-toolbar'` or `'scope-bar'`) without editing raw JSON.
|
|
458
467
|
- **Table (`table`)**: embedded `<praxis-table-inline-authoring-editor>` with explicit column inheritance awareness. When `metadata.table.columns` is `[]` and the CRUD resolves columns dynamically from the bound resource schema (`effectiveTableConfig`), the editor surfaces an inheritance banner showing the resolved resource columns, forwards those columns into the inline table editor for direct inspection/customization, preserves `columns: []` when only toolbar or pagination settings change, and provides a one-click reset back to inherited resource columns after customization.
|
|
459
468
|
- **Form Layout Scope & Persistence (`layoutScope?: 'shared' | 'mode-only'`)**: when customizing an inner `praxis-dynamic-form` inside a CRUD dialog or drawer (`DynamicFormDialogHostComponent`), the **Comportamento & Contexto** tab exposes the layout scope selector (`[data-testid="dynamic-form-layout-scope-toggle"]`):
|
|
460
|
-
- `'shared'` (default): structural layout edits (`sections`, `rows`, `columns`) propagate across sibling modes (`create`, `edit`, `view`) while automatically protecting any sibling mode explicitly locked with `metadata.layoutScope === 'mode-only'`.
|
|
461
|
-
- `'mode-only'`: locks the structural layout exclusively to the active mode (`create`, `edit`, or `
|
|
469
|
+
- `'shared'` (default): structural layout edits (`sections`, `rows`, `columns`, `layout`) propagate across sibling modes (`create`, `edit`, `view`, `presentation`, `dossier`) while automatically protecting any sibling mode explicitly locked with `metadata.layoutScope === 'mode-only'`.
|
|
470
|
+
- `'mode-only'`: locks the structural layout exclusively to the active mode (`create`, `edit`, `view`, `presentation`, or `dossier`), isolating it from future shared updates or resets triggered from sibling modes.
|
|
471
|
+
- Even though `DynamicFormDialogHostComponent` sets `formConfigPersistenceStrategy = 'input-first'`, when `metadata.form` is empty/policy-only (no explicit `sections` or `fieldMetadata`), it hydrates user-saved `metadata.source === 'local'` snapshots for `praxis-form-config-<id>:<mode>` while preserving host `actions`, `helpPresentation`, and fallback `formRules`.
|
|
462
472
|
- Both `crud-authoring:<id>` and `praxis-form-config-<id>:<mode>` keys persist seamlessly through `ASYNC_CONFIG_STORAGE` (local `LocalStorageConfigService` or remote `ApiConfigStorage` backed by `praxis-config-starter` at `/api/praxis/config/ui` with `If-Match` / `ETag` concurrency and automatic 412 conflict retry).
|
|
463
473
|
|
|
464
474
|
Use this authoring surface to edit CRUD orchestration metadata. Do not build local CRUD editors in consuming apps when the needed behavior belongs to the package contract.
|
|
465
475
|
|
|
476
|
+
## Multi-step forms in modals, drawers, and routes
|
|
477
|
+
|
|
478
|
+
When a CRUD form schema or `FormConfig` configures `layout.mode = 'stepper'`, `DynamicFormDialogHostComponent` (dialogs and drawers) and routed CRUD form hosts run the native multi-step form contract directly on top of the inner `PraxisDynamicForm`:
|
|
479
|
+
|
|
480
|
+
- **Single root `FormGroup` & concurrency**: all steps read from and write to the same root `FormGroup`, preserving `initialValue` seeding, `PATCH` dirty-field diffing, and optimistic `ETag` / `If-Match` headers.
|
|
481
|
+
- **Dirty guard on modal/drawer exit (`canLeaveForm()`) & session draft awareness**: closing via backdrop click, `Escape`, or `Cancelar` across any step still triggers the CRUD unsaved-changes confirmation before discarding edits across steps; when `behavior.draftPersistence` is active in `create` mode, the confirmation dialog explicitly informs the operator that the session draft remains saved locally (`Sair e manter rascunho`).
|
|
482
|
+
- **Step telemetry forwarding (`@Output() formStepTelemetry`)**: `DynamicFormDialogHostComponent` and `PraxisCrudComponent` forward metadata-only step transitions (`CrudFormStepTelemetryEvent`: `{ action, openMode, event }`) so host applications can monitor multi-step progress and drop-off across Modal, Drawer, and Route flows without inspecting field values.
|
|
483
|
+
- **Mode synchronization (`layoutScope: 'shared'`) & read-mode stepper policy**: editing steps inside `create`, `edit`, `view`, `presentation`, or `dossier` automatically propagates structural sections and `layout` across sibling modes (ignoring `'mode-only'` siblings). Read-only behavior follows `layout.stepperInReadMode` (`'off'`, default `'presentation'`, or `'all'`): interactive input `view` mode (`presentationModeGlobal === false`) flattens steps unless `'all'` is set, whereas Presentation/Dossier mode retains editorial step navigation (with all chapters automatically expanded for `@media print`).
|
|
484
|
+
- **Single action bar & `422` error recovery**: intermediate steps expose `Anterior` / `Próxima etapa` in `<praxis-form-actions>` while the write request (`POST` / `PUT` / `PATCH`) executes exclusively from the final step. Both cumulative linear validation (`0..targetIndex - 1`) and backend HTTP `422` field errors automatically reveal the owning step and focus the offending control inside the modal/drawer.
|
|
485
|
+
- **Host sizing guidance**: prefer `drawer`, full routes, or `md`/`lg`/`xl` dialog presets when rendering forms with 3 or more steps, reserving standalone `@praxisui/stepper` only for multi-aggregate wizards that commit separate resources across stages.
|
|
486
|
+
|
|
487
|
+
## Custom Fields Studio (`metadata.customFieldsStudio`)
|
|
488
|
+
|
|
489
|
+
When an application host enables dynamic `@CustomFields` resources, `<praxis-crud>` and `<praxis-resource-page>` expose `PraxisCustomFieldStudioDialogComponent` declaratively via `metadata.customFieldsStudio`:
|
|
490
|
+
|
|
491
|
+
- **Modes**: `'catalog'` intercepts `create`/`edit` actions on the definitions catalog resource; `'target-resource'` renders a header trigger on the extensible resource page pre-bound to `targetResourceKey`.
|
|
492
|
+
- **Host configuration & domain neutrality**: configure `definitionsResourcePath`, optional `targetsCatalogEndpoint`, `previewDeterminationEndpoint`, `aiDraftEndpoint`, `requiredAuthority`, `officialCatalogHint`, and `aiPromptExamples`. `@praxisui/crud` stays domain-agnostic and delegates host-specific catalog hints or example prompts through metadata.
|
|
493
|
+
- **Security & profile guard**: `customFieldsStudio` is blocked whenever `interactionMode === 'inspect-only'` (enforced by runtime components, `assertCrudMetadata`, and the `public-local-inspect-only` metadata profile) and requires `EnterpriseRuntimeContextService` authority matching when `requiredAuthority` is set.
|
|
494
|
+
- **Runtime cache & schema synchronization**: confirmed Studio saves and catalog mutations (save, delete, bulk, discovered surfaces) invalidate `DynamicFormService` and `PraxisCacheInvalidatorService`, reload the active CRUD schema, and invoke `PraxisTable.reloadSchema()` (refreshing columns and `<praxis-filter>` criteria in place).
|
|
495
|
+
|
|
466
496
|
## AI Authoring
|
|
467
497
|
|
|
468
498
|
`PRAXIS_CRUD_AUTHORING_MANIFEST` declares the governed operation families for AI-assisted authoring:
|