@praxisui/crud 10.0.0-rc.60 → 10.0.0-rc.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 CHANGED
@@ -145,7 +145,7 @@ export class EmployeesCrudComponent {
145
145
  - `metadata`: `CrudMetadata | string`
146
146
  - `crudId`: stable instance id
147
147
  - `componentInstanceId`: optional host-level instance id
148
- - `tableConfigPersistenceStrategy`: controls persistence precedence for the internal table. Keep `local-first` for user-owned workspaces, use `input-first` for an authoritative governed contract, and use `volatile` for previews that must neither read nor write stored preferences.
148
+ - `tableConfigPersistenceStrategy` / `configPersistenceStrategy`: controls persistence precedence (`'local-first' | 'input-first' | 'volatile'`, normalizing `'storage-first'` to `'local-first'`) for the internal table, authoring overrides, and launched modal/drawer form hosts. Keep `local-first` for user-owned workspaces, use `input-first` for an authoritative governed contract, and use `volatile` for ephemeral previews that must neither read nor write stored preferences.
149
149
  - `context`: host/runtime context passed into table and form flows
150
150
  - `enableCustomization`: enables the package authoring surface
151
151
  - `showResourceIdentityKey`: defaults to `true`; set it to `false` when an existing-record modal or drawer should preserve the readable identity title without exposing an opaque or technical public key
@@ -533,6 +533,8 @@ Main exports:
533
533
  - Avoid template getters that create new object/array references for CRUD context.
534
534
  - Treat `actions[].params` and `actions[].form.initialValue` as input seeding for the launcher, not as automatic persistence rules.
535
535
  - Keep UI-only/transient form fields in the dynamic form contract with the appropriate submit policy.
536
+ - `PraxisCrudComponent` and `openCrudMetadataEditor` synchronize Settings Panel `configStorageKey`, await async save/reset persistence with visual rollback and structured error propagation, and normalize `configPersistenceStrategy` (`'local-first' | 'input-first' | 'volatile'`).
537
+ - `CrudRouteFormComponent` automatically invokes `disableCustomization()` when `!available()` to keep route customization fail-closed.
536
538
  - Use the official documentation and quickstart for full route, drawer, modal, and backend examples.
537
539
 
538
540
  <!-- praxis-npm-catalog-links:start -->
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-11-23T14:32:32.238Z",
3
+ "generatedAt": "2026-11-24T14:00:56.078Z",
4
4
  "packageName": "@praxisui/crud",
5
- "packageVersion": "10.0.0-rc.60",
5
+ "packageVersion": "10.0.0-rc.61",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 3,
@@ -49,6 +49,13 @@
49
49
  "description": "Política da tabela interna. Use input-first para contratos governados autoritativos e volatile para previews que não devem ler nem gravar preferências locais.",
50
50
  "default": "local-first"
51
51
  },
52
+ {
53
+ "name": "configPersistenceStrategy",
54
+ "type": "'local-first' | 'input-first' | 'volatile' | 'storage-first'",
55
+ "required": false,
56
+ "description": "Alias canônico alinhado a @praxisui/core para governar persistência da tabela interna e fluxos derivados (`local-first`, `input-first`, `volatile`).",
57
+ "default": "local-first"
58
+ },
52
59
  {
53
60
  "name": "context",
54
61
  "type": "Record<string, unknown>",
@@ -233,6 +240,25 @@
233
240
  "recommendedCols": 12,
234
241
  "recommendedRows": 6
235
242
  },
