@praxisui/crud 9.0.0-beta.8 → 9.0.0-beta.80

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/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@praxisui/crud",
3
- "version": "9.0.0-beta.8",
3
+ "version": "9.0.0-beta.80",
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.8",
9
- "@praxisui/table": "^9.0.0-beta.8",
10
- "@praxisui/core": "^9.0.0-beta.8",
11
- "@praxisui/dynamic-fields": "^9.0.0-beta.8",
12
- "@praxisui/settings-panel": "^9.0.0-beta.8",
8
+ "@praxisui/dynamic-form": "^9.0.0-beta.80",
9
+ "@praxisui/table": "^9.0.0-beta.80",
10
+ "@praxisui/core": "^9.0.0-beta.80",
11
+ "@praxisui/dynamic-fields": "^9.0.0-beta.80",
12
+ "@praxisui/settings-panel": "^9.0.0-beta.80",
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.8",
17
+ "@praxisui/ai": "^9.0.0-beta.80",
18
18
  "rxjs": "~7.8.0"
19
19
  },
20
20
  "dependencies": {
@@ -28,6 +28,7 @@
28
28
  "keywords": [
29
29
  "angular",
30
30
  "praxisui",
31
+ "praxis",
31
32
  "crud",
32
33
  "admin",
33
34
  "backoffice",
@@ -48,7 +49,10 @@
48
49
  "./drawer-adapter": {
49
50
  "types": "./types/praxisui-crud-drawer-adapter.d.ts",
50
51
  "default": "./fesm2022/praxisui-crud-drawer-adapter.mjs"
52
+ },
53
+ "./ai/component-registry.json": {
54
+ "default": "./ai/component-registry.json"
51
55
  }
52
56
  },
53
57
  "type": "module"
54
- }
58
+ }
@@ -1,5 +1,5 @@
1
1
  import * as _praxisui_core from '@praxisui/core';
2
- import { RowAction, ToolbarAction, ApiEndpoint, ApiUrlEntry, BackConfig, TableConfig, PraxisDataQueryContext, FormConfig, ResourceActionCatalogItem, ResourceSurfaceCatalogItem, LoadingState, RestApiLinks, ResourceCapabilitySnapshot, GenericCrudService, AsyncConfigStorage, ComponentDocMeta, AiCapabilityCatalog, AiCapability, AiCapabilityCategory, AiValueKind, ComponentAuthoringManifest, SettingsValueProvider } from '@praxisui/core';
2
+ import { RowAction, ToolbarAction, ApiEndpoint, ApiUrlEntry, DynamicFormLayoutPolicy, BackConfig, TableConfig, PraxisDataQueryContext, FormConfig, ResourceActionCatalogItem, ResourceSurfaceCatalogItem, MaterializedResourceIdentity, LoadingState, RestApiLinks, ResourceCapabilitySnapshot, GenericCrudService, AsyncConfigStorage, ComponentDocMeta, AiCapabilityCatalog, AiCapability, AiCapabilityCategory, AiValueKind, ComponentAuthoringManifest, SettingsValueProvider } from '@praxisui/core';
3
3
  export { BackConfig } from '@praxisui/core';
4
4
  import * as _angular_core from '@angular/core';
5
5
  import { NgZone, OnChanges, EventEmitter, SimpleChanges, OnInit, Provider, AfterViewInit, OnDestroy } from '@angular/core';
@@ -53,6 +53,7 @@ interface CrudActionFormContract {
53
53
  apiEndpointKey?: ApiEndpoint | string | null;
54
54
  apiUrlEntry?: ApiUrlEntry | null;
55
55
  initialValue?: Record<string, unknown> | null;
56
+ layoutPolicy?: DynamicFormLayoutPolicy | null;
56
57
  }
57
58
  type CrudActionResolutionMode = 'inferred' | 'explicit';
