@praxisui/crud 9.0.0-beta.59 → 9.0.0-beta.60
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-09T12:14:45.592Z",
|
|
4
4
|
"packageName": "@praxisui/crud",
|
|
5
|
-
"packageVersion": "9.0.0-beta.
|
|
5
|
+
"packageVersion": "9.0.0-beta.60",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 2,
|
|
@@ -3631,6 +3631,7 @@ class PraxisCrudComponent {
|
|
|
3631
3631
|
resourceDiscoveryInstance;
|
|
3632
3632
|
actionOpenAdapterInstance;
|
|
3633
3633
|
surfaceOpenAdapterInstance;
|
|
3634
|
+
materializedRefreshSequence = 0;
|
|
3634
3635
|
global = (() => {
|
|
3635
3636
|
try {
|
|
3636
3637
|
return inject(GlobalConfigService);
|
|
@@ -3712,6 +3713,7 @@ class PraxisCrudComponent {
|
|
|
3712
3713
|
if (!changes['metadata'] && !changes['context']) {
|
|
3713
3714
|
return;
|
|
3714
3715
|
}
|
|
3716
|
+
this.materializedRefreshSequence += 1;
|
|
3715
3717
|
try {
|
|
3716
3718
|
const parsed = typeof this.metadata === 'string'
|
|
3717
3719
|
? JSON.parse(this.metadata)
|
|
@@ -4003,8 +4005,77 @@ class PraxisCrudComponent {
|
|
|
4003
4005
|
return true;
|
|
4004
4006
|
}
|
|
4005
4007
|
refreshTable() {
|
|
4008
|
+
if (this.tryRefreshMaterializedLocalData()) {
|
|
4009
|
+
return;
|
|
4010
|
+
}
|
|
4006
4011
|
this.table.refetch();
|
|
4007
4012
|
}
|
|
4013
|
+
tryRefreshMaterializedLocalData() {
|
|
4014
|
+
const readUrl = this.resolveMaterializedReadUrl();
|
|
4015
|
+
if (!readUrl || this.resolveResourcePath(this.resolvedMetadata)) {
|
|
4016
|
+
return false;
|
|
4017
|
+
}
|
|
4018
|
+
const refreshSequence = ++this.materializedRefreshSequence;
|
|
4019
|
+
void firstValueFrom(this.getResourceDiscovery().fetchJson(readUrl, {
|
|
4020
|
+
endpointKey: this.resolvedMetadata.resource?.endpointKey,
|
|
4021
|
+
apiUrlEntry: this.resolvedMetadata.resource?.apiUrlEntry,
|
|
4022
|
+
}))
|
|
4023
|
+
.then((response) => {
|
|
4024
|
+
if (!this.isCurrentMaterializedRefresh(refreshSequence, readUrl)) {
|
|
4025
|
+
return;
|
|
4026
|
+
}
|
|
4027
|
+
const data = this.extractCollectionData(this.unwrapRestData(response));
|
|
4028
|
+
if (!data) {
|
|
4029
|
+
this.error.emit({
|
|
4030
|
+
code: 'CRUD_MATERIALIZED_REFRESH_INVALID_COLLECTION',
|
|
4031
|
+
readUrl,
|
|
4032
|
+
});
|
|
4033
|
+
return;
|
|
4034
|
+
}
|
|
4035
|
+
this.resolvedMetadata = {
|
|
4036
|
+
...this.resolvedMetadata,
|
|
4037
|
+
data,
|
|
4038
|
+
};
|
|
4039
|
+
this.applyResolvedCrudState(this.resolvedMetadata);
|
|
4040
|
+
this.cdr.markForCheck();
|
|
4041
|
+
})
|
|
4042
|
+
.catch((error) => this.error.emit(error));
|
|
4043
|
+
return true;
|
|
4044
|
+
}
|
|
4045
|
+
isCurrentMaterializedRefresh(refreshSequence, readUrl) {
|
|
4046
|
+
return (refreshSequence === this.materializedRefreshSequence &&
|
|
4047
|
+
this.resolveMaterializedReadUrl() === readUrl &&
|
|
4048
|
+
this.resolveResourcePath(this.resolvedMetadata).length === 0);
|
|
4049
|
+
}
|
|
4050
|
+
resolveMaterializedReadUrl() {
|
|
4051
|
+
const materialization = this.context?.['materialization'];
|
|
4052
|
+
return String(materialization?.['readUrl'] || '').trim();
|
|
4053
|
+
}
|
|
4054
|
+
unwrapRestData(value) {
|
|
4055
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && 'data' in value) {
|
|
4056
|
+
return value.data;
|
|
4057
|
+
}
|
|
4058
|
+
return value;
|
|
4059
|
+
}
|
|
4060
|
+
extractCollectionData(data) {
|
|
4061
|
+
if (Array.isArray(data)) {
|
|
4062
|
+
return data;
|
|
4063
|
+
}
|
|
4064
|
+
if (!data || typeof data !== 'object') {
|
|
4065
|
+
return null;
|
|
4066
|
+
}
|
|
4067
|
+
const record = data;
|
|
4068
|
+
if (Array.isArray(record['content'])) {
|
|
4069
|
+
return record['content'];
|
|
4070
|
+
}
|
|
4071
|
+
if (Array.isArray(record['items'])) {
|
|
4072
|
+
return record['items'];
|
|
4073
|
+
}
|
|
4074
|
+
if (Array.isArray(record['data'])) {
|
|
4075
|
+
return record['data'];
|
|
4076
|
+
}
|
|
4077
|
+
return null;
|
|
4078
|
+
}
|
|
4008
4079
|
emitTableRuntimeConfigSnapshot() {
|
|
4009
4080
|
const snapshot = this.getCurrentTableConfigSnapshot();
|
|
4010
4081
|
if (!snapshot)
|
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.60",
|
|
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.60",
|
|
9
|
+
"@praxisui/table": "^9.0.0-beta.60",
|
|
10
|
+
"@praxisui/core": "^9.0.0-beta.60",
|
|
11
|
+
"@praxisui/dynamic-fields": "^9.0.0-beta.60",
|
|
12
|
+
"@praxisui/settings-panel": "^9.0.0-beta.60",
|
|
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.60",
|
|
18
18
|
"rxjs": "~7.8.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
package/types/praxisui-crud.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
196
196
|
private resourceDiscoveryInstance?;
|
|
197
197
|
private actionOpenAdapterInstance?;
|
|
198
198
|
private surfaceOpenAdapterInstance?;
|
|
199
|
+
private materializedRefreshSequence;
|
|
199
200
|
private readonly global;
|
|
200
201
|
private readonly surfaceService;
|
|
201
202
|
private readonly componentKeys;
|
|
@@ -236,6 +237,11 @@ declare class PraxisCrudComponent implements OnChanges {
|
|
|
236
237
|
onConfigureRequested(): void;
|
|
237
238
|
private tryHandleCanonicalDeleteAction;
|
|
238
239
|
private refreshTable;
|
|
240
|
+
private tryRefreshMaterializedLocalData;
|
|
241
|
+
private isCurrentMaterializedRefresh;
|
|
242
|
+
private resolveMaterializedReadUrl;
|
|
243
|
+
private unwrapRestData;
|
|
244
|
+
private extractCollectionData;
|
|
239
245
|
private emitTableRuntimeConfigSnapshot;
|
|
240
246
|
private applyResolvedCrudState;
|
|
241
247
|
private assignTableConfigForBinding;
|