@praxisui/crud 9.0.0-beta.47 → 9.0.0-beta.49

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.
@@ -4426,6 +4426,7 @@ class PraxisCrudComponent {
4426
4426
  action: 'create',
4427
4427
  }
4428
4428
  : action);
4429
+ changed = true;
4429
4430
  }
4430
4431
  else {
4431
4432
  const toolbar = ensureToolbar();
@@ -5001,6 +5002,7 @@ class DynamicFormDialogHostComponent {
5001
5002
  apiEndpointKey;
5002
5003
  apiUrlEntry;
5003
5004
  layoutPolicy;
5005
+ formConfig = {};
5004
5006
  formActions;
5005
5007
  mode = 'create';
5006
5008
  backConfig;
@@ -5058,6 +5060,7 @@ class DynamicFormDialogHostComponent {
5058
5060
  this.apiUrlEntry = this.data.inputs?.['apiUrlEntry'] ?? null;
5059
5061
  const act = this.data.action?.action;
5060
5062
  this.mode = act === 'edit' ? 'edit' : act === 'view' ? 'view' : 'create';
5063
+ this.formConfig = this.resolveFormConfig();
5061
5064
  this.layoutPolicy = this.resolveLayoutPolicy();
5062
5065
  this.formActions = this.resolveFormActions();
5063
5066
  // Back config: defaults from metadata/action, overridden by saved per-form config
@@ -5117,10 +5120,22 @@ class DynamicFormDialogHostComponent {
5117
5120
  }
5118
5121
  return Object.keys(explicit).length ? explicit : null;
5119
5122
  }
5123
+ resolveFormConfig() {
5124
+ const config = this.data.metadata?.form;
5125
+ return config && typeof config === 'object' ? config : {};
5126
+ }
5127
+ get dialogTitle() {
5128
+ return stringOrUndefined(this.data.action?.label) ||
5129
+ stringOrUndefined(this.formConfig['title']) ||
5130
+ this.texts.title;
5131
+ }
5120
5132
  resolveFormActions() {
5121
5133
  if (this.mode === 'view') {
5122
5134
  return undefined;
5123
5135
  }
5136
+ if (this.formConfig?.actions) {
5137
+ return undefined;
5138
+ }
5124
5139
  const submitLabel = this.resolveSubmitLabel();
5125
5140
  if (!submitLabel) {
5126
5141
  return undefined;
@@ -5292,7 +5307,7 @@ class DynamicFormDialogHostComponent {
5292
5307
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: DynamicFormDialogHostComponent, isStandalone: true, selector: "praxis-dynamic-form-dialog-host", host: { properties: { "attr.data-density": "modal.density || \"default\"", "attr.data-presentation": "presentation", "class.praxis-drawer": "presentation === \"drawer\"" }, classAttribute: "praxis-dialog" }, providers: [GenericCrudService], viewQueries: [{ propertyName: "formComp", first: true, predicate: PraxisDynamicForm, descendants: true }], ngImport: i0, template: `
5293
5308
  <div mat-dialog-title class="dialog-header">
5294
5309
  <h2 id="crudDialogTitle" class="dialog-title">
5295
- {{ data.action?.label || texts.title }}
5310
+ {{ dialogTitle }}
5296
5311
  </h2>
5297
5312
  <span class="spacer"></span>
5298
5313
  @if (modal.canMaximize) {
@@ -5326,6 +5341,7 @@ class DynamicFormDialogHostComponent {
5326
5341
  [resourceId]="resourceId"
5327
5342
  [initialValue]="initialValue"
5328
5343
  [mode]="mode"
5344
+ [config]="formConfig"
5329
5345
  [schemaUrl]="schemaUrl"
5330
5346
  [submitUrl]="submitUrl"
5331
5347
  [submitMethod]="submitMethod"
@@ -5357,7 +5373,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5357
5373
  }, template: `
5358
5374
  <div mat-dialog-title class="dialog-header">
5359
5375
  <h2 id="crudDialogTitle" class="dialog-title">
5360
- {{ data.action?.label || texts.title }}
5376
+ {{ dialogTitle }}
5361
5377
  </h2>
5362
5378
  <span class="spacer"></span>
5363
5379
  @if (modal.canMaximize) {
@@ -5391,6 +5407,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5391
5407
  [resourceId]="resourceId"
5392
5408
  [initialValue]="initialValue"
5393
5409
  [mode]="mode"
5410
+ [config]="formConfig"
5394
5411
  [schemaUrl]="schemaUrl"
5395
5412
  [submitUrl]="submitUrl"
5396
5413
  [submitMethod]="submitMethod"
@@ -5596,6 +5613,11 @@ const PRAXIS_CRUD_COMPONENT_METADATA = {
5596
5613
  type: 'Record<string, unknown> | null',
5597
5614
  description: 'Bridge declarativa de filtros encaminhada para a tabela interna. Para novo authoring, prefira metadata.queryContext.',
5598
5615
  },
5616
+ {
5617
+ name: 'metadata.form',
5618
+ type: 'FormConfig',
5619
+ description: 'Configuração do formulário encaminhada para o PraxisDynamicForm aberto por ações modal/drawer; layout, fieldMetadata, actions e helpPresentation permanecem propriedade do Dynamic Form.',
5620
+ },
5599
5621
  {
5600
5622
  name: 'metadata.actions[].form',
5601
5623
  type: 'CrudActionFormContract',
@@ -6129,7 +6151,7 @@ const PRAXIS_CRUD_AUTHORING_MANIFEST = {
6129
6151
  { kind: 'viewSurface', resolver: 'crud-action-by-id:view', description: 'View action open mode, route/form binding and launcher inputs.' },
6130
6152
  { kind: 'deleteBehavior', resolver: 'crud-action-by-id:delete', description: 'Delete action enablement, confirmation, endpoint and capability policy.' },
6131
6153
  { kind: 'dialogHost', resolver: 'crud-dialog-host-defaults', description: 'Route/modal/drawer defaults consumed by CrudLauncherService and DynamicFormDialogHostComponent.' },
6132
- { kind: 'formBinding', resolver: 'crud-action-form-contract-by-action-id', description: 'CRUD-owned form binding fields: formId, schemaUrl, submitUrl, submitMethod, params and initialValue.' },
6154
+ { kind: 'formBinding', resolver: 'crud-action-form-contract-by-action-id', description: 'CRUD-owned form binding fields: formId, schemaUrl, submitUrl, submitMethod, params and initialValue. Shared FormConfig remains owned by Dynamic Form and is forwarded through CrudMetadata.form when present.' },
6133
6155
  { kind: 'permissions', resolver: 'crud-resource-capabilities', description: 'CRUD action availability derived from resource capabilities and action permissions.' },
6134
6156
  { kind: 'domainGovernanceContext', resolver: 'domain-catalog-context-by-resource-key', description: 'Read-only semantic/governance context resolved from Domain Catalog and referenced from CRUD queryContext.meta.' },
6135
6157
  { kind: 'childOperation', resolver: 'child-authoring-manifest-operation', description: 'Delegated form/table/dialog/settings-panel operation owned by the child component manifest.' },
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@praxisui/crud",
3
- "version": "9.0.0-beta.47",
3
+ "version": "9.0.0-beta.49",
4
4
  "description": "CRUD building blocks for Praxis UI: integrates dynamic forms and tables with unified configuration and services.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/dynamic-form": "^9.0.0-beta.47",
9
- "@praxisui/table": "^9.0.0-beta.47",
10
- "@praxisui/core": "^9.0.0-beta.47",
11
- "@praxisui/dynamic-fields": "^9.0.0-beta.47",
12
- "@praxisui/settings-panel": "^9.0.0-beta.47",
8
+ "@praxisui/dynamic-form": "^9.0.0-beta.49",
9
+ "@praxisui/table": "^9.0.0-beta.49",
10
+ "@praxisui/core": "^9.0.0-beta.49",
11
+ "@praxisui/dynamic-fields": "^9.0.0-beta.49",
12
+ "@praxisui/settings-panel": "^9.0.0-beta.49",
13
13
  "@angular/cdk": "^21.0.0",
14
14
  "@angular/forms": "^21.0.0",
15
15
  "@angular/material": "^21.0.0",
16
16
  "@angular/router": "^21.0.0",
17
- "@praxisui/ai": "^9.0.0-beta.47",
17
+ "@praxisui/ai": "^9.0.0-beta.49",
18
18
  "rxjs": "~7.8.0"
19
19
  },
20
20
  "dependencies": {
@@ -368,6 +368,7 @@ declare class DynamicFormDialogHostComponent implements OnInit {
368
368
  apiEndpointKey?: ApiEndpoint | string | null;
369
369
  apiUrlEntry?: ApiUrlEntry | null;
370
370
  layoutPolicy?: DynamicFormLayoutPolicy | null;
371
+ formConfig: FormConfig;
371
372
  formActions?: FormConfig['actions'];
372
373
  mode: 'create' | 'edit' | 'view';
373
374
  backConfig?: BackConfig;
@@ -375,6 +376,8 @@ declare class DynamicFormDialogHostComponent implements OnInit {
375
376
  texts: Record<string, string>;
376
377
  constructor(dialogRef: DialogRef<DynamicFormDialogHostComponent>, data: any, dialogService: DialogService, crud: GenericCrudService<any>, configStorage: AsyncConfigStorage);
377
378
  private extractInitialValue;
379
+ private resolveFormConfig;
380
+ get dialogTitle(): string;
378
381
  private resolveFormActions;
379
382
  private resolveLayoutPolicy;
380
383
  private resolveSubmitLabel;