243
+ "transientInputs": [
244
+ "selectedRows",
245
+ "selectedRow",
246
+ "selectionDigest",
247
+ "loading",
248
+ "dirty",
249
+ "queryContext"
250
+ ],
251
+ "lockedInputs": [
252
+ "resourcePath",
253
+ "crudId"
254
+ ],
255
+ "visualOverrideKeys": [
256
+ "metadata",
257
+ "enableCustomization",
258
+ "tableConfigPersistenceStrategy",
259
+ "configPersistenceStrategy"
260
+ ],
261
+ "schemaVersion": "1.0.0",
236
262
  "actions": [
237
263
  {
238
264
  "id": "create",
@@ -10225,9 +10251,9 @@
10225
10251
  {
10226
10252
  "chunkIndex": 0,
10227
10253
  "chunkKind": "summary",
10228
- "content": "Component ID: praxis-crud\nSelector: praxis-crud\nFriendly Name: Workspace de Recurso\nDescription: Superfície operacional completa guiada por contrato: listagem semântica, KPIs, escopo, dossiês e ações de negócio.\nLib/Package: @praxisui/crud\nTags: widget, crud, configurable, hasWizard, stable\nInputs:\n - metadata (CrudMetadata | string)\n - metadata.customFieldsStudio (PraxisCustomFieldsStudioConfig)\n - metadata.interactionMode ('interactive' | 'inspect-only')\n - crudId (string)\n - componentInstanceId (string)\n - tableConfigPersistenceStrategy ('local-first' | 'input-first' | 'volatile')\n - context (Record<string, unknown>)\n - metadata.queryContext (PraxisDataQueryContext | null)\n - metadata.resource.schemaPath (string | null)\n - metadata.resource.title (string | null)\n - metadata.resource.formTitle (string | null)\n - metadata.filterCriteria (Record<string, unknown> | null)\n - metadata.form (FormConfig)\n - metadata.actions[].form (CrudActionFormContract)\n - enableCustomization (boolean)\n - showResourceIdentityKey (boolean)\n - authoringCapability (string | null)\nOutputs:\n - afterOpen ({ mode: FormOpenMode; action: string })\n - afterClose (void)\n - afterSave ({ id: string | number; data: unknown })\n - afterDelete ({ id: string | number })\n - reactiveDeterminationExecuted ({ action: string; event: ReactiveDeterminationExecutionEvent })\n - reactiveDeterminationPendingChange ({ action: string; pending: boolean })\n - reactiveDeterminationStabilityChange (CrudReactiveDeterminationStabilityChange)\n - formStepTelemetry (CrudFormStepTelemetryEvent)\n - rowClick ({ row: unknown; index: number })\n - rowAction (CrudActionRuntimeEvent)\n - selectionChange (unknown)\n - resourceEvent (PraxisResourceEvent<unknown>)\n - error (unknown)\n - configureRequested (void)\n - crudAuthoringDocumentApplied (CrudAuthoringWidgetPersistenceEvent)\n - crudAuthoringDocumentSaved (CrudAuthoringWidgetPersistenceEvent)\n",
10254
+ "content": "Component ID: praxis-crud\nSelector: praxis-crud\nFriendly Name: Workspace de Recurso\nDescription: Superfície operacional completa guiada por contrato: listagem semântica, KPIs, escopo, dossiês e ações de negócio.\nLib/Package: @praxisui/crud\nTags: widget, crud, configurable, hasWizard, stable\nInputs:\n - metadata (CrudMetadata | string)\n - metadata.customFieldsStudio (PraxisCustomFieldsStudioConfig)\n - metadata.interactionMode ('interactive' | 'inspect-only')\n - crudId (string)\n - componentInstanceId (string)\n - tableConfigPersistenceStrategy ('local-first' | 'input-first' | 'volatile')\n - configPersistenceStrategy ('local-first' | 'input-first' | 'volatile' | 'storage-first')\n - context (Record<string, unknown>)\n - metadata.queryContext (PraxisDataQueryContext | null)\n - metadata.resource.schemaPath (string | null)\n - metadata.resource.title (string | null)\n - metadata.resource.formTitle (string | null)\n - metadata.filterCriteria (Record<string, unknown> | null)\n - metadata.form (FormConfig)\n - metadata.actions[].form (CrudActionFormContract)\n - enableCustomization (boolean)\n - showResourceIdentityKey (boolean)\n - authoringCapability (string | null)\nOutputs:\n - afterOpen ({ mode: FormOpenMode; action: string })\n - afterClose (void)\n - afterSave ({ id: string | number; data: unknown })\n - afterDelete ({ id: string | number })\n - reactiveDeterminationExecuted ({ action: string; event: ReactiveDeterminationExecutionEvent })\n - reactiveDeterminationPendingChange ({ action: string; pending: boolean })\n - reactiveDeterminationStabilityChange (CrudReactiveDeterminationStabilityChange)\n - formStepTelemetry (CrudFormStepTelemetryEvent)\n - rowClick ({ row: unknown; index: number })\n - rowAction (CrudActionRuntimeEvent)\n - selectionChange (unknown)\n - resourceEvent (PraxisResourceEvent<unknown>)\n - error (unknown)\n - configureRequested (void)\n - crudAuthoringDocumentApplied (CrudAuthoringWidgetPersistenceEvent)\n - crudAuthoringDocumentSaved (CrudAuthoringWidgetPersistenceEvent)\n",
10229
10255
  "sourcePointer": "projects/praxis-crud/src/lib/praxis-crud.metadata.ts",
10230
- "contentHash": "ffb73d7e44b68b735b17082297e888427cb8e39ef4625901b23f406c8cf9b9b1",
10256
+ "contentHash": "01e1fed53777eeef9f7cd4fe8e03a8a57166c53a57b0f35465731cfd34b37fad",
10231
10257
  "sourceKind": "component_definition",
10232
10258
  "sourceId": "praxis-crud",
10233
10259
  "corpusVersion": "1.0.0"
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injector, DestroyRef, signal, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, Injector, DestroyRef, signal, effect, untracked, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { NgComponentOutlet } from '@angular/common';
4
4
  import { Router, ActivatedRoute } from '@angular/router';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { EnterpriseRuntimeContextService, PraxisI18nService, providePraxisI18nConfig } from '@praxisui/core';
7
- import { d as CrudRouteFormHandoffService, e as DynamicFormDialogHostComponent, $ as translateCrudRuntimeText, J as crudRouteContextKey, i as PRAXIS_CRUD_RUNTIME_I18N_CONFIG } from './praxisui-crud-praxisui-crud-BzH-kq3N.mjs';
6
+ import { EnterpriseRuntimeContextService, PraxisCustomizationModeService, PraxisI18nService, providePraxisI18nConfig } from '@praxisui/core';
7
+ import { d as CrudRouteFormHandoffService, e as DynamicFormDialogHostComponent, $ as translateCrudRuntimeText, J as crudRouteContextKey, i as PRAXIS_CRUD_RUNTIME_I18N_CONFIG } from './praxisui-crud-praxisui-crud-wv2Iua_J.mjs';
8
8
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
9
9
 
10
10
  /** Created only by createCrudFormRoute; owns the transferred form instance. */
@@ -14,9 +14,12 @@ class CrudRouteFormComponent {
14
14
  parentInjector = inject(Injector);
15
15
  destroyRef = inject(DestroyRef);
16
16
  context = inject(EnterpriseRuntimeContextService, { optional: true });
17
+ customizationMode = inject(PraxisCustomizationModeService, { optional: true });
17
18
  i18n = inject(PraxisI18nService);
18
19
  data = inject(CrudRouteFormHandoffService).claim(this.route.snapshot.data['crudFormTarget']);
19
- available = signal(!!this.data, ...(ngDevMode ? [{ debugName: "available" }] : /* istanbul ignore next */ []));
20
+ releaseCustomizationDisable = null;
21
+ _available = signal(!!this.data, ...(ngDevMode ? [{ debugName: "_available" }] : /* istanbul ignore next */ []));
22
+ available = this._available.asReadonly();
20
23
  host = DynamicFormDialogHostComponent;
21
24
  unavailableText = translateCrudRuntimeText(this.i18n, 'crud.route.unavailable', 'Esta cópia não está mais disponível. Volte à lista e prepare uma nova cópia.');
22
25
  formInjector = Injector.create({
@@ -29,13 +32,41 @@ class CrudRouteFormComponent {
29
32
  });
30
33
  outlet;
31
34
  constructor() {
35
+ this.syncCustomizationAvailability();
36
+ effect(() => {
37
+ this.available();
38
+ untracked(() => this.syncCustomizationAvailability());
39
+ });
32
40
  // A route owns its context after handoff; it must not depend on the destroyed source.
33
41
  const contextKey = crudRouteContextKey(this.context?.snapshot);
34
42
  this.context?.contextChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(current => {
35
- if (crudRouteContextKey(current) !== contextKey)
36
- this.available.set(false);
43
+ if (crudRouteContextKey(current) !== contextKey) {
44
+ this._available.set(false);
45
+ this.syncCustomizationAvailability();
46
+ }
47
+ });
48
+ this.destroyRef.onDestroy(() => {
49
+ this.releaseCustomizationLock();
50
+ this.formInjector.destroy();
37
51
  });
38
- this.destroyRef.onDestroy(() => this.formInjector.destroy());
52
+ }
53
+ syncCustomizationAvailability() {
54
+ if (!this.available()) {
55
+ if (!this.releaseCustomizationDisable) {
56
+ this.releaseCustomizationDisable =
57
+ this.customizationMode?.disableCustomization?.(translateCrudRuntimeText(this.i18n, 'crud.route.customizationUnavailable', 'Customização indisponível para esta visualização de rota.')) ?? null;
58
+ }
59
+ return;
60
+ }
61
+ this.releaseCustomizationLock();
62
+ }
63
+ releaseCustomizationLock() {
64
+ if (!this.releaseCustomizationDisable) {
65
+ return;
66
+ }
67
+ const release = this.releaseCustomizationDisable;
68
+ this.releaseCustomizationDisable = null;
69
+ release();
39
70
  }
40
71
  canLeave() {
41
72
  return this.outlet?.componentInstance?.canLeaveForm() ?? true;