@praxisui/crud 9.0.0-beta.9 → 9.0.0-beta.90
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 +73 -9
- package/ai/component-registry.json +12227 -0
- package/fesm2022/praxisui-crud.mjs +937 -116
- package/package.json +12 -8
- package/types/praxisui-crud-drawer-adapter.d.ts +3 -1
- package/types/praxisui-crud.d.ts +78 -3
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/crud",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.90",
|
|
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.
|
|
9
|
-
"@praxisui/table": "^9.0.0-beta.
|
|
10
|
-
"@praxisui/core": "^9.0.0-beta.
|
|
11
|
-
"@praxisui/dynamic-fields": "^9.0.0-beta.
|
|
12
|
-
"@praxisui/settings-panel": "^9.0.0-beta.
|
|
8
|
+
"@praxisui/dynamic-form": "^9.0.0-beta.90",
|
|
9
|
+
"@praxisui/table": "^9.0.0-beta.90",
|
|
10
|
+
"@praxisui/core": "^9.0.0-beta.90",
|
|
11
|
+
"@praxisui/dynamic-fields": "^9.0.0-beta.90",
|
|
12
|
+
"@praxisui/settings-panel": "^9.0.0-beta.90",
|
|
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.
|
|
17
|
+
"@praxisui/ai": "^9.0.0-beta.90",
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { MatDialogConfig } from '@angular/material/dialog';
|
|
3
|
-
import { RowAction, ToolbarAction, BackConfig, ApiEndpoint, TableConfig, FormConfig } from '@praxisui/core';
|
|
3
|
+
import { RowAction, ToolbarAction, BackConfig, ApiEndpoint, TableConfig, FormConfig, MaterializedResourceIdentity } from '@praxisui/core';
|
|
4
4
|
|
|
5
5
|
type FormOpenMode = 'route' | 'modal' | 'drawer';
|
|
6
6
|
interface CrudParamMapping {
|
|
@@ -55,6 +55,8 @@ interface CrudDrawerOpenConfig {
|
|
|
55
55
|
action: CrudAction;
|
|
56
56
|
metadata: CrudMetadata;
|
|
57
57
|
inputs: Record<string, unknown>;
|
|
58
|
+
/** Read-only record context for edit drawers. It is never part of form inputs or submit payloads. */
|
|
59
|
+
resourceIdentity?: MaterializedResourceIdentity | null;
|
|
58
60
|
/**
|
|
59
61
|
* Notifica fechamento do drawer (cancelamento/fechamento externo/resultado finalizado).
|
|
60
62
|
*/
|
package/types/praxisui-crud.d.ts
CHANGED
|
@@ -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';
|
|
@@ -20,14 +20,20 @@ interface DialogConfig<D = any> extends MatDialogConfig<D> {
|
|
|
20
20
|
disableCloseOnEsc?: boolean;
|
|
21
21
|
/** Density hint consumed by CRUD dialog host chrome */
|
|
22
22
|
density?: 'default' | 'compact';
|
|
23
|
+
/** Praxis backdrop visual preset */
|
|
24
|
+
backdropStyle?: 'blur' | 'dim' | 'transparent';
|
|
23
25
|
/** Enable maximize button */
|
|
24
26
|
canMaximize?: boolean;
|
|
25
27
|
/** Persist last dialog size/state for the same form */
|
|
26
28
|
rememberLastState?: boolean;
|
|
29
|
+
/** Keep the dialog open after a successful form submission */
|
|
30
|
+
closeOnSave?: boolean;
|
|
27
31
|
/** Start dialog maximized */
|
|
28
32
|
startMaximized?: boolean;
|
|
29
33
|
/** Screen width in px where dialog starts fullscreen */
|
|
30
34
|
fullscreenBreakpoint?: number;
|
|
35
|
+
/** Viewport inset in px applied while the dialog or drawer is maximized */
|
|
36
|
+
edgeGap?: number;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
declare class DialogService {
|
|
@@ -53,6 +59,7 @@ interface CrudActionFormContract {
|
|
|
53
59
|
apiEndpointKey?: ApiEndpoint | string | null;
|
|
54
60
|
apiUrlEntry?: ApiUrlEntry | null;
|
|
55
61
|
initialValue?: Record<string, unknown> | null;
|
|
62
|
+
layoutPolicy?: DynamicFormLayoutPolicy | null;
|
|
56
63
|
}
|
|
57
64
|
type CrudActionResolutionMode = 'inferred' | 'explicit';
|
|
58
65
|
type CrudAction = (RowAction | ToolbarAction) & {
|
|
@@ -72,8 +79,13 @@ interface CrudDefaults {
|
|
|
72
79
|
}
|
|
73
80
|
interface CrudResource {
|
|
74
81
|
path: string;
|
|
82
|
+
schemaPath?: string | null;
|
|
75
83
|
idField?: string | number;
|
|
84
|
+
title?: string | null;
|
|
85
|
+
label?: string | null;
|
|
86
|
+
formTitle?: string | null;
|
|
76
87
|
endpointKey?: ApiEndpoint;
|
|
88
|
+
apiUrlEntry?: ApiUrlEntry | null;
|
|
77
89
|
}
|
|
78
90
|
interface CrudMetadata {
|
|
79
91
|
component: 'praxis-crud';
|
|
@@ -124,7 +136,18 @@ interface CrudValidationContext {
|
|
|
124
136
|
}
|
|
125
137
|
|
|
126
138
|
type CrudActionRuntimeEvent = {
|
|
127
|
-
|
|
139
|
+
action?: string;
|
|
140
|
+
actionConfig?: ToolbarAction | ResourceActionCatalogItem | ResourceSurfaceCatalogItem | {
|
|
141
|
+
id?: string;
|
|
142
|
+
action?: string;
|
|
143
|
+
label?: string;
|
|
144
|
+
resourceKey?: string;
|
|
145
|
+
} | null;
|
|
146
|
+
row?: Record<string, unknown>;
|
|
147
|
+
selectedRow?: Record<string, unknown>;
|
|
148
|
+
selectedRows?: Record<string, unknown>[];
|
|
149
|
+
rows?: Record<string, unknown>[];
|
|
150
|
+
resourceIdentity?: MaterializedResourceIdentity | null;
|
|
128
151
|
};
|
|
129
152
|
type CrudContextAction = {
|
|
130
153
|
action: string;
|
|
@@ -149,6 +172,8 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
149
172
|
componentInstanceId?: string;
|
|
150
173
|
context?: Record<string, unknown>;
|
|
151
174
|
enableCustomization: boolean;
|
|
175
|
+
/** Capability publica exigida para authoring governado do CRUD e da tabela interna. */
|
|
176
|
+
authoringCapability: string | null;
|
|
152
177
|
configureRequested: EventEmitter<void>;
|
|
153
178
|
afterOpen: EventEmitter<{
|
|
154
179
|
mode: FormOpenMode;
|
|
@@ -181,6 +206,7 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
181
206
|
private table;
|
|
182
207
|
private readonly storage;
|
|
183
208
|
private readonly settingsPanel;
|
|
209
|
+
private readonly enterpriseRuntimeContext;
|
|
184
210
|
private readonly snack;
|
|
185
211
|
private readonly dialog;
|
|
186
212
|
private readonly i18n;
|
|
@@ -188,8 +214,10 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
188
214
|
private resourceDiscoveryInstance?;
|
|
189
215
|
private actionOpenAdapterInstance?;
|
|
190
216
|
private surfaceOpenAdapterInstance?;
|
|
217
|
+
private materializedRefreshSequence;
|
|
191
218
|
private readonly global;
|
|
192
219
|
private readonly surfaceService;
|
|
220
|
+
private readonly surfaceOutlets;
|
|
193
221
|
private readonly componentKeys;
|
|
194
222
|
private readonly route;
|
|
195
223
|
private warnedMissingId;
|
|
@@ -199,16 +227,21 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
199
227
|
private lastAppliedResourceIdentity;
|
|
200
228
|
private tableCollectionLinks;
|
|
201
229
|
private collectionCapabilities;
|
|
230
|
+
private activeAuthoringPanelRef;
|
|
231
|
+
constructor();
|
|
202
232
|
private collectionCapabilitiesRequestHref;
|
|
203
233
|
private collectionCapabilitiesResolvedHref;
|
|
204
234
|
private collectionCapabilitiesRequestSeq;
|
|
205
235
|
private currentAuthoringDocument?;
|
|
236
|
+
selectedRow: Record<string, unknown> | null;
|
|
206
237
|
private getResourceDiscovery;
|
|
207
238
|
private getActionOpenAdapter;
|
|
208
239
|
private getSurfaceOpenAdapter;
|
|
209
240
|
onResetPreferences(): void;
|
|
210
241
|
onTableRowClick(event: unknown): void;
|
|
211
242
|
onTableSelectionChange(event: unknown): void;
|
|
243
|
+
onBulkAction(event: CrudActionRuntimeEvent): Promise<void>;
|
|
244
|
+
onToolbarAction(event: CrudActionRuntimeEvent): Promise<void>;
|
|
212
245
|
ngOnChanges(changes: SimpleChanges): void;
|
|
213
246
|
onAction(action: string, row?: Record<string, unknown>, runtimeEvent?: CrudActionRuntimeEvent): Promise<void>;
|
|
214
247
|
private hasExplicitOpenBinding;
|
|
@@ -225,7 +258,13 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
225
258
|
getEmptyStatePrimaryAction(): string;
|
|
226
259
|
onConfigureRequested(): void;
|
|
227
260
|
private tryHandleCanonicalDeleteAction;
|
|
261
|
+
private tryHandleCanonicalDuplicateDraftAction;
|
|
228
262
|
private refreshTable;
|
|
263
|
+
private tryRefreshMaterializedLocalData;
|
|
264
|
+
private isCurrentMaterializedRefresh;
|
|
265
|
+
private resolveMaterializedReadUrl;
|
|
266
|
+
private unwrapRestData;
|
|
267
|
+
private extractCollectionData;
|
|
229
268
|
private emitTableRuntimeConfigSnapshot;
|
|
230
269
|
private applyResolvedCrudState;
|
|
231
270
|
private assignTableConfigForBinding;
|
|
@@ -234,6 +273,12 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
234
273
|
private syncRuntimeBindings;
|
|
235
274
|
private resolveQueryContext;
|
|
236
275
|
private resolveFilterCriteria;
|
|
276
|
+
private extractRowFromEvent;
|
|
277
|
+
private extractSelectedRowFromEvent;
|
|
278
|
+
private extractSelectedRowFromBulkAction;
|
|
279
|
+
private extractSelectedRowFromToolbarAction;
|
|
280
|
+
private extractDiscoveryActionConfig;
|
|
281
|
+
private resolveSelectedRowForAction;
|
|
237
282
|
private tryOpenDiscoveredCrudSurface;
|
|
238
283
|
private resolveDiscoveredSurfaceCatalog;
|
|
239
284
|
private tryOpenDiscoveredWorkflowAction;
|
|
@@ -251,8 +296,12 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
251
296
|
private handleDiscoveredSurfaceResult;
|
|
252
297
|
private buildEffectiveTableConfig;
|
|
253
298
|
private isAddLike;
|
|
299
|
+
private normalizeCrudActionName;
|
|
300
|
+
private shouldCanonicalizeToolbarCreateAction;
|
|
301
|
+
private isCreateActionAliasName;
|
|
254
302
|
private buildTableCrudContext;
|
|
255
303
|
private readonly openCrudAuthoringFromTable;
|
|
304
|
+
isCustomizationAvailable(): boolean;
|
|
256
305
|
private applyCrudAuthoringPayload;
|
|
257
306
|
private buildWidgetPersistencePayload;
|
|
258
307
|
private resolveCreateToolbarAction;
|
|
@@ -274,9 +323,12 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
274
323
|
private componentKeyId;
|
|
275
324
|
private warnMissingId;
|
|
276
325
|
private getCrudActionLabel;
|
|
326
|
+
private ensureCanonicalCollectionEmptyState;
|
|
277
327
|
private tx;
|
|
328
|
+
private txWithParams;
|
|
329
|
+
private interpolateTranslationParams;
|
|
278
330
|
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>;
|
|
331
|
+
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
332
|
}
|
|
281
333
|
|
|
282
334
|
type CrudDrawerResultType = 'save' | 'delete' | 'close';
|
|
@@ -298,6 +350,7 @@ declare class CrudLauncherService {
|
|
|
298
350
|
}, runtime?: {
|
|
299
351
|
capabilities?: ResourceCapabilitySnapshot | null;
|
|
300
352
|
links?: RestApiLinks | null;
|
|
353
|
+
resourceIdentity?: MaterializedResourceIdentity | null;
|
|
301
354
|
}): Promise<{
|
|
302
355
|
mode: FormOpenMode;
|
|
303
356
|
ref?: DialogRef<any>;
|
|
@@ -306,6 +359,7 @@ declare class CrudLauncherService {
|
|
|
306
359
|
private buildRoute;
|
|
307
360
|
private mapInputs;
|
|
308
361
|
private resolveActionForLaunch;
|
|
362
|
+
private resolveSubmitUrlTemplate;
|
|
309
363
|
private resolveActionFormContract;
|
|
310
364
|
resolveRuntimeContract(action: CrudAction, row: Record<string, unknown> | undefined, metadata: CrudMetadata, runtime?: {
|
|
311
365
|
capabilities?: ResourceCapabilitySnapshot | null;
|
|
@@ -316,10 +370,14 @@ declare class CrudLauncherService {
|
|
|
316
370
|
submitMethod?: string | null;
|
|
317
371
|
apiEndpointKey?: unknown;
|
|
318
372
|
apiUrlEntry?: unknown;
|
|
373
|
+
layoutPolicy?: unknown;
|
|
319
374
|
};
|
|
320
375
|
private buildInferredFormId;
|
|
321
376
|
private isCanonicalCrudAction;
|
|
377
|
+
private normalizeActionForLaunch;
|
|
378
|
+
private normalizeCrudOperationName;
|
|
322
379
|
private isExplicitCrudAction;
|
|
380
|
+
private defaultInferredLayoutPolicy;
|
|
323
381
|
private mergeCrudOverrides;
|
|
324
382
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CrudLauncherService, never>;
|
|
325
383
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CrudLauncherService>;
|
|
@@ -333,35 +391,51 @@ declare class DynamicFormDialogHostComponent implements OnInit {
|
|
|
333
391
|
private configStorage;
|
|
334
392
|
formComp?: PraxisDynamicForm;
|
|
335
393
|
modal: any;
|
|
394
|
+
presentation: 'modal' | 'drawer';
|
|
336
395
|
maximized: boolean;
|
|
337
396
|
private initialSize;
|
|
397
|
+
private readonly initialPosition?;
|
|
338
398
|
private rememberState;
|
|
339
399
|
private stateKey?;
|
|
340
400
|
private backDefaults;
|
|
341
401
|
private destroyRef;
|
|
402
|
+
private readonly i18n;
|
|
342
403
|
resourcePath?: string;
|
|
343
404
|
resourceId?: string | number;
|
|
344
405
|
initialValue?: Record<string, unknown> | null;
|
|
406
|
+
resourceIdentity: MaterializedResourceIdentity | null;
|
|
345
407
|
schemaUrl?: string | null;
|
|
346
408
|
submitUrl?: string | null;
|
|
347
409
|
submitMethod?: string | null;
|
|
348
410
|
apiEndpointKey?: ApiEndpoint | string | null;
|
|
349
411
|
apiUrlEntry?: ApiUrlEntry | null;
|
|
412
|
+
layoutPolicy?: DynamicFormLayoutPolicy | null;
|
|
413
|
+
formConfig: FormConfig;
|
|
350
414
|
formActions?: FormConfig['actions'];
|
|
415
|
+
readonly formConfigPersistenceStrategy = "input-first";
|
|
351
416
|
mode: 'create' | 'edit' | 'view';
|
|
352
417
|
backConfig?: BackConfig;
|
|
353
418
|
private idField;
|
|
354
419
|
texts: Record<string, string>;
|
|
355
420
|
constructor(dialogRef: DialogRef<DynamicFormDialogHostComponent>, data: any, dialogService: DialogService, crud: GenericCrudService<any>, configStorage: AsyncConfigStorage);
|
|
356
421
|
private extractInitialValue;
|
|
422
|
+
private resolveFormConfig;
|
|
423
|
+
get dialogTitle(): string;
|
|
424
|
+
private resolveActionDialogTitle;
|
|
425
|
+
private resolveResourceTitle;
|
|
357
426
|
private resolveFormActions;
|
|
427
|
+
private resolveLayoutPolicy;
|
|
358
428
|
private resolveSubmitLabel;
|
|
359
429
|
ngOnInit(): void;
|
|
360
430
|
onSave(result: unknown): void;
|
|
361
431
|
onCancel(): void;
|
|
362
432
|
toggleMaximize(initial?: boolean): void;
|
|
433
|
+
private resolveOverlayPane;
|
|
434
|
+
private captureRenderedInitialSize;
|
|
363
435
|
private saveState;
|
|
364
436
|
private applySavedState;
|
|
437
|
+
private updateHostPosition;
|
|
438
|
+
private resolveMaximizedDrawerPosition;
|
|
365
439
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DynamicFormDialogHostComponent, never>;
|
|
366
440
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DynamicFormDialogHostComponent, "praxis-dynamic-form-dialog-host", never, {}, {}, never, never, true, never>;
|
|
367
441
|
}
|
|
@@ -604,6 +678,7 @@ interface PraxisCrudWidgetEditorInputs {
|
|
|
604
678
|
componentInstanceId?: string;
|
|
605
679
|
context?: Record<string, unknown>;
|
|
606
680
|
enableCustomization?: boolean;
|
|
681
|
+
authoringCapability?: string | null;
|
|
607
682
|
[key: string]: unknown;
|
|
608
683
|
}
|
|
609
684
|
interface PraxisCrudWidgetEditorValue {
|