@acorex/platform 21.0.0-next.2 → 21.0.0-next.3
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/auth/index.d.ts +97 -238
- package/common/index.d.ts +778 -213
- package/core/index.d.ts +562 -433
- package/fesm2022/acorex-platform-auth.mjs +160 -200
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1012 -125
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +685 -400
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +54 -11
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +412 -270
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +2112 -3153
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +756 -648
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +4 -4
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +248 -174
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs → acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +3058 -1038
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs → acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs} +26 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs → acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs} +4 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs → acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +166 -30
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +27 -27
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/layout/builder/index.d.ts +4 -1
- package/layout/components/index.d.ts +405 -327
- package/layout/designer/index.d.ts +3 -3
- package/layout/entity/index.d.ts +163 -108
- package/layout/widget-core/index.d.ts +39 -49
- package/layout/widgets/index.d.ts +368 -54
- package/package.json +5 -5
- package/themes/default/index.d.ts +15 -2
- package/themes/shared/index.d.ts +10 -10
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +0 -55
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +0 -48
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, makeEnvironmentProviders, inject, NgModule, Injectable } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { AXPEntityService } from '@acorex/platform/layout/entity';
|
|
4
4
|
import { AXPCommandRegistry, AXPQueryRegistry, AXPRuntimeModule } from '@acorex/platform/runtime';
|
|
5
5
|
|
|
6
6
|
const AXP_ENTITY_CRUD_SETUP = new InjectionToken('AXP_ENTITY_CRUD_SETUP');
|
|
@@ -12,14 +12,18 @@ function provideEntity(entityKeys) {
|
|
|
12
12
|
useFactory: () => {
|
|
13
13
|
const commandRegistry = inject(AXPCommandRegistry);
|
|
14
14
|
const queryRegistry = inject(AXPQueryRegistry);
|
|
15
|
+
const entityService = inject(AXPEntityService);
|
|
15
16
|
for (const entityKey of entityKeys) {
|
|
16
|
-
const
|
|
17
|
+
const dataAccessor = entityService.withEntity(entityKey).data();
|
|
17
18
|
// Register Commands
|
|
18
19
|
commandRegistry.register(`${entityKey}:Create`, async () => ({
|
|
19
20
|
execute: async (input) => {
|
|
20
21
|
try {
|
|
21
|
-
const id = await
|
|
22
|
-
const entity = await
|
|
22
|
+
const id = await dataAccessor.create(input);
|
|
23
|
+
const entity = await dataAccessor.byKey(id);
|
|
24
|
+
if (!entity) {
|
|
25
|
+
throw new Error('Entity not found after creation');
|
|
26
|
+
}
|
|
23
27
|
return {
|
|
24
28
|
success: true,
|
|
25
29
|
data: entity,
|
|
@@ -38,7 +42,7 @@ function provideEntity(entityKeys) {
|
|
|
38
42
|
commandRegistry.register(`${entityKey}:Update`, async () => ({
|
|
39
43
|
execute: async ({ id, ...rest }) => {
|
|
40
44
|
try {
|
|
41
|
-
const updated = await
|
|
45
|
+
const updated = await dataAccessor.update(id, rest);
|
|
42
46
|
return {
|
|
43
47
|
success: true,
|
|
44
48
|
data: updated,
|
|
@@ -57,7 +61,7 @@ function provideEntity(entityKeys) {
|
|
|
57
61
|
commandRegistry.register(`${entityKey}:Delete`, async () => ({
|
|
58
62
|
execute: async (id) => {
|
|
59
63
|
try {
|
|
60
|
-
await
|
|
64
|
+
await dataAccessor.delete(id);
|
|
61
65
|
return {
|
|
62
66
|
success: true,
|
|
63
67
|
};
|
|
@@ -74,19 +78,58 @@ function provideEntity(entityKeys) {
|
|
|
74
78
|
}));
|
|
75
79
|
// Register Queries
|
|
76
80
|
queryRegistry.register(`${entityKey}:GetById`, async () => ({
|
|
77
|
-
fetch: (id) =>
|
|
81
|
+
fetch: (id) => dataAccessor.byKey(id)
|
|
78
82
|
}));
|
|
79
83
|
queryRegistry.register(`${entityKey}:GetList`, async () => ({
|
|
80
|
-
fetch: (request) =>
|
|
84
|
+
fetch: (request) => dataAccessor.query(request)
|
|
81
85
|
}));
|
|
86
|
+
// Implement getRoots, getChildren, and getByCategory using query with appropriate filters
|
|
82
87
|
queryRegistry.register(`${entityKey}:GetRoots`, async () => ({
|
|
83
|
-
fetch: (request) =>
|
|
88
|
+
fetch: async (request) => {
|
|
89
|
+
return await dataAccessor.query({
|
|
90
|
+
skip: 0,
|
|
91
|
+
take: 1000,
|
|
92
|
+
filter: {
|
|
93
|
+
field: 'parentId',
|
|
94
|
+
operator: {
|
|
95
|
+
type: 'isEmpty',
|
|
96
|
+
},
|
|
97
|
+
value: true,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
84
101
|
}));
|
|
85
102
|
queryRegistry.register(`${entityKey}:GetChildren`, async () => ({
|
|
86
|
-
fetch: (request) =>
|
|
103
|
+
fetch: async (request) => {
|
|
104
|
+
const parentKey = request.parentKey ?? 'parentId';
|
|
105
|
+
return await dataAccessor.query({
|
|
106
|
+
skip: 0,
|
|
107
|
+
take: 1000,
|
|
108
|
+
filter: {
|
|
109
|
+
field: parentKey,
|
|
110
|
+
operator: {
|
|
111
|
+
type: 'equal',
|
|
112
|
+
},
|
|
113
|
+
value: request.parentId,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
87
117
|
}));
|
|
88
118
|
queryRegistry.register(`${entityKey}:GetByCategory`, async () => ({
|
|
89
|
-
fetch: (request) =>
|
|
119
|
+
fetch: async (request) => {
|
|
120
|
+
const categoryKey = request.categoryKey ?? 'categoryIds';
|
|
121
|
+
return await dataAccessor.query({
|
|
122
|
+
skip: 0,
|
|
123
|
+
take: 1000,
|
|
124
|
+
filter: {
|
|
125
|
+
field: categoryKey,
|
|
126
|
+
operator: {
|
|
127
|
+
type: 'contains',
|
|
128
|
+
},
|
|
129
|
+
value: request.categoryId,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
90
133
|
}));
|
|
91
134
|
}
|
|
92
135
|
return true;
|