58
59
  type CrudAction = (RowAction | ToolbarAction) & {
@@ -72,8 +73,13 @@ interface CrudDefaults {
72
73
  }
73
74
  interface CrudResource {
74
75
  path: string;
76
+ schemaPath?: string | null;
75
77
  idField?: string | number;
78
+ title?: string | null;
79
+ label?: string | null;
80
+ formTitle?: string | null;
76
81
  endpointKey?: ApiEndpoint;
82
+ apiUrlEntry?: ApiUrlEntry | null;
77
83
  }
78
84
  interface CrudMetadata {
79
85
  component: 'praxis-crud';
@@ -124,7 +130,10 @@ interface CrudValidationContext {
124
130
  }
125
131
 
126
132
  type CrudActionRuntimeEvent = {
133
+ action?: string;
127
134
  actionConfig?: ResourceActionCatalogItem | ResourceSurfaceCatalogItem | null;
135
+ rows?: Record<string, unknown>[];
136
+ resourceIdentity?: MaterializedResourceIdentity | null;
128
137
  };
129
138
  type CrudContextAction = {
130
139
  action: string;
@@ -149,6 +158,8 @@ declare class PraxisCrudComponent implements OnChanges {
149
158
  componentInstanceId?: string;
150
159
  context?: Record<string, unknown>;
151
160
  enableCustomization: boolean;
161
+ /** Capability publica exigida para authoring governado do CRUD e da tabela interna. */
162
+ authoringCapability: string | null;
152
163
  configureRequested: EventEmitter<void>;
153
164
  afterOpen: EventEmitter<{
154
165
  mode: FormOpenMode;
@@ -181,6 +192,7 @@ declare class PraxisCrudComponent implements OnChanges {
181
192
  private table;
182
193
  private readonly storage;
183
194
  private readonly settingsPanel;
195
+ private readonly enterpriseRuntimeContext;
184
196
  private readonly snack;
185
197
  private readonly dialog;
186
198
  private readonly i18n;
@@ -188,8 +200,10 @@ declare class PraxisCrudComponent implements OnChanges {
188
200
  private resourceDiscoveryInstance?;
189
201
  private actionOpenAdapterInstance?;
190
202
  private surfaceOpenAdapterInstance?;
203
+ private materializedRefreshSequence;
191
204
  private readonly global;
192
205
  private readonly surfaceService;
206
+ private readonly surfaceOutlets;
193
207
  private readonly componentKeys;
194
208
  private readonly route;
195
209
  private warnedMissingId;
@@ -199,16 +213,20 @@ declare class PraxisCrudComponent implements OnChanges {
199
213
  private lastAppliedResourceIdentity;
200
214
  private tableCollectionLinks;
201
215
  private collectionCapabilities;
216
+ private activeAuthoringPanelRef;
217
+ constructor();
202
218
  private collectionCapabilitiesRequestHref;
203
219
  private collectionCapabilitiesResolvedHref;
204
220
  private collectionCapabilitiesRequestSeq;
205
221
  private currentAuthoringDocument?;
222
+ selectedRow: Record<string, unknown> | null;
206
223
  private getResourceDiscovery;
207
224
  private getActionOpenAdapter;
208
225
  private getSurfaceOpenAdapter;
209
226
  onResetPreferences(): void;
210
227
  onTableRowClick(event: unknown): void;
211
228
  onTableSelectionChange(event: unknown): void;
229
+ onBulkAction(event: CrudActionRuntimeEvent): Promise<void>;
212
230
  ngOnChanges(changes: SimpleChanges): void;
213
231
  onAction(action: string, row?: Record<string, unknown>, runtimeEvent?: CrudActionRuntimeEvent): Promise<void>;
214
232
  private hasExplicitOpenBinding;
@@ -225,7 +243,13 @@ declare class PraxisCrudComponent implements OnChanges {
225
243
  getEmptyStatePrimaryAction(): string;
226
244
  onConfigureRequested(): void;
227
245
  private tryHandleCanonicalDeleteAction;
246
+ private tryHandleCanonicalDuplicateDraftAction;
228
247
  private refreshTable;
248
+ private tryRefreshMaterializedLocalData;
249
+ private isCurrentMaterializedRefresh;
250
+ private resolveMaterializedReadUrl;
251
+ private unwrapRestData;
252
+ private extractCollectionData;
229
253
  private emitTableRuntimeConfigSnapshot;
230
254
  private applyResolvedCrudState;
231
255
  private assignTableConfigForBinding;
@@ -234,6 +258,10 @@ declare class PraxisCrudComponent implements OnChanges {
234
258
  private syncRuntimeBindings;
235
259
  private resolveQueryContext;
236
260
  private resolveFilterCriteria;
261
+ private extractRowFromEvent;
262
+ private extractSelectedRowFromEvent;
263
+ private extractSelectedRowFromBulkAction;
264
+ private resolveSelectedRowForAction;
237
265
  private tryOpenDiscoveredCrudSurface;
238
266
  private resolveDiscoveredSurfaceCatalog;
239
267
  private tryOpenDiscoveredWorkflowAction;
@@ -251,8 +279,12 @@ declare class PraxisCrudComponent implements OnChanges {
251
279
  private handleDiscoveredSurfaceResult;
252
280
  private buildEffectiveTableConfig;
253
281
  private isAddLike;
282
+ private normalizeCrudActionName;
283
+ private shouldCanonicalizeToolbarCreateAction;
284
+ private isCreateActionAliasName;
254
285
  private buildTableCrudContext;
255
286
  private readonly openCrudAuthoringFromTable;
287
+ isCustomizationAvailable(): boolean;
256
288
  private applyCrudAuthoringPayload;
257
289
  private buildWidgetPersistencePayload;
258
290
  private resolveCreateToolbarAction;
@@ -274,9 +306,12 @@ declare class PraxisCrudComponent implements OnChanges {
274
306
  private componentKeyId;
275
307
  private warnMissingId;
276
308
  private getCrudActionLabel;
309
+ private ensureCanonicalCollectionEmptyState;
277
310
  private tx;
311
+ private txWithParams;
312
+ private interpolateTranslationParams;
278
313
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PraxisCrudComponent, never>;
279
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisCrudComponent, "praxis-crud", never, { "metadata": { "alias": "metadata"; "required": true; }; "crudId": { "alias": "crudId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "context": { "alias": "context"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; }, { "configureRequested": "configureRequested"; "afterOpen": "afterOpen"; "afterClose": "afterClose"; "afterSave": "afterSave"; "afterDelete": "afterDelete"; "error": "error"; "rowClick": "rowClick"; "selectionChange": "selectionChange"; "tableRuntimeConfigChange": "tableRuntimeConfigChange"; "crudAuthoringDocumentApplied": "crudAuthoringDocumentApplied"; "crudAuthoringDocumentSaved": "crudAuthoringDocumentSaved"; }, never, never, true, never>;
314
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisCrudComponent, "praxis-crud", never, { "metadata": { "alias": "metadata"; "required": true; }; "crudId": { "alias": "crudId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "context": { "alias": "context"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; "authoringCapability": { "alias": "authoringCapability"; "required": false; }; }, { "configureRequested": "configureRequested"; "afterOpen": "afterOpen"; "afterClose": "afterClose"; "afterSave": "afterSave"; "afterDelete": "afterDelete"; "error": "error"; "rowClick": "rowClick"; "selectionChange": "selectionChange"; "tableRuntimeConfigChange": "tableRuntimeConfigChange"; "crudAuthoringDocumentApplied": "crudAuthoringDocumentApplied"; "crudAuthoringDocumentSaved": "crudAuthoringDocumentSaved"; }, never, never, true, never>;
280
315
  }
281
316
 
282
317
  type CrudDrawerResultType = 'save' | 'delete' | 'close';
@@ -298,6 +333,7 @@ declare class CrudLauncherService {
298
333
  }, runtime?: {
299
334
  capabilities?: ResourceCapabilitySnapshot | null;
300
335
  links?: RestApiLinks | null;
336
+ resourceIdentity?: MaterializedResourceIdentity | null;
301
337
  }): Promise<{
302
338
  mode: FormOpenMode;
303
339
  ref?: DialogRef<any>;
@@ -306,6 +342,7 @@ declare class CrudLauncherService {
306
342
  private buildRoute;
307
343
  private mapInputs;
308
344
  private resolveActionForLaunch;
345
+ private resolveSubmitUrlTemplate;
309
346
  private resolveActionFormContract;
310
347
  resolveRuntimeContract(action: CrudAction, row: Record<string, unknown> | undefined, metadata: CrudMetadata, runtime?: {
311
348
  capabilities?: ResourceCapabilitySnapshot | null;
@@ -316,10 +353,14 @@ declare class CrudLauncherService {
316
353
  submitMethod?: string | null;
317
354
  apiEndpointKey?: unknown;
318
355
  apiUrlEntry?: unknown;
356
+ layoutPolicy?: unknown;
319
357
  };
320
358
  private buildInferredFormId;
321
359
  private isCanonicalCrudAction;
360
+ private normalizeActionForLaunch;
361
+ private normalizeCrudOperationName;
322
362
  private isExplicitCrudAction;
363
+ private defaultInferredLayoutPolicy;
323
364
  private mergeCrudOverrides;
324
365
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CrudLauncherService, never>;
325
366
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<CrudLauncherService>;
@@ -333,8 +374,10 @@ declare class DynamicFormDialogHostComponent implements OnInit {
333
374
  private configStorage;
334
375
  formComp?: PraxisDynamicForm;
335
376
  modal: any;
377
+ presentation: 'modal' | 'drawer';
336
378
  maximized: boolean;
337
379
  private initialSize;
380
+ private readonly initialPosition?;
338
381
  private rememberState;
339
382
  private stateKey?;
340
383
  private backDefaults;
@@ -342,19 +385,28 @@ declare class DynamicFormDialogHostComponent implements OnInit {
342
385
  resourcePath?: string;
343
386
  resourceId?: string | number;
344
387
  initialValue?: Record<string, unknown> | null;
388
+ resourceIdentity: MaterializedResourceIdentity | null;
345
389
  schemaUrl?: string | null;
346
390
  submitUrl?: string | null;
347
391
  submitMethod?: string | null;
348
392
  apiEndpointKey?: ApiEndpoint | string | null;
349
393
  apiUrlEntry?: ApiUrlEntry | null;
394
+ layoutPolicy?: DynamicFormLayoutPolicy | null;
395
+ formConfig: FormConfig;
350
396
  formActions?: FormConfig['actions'];
397
+ readonly formConfigPersistenceStrategy = "input-first";
351
398
  mode: 'create' | 'edit' | 'view';
352
399
  backConfig?: BackConfig;
353
400
  private idField;
354
401
  texts: Record<string, string>;
355
402
  constructor(dialogRef: DialogRef<DynamicFormDialogHostComponent>, data: any, dialogService: DialogService, crud: GenericCrudService<any>, configStorage: AsyncConfigStorage);
356
403
  private extractInitialValue;
404
+ private resolveFormConfig;
405
+ get dialogTitle(): string;
406
+ private resolveActionDialogTitle;
407
+ private resolveResourceTitle;
357
408
  private resolveFormActions;
409
+ private resolveLayoutPolicy;
358
410
  private resolveSubmitLabel;
359
411
  ngOnInit(): void;
360
412
  onSave(result: unknown): void;
@@ -362,6 +414,8 @@ declare class DynamicFormDialogHostComponent implements OnInit {
362
414
  toggleMaximize(initial?: boolean): void;
363
415
  private saveState;
364
416
  private applySavedState;
417
+ private updateHostPosition;
418
+ private resolveMaximizedDrawerPosition;
365
419
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DynamicFormDialogHostComponent, never>;
366
420
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DynamicFormDialogHostComponent, "praxis-dynamic-form-dialog-host", never, {}, {}, never, never, true, never>;
367
421
  }
@@ -604,6 +658,7 @@ interface PraxisCrudWidgetEditorInputs {
604
658
  componentInstanceId?: string;
605
659
  context?: Record<string, unknown>;
606
660
  enableCustomization?: boolean;
661
+ authoringCapability?: string | null;
607
662
  [key: string]: unknown;
608
663
  }
609
664
  interface PraxisCrudWidgetEditorValue {