@praxisui/crud 4.0.0-beta.0 → 6.0.0-beta.0

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.
@@ -208,6 +208,21 @@ class CrudLauncherService {
208
208
  inputs[p.name] = row?.[p.from];
209
209
  }
210
210
  });
211
+ if (action.form?.schemaUrl) {
212
+ inputs['schemaUrl'] = action.form.schemaUrl;
213
+ }
214
+ if (action.form?.submitUrl) {
215
+ inputs['submitUrl'] = action.form.submitUrl;
216
+ }
217
+ if (action.form?.submitMethod) {
218
+ inputs['submitMethod'] = action.form.submitMethod;
219
+ }
220
+ if (action.form?.apiEndpointKey != null) {
221
+ inputs['apiEndpointKey'] = action.form.apiEndpointKey;
222
+ }
223
+ if (action.form?.apiUrlEntry != null) {
224
+ inputs['apiUrlEntry'] = action.form.apiUrlEntry;
225
+ }
211
226
  return inputs;
212
227
  }
213
228
  async mergeCrudOverrides(metadata, action, componentKeyId) {
@@ -287,6 +302,11 @@ function assertCrudMetadata(meta, options = {}) {
287
302
  throw new Error(`Invalid param mapping target: ${p.to}`);
288
303
  }
289
304
  });
305
+ const hasSubmitUrl = !!String(action.form?.submitUrl || '').trim();
306
+ const hasSubmitMethod = !!String(action.form?.submitMethod || '').trim();
307
+ if (hasSubmitUrl !== hasSubmitMethod) {
308
+ throw new Error(`Crud action ${action.action} requires form.submitUrl and form.submitMethod together`);
309
+ }
290
310
  });
291
311
  }
292
312
 
@@ -1346,7 +1366,7 @@ class PraxisCrudComponent {
1346
1366
  />
1347
1367
  }
1348
1368
  }
