@praxisui/crud 8.0.0-beta.20 → 8.0.0-beta.22
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/fesm2022/praxisui-crud.mjs +107 -3
- package/index.d.ts +36 -3
- package/package.json +7 -7
|
@@ -4,7 +4,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
4
4
|
import { HttpClient } from '@angular/common/http';
|
|
5
5
|
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
|
|
6
6
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
7
|
-
import { firstValueFrom, BehaviorSubject } from 'rxjs';
|
|
7
|
+
import { firstValueFrom, BehaviorSubject, Subscription } from 'rxjs';
|
|
8
8
|
import * as i2$1 from '@praxisui/core';
|
|
9
9
|
import { ASYNC_CONFIG_STORAGE, GlobalConfigService, CrudOperationResolutionService, fillUndefined, SETTINGS_PANEL_DATA, PraxisI18nService, providePraxisI18nConfig, createDefaultTableConfig, ResourceDiscoveryService, ResourceActionOpenAdapterService, ResourceSurfaceOpenAdapterService, GLOBAL_SURFACE_SERVICE, ComponentKeyService, translateUnavailableWorkflowMessage, EmptyStateCardComponent, RESOURCE_DISCOVERY_I18N_CONFIG, PraxisIconDirective, GenericCrudService, ComponentMetadataRegistry } from '@praxisui/core';
|
|
10
10
|
import { SettingsPanelService } from '@praxisui/settings-panel';
|
|
@@ -4439,7 +4439,7 @@ class PraxisCrudComponent {
|
|
|
4439
4439
|
/>
|
|
4440
4440
|
}
|
|
4441
4441
|
}
|
|
4442
|
-
`, 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", "exportAction", "columnReorder", "columnReorderAttempt", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "metadataChange", "loadingStateChange", "collectionLinksChange", "selectionChange"] }, { kind: "component", type: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone"] }] });
|
|
4442
|
+
`, 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", "horizontalScroll", "enableCustomization", "dense"], outputs: ["rowClick", "rowDoubleClick", "rowExpansionChange", "rowAction", "toolbarAction", "bulkAction", "exportAction", "columnReorder", "columnReorderAttempt", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "metadataChange", "loadingStateChange", "collectionLinksChange", "selectionChange"] }, { kind: "component", type: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone"] }] });
|
|
4443
4443
|
}
|
|
4444
4444
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisCrudComponent, decorators: [{
|
|
4445
4445
|
type: Component,
|
|
@@ -4963,6 +4963,102 @@ var dynamicFormDialogHost_component = /*#__PURE__*/Object.freeze({
|
|
|
4963
4963
|
DynamicFormDialogHostComponent: DynamicFormDialogHostComponent
|
|
4964
4964
|
});
|
|
4965
4965
|
|
|
4966
|
+
class PraxisCrudWidgetConfigEditor {
|
|
4967
|
+
inputs = null;
|
|
4968
|
+
widgetKey;
|
|
4969
|
+
crudEditor;
|
|
4970
|
+
isDirty$ = new BehaviorSubject(false);
|
|
4971
|
+
isValid$ = new BehaviorSubject(true);
|
|
4972
|
+
isBusy$ = new BehaviorSubject(false);
|
|
4973
|
+
subscription = new Subscription();
|
|
4974
|
+
ngAfterViewInit() {
|
|
4975
|
+
if (!this.crudEditor) {
|
|
4976
|
+
return;
|
|
4977
|
+
}
|
|
4978
|
+
this.subscription.add(this.crudEditor.isDirty$.subscribe((value) => this.isDirty$.next(value)));
|
|
4979
|
+
this.subscription.add(this.crudEditor.isValid$.subscribe((value) => this.isValid$.next(value)));
|
|
4980
|
+
this.subscription.add(this.crudEditor.isBusy$.subscribe((value) => this.isBusy$.next(value)));
|
|
4981
|
+
}
|
|
4982
|
+
ngOnDestroy() {
|
|
4983
|
+
this.subscription.unsubscribe();
|
|
4984
|
+
}
|
|
4985
|
+
get metadata() {
|
|
4986
|
+
return this.createDocumentFromInputs().metadata;
|
|
4987
|
+
}
|
|
4988
|
+
get effectiveCrudId() {
|
|
4989
|
+
return this.inputs?.crudId ?? this.widgetKey ?? null;
|
|
4990
|
+
}
|
|
4991
|
+
getSettingsValue() {
|
|
4992
|
+
return this.buildValue(this.crudEditor?.getSettingsValue());
|
|
4993
|
+
}
|
|
4994
|
+
onSave() {
|
|
4995
|
+
return this.buildValue(this.crudEditor?.onSave?.() ?? this.crudEditor?.getSettingsValue());
|
|
4996
|
+
}
|
|
4997
|
+
reset() {
|
|
4998
|
+
this.crudEditor?.reset?.();
|
|
4999
|
+
}
|
|
5000
|
+
buildValue(rawPayload) {
|
|
5001
|
+
const document = this.extractDocument(rawPayload);
|
|
5002
|
+
return {
|
|
5003
|
+
inputs: {
|
|
5004
|
+
...(this.inputs ?? {}),
|
|
5005
|
+
metadata: document.metadata,
|
|
5006
|
+
crudId: this.inputs?.crudId ?? this.widgetKey,
|
|
5007
|
+
componentInstanceId: this.inputs?.componentInstanceId ?? this.widgetKey,
|
|
5008
|
+
context: this.inputs?.context,
|
|
5009
|
+
enableCustomization: this.inputs?.enableCustomization ?? false,
|
|
5010
|
+
},
|
|
5011
|
+
};
|
|
5012
|
+
}
|
|
5013
|
+
createDocumentFromInputs() {
|
|
5014
|
+
return parseLegacyOrCrudDocument(this.inputs?.metadata ?? {
|
|
5015
|
+
component: 'praxis-crud',
|
|
5016
|
+
table: { columns: [] },
|
|
5017
|
+
});
|
|
5018
|
+
}
|
|
5019
|
+
extractDocument(rawPayload) {
|
|
5020
|
+
const payload = rawPayload;
|
|
5021
|
+
return parseLegacyOrCrudDocument(payload?.document ??
|
|
5022
|
+
payload?.metadata ??
|
|
5023
|
+
serializeCrudAuthoringDocument(this.createDocumentFromInputs()));
|
|
5024
|
+
}
|
|
5025
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisCrudWidgetConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5026
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: PraxisCrudWidgetConfigEditor, isStandalone: true, selector: "praxis-crud-widget-config-editor", inputs: { inputs: "inputs", widgetKey: "widgetKey" }, viewQueries: [{ propertyName: "crudEditor", first: true, predicate: ["crudEditor"], descendants: true }], ngImport: i0, template: `
|
|
5027
|
+
<section data-testid="crud-widget-config-editor">
|
|
5028
|
+
<praxis-crud-metadata-editor
|
|
5029
|
+
#crudEditor
|
|
5030
|
+
[metadata]="metadata"
|
|
5031
|
+
[crudId]="effectiveCrudId"
|
|
5032
|
+
/>
|
|
5033
|
+
</section>
|
|
5034
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CrudMetadataEditorComponent, selector: "praxis-crud-metadata-editor", inputs: ["document", "metadata", "crudId", "readonly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5035
|
+
}
|
|
5036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisCrudWidgetConfigEditor, decorators: [{
|
|
5037
|
+
type: Component,
|
|
5038
|
+
args: [{
|
|
5039
|
+
selector: 'praxis-crud-widget-config-editor',
|
|
5040
|
+
standalone: true,
|
|
5041
|
+
imports: [CommonModule, CrudMetadataEditorComponent],
|
|
5042
|
+
template: `
|
|
5043
|
+
<section data-testid="crud-widget-config-editor">
|
|
5044
|
+
<praxis-crud-metadata-editor
|
|
5045
|
+
#crudEditor
|
|
5046
|
+
[metadata]="metadata"
|
|
5047
|
+
[crudId]="effectiveCrudId"
|
|
5048
|
+
/>
|
|
5049
|
+
</section>
|
|
5050
|
+
`,
|
|
5051
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5052
|
+
}]
|
|
5053
|
+
}], propDecorators: { inputs: [{
|
|
5054
|
+
type: Input
|
|
5055
|
+
}], widgetKey: [{
|
|
5056
|
+
type: Input
|
|
5057
|
+
}], crudEditor: [{
|
|
5058
|
+
type: ViewChild,
|
|
5059
|
+
args: ['crudEditor']
|
|
5060
|
+
}] } });
|
|
5061
|
+
|
|
4966
5062
|
/** Metadata for PraxisCrudComponent */
|
|
4967
5063
|
const PRAXIS_CRUD_COMPONENT_METADATA = {
|
|
4968
5064
|
id: 'praxis-crud',
|
|
@@ -4971,6 +5067,14 @@ const PRAXIS_CRUD_COMPONENT_METADATA = {
|
|
|
4971
5067
|
friendlyName: 'Praxis CRUD',
|
|
4972
5068
|
description: 'Tabela com operações de CRUD via metadados.',
|
|
4973
5069
|
icon: 'table_chart',
|
|
5070
|
+
authoringManifestRef: {
|
|
5071
|
+
componentId: 'praxis-crud',
|
|
5072
|
+
source: 'PRAXIS_CRUD_AUTHORING_MANIFEST',
|
|
5073
|
+
},
|
|
5074
|
+
configEditor: {
|
|
5075
|
+
component: PraxisCrudWidgetConfigEditor,
|
|
5076
|
+
title: 'Configurar CRUD',
|
|
5077
|
+
},
|
|
4974
5078
|
inputs: [
|
|
4975
5079
|
{
|
|
4976
5080
|
name: 'metadata',
|
|
@@ -5792,4 +5896,4 @@ const PRAXIS_CRUD_AUTHORING_MANIFEST = {
|
|
|
5792
5896
|
* Generated bundle index. Do not edit.
|
|
5793
5897
|
*/
|
|
5794
5898
|
|
|
5795
|
-
export { CRUD_AI_CAPABILITIES, CrudLauncherService, CrudMetadataEditorComponent, CrudPageHeaderComponent, DialogService, DynamicFormDialogHostComponent, PRAXIS_CRUD_AUTHORING_MANIFEST, PRAXIS_CRUD_COMPONENT_METADATA, PraxisCrudComponent, assertCrudMetadata, createCrudAuthoringDocument, findCrudAction, normalizeCrudAuthoringDocument, openCrudMetadataEditor, parseLegacyOrCrudDocument, providePraxisCrudMetadata, serializeCrudAuthoringDocument, validateCrudAuthoringDocument };
|
|
5899
|
+
export { CRUD_AI_CAPABILITIES, CrudLauncherService, CrudMetadataEditorComponent, CrudPageHeaderComponent, DialogService, DynamicFormDialogHostComponent, PRAXIS_CRUD_AUTHORING_MANIFEST, PRAXIS_CRUD_COMPONENT_METADATA, PraxisCrudComponent, PraxisCrudWidgetConfigEditor, assertCrudMetadata, createCrudAuthoringDocument, findCrudAction, normalizeCrudAuthoringDocument, openCrudMetadataEditor, parseLegacyOrCrudDocument, providePraxisCrudMetadata, serializeCrudAuthoringDocument, validateCrudAuthoringDocument };
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _praxisui_core from '@praxisui/core';
|
|
|
2
2
|
import { ApiEndpoint, TableConfig, PraxisDataQueryContext, FormConfig, BackConfig, RowAction, ToolbarAction, ApiUrlEntry, ResourceActionCatalogItem, ResourceSurfaceCatalogItem, LoadingState, RestApiLinks, ResourceCapabilitySnapshot, GenericCrudService, AsyncConfigStorage, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog, ComponentAuthoringManifest, SettingsValueProvider } from '@praxisui/core';
|
|
3
3
|
export { BackConfig } from '@praxisui/core';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
|
-
import { NgZone, OnChanges, EventEmitter, SimpleChanges, OnInit, Provider } from '@angular/core';
|
|
5
|
+
import { NgZone, OnChanges, EventEmitter, SimpleChanges, OnInit, Provider, AfterViewInit, OnDestroy } from '@angular/core';
|
|
6
6
|
import { MatDialogConfig, MatDialogRef, MatDialog } from '@angular/material/dialog';
|
|
7
7
|
export { MAT_DIALOG_DATA as DIALOG_DATA } from '@angular/material/dialog';
|
|
8
8
|
import { ComponentType } from '@angular/cdk/portal';
|
|
@@ -586,6 +586,39 @@ declare class CrudMetadataEditorComponent implements SettingsValueProvider {
|
|
|
586
586
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CrudMetadataEditorComponent, "praxis-crud-metadata-editor", never, { "documentInput": { "alias": "document"; "required": false; "isSignal": true; }; "metadataInput": { "alias": "metadata"; "required": false; "isSignal": true; }; "crudIdInput": { "alias": "crudId"; "required": false; "isSignal": true; }; "readonlyInput": { "alias": "readonly"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
587
587
|
}
|
|
588
588
|
|
|
589
|
+
interface PraxisCrudWidgetEditorInputs {
|
|
590
|
+
metadata?: CrudMetadata | string | null;
|
|
591
|
+
crudId?: string;
|
|
592
|
+
componentInstanceId?: string;
|
|
593
|
+
context?: Record<string, unknown>;
|
|
594
|
+
enableCustomization?: boolean;
|
|
595
|
+
[key: string]: unknown;
|
|
596
|
+
}
|
|
597
|
+
interface PraxisCrudWidgetEditorValue {
|
|
598
|
+
inputs: PraxisCrudWidgetEditorInputs;
|
|
599
|
+
}
|
|
600
|
+
declare class PraxisCrudWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
|
|
601
|
+
inputs: PraxisCrudWidgetEditorInputs | null;
|
|
602
|
+
widgetKey?: string;
|
|
603
|
+
crudEditor?: CrudMetadataEditorComponent;
|
|
604
|
+
readonly isDirty$: BehaviorSubject<boolean>;
|
|
605
|
+
readonly isValid$: BehaviorSubject<boolean>;
|
|
606
|
+
readonly isBusy$: BehaviorSubject<boolean>;
|
|
607
|
+
private readonly subscription;
|
|
608
|
+
ngAfterViewInit(): void;
|
|
609
|
+
ngOnDestroy(): void;
|
|
610
|
+
get metadata(): CrudMetadata;
|
|
611
|
+
get effectiveCrudId(): string | null;
|
|
612
|
+
getSettingsValue(): PraxisCrudWidgetEditorValue;
|
|
613
|
+
onSave(): PraxisCrudWidgetEditorValue;
|
|
614
|
+
reset(): void;
|
|
615
|
+
private buildValue;
|
|
616
|
+
private createDocumentFromInputs;
|
|
617
|
+
private extractDocument;
|
|
618
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PraxisCrudWidgetConfigEditor, never>;
|
|
619
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisCrudWidgetConfigEditor, "praxis-crud-widget-config-editor", never, { "inputs": { "alias": "inputs"; "required": false; }; "widgetKey": { "alias": "widgetKey"; "required": false; }; }, {}, never, never, true, never>;
|
|
620
|
+
}
|
|
621
|
+
|
|
589
622
|
type OpenCrudMetadataEditorOptions = {
|
|
590
623
|
id?: string;
|
|
591
624
|
title?: string;
|
|
@@ -597,5 +630,5 @@ type OpenCrudMetadataEditorOptions = {
|
|
|
597
630
|
};
|
|
598
631
|
declare function openCrudMetadataEditor(settings: SettingsPanelService, opts?: OpenCrudMetadataEditorOptions): _praxisui_settings_panel.SettingsPanelRef;
|
|
599
632
|
|
|
600
|
-
export { CRUD_AI_CAPABILITIES, CrudLauncherService, CrudMetadataEditorComponent, CrudPageHeaderComponent, DialogService, DynamicFormDialogHostComponent, PRAXIS_CRUD_AUTHORING_MANIFEST, PRAXIS_CRUD_COMPONENT_METADATA, PraxisCrudComponent, assertCrudMetadata, createCrudAuthoringDocument, findCrudAction, normalizeCrudAuthoringDocument, openCrudMetadataEditor, parseLegacyOrCrudDocument, providePraxisCrudMetadata, serializeCrudAuthoringDocument, validateCrudAuthoringDocument };
|
|
601
|
-
export type { Capability, CapabilityCatalog, CapabilityCategory, CrudAction, CrudActionFormContract, CrudActionResolutionMode, CrudAuthoringDocument, CrudAuthoringWidgetPersistenceEvent, CrudDefaults, CrudEditorDiagnostic, CrudHeaderConfig, CrudHeaderVariant, CrudMetadata, CrudMetadataAssertionOptions, CrudParamMapping, CrudResource, CrudValidationContext, DialogConfig, DialogRef, FormOpenMode, OpenCrudMetadataEditorOptions, ValueKind };
|
|
633
|
+
export { CRUD_AI_CAPABILITIES, CrudLauncherService, CrudMetadataEditorComponent, CrudPageHeaderComponent, DialogService, DynamicFormDialogHostComponent, PRAXIS_CRUD_AUTHORING_MANIFEST, PRAXIS_CRUD_COMPONENT_METADATA, PraxisCrudComponent, PraxisCrudWidgetConfigEditor, assertCrudMetadata, createCrudAuthoringDocument, findCrudAction, normalizeCrudAuthoringDocument, openCrudMetadataEditor, parseLegacyOrCrudDocument, providePraxisCrudMetadata, serializeCrudAuthoringDocument, validateCrudAuthoringDocument };
|
|
634
|
+
export type { Capability, CapabilityCatalog, CapabilityCategory, CrudAction, CrudActionFormContract, CrudActionResolutionMode, CrudAuthoringDocument, CrudAuthoringWidgetPersistenceEvent, CrudDefaults, CrudEditorDiagnostic, CrudHeaderConfig, CrudHeaderVariant, CrudMetadata, CrudMetadataAssertionOptions, CrudParamMapping, CrudResource, CrudValidationContext, DialogConfig, DialogRef, FormOpenMode, OpenCrudMetadataEditorOptions, PraxisCrudWidgetEditorInputs, PraxisCrudWidgetEditorValue, ValueKind };
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/crud",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.22",
|
|
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": "^8.0.0-beta.
|
|
9
|
-
"@praxisui/table": "^8.0.0-beta.
|
|
10
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
11
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
12
|
-
"@praxisui/settings-panel": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/dynamic-form": "^8.0.0-beta.22",
|
|
9
|
+
"@praxisui/table": "^8.0.0-beta.22",
|
|
10
|
+
"@praxisui/core": "^8.0.0-beta.22",
|
|
11
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.22",
|
|
12
|
+
"@praxisui/settings-panel": "^8.0.0-beta.22",
|
|
13
13
|
"@angular/cdk": "^20.1.0",
|
|
14
14
|
"@angular/forms": "^20.1.0",
|
|
15
15
|
"@angular/material": "^20.1.0",
|
|
16
16
|
"@angular/router": "^20.1.0",
|
|
17
|
-
"@praxisui/ai": "^8.0.0-beta.
|
|
17
|
+
"@praxisui/ai": "^8.0.0-beta.22",
|
|
18
18
|
"rxjs": "~7.8.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|