@acorex/platform 21.0.0-next.42 → 21.0.0-next.44
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/acorex-platform-auth.mjs +4 -0
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-common-common-settings.provider-G9XcXXOG.mjs → acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs} +22 -24
- package/fesm2022/acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +115 -23
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +172 -19
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +164 -24
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +235 -15
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +40 -5
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +539 -8
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +161 -130
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +65 -2
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +23 -24
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +39 -5
- package/types/acorex-platform-core.d.ts +21 -3
- package/types/acorex-platform-layout-builder.d.ts +63 -21
- package/types/acorex-platform-layout-components.d.ts +54 -3
- package/types/acorex-platform-layout-entity.d.ts +143 -6
- package/types/acorex-platform-layout-widgets.d.ts +19 -5
- package/types/acorex-platform-runtime.d.ts +6 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs.map +0 -1
|
@@ -1668,7 +1668,9 @@ class PropertyFilter {
|
|
|
1668
1668
|
d.setActions((a) => a.submit('@general:actions.close.title'));
|
|
1669
1669
|
}
|
|
1670
1670
|
else {
|
|
1671
|
-
d.setActions((a) => a
|
|
1671
|
+
d.setActions((a) => a
|
|
1672
|
+
.cancel('@general:actions.cancel.title')
|
|
1673
|
+
.submit(this.kind === 'create' ? '@general:actions.create.title' : '@general:actions.apply.title'));
|
|
1672
1674
|
}
|
|
1673
1675
|
if (useListWizard && this.onActionHandler) {
|
|
1674
1676
|
d.onAction(this.createWizardOnActionWrapper(this.onActionHandler));
|
|
@@ -2416,7 +2418,7 @@ class AXPCreateEntityCommand {
|
|
|
2416
2418
|
const entityRef = await this.entityService.resolve(moduleName, entityName);
|
|
2417
2419
|
let chain = this.entityForm.entity(`${moduleName}.${entityName}`).create(data);
|
|
2418
2420
|
chain.actions((actions) => {
|
|
2419
|
-
actions.submit('@general:actions.create.title');
|
|
2421
|
+
actions.cancel('@general:actions.cancel.title').submit('@general:actions.create.title');
|
|
2420
2422
|
});
|
|
2421
2423
|
if (excludeProperties && excludeProperties.length > 0) {
|
|
2422
2424
|
chain = chain.exclude(...excludeProperties);
|
|
@@ -2440,6 +2442,9 @@ class AXPCreateEntityCommand {
|
|
|
2440
2442
|
}
|
|
2441
2443
|
const result = await chain
|
|
2442
2444
|
.onAction(async (dialogRef) => {
|
|
2445
|
+
if (dialogRef.action() === 'cancel') {
|
|
2446
|
+
return { success: false };
|
|
2447
|
+
}
|
|
2443
2448
|
const createFn = entityRef.commands?.create?.execute;
|
|
2444
2449
|
const updateFn = entityRef.commands?.update?.execute;
|
|
2445
2450
|
const context = dialogRef.context();
|
|
@@ -2633,7 +2638,7 @@ class AXPUpdateEntityCommand {
|
|
|
2633
2638
|
}
|
|
2634
2639
|
let chain = this.entityForm.entity(`${moduleName}.${entityName}`).update(data);
|
|
2635
2640
|
chain.actions((actions) => {
|
|
2636
|
-
actions.submit('@general:actions.apply.title');
|
|
2641
|
+
actions.cancel('@general:actions.cancel.title').submit('@general:actions.apply.title');
|
|
2637
2642
|
});
|
|
2638
2643
|
if (excludeProperties && excludeProperties.length > 0) {
|
|
2639
2644
|
chain = chain.exclude(...excludeProperties);
|
|
@@ -2655,6 +2660,9 @@ class AXPUpdateEntityCommand {
|
|
|
2655
2660
|
}
|
|
2656
2661
|
return (await chain
|
|
2657
2662
|
.onAction(async (dialogRef) => {
|
|
2663
|
+
if (dialogRef.action() === 'cancel') {
|
|
2664
|
+
return { success: false };
|
|
2665
|
+
}
|
|
2658
2666
|
const updateFn = entityRef.commands?.update?.execute;
|
|
2659
2667
|
if (!updateFn) {
|
|
2660
2668
|
const msg = await this.translationService.translateAsync('@general:messages.entity.update-command-unavailable');
|
|
@@ -3207,6 +3215,24 @@ class AXPEntityDataProviderImpl {
|
|
|
3207
3215
|
insertOne(entity) {
|
|
3208
3216
|
return this.storageService.insertOne(this.entityName, entity);
|
|
3209
3217
|
}
|
|
3218
|
+
count(request) {
|
|
3219
|
+
return this.storageService.count(this.entityName, request);
|
|
3220
|
+
}
|
|
3221
|
+
queryAll(request, options) {
|
|
3222
|
+
return this.storageService.queryAll(this.entityName, request, options);
|
|
3223
|
+
}
|
|
3224
|
+
getMany(ids) {
|
|
3225
|
+
return this.storageService.getMany(this.entityName, ids);
|
|
3226
|
+
}
|
|
3227
|
+
exists(id) {
|
|
3228
|
+
return this.storageService.exists(this.entityName, id);
|
|
3229
|
+
}
|
|
3230
|
+
upsertOne(entity, options) {
|
|
3231
|
+
return this.storageService.upsertOne(this.entityName, entity, options);
|
|
3232
|
+
}
|
|
3233
|
+
aggregate(request, options) {
|
|
3234
|
+
return this.storageService.aggregate(this.entityName, request, options);
|
|
3235
|
+
}
|
|
3210
3236
|
}
|
|
3211
3237
|
class AXMEntityCrudService {
|
|
3212
3238
|
}
|
|
@@ -3308,6 +3334,24 @@ class AXMEntityCrudServiceImpl {
|
|
|
3308
3334
|
get storageService() {
|
|
3309
3335
|
return this._storageService;
|
|
3310
3336
|
}
|
|
3337
|
+
async count(request) {
|
|
3338
|
+
return this._entityDataProvider.count(request);
|
|
3339
|
+
}
|
|
3340
|
+
async queryAll(request, options) {
|
|
3341
|
+
return this._entityDataProvider.queryAll(request, options);
|
|
3342
|
+
}
|
|
3343
|
+
async getMany(ids) {
|
|
3344
|
+
return this._entityDataProvider.getMany(ids);
|
|
3345
|
+
}
|
|
3346
|
+
async exists(id) {
|
|
3347
|
+
return this._entityDataProvider.exists(id);
|
|
3348
|
+
}
|
|
3349
|
+
async upsertOne(entity, options) {
|
|
3350
|
+
return this._entityDataProvider.upsertOne(entity, options);
|
|
3351
|
+
}
|
|
3352
|
+
async aggregate(request, options) {
|
|
3353
|
+
return this._entityDataProvider.aggregate(request, options);
|
|
3354
|
+
}
|
|
3311
3355
|
async custom(request) { }
|
|
3312
3356
|
}
|
|
3313
3357
|
|
|
@@ -5085,7 +5129,6 @@ class AXPEntityMasterListViewModel {
|
|
|
5085
5129
|
const type = (e.options?.filter?.advance?.widgetType ||
|
|
5086
5130
|
widgetConfig?.defaultFilterWidgetName ||
|
|
5087
5131
|
e.schema.interface?.type);
|
|
5088
|
-
const disabled = e.schema.interface?.options?.['disabled'];
|
|
5089
5132
|
const iface = e.schema.interface ?? {};
|
|
5090
5133
|
return {
|
|
5091
5134
|
title: e.title,
|
|
@@ -5102,7 +5145,7 @@ class AXPEntityMasterListViewModel {
|
|
|
5102
5145
|
inline: e.options?.filter?.inline?.enabled ?? false,
|
|
5103
5146
|
preload: e.options?.filter?.preload,
|
|
5104
5147
|
},
|
|
5105
|
-
disabled
|
|
5148
|
+
// `interface.options.disabled` is for edit forms only; do not gray out advance filters.
|
|
5106
5149
|
triggers: e.schema.interface?.triggers,
|
|
5107
5150
|
};
|
|
5108
5151
|
});
|
|
@@ -6100,6 +6143,150 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
|
|
|
6100
6143
|
return service.create(moduleName, entityName, id);
|
|
6101
6144
|
};
|
|
6102
6145
|
|
|
6146
|
+
//#endregion
|
|
6147
|
+
//#region ---- Quick search: schema-driven field paths ----
|
|
6148
|
+
const NON_TEXT_DATATYPES = new Set([
|
|
6149
|
+
'number',
|
|
6150
|
+
'integer',
|
|
6151
|
+
'int',
|
|
6152
|
+
'long',
|
|
6153
|
+
'float',
|
|
6154
|
+
'double',
|
|
6155
|
+
'decimal',
|
|
6156
|
+
'money',
|
|
6157
|
+
'currency',
|
|
6158
|
+
'boolean',
|
|
6159
|
+
'bool',
|
|
6160
|
+
'date',
|
|
6161
|
+
'datetime',
|
|
6162
|
+
'time',
|
|
6163
|
+
'object',
|
|
6164
|
+
'array',
|
|
6165
|
+
'json',
|
|
6166
|
+
'image',
|
|
6167
|
+
'file',
|
|
6168
|
+
'binary',
|
|
6169
|
+
]);
|
|
6170
|
+
/**
|
|
6171
|
+
* Whether an entity property likely stores free text worth a `contains` quick-search clause.
|
|
6172
|
+
*/
|
|
6173
|
+
function isTextLikeDataType(dataType) {
|
|
6174
|
+
const dt = (dataType ?? 'string').toLowerCase().trim();
|
|
6175
|
+
if (!dt || NON_TEXT_DATATYPES.has(dt)) {
|
|
6176
|
+
return false;
|
|
6177
|
+
}
|
|
6178
|
+
return true;
|
|
6179
|
+
}
|
|
6180
|
+
/**
|
|
6181
|
+
* Lodash-get paths for quick search from a single entity definition: string-like property names
|
|
6182
|
+
* plus lookup `expose[].target` paths (e.g. `brand.title`).
|
|
6183
|
+
*/
|
|
6184
|
+
function collectQuickSearchPathsFromSingleEntityDefinition(entity) {
|
|
6185
|
+
if (!entity?.properties?.length) {
|
|
6186
|
+
return [];
|
|
6187
|
+
}
|
|
6188
|
+
const paths = new Set();
|
|
6189
|
+
for (const p of entity.properties) {
|
|
6190
|
+
if (isTextLikeDataType(p.schema?.dataType)) {
|
|
6191
|
+
paths.add(p.name);
|
|
6192
|
+
}
|
|
6193
|
+
const opts = p.schema?.interface?.options;
|
|
6194
|
+
const expose = opts?.['expose'];
|
|
6195
|
+
if (!Array.isArray(expose)) {
|
|
6196
|
+
continue;
|
|
6197
|
+
}
|
|
6198
|
+
for (const row of expose) {
|
|
6199
|
+
if (row && typeof row === 'object' && typeof row.target === 'string') {
|
|
6200
|
+
const t = (row.target).trim();
|
|
6201
|
+
if (t) {
|
|
6202
|
+
paths.add(t);
|
|
6203
|
+
}
|
|
6204
|
+
}
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
return [...paths];
|
|
6208
|
+
}
|
|
6209
|
+
//#endregion
|
|
6210
|
+
//#region ---- Column-derived nested paths ----
|
|
6211
|
+
/**
|
|
6212
|
+
* Adds dotted paths from master columns (`name` or `options.dataPath`), e.g. `person.fullName`, `jobDefinition.title`.
|
|
6213
|
+
*/
|
|
6214
|
+
function collectNestedFieldPathsFromEntityColumns(entity) {
|
|
6215
|
+
if (!entity?.columns?.length) {
|
|
6216
|
+
return [];
|
|
6217
|
+
}
|
|
6218
|
+
const paths = new Set();
|
|
6219
|
+
for (const col of entity.columns) {
|
|
6220
|
+
const name = col.name.trim();
|
|
6221
|
+
if (name.includes('.')) {
|
|
6222
|
+
paths.add(name);
|
|
6223
|
+
}
|
|
6224
|
+
const rawDp = col.options?.['dataPath'];
|
|
6225
|
+
if (typeof rawDp === 'string') {
|
|
6226
|
+
const dp = rawDp.trim();
|
|
6227
|
+
if (dp.includes('.')) {
|
|
6228
|
+
paths.add(dp);
|
|
6229
|
+
}
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6232
|
+
return [...paths];
|
|
6233
|
+
}
|
|
6234
|
+
//#endregion
|
|
6235
|
+
//#region ---- Related merge-detail paths ----
|
|
6236
|
+
function parseRelatedEntityFullName(fullName) {
|
|
6237
|
+
const t = fullName.trim();
|
|
6238
|
+
const idx = t.indexOf('.');
|
|
6239
|
+
if (idx <= 0 || idx >= t.length - 1) {
|
|
6240
|
+
return null;
|
|
6241
|
+
}
|
|
6242
|
+
return {
|
|
6243
|
+
moduleName: t.slice(0, idx),
|
|
6244
|
+
entityName: t.slice(idx + 1),
|
|
6245
|
+
};
|
|
6246
|
+
}
|
|
6247
|
+
//#endregion
|
|
6248
|
+
//#region ---- Public API ----
|
|
6249
|
+
/**
|
|
6250
|
+
* Collects lodash-get field paths used for mock/API quick search (`contains` / OR filters):
|
|
6251
|
+
* host properties and lookup expose targets, dotted column paths, and merge-detail related entities
|
|
6252
|
+
* prefixed with the related entity merge `persistence.dataPath` (e.g. `person.firstName`).
|
|
6253
|
+
*/
|
|
6254
|
+
async function collectEntityQuickSearchFieldPaths(entity, resolveRelatedDefinition) {
|
|
6255
|
+
if (!entity) {
|
|
6256
|
+
return [];
|
|
6257
|
+
}
|
|
6258
|
+
const paths = new Set();
|
|
6259
|
+
for (const p of collectQuickSearchPathsFromSingleEntityDefinition(entity)) {
|
|
6260
|
+
paths.add(p);
|
|
6261
|
+
}
|
|
6262
|
+
for (const p of collectNestedFieldPathsFromEntityColumns(entity)) {
|
|
6263
|
+
paths.add(p);
|
|
6264
|
+
}
|
|
6265
|
+
const related = entity.relatedEntities ?? [];
|
|
6266
|
+
for (const rel of related) {
|
|
6267
|
+
const dataPath = rel.persistence?.dataPath?.trim();
|
|
6268
|
+
if (!dataPath || rel.layout?.type !== 'merge-detail') {
|
|
6269
|
+
continue;
|
|
6270
|
+
}
|
|
6271
|
+
const parsed = rel.entity ? parseRelatedEntityFullName(rel.entity) : null;
|
|
6272
|
+
if (!parsed) {
|
|
6273
|
+
continue;
|
|
6274
|
+
}
|
|
6275
|
+
const relatedDef = await resolveRelatedDefinition(parsed.moduleName, parsed.entityName);
|
|
6276
|
+
if (!relatedDef) {
|
|
6277
|
+
continue;
|
|
6278
|
+
}
|
|
6279
|
+
for (const p of collectQuickSearchPathsFromSingleEntityDefinition(relatedDef)) {
|
|
6280
|
+
paths.add(`${dataPath}.${p}`);
|
|
6281
|
+
}
|
|
6282
|
+
for (const p of collectNestedFieldPathsFromEntityColumns(relatedDef)) {
|
|
6283
|
+
paths.add(`${dataPath}.${p}`);
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
return [...paths];
|
|
6287
|
+
}
|
|
6288
|
+
//#endregion
|
|
6289
|
+
|
|
6103
6290
|
class AXPEntityPreloadFiltersViewModel {
|
|
6104
6291
|
//#region ---- Constructor ----
|
|
6105
6292
|
constructor(injector, config) {
|
|
@@ -6192,6 +6379,225 @@ const AXPEntityPreloadFiltersViewModelResolver = async (route, state) => {
|
|
|
6192
6379
|
};
|
|
6193
6380
|
//#endregion
|
|
6194
6381
|
|
|
6382
|
+
//#region ---- Path / numeric helpers ----
|
|
6383
|
+
function getPath(obj, path) {
|
|
6384
|
+
if (obj == null || path.length === 0) {
|
|
6385
|
+
return undefined;
|
|
6386
|
+
}
|
|
6387
|
+
const parts = path.split('.');
|
|
6388
|
+
let cur = obj;
|
|
6389
|
+
for (const p of parts) {
|
|
6390
|
+
if (cur == null || typeof cur !== 'object') {
|
|
6391
|
+
return undefined;
|
|
6392
|
+
}
|
|
6393
|
+
cur = cur[p];
|
|
6394
|
+
}
|
|
6395
|
+
return cur;
|
|
6396
|
+
}
|
|
6397
|
+
function toNumber(value) {
|
|
6398
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
6399
|
+
return value;
|
|
6400
|
+
}
|
|
6401
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
6402
|
+
const n = Number(value);
|
|
6403
|
+
return Number.isFinite(n) ? n : null;
|
|
6404
|
+
}
|
|
6405
|
+
return null;
|
|
6406
|
+
}
|
|
6407
|
+
function defaultAlias(measure, index) {
|
|
6408
|
+
if (measure.alias?.trim()) {
|
|
6409
|
+
return measure.alias.trim();
|
|
6410
|
+
}
|
|
6411
|
+
if (measure.reducer === 'count') {
|
|
6412
|
+
return index === 0 ? 'count' : `count_${index}`;
|
|
6413
|
+
}
|
|
6414
|
+
const field = measure.field ?? 'value';
|
|
6415
|
+
const safeField = field.replace(/\./g, '_');
|
|
6416
|
+
return `${measure.reducer}_${safeField}`;
|
|
6417
|
+
}
|
|
6418
|
+
/**
|
|
6419
|
+
* Pure aggregation over already-filtered plain rows (e.g. outputs of {@link filterSortEntityRows}).
|
|
6420
|
+
*/
|
|
6421
|
+
function computeEntityAggregates(rows, request) {
|
|
6422
|
+
const groupBy = request.groupBy ?? [];
|
|
6423
|
+
const measures = request.measures ?? [];
|
|
6424
|
+
if (measures.length === 0) {
|
|
6425
|
+
return [];
|
|
6426
|
+
}
|
|
6427
|
+
const groups = new Map();
|
|
6428
|
+
const stableGroupKey = (row) => {
|
|
6429
|
+
const parts = groupBy.map((path) => getPath(row, path));
|
|
6430
|
+
return JSON.stringify(parts);
|
|
6431
|
+
};
|
|
6432
|
+
for (const row of rows) {
|
|
6433
|
+
const k = stableGroupKey(row);
|
|
6434
|
+
let bucket = groups.get(k);
|
|
6435
|
+
if (!bucket) {
|
|
6436
|
+
bucket = {
|
|
6437
|
+
keyParts: groupBy.map((path) => getPath(row, path)),
|
|
6438
|
+
rows: [],
|
|
6439
|
+
};
|
|
6440
|
+
groups.set(k, bucket);
|
|
6441
|
+
}
|
|
6442
|
+
bucket.rows.push(row);
|
|
6443
|
+
}
|
|
6444
|
+
const result = [];
|
|
6445
|
+
for (const bucket of groups.values()) {
|
|
6446
|
+
const out = {};
|
|
6447
|
+
groupBy.forEach((field, i) => {
|
|
6448
|
+
out[field] = bucket.keyParts[i];
|
|
6449
|
+
});
|
|
6450
|
+
measures.forEach((measure, index) => {
|
|
6451
|
+
const alias = defaultAlias(measure, index);
|
|
6452
|
+
const gRows = bucket.rows;
|
|
6453
|
+
if (measure.reducer === 'count') {
|
|
6454
|
+
out[alias] = gRows.length;
|
|
6455
|
+
return;
|
|
6456
|
+
}
|
|
6457
|
+
const fieldPath = measure.field;
|
|
6458
|
+
if (!fieldPath) {
|
|
6459
|
+
out[alias] = null;
|
|
6460
|
+
return;
|
|
6461
|
+
}
|
|
6462
|
+
const nums = gRows.map((r) => toNumber(getPath(r, fieldPath))).filter((n) => n !== null);
|
|
6463
|
+
switch (measure.reducer) {
|
|
6464
|
+
case 'sum':
|
|
6465
|
+
out[alias] = nums.reduce((a, b) => a + b, 0);
|
|
6466
|
+
break;
|
|
6467
|
+
case 'min':
|
|
6468
|
+
out[alias] = nums.length ? Math.min(...nums) : null;
|
|
6469
|
+
break;
|
|
6470
|
+
case 'max':
|
|
6471
|
+
out[alias] = nums.length ? Math.max(...nums) : null;
|
|
6472
|
+
break;
|
|
6473
|
+
case 'avg':
|
|
6474
|
+
out[alias] = nums.length ? nums.reduce((a, b) => a + b, 0) / nums.length : null;
|
|
6475
|
+
break;
|
|
6476
|
+
default:
|
|
6477
|
+
out[alias] = null;
|
|
6478
|
+
}
|
|
6479
|
+
});
|
|
6480
|
+
result.push(out);
|
|
6481
|
+
}
|
|
6482
|
+
return result;
|
|
6483
|
+
}
|
|
6484
|
+
//#endregion
|
|
6485
|
+
|
|
6486
|
+
//#endregion
|
|
6487
|
+
//#region ---- Pure helpers ----
|
|
6488
|
+
/**
|
|
6489
|
+
* Fields where `contains` means hierarchical category membership (expand to descendants).
|
|
6490
|
+
* Excludes e.g. `roleIds`, which uses array membership only and must use normal filter logic.
|
|
6491
|
+
*/
|
|
6492
|
+
function isCategoryContainsFieldName(field) {
|
|
6493
|
+
if (field === 'categoryIds') {
|
|
6494
|
+
return true;
|
|
6495
|
+
}
|
|
6496
|
+
if (typeof field === 'string' && field.endsWith('Ids') && field !== 'roleIds') {
|
|
6497
|
+
return true;
|
|
6498
|
+
}
|
|
6499
|
+
return false;
|
|
6500
|
+
}
|
|
6501
|
+
/**
|
|
6502
|
+
* Check if the entity is a category entity (ends with 'Category').
|
|
6503
|
+
*/
|
|
6504
|
+
function isCategoryEntity(entityName) {
|
|
6505
|
+
return entityName.endsWith('Category');
|
|
6506
|
+
}
|
|
6507
|
+
/**
|
|
6508
|
+
* Check if the filter is a category filter (contains operator on categoryIds field).
|
|
6509
|
+
* Handles both simple filters and compound filters.
|
|
6510
|
+
*/
|
|
6511
|
+
function isCategoryFilter(filter) {
|
|
6512
|
+
if (filter?.operator?.type === 'contains' && isCategoryContainsFieldName(filter.field)) {
|
|
6513
|
+
return true;
|
|
6514
|
+
}
|
|
6515
|
+
if (filter?.logic && filter?.filters && Array.isArray(filter.filters)) {
|
|
6516
|
+
return filter.filters.some((nestedFilter) => nestedFilter?.operator?.type === 'contains' && isCategoryContainsFieldName(nestedFilter.field));
|
|
6517
|
+
}
|
|
6518
|
+
return false;
|
|
6519
|
+
}
|
|
6520
|
+
//#endregion
|
|
6521
|
+
//#region ---- Query execution ----
|
|
6522
|
+
/**
|
|
6523
|
+
* Apply recursive category filtering: entities that belong to the category or any of its children.
|
|
6524
|
+
*/
|
|
6525
|
+
async function applyRecursiveCategoryFilter(result, filter, entityName, getAllChildCategoryIds) {
|
|
6526
|
+
let categoryFilter = filter;
|
|
6527
|
+
let otherFilters = [];
|
|
6528
|
+
if (filter?.logic && filter?.filters && Array.isArray(filter.filters)) {
|
|
6529
|
+
const categoryFilterIndex = filter.filters.findIndex((f) => f?.operator?.type === 'contains' && isCategoryContainsFieldName(f.field));
|
|
6530
|
+
if (categoryFilterIndex !== -1) {
|
|
6531
|
+
categoryFilter = filter.filters[categoryFilterIndex];
|
|
6532
|
+
otherFilters = filter.filters.filter((_, index) => index !== categoryFilterIndex);
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6535
|
+
if (!categoryFilter) {
|
|
6536
|
+
return applyFilterArray(result, [filter]);
|
|
6537
|
+
}
|
|
6538
|
+
const categoryId = categoryFilter.value;
|
|
6539
|
+
const categoryField = categoryFilter.field;
|
|
6540
|
+
const allCategoryIds = await getAllChildCategoryIds(categoryId, entityName);
|
|
6541
|
+
let filteredResult = result.filter((item) => {
|
|
6542
|
+
const categoryIds = item[categoryField];
|
|
6543
|
+
if (!categoryIds)
|
|
6544
|
+
return false;
|
|
6545
|
+
const itemCategoryIds = Array.isArray(categoryIds) ? categoryIds : [categoryIds];
|
|
6546
|
+
return itemCategoryIds.some((itemCategoryId) => allCategoryIds.includes(itemCategoryId));
|
|
6547
|
+
});
|
|
6548
|
+
if (otherFilters.length > 0) {
|
|
6549
|
+
filteredResult = applyFilterArray(filteredResult, otherFilters);
|
|
6550
|
+
}
|
|
6551
|
+
return filteredResult;
|
|
6552
|
+
}
|
|
6553
|
+
/**
|
|
6554
|
+
* Calculate childrenCount for each category entity when missing.
|
|
6555
|
+
*/
|
|
6556
|
+
async function calculateChildrenCounts(items, entityName, getDirectChildCount) {
|
|
6557
|
+
return Promise.all(items.map(async (item) => {
|
|
6558
|
+
if (typeof item.childrenCount === 'number') {
|
|
6559
|
+
return { ...item };
|
|
6560
|
+
}
|
|
6561
|
+
const childrenCount = await getDirectChildCount(item.id, entityName);
|
|
6562
|
+
return { ...item, childrenCount };
|
|
6563
|
+
}));
|
|
6564
|
+
}
|
|
6565
|
+
/**
|
|
6566
|
+
* Loads raw rows for an entity and applies the same sorting and filtering as {@link runEntityQuery},
|
|
6567
|
+
* without pagination.
|
|
6568
|
+
*/
|
|
6569
|
+
async function filterSortEntityRows(entityName, request, adapters) {
|
|
6570
|
+
let result = await adapters.getRawAll(entityName);
|
|
6571
|
+
if (request.sort && request.sort.length) {
|
|
6572
|
+
result = applySortArray(result, request.sort);
|
|
6573
|
+
}
|
|
6574
|
+
if (request.filter && isCategoryFilter(request.filter)) {
|
|
6575
|
+
result = await applyRecursiveCategoryFilter(result, request.filter, entityName, adapters.getAllChildCategoryIds);
|
|
6576
|
+
}
|
|
6577
|
+
else {
|
|
6578
|
+
result = applyFilterArray(result, request.filter ? [request.filter] : []);
|
|
6579
|
+
}
|
|
6580
|
+
if (isCategoryEntity(entityName)) {
|
|
6581
|
+
result = await calculateChildrenCounts(result, entityName, adapters.getDirectChildCount);
|
|
6582
|
+
}
|
|
6583
|
+
return result;
|
|
6584
|
+
}
|
|
6585
|
+
/**
|
|
6586
|
+
* Shared entity query logic: sort, filter (including recursive category filter), childrenCount, pagination.
|
|
6587
|
+
*/
|
|
6588
|
+
async function runEntityQuery(entityName, request, adapters) {
|
|
6589
|
+
const rows = await filterSortEntityRows(entityName, request, adapters);
|
|
6590
|
+
const skip = request.skip ?? 0;
|
|
6591
|
+
const take = request.take ?? 0;
|
|
6592
|
+
return {
|
|
6593
|
+
total: rows.length,
|
|
6594
|
+
items: rows.slice(skip, skip + take),
|
|
6595
|
+
};
|
|
6596
|
+
}
|
|
6597
|
+
//#endregion
|
|
6598
|
+
|
|
6599
|
+
//#endregion
|
|
6600
|
+
|
|
6195
6601
|
//#region ---- Imports ----
|
|
6196
6602
|
//#endregion
|
|
6197
6603
|
//#region ---- Constants ----
|
|
@@ -8370,7 +8776,7 @@ class AXPEntityCategoryTreeSelectorComponent extends AXBasePageComponent {
|
|
|
8370
8776
|
></ax-button>
|
|
8371
8777
|
</ax-suffix>
|
|
8372
8778
|
</ax-footer>
|
|
8373
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i2$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i4$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i5$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "
|
|
8779
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i2$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i4$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i5$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "look"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8374
8780
|
}
|
|
8375
8781
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityCategoryTreeSelectorComponent, decorators: [{
|
|
8376
8782
|
type: Component,
|
|
@@ -12016,6 +12422,7 @@ class AXPEntityDataSelectorService {
|
|
|
12016
12422
|
options['layout'] = quickCreate.layout;
|
|
12017
12423
|
}
|
|
12018
12424
|
}
|
|
12425
|
+
options['process'] = { redirect: false };
|
|
12019
12426
|
const result = await this.commandService.execute('Entity:Create', {
|
|
12020
12427
|
__context__: {
|
|
12021
12428
|
entity: `${entity.module}.${entity.name}`,
|
|
@@ -13131,7 +13538,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
13131
13538
|
this.componentLook()?.focus();
|
|
13132
13539
|
}
|
|
13133
13540
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
13134
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "axp-lookup-widget-edit", viewQueries: [{ propertyName: "componentLook", first: true, predicate: LookupWidgetLookBase, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
13541
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "axp-lookup-widget-edit", host: { classAttribute: "ax-w-full" }, viewQueries: [{ propertyName: "componentLook", first: true, predicate: LookupWidgetLookBase, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
13135
13542
|
@if (entityDef()) {
|
|
13136
13543
|
<div class="ax-flex ax-items-center ax-gap-1 ax-w-full">
|
|
13137
13544
|
@switch (look()) {
|
|
@@ -13256,6 +13663,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
13256
13663
|
</div>
|
|
13257
13664
|
}
|
|
13258
13665
|
`,
|
|
13666
|
+
host: {
|
|
13667
|
+
class: 'ax-w-full',
|
|
13668
|
+
},
|
|
13259
13669
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13260
13670
|
imports: [
|
|
13261
13671
|
CommonModule,
|
|
@@ -18061,6 +18471,9 @@ class AXPMainEntityContentBuilder {
|
|
|
18061
18471
|
isOpen: !s.collapsed,
|
|
18062
18472
|
look: 'card',
|
|
18063
18473
|
showTitle: s.layout?.label?.visible !== false,
|
|
18474
|
+
...(s.layout?.visible != null && String(s.layout.visible).trim() !== ''
|
|
18475
|
+
? { visible: s.layout.visible }
|
|
18476
|
+
: {}),
|
|
18064
18477
|
},
|
|
18065
18478
|
children: [
|
|
18066
18479
|
{
|
|
@@ -19238,6 +19651,9 @@ function getDedupKey(op, entityName, init) {
|
|
|
19238
19651
|
if (op === 'getOne' && init?.id !== undefined) {
|
|
19239
19652
|
return `getOne:${entityName}:${String(init.id)}`;
|
|
19240
19653
|
}
|
|
19654
|
+
if (op === 'exists' && init?.id !== undefined) {
|
|
19655
|
+
return `exists:${entityName}:${String(init.id)}`;
|
|
19656
|
+
}
|
|
19241
19657
|
if (op === 'getAll') {
|
|
19242
19658
|
return `getAll:${entityName}`;
|
|
19243
19659
|
}
|
|
@@ -19245,6 +19661,20 @@ function getDedupKey(op, entityName, init) {
|
|
|
19245
19661
|
const r = init.request;
|
|
19246
19662
|
return `query:${entityName}:${r.skip ?? 0}:${r.take ?? 0}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}:${JSON.stringify(r.params ?? null)}`;
|
|
19247
19663
|
}
|
|
19664
|
+
if (op === 'count' && init?.request) {
|
|
19665
|
+
const r = init.request;
|
|
19666
|
+
return `count:${entityName}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}`;
|
|
19667
|
+
}
|
|
19668
|
+
if (op === 'queryAll' && init?.request) {
|
|
19669
|
+
const r = init.request;
|
|
19670
|
+
return `queryAll:${entityName}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}:${JSON.stringify(init.queryAllOptions ?? null)}`;
|
|
19671
|
+
}
|
|
19672
|
+
if (op === 'getMany' && init?.ids) {
|
|
19673
|
+
return `getMany:${entityName}:${init.ids.map(String).join(',')}`;
|
|
19674
|
+
}
|
|
19675
|
+
if (op === 'aggregate' && init?.aggregateRequest) {
|
|
19676
|
+
return `aggregate:${entityName}:${JSON.stringify(init.aggregateRequest)}:${JSON.stringify(init.aggregateOptions ?? null)}`;
|
|
19677
|
+
}
|
|
19248
19678
|
return '';
|
|
19249
19679
|
}
|
|
19250
19680
|
class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
@@ -19304,6 +19734,13 @@ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
|
19304
19734
|
insertOne: (name, e) => this.backend.insertOne(name, e),
|
|
19305
19735
|
query: (name, request) => this.backend.query(name, request),
|
|
19306
19736
|
updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
|
|
19737
|
+
deleteOne: (name, id) => this.backend.deleteOne(name, id),
|
|
19738
|
+
count: (name, request) => this.backend.count(name, request),
|
|
19739
|
+
queryAll: (name, request, options) => this.backend.queryAll(name, request, options),
|
|
19740
|
+
getMany: (name, ids) => this.backend.getMany(name, ids),
|
|
19741
|
+
exists: (name, id) => this.backend.exists(name, id),
|
|
19742
|
+
upsertOne: (name, entity, options) => this.backend.upsertOne(name, entity, options),
|
|
19743
|
+
aggregate: (name, request, options) => this.backend.aggregate(name, request, options),
|
|
19307
19744
|
},
|
|
19308
19745
|
...init,
|
|
19309
19746
|
};
|
|
@@ -19375,6 +19812,100 @@ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
|
19375
19812
|
const ctx = this.createCtx('query', entityName, { request });
|
|
19376
19813
|
return this.run(ctx, () => this.backend.query(ctx.entityName, request));
|
|
19377
19814
|
}
|
|
19815
|
+
async count(entityName, request) {
|
|
19816
|
+
const filterSortRequest = { ...request, skip: 0, take: 0 };
|
|
19817
|
+
const key = getDedupKey('count', entityName, { request: filterSortRequest });
|
|
19818
|
+
if (key) {
|
|
19819
|
+
const existing = this.inFlight.get(key);
|
|
19820
|
+
if (existing) {
|
|
19821
|
+
return existing;
|
|
19822
|
+
}
|
|
19823
|
+
const promise = this.runWithDedup(key, () => {
|
|
19824
|
+
const ctx = this.createCtx('count', entityName, { request: filterSortRequest });
|
|
19825
|
+
return this.run(ctx, () => this.backend.count(ctx.entityName, request));
|
|
19826
|
+
});
|
|
19827
|
+
this.inFlight.set(key, promise);
|
|
19828
|
+
return promise;
|
|
19829
|
+
}
|
|
19830
|
+
const ctx = this.createCtx('count', entityName, { request: filterSortRequest });
|
|
19831
|
+
return this.run(ctx, () => this.backend.count(ctx.entityName, request));
|
|
19832
|
+
}
|
|
19833
|
+
async queryAll(entityName, request, options) {
|
|
19834
|
+
const filterSortRequest = { ...request, skip: 0, take: 0 };
|
|
19835
|
+
const key = getDedupKey('queryAll', entityName, { request: filterSortRequest, queryAllOptions: options });
|
|
19836
|
+
if (key) {
|
|
19837
|
+
const existing = this.inFlight.get(key);
|
|
19838
|
+
if (existing) {
|
|
19839
|
+
return existing;
|
|
19840
|
+
}
|
|
19841
|
+
const promise = this.runWithDedup(key, () => {
|
|
19842
|
+
const ctx = this.createCtx('queryAll', entityName, { request: filterSortRequest });
|
|
19843
|
+
return this.run(ctx, () => this.backend.queryAll(ctx.entityName, request, options));
|
|
19844
|
+
});
|
|
19845
|
+
this.inFlight.set(key, promise);
|
|
19846
|
+
return promise;
|
|
19847
|
+
}
|
|
19848
|
+
const ctx = this.createCtx('queryAll', entityName, { request: filterSortRequest });
|
|
19849
|
+
return this.run(ctx, () => this.backend.queryAll(ctx.entityName, request, options));
|
|
19850
|
+
}
|
|
19851
|
+
async getMany(entityName, ids) {
|
|
19852
|
+
const key = getDedupKey('getMany', entityName, { ids: ids });
|
|
19853
|
+
if (key) {
|
|
19854
|
+
const existing = this.inFlight.get(key);
|
|
19855
|
+
if (existing) {
|
|
19856
|
+
return existing;
|
|
19857
|
+
}
|
|
19858
|
+
const promise = this.runWithDedup(key, () => {
|
|
19859
|
+
const ctx = this.createCtx('getMany', entityName);
|
|
19860
|
+
return this.run(ctx, () => this.backend.getMany(ctx.entityName, ids));
|
|
19861
|
+
});
|
|
19862
|
+
this.inFlight.set(key, promise);
|
|
19863
|
+
return promise;
|
|
19864
|
+
}
|
|
19865
|
+
const ctx = this.createCtx('getMany', entityName);
|
|
19866
|
+
return this.run(ctx, () => this.backend.getMany(ctx.entityName, ids));
|
|
19867
|
+
}
|
|
19868
|
+
async exists(entityName, id) {
|
|
19869
|
+
const key = getDedupKey('exists', entityName, { id });
|
|
19870
|
+
if (key) {
|
|
19871
|
+
const existing = this.inFlight.get(key);
|
|
19872
|
+
if (existing) {
|
|
19873
|
+
return existing;
|
|
19874
|
+
}
|
|
19875
|
+
const promise = this.runWithDedup(key, () => {
|
|
19876
|
+
const ctx = this.createCtx('exists', entityName, { id });
|
|
19877
|
+
return this.run(ctx, () => this.backend.exists(ctx.entityName, id));
|
|
19878
|
+
});
|
|
19879
|
+
this.inFlight.set(key, promise);
|
|
19880
|
+
return promise;
|
|
19881
|
+
}
|
|
19882
|
+
const ctx = this.createCtx('exists', entityName, { id });
|
|
19883
|
+
return this.run(ctx, () => this.backend.exists(ctx.entityName, id));
|
|
19884
|
+
}
|
|
19885
|
+
async upsertOne(entityName, entity, options) {
|
|
19886
|
+
const ctx = this.createCtx('upsertOne', entityName, { data: entity });
|
|
19887
|
+
ctx.locals.set('upsertOptions', options);
|
|
19888
|
+
return this.run(ctx, () => this.backend.upsertOne(ctx.entityName, entity, options));
|
|
19889
|
+
}
|
|
19890
|
+
async aggregate(entityName, request, options) {
|
|
19891
|
+
const key = getDedupKey('aggregate', entityName, { aggregateRequest: request, aggregateOptions: options });
|
|
19892
|
+
if (key) {
|
|
19893
|
+
const existing = this.inFlight.get(key);
|
|
19894
|
+
if (existing) {
|
|
19895
|
+
return existing;
|
|
19896
|
+
}
|
|
19897
|
+
const promise = this.runWithDedup(key, () => {
|
|
19898
|
+
const ctx = this.createCtx('aggregate', entityName);
|
|
19899
|
+
ctx.locals.set('aggregateRequest', request);
|
|
19900
|
+
ctx.locals.set('aggregateOptions', options);
|
|
19901
|
+
return this.run(ctx, () => this.backend.aggregate(ctx.entityName, request, options));
|
|
19902
|
+
});
|
|
19903
|
+
this.inFlight.set(key, promise);
|
|
19904
|
+
return promise;
|
|
19905
|
+
}
|
|
19906
|
+
const ctx = this.createCtx('aggregate', entityName);
|
|
19907
|
+
return this.run(ctx, () => this.backend.aggregate(ctx.entityName, request, options));
|
|
19908
|
+
}
|
|
19378
19909
|
async runWithDedup(key, fn) {
|
|
19379
19910
|
try {
|
|
19380
19911
|
return await fn();
|
|
@@ -20335,5 +20866,5 @@ var getEntityDetails_query = /*#__PURE__*/Object.freeze({
|
|
|
20335
20866
|
* Generated bundle index. Do not edit.
|
|
20336
20867
|
*/
|
|
20337
20868
|
|
|
20338
|
-
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityEventsKeys, AXPEntityFormBuilderService, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLayoutOrderingConfigService, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPMultiSourceDefinitionProviderContext, AXPMultiSourceDefinitionProviderService, AXPMultiSourceFederatedSearchService, AXPMultiSourceSelectorComponent, AXPMultiSourceSelectorService, AXPMultiSourceSelectorWidget, AXPMultiSourceSelectorWidgetColumnComponent, AXPMultiSourceSelectorWidgetEditComponent, AXPMultiSourceSelectorWidgetViewComponent, AXPMultiSourceType, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPRelatedColumnEnrichmentService, AXPRelatedColumnMetadataResolver, AXPSelectorStructureWidget, AXPSelectorStructureWidgetColumnComponent, AXPSelectorStructureWidgetEditComponent, AXPSelectorStructureWidgetViewComponent, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTruncatedBreadcrumbComponent, AXPUpdateEntityCommand, AXPViewEntityDetailsCommand, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, AXP_MULTI_SOURCE_DEFINITION_PROVIDER, DEFAULT_COLUMN_ORDER, DEFAULT_PAIR_SPAN_RULES, DEFAULT_PROPERTY_ORDER, DEFAULT_SECTION_ORDER, EntityBuilder, EntityDataAccessor, actionExists, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, cloneLayoutArrays, collectNestedCreateHiddenProperties, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, entityDetailsCreateActions, entityDetailsCreateActionsDeferredParent, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsNewEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterEditAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, getMasterInterfacePropertySortKey, isAXPMiddlewareAbortError, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mergeForeignKeyFieldIntoCreateActions, provideEntity, resolveEntityPluginDetailPageOrder, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider };
|
|
20869
|
+
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityEventsKeys, AXPEntityFormBuilderService, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLayoutOrderingConfigService, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPMultiSourceDefinitionProviderContext, AXPMultiSourceDefinitionProviderService, AXPMultiSourceFederatedSearchService, AXPMultiSourceSelectorComponent, AXPMultiSourceSelectorService, AXPMultiSourceSelectorWidget, AXPMultiSourceSelectorWidgetColumnComponent, AXPMultiSourceSelectorWidgetEditComponent, AXPMultiSourceSelectorWidgetViewComponent, AXPMultiSourceType, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPRelatedColumnEnrichmentService, AXPRelatedColumnMetadataResolver, AXPSelectorStructureWidget, AXPSelectorStructureWidgetColumnComponent, AXPSelectorStructureWidgetEditComponent, AXPSelectorStructureWidgetViewComponent, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTruncatedBreadcrumbComponent, AXPUpdateEntityCommand, AXPViewEntityDetailsCommand, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, AXP_MULTI_SOURCE_DEFINITION_PROVIDER, DEFAULT_COLUMN_ORDER, DEFAULT_PAIR_SPAN_RULES, DEFAULT_PROPERTY_ORDER, DEFAULT_SECTION_ORDER, EntityBuilder, EntityDataAccessor, actionExists, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, cloneLayoutArrays, collectEntityQuickSearchFieldPaths, collectNestedCreateHiddenProperties, collectNestedFieldPathsFromEntityColumns, collectQuickSearchPathsFromSingleEntityDefinition, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, computeEntityAggregates, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, entityDetailsCreateActions, entityDetailsCreateActionsDeferredParent, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsNewEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterEditAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, filterSortEntityRows, getMasterInterfacePropertySortKey, isAXPMiddlewareAbortError, isCategoryEntity, isCategoryFilter, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mergeForeignKeyFieldIntoCreateActions, provideEntity, resolveEntityPluginDetailPageOrder, runEntityQuery, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider };
|
|
20339
20870
|
//# sourceMappingURL=acorex-platform-layout-entity.mjs.map
|