1349
- `, isInline: true, styles: [":host{display:block;width:100%;min-width:0;max-width:100%}\n"], dependencies: [{ kind: "component", type: PraxisTable, selector: "praxis-table", inputs: ["config", "resourcePath", "data", "tableId", "componentInstanceId", "title", "subtitle", "icon", "autoDelete", "notifyIfOutdated", "snoozeMs", "autoOpenSettingsOnOutdated", "crudContext", "dslFunctionRegistry", "filterCriteria", "queryContext", "enableCustomization", "dense"], outputs: ["rowClick", "rowDoubleClick", "rowExpansionChange", "rowAction", "toolbarAction", "bulkAction", "columnReorder", "columnReorderAttempt", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "metadataChange", "loadingStateChange", "collectionLinksChange"] }, { kind: "component", type: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone"] }] });
1369
+ `, isInline: true, styles: [":host{display:block;width:100%;min-width:0;max-width:100%}\n"], dependencies: [{ kind: "component", type: PraxisTable, selector: "praxis-table", inputs: ["config", "resourcePath", "data", "tableId", "componentInstanceId", "title", "subtitle", "icon", "autoDelete", "notifyIfOutdated", "snoozeMs", "autoOpenSettingsOnOutdated", "crudContext", "filterCriteria", "queryContext", "enableCustomization", "dense"], outputs: ["rowClick", "rowDoubleClick", "rowExpansionChange", "rowAction", "toolbarAction", "bulkAction", "columnReorder", "columnReorderAttempt", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "metadataChange", "loadingStateChange", "collectionLinksChange"] }, { kind: "component", type: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone"] }] });
1350
1370
  }
1351
1371
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisCrudComponent, decorators: [{
1352
1372
  type: Component,
@@ -1806,6 +1826,11 @@ const PRAXIS_CRUD_COMPONENT_METADATA = {
1806
1826
  type: 'Record<string, unknown> | null',
1807
1827
  description: 'Bridge declarativa de filtros encaminhada para a tabela interna. Para novo authoring, prefira metadata.queryContext.',
1808
1828
  },
1829
+ {
1830
+ name: 'metadata.actions[].form',
1831
+ type: 'CrudActionFormContract',
1832
+ description: 'Contrato canônico explícito para modal/drawer quando o host precisa informar schemaUrl, submitUrl e submitMethod sem depender do fallback genérico por resource.path.',
1833
+ },
1809
1834
  {
1810
1835
  name: 'enableCustomization',
1811
1836
  type: 'boolean',
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _praxisui_core from '@praxisui/core';
2
- import { ApiEndpoint, TableConfig, PraxisDataQueryContext, FormConfig, BackConfig, RowAction, ToolbarAction, ResourceActionCatalogItem, LoadingState, RestApiLinks, ApiUrlEntry, GenericCrudService, AsyncConfigStorage, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
2
+ import { ApiEndpoint, TableConfig, PraxisDataQueryContext, FormConfig, BackConfig, RowAction, ToolbarAction, ApiUrlEntry, ResourceActionCatalogItem, LoadingState, RestApiLinks, GenericCrudService, AsyncConfigStorage, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
3
3
  export { BackConfig } from '@praxisui/core';
4
4
  import * as i0 from '@angular/core';
5
5
  import { NgZone, OnChanges, EventEmitter, SimpleChanges, OnInit, Provider } from '@angular/core';
@@ -38,10 +38,18 @@ interface CrudParamMapping {
38
38
  to: 'routeParam' | 'query' | 'input';
39
39
  name: string;
40
40
  }
41
+ interface CrudActionFormContract {
42
+ schemaUrl?: string;
43
+ submitUrl?: string;
44
+ submitMethod?: 'post' | 'put' | 'patch';
45
+ apiEndpointKey?: ApiEndpoint | string | null;
46
+ apiUrlEntry?: ApiUrlEntry | null;
47
+ }
41
48
  type CrudAction = (RowAction | ToolbarAction) & {
42
49
  openMode?: FormOpenMode;
43
50
  route?: string;
44
51
  formId?: string;
52
+ form?: CrudActionFormContract;
45
53
  params?: CrudParamMapping[];
46
54
  back?: BackConfig;
47
55
  };
@@ -326,4 +334,4 @@ interface CapabilityCatalog extends AiCapabilityCatalog {
326
334
  declare const CRUD_AI_CAPABILITIES: CapabilityCatalog;
327
335
 
328
336
  export { CRUD_AI_CAPABILITIES, CrudLauncherService, CrudPageHeaderComponent, DialogService, DynamicFormDialogHostComponent, PRAXIS_CRUD_COMPONENT_METADATA, PraxisCrudComponent, assertCrudMetadata, providePraxisCrudMetadata };
329
- export type { Capability, CapabilityCatalog, CapabilityCategory, CrudAction, CrudDefaults, CrudHeaderConfig, CrudHeaderVariant, CrudMetadata, CrudMetadataAssertionOptions, CrudParamMapping, CrudResource, DialogConfig, DialogRef, FormOpenMode, ValueKind };
337
+ export type { Capability, CapabilityCatalog, CapabilityCategory, CrudAction, CrudActionFormContract, CrudDefaults, CrudHeaderConfig, CrudHeaderVariant, CrudMetadata, CrudMetadataAssertionOptions, CrudParamMapping, CrudResource, DialogConfig, DialogRef, FormOpenMode, ValueKind };
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@praxisui/crud",
3
- "version": "4.0.0-beta.0",
3
+ "version": "6.0.0-beta.0",
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": "^20.1.0",
7
7
  "@angular/core": "^20.1.0",
8
- "@praxisui/dynamic-form": "^4.0.0-beta.0",
9
- "@praxisui/table": "^4.0.0-beta.0",
10
- "@praxisui/core": "^4.0.0-beta.0",
11
- "@praxisui/dynamic-fields": "^4.0.0-beta.0",
12
- "@praxisui/settings-panel": "^4.0.0-beta.0"
8
+ "@praxisui/dynamic-form": "^6.0.0-beta.0",
9
+ "@praxisui/table": "^6.0.0-beta.0",
10
+ "@praxisui/core": "^6.0.0-beta.0",
11
+ "@praxisui/dynamic-fields": "^6.0.0-beta.0",
12
+ "@praxisui/settings-panel": "^6.0.0-beta.0"
13
13
  },
14
14
  "dependencies": {
15
15
  "tslib": "^2.3.0"