@acorex/platform 20.9.18 → 20.9.20
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-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +209 -42
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +31 -8
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-layout-entity.d.ts +50 -2
|
@@ -2357,6 +2357,11 @@ class AXPCreateEntityCommand {
|
|
|
2357
2357
|
if (finalSize) {
|
|
2358
2358
|
chain.size(finalSize);
|
|
2359
2359
|
}
|
|
2360
|
+
const entityFullName = `${moduleName}.${entityName}`;
|
|
2361
|
+
const redirectOption = options?.process?.redirect;
|
|
2362
|
+
const { shouldRedirect, shouldHighlight } = await resolveEntityCreateListBehavior(this.settingsService, {
|
|
2363
|
+
redirect: redirectOption,
|
|
2364
|
+
});
|
|
2360
2365
|
const result = await chain
|
|
2361
2366
|
.onAction(async (dialogRef) => {
|
|
2362
2367
|
if (dialogRef.action() === 'cancel') {
|
|
@@ -2387,13 +2392,17 @@ class AXPCreateEntityCommand {
|
|
|
2387
2392
|
try {
|
|
2388
2393
|
const result = await persistFn(context);
|
|
2389
2394
|
if (result) {
|
|
2390
|
-
|
|
2395
|
+
const commandResult = {
|
|
2391
2396
|
success: true,
|
|
2392
2397
|
data: result.data ?? result,
|
|
2393
2398
|
message: {
|
|
2394
2399
|
text: await this.translationService.translateAsync('@general:messages.generic.success.description'),
|
|
2395
2400
|
},
|
|
2396
2401
|
};
|
|
2402
|
+
if (dialogRef.action() === ENTITY_FORM_ACTION_FIRST_STEP_CONTINUE) {
|
|
2403
|
+
this.dispatchCreateListRefresh(entityFullName, entityRef, commandResult.data, shouldHighlight);
|
|
2404
|
+
}
|
|
2405
|
+
return commandResult;
|
|
2397
2406
|
}
|
|
2398
2407
|
else {
|
|
2399
2408
|
return {
|
|
@@ -2421,33 +2430,35 @@ class AXPCreateEntityCommand {
|
|
|
2421
2430
|
})
|
|
2422
2431
|
.show();
|
|
2423
2432
|
const commandResult = result;
|
|
2424
|
-
const redirectOption = options?.process?.redirect;
|
|
2425
|
-
const { shouldRedirect, shouldHighlight } = await resolveEntityCreateListBehavior(this.settingsService, {
|
|
2426
|
-
redirect: redirectOption,
|
|
2427
|
-
});
|
|
2428
2433
|
if (commandResult.success && commandResult.data) {
|
|
2429
2434
|
const createdItem = commandResult.data?.item ?? commandResult.data;
|
|
2430
2435
|
const createdId = createdItem?.id ?? createdItem?._id;
|
|
2431
|
-
|
|
2432
|
-
if (createdId != null && shouldHighlight) {
|
|
2433
|
-
refreshMeta['highlightRowId'] = createdId;
|
|
2434
|
-
}
|
|
2435
|
-
if (entityRef.parentKey && createdItem?.[entityRef.parentKey]) {
|
|
2436
|
-
refreshMeta['refreshTargetId'] = createdItem[entityRef.parentKey];
|
|
2437
|
-
}
|
|
2438
|
-
this.workflowEventService.dispatch(AXPRefreshEvent({
|
|
2439
|
-
entity: `${moduleName}.${entityName}`,
|
|
2440
|
-
meta: refreshMeta,
|
|
2441
|
-
}));
|
|
2436
|
+
this.dispatchCreateListRefresh(entityFullName, entityRef, commandResult.data, shouldHighlight);
|
|
2442
2437
|
if (shouldRedirect && createdId != null) {
|
|
2443
2438
|
await this.openEntityDetailsCommand.execute({
|
|
2444
|
-
entity:
|
|
2439
|
+
entity: entityFullName,
|
|
2445
2440
|
data: { id: String(createdId) },
|
|
2446
2441
|
});
|
|
2447
2442
|
}
|
|
2448
2443
|
}
|
|
2449
2444
|
return commandResult;
|
|
2450
2445
|
}
|
|
2446
|
+
dispatchCreateListRefresh(entityFullName, entityRef, resultData, shouldHighlight) {
|
|
2447
|
+
const createdItem = resultData?.item ?? resultData;
|
|
2448
|
+
const createdRecord = createdItem;
|
|
2449
|
+
const createdId = createdRecord?.['id'] ?? createdRecord?.['_id'];
|
|
2450
|
+
const refreshMeta = { resetPagination: true };
|
|
2451
|
+
if (createdId != null && shouldHighlight) {
|
|
2452
|
+
refreshMeta['highlightRowId'] = createdId;
|
|
2453
|
+
}
|
|
2454
|
+
if (entityRef.parentKey && createdRecord?.[entityRef.parentKey]) {
|
|
2455
|
+
refreshMeta['refreshTargetId'] = createdRecord[entityRef.parentKey];
|
|
2456
|
+
}
|
|
2457
|
+
this.workflowEventService.dispatch(AXPRefreshEvent({
|
|
2458
|
+
entity: entityFullName,
|
|
2459
|
+
meta: refreshMeta,
|
|
2460
|
+
}));
|
|
2461
|
+
}
|
|
2451
2462
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPCreateEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2452
2463
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPCreateEntityCommand, providedIn: 'root' }); }
|
|
2453
2464
|
}
|
|
@@ -5480,6 +5491,8 @@ class AXPEntityMasterListViewModel {
|
|
|
5480
5491
|
/** When true, pager changes are not persisted (programmatic UI sync). */
|
|
5481
5492
|
this.skipListPagingPersistence = false;
|
|
5482
5493
|
this.listPersistenceMode = null;
|
|
5494
|
+
/** Serializes user-setting updates for this entity list to avoid lost merges (e.g. filters vs paging). */
|
|
5495
|
+
this.settingsUpdateChain = Promise.resolve();
|
|
5483
5496
|
this.events$ = new Subject();
|
|
5484
5497
|
//****************** Views ******************//
|
|
5485
5498
|
this.allViews = computed(() => {
|
|
@@ -5763,7 +5776,10 @@ class AXPEntityMasterListViewModel {
|
|
|
5763
5776
|
return this.listPersistenceMode;
|
|
5764
5777
|
}
|
|
5765
5778
|
const value = await this.settings.get(AXPCommonSettings.EntityListPersistenceMode);
|
|
5766
|
-
|
|
5779
|
+
const resolved = value != null && typeof value === 'object' && 'value' in value
|
|
5780
|
+
? value.value
|
|
5781
|
+
: value;
|
|
5782
|
+
this.listPersistenceMode = normalizeEntityListPersistenceMode(resolved);
|
|
5767
5783
|
return this.listPersistenceMode;
|
|
5768
5784
|
}
|
|
5769
5785
|
async shouldLoadPersistedListState() {
|
|
@@ -5912,17 +5928,41 @@ class AXPEntityMasterListViewModel {
|
|
|
5912
5928
|
const wasExpanded = meta?.['expanded'] === true;
|
|
5913
5929
|
this.updateExpandedRowId(rowId, !wasExpanded);
|
|
5914
5930
|
}
|
|
5931
|
+
/**
|
|
5932
|
+
* User-applied filters to persist (excludes hidden view conditions and empty values).
|
|
5933
|
+
*/
|
|
5934
|
+
getPersistableFilterQueries(queries = this.filterQueries()) {
|
|
5935
|
+
return queries.filter((f) => {
|
|
5936
|
+
if (f.hidden === true) {
|
|
5937
|
+
return false;
|
|
5938
|
+
}
|
|
5939
|
+
if (f.readOnly === true) {
|
|
5940
|
+
return false;
|
|
5941
|
+
}
|
|
5942
|
+
const value = f.value;
|
|
5943
|
+
if (value === undefined || value === null || value === '') {
|
|
5944
|
+
return false;
|
|
5945
|
+
}
|
|
5946
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
5947
|
+
return false;
|
|
5948
|
+
}
|
|
5949
|
+
return true;
|
|
5950
|
+
});
|
|
5951
|
+
}
|
|
5952
|
+
enqueueSettingsUpdate(updateFn) {
|
|
5953
|
+
const run = () => this.settings.scope(AXPPlatformScope.User).update(this.settingEntityKey, updateFn);
|
|
5954
|
+
const next = this.settingsUpdateChain.then(run);
|
|
5955
|
+
this.settingsUpdateChain = next.catch(() => undefined);
|
|
5956
|
+
return next;
|
|
5957
|
+
}
|
|
5915
5958
|
async saveSettings(changesType, data) {
|
|
5916
5959
|
if (!(await this.shouldPersistListState())) {
|
|
5917
5960
|
return;
|
|
5918
5961
|
}
|
|
5919
|
-
const updateSettings = (updateFn) => {
|
|
5920
|
-
this.settings.scope(AXPPlatformScope.User).update(this.settingEntityKey, updateFn);
|
|
5921
|
-
};
|
|
5922
5962
|
switch (changesType) {
|
|
5923
5963
|
case 'columnSizes': {
|
|
5924
5964
|
const columnSizeData = data;
|
|
5925
|
-
|
|
5965
|
+
await this.enqueueSettingsUpdate((prev) => {
|
|
5926
5966
|
const field = columnSizeData.dataField.split('-')[1];
|
|
5927
5967
|
const newSettings = { ...prev };
|
|
5928
5968
|
const existingColumns = prev?.list?.views?.[this.view().name]?.columns;
|
|
@@ -5949,7 +5989,7 @@ class AXPEntityMasterListViewModel {
|
|
|
5949
5989
|
}
|
|
5950
5990
|
case 'columnOrders': {
|
|
5951
5991
|
const orderedColumns = data;
|
|
5952
|
-
|
|
5992
|
+
await this.enqueueSettingsUpdate((prev) => {
|
|
5953
5993
|
const newSettings = { ...prev };
|
|
5954
5994
|
set(newSettings, `list.views.${this.view().name}.columns`, orderedColumns.map((c) => ({
|
|
5955
5995
|
name: c.column?.options?.dataPath ?? c.name,
|
|
@@ -5961,7 +6001,7 @@ class AXPEntityMasterListViewModel {
|
|
|
5961
6001
|
break;
|
|
5962
6002
|
}
|
|
5963
6003
|
case 'view':
|
|
5964
|
-
|
|
6004
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
5965
6005
|
...prev,
|
|
5966
6006
|
list: {
|
|
5967
6007
|
...prev?.list,
|
|
@@ -5970,7 +6010,7 @@ class AXPEntityMasterListViewModel {
|
|
|
5970
6010
|
}));
|
|
5971
6011
|
break;
|
|
5972
6012
|
case 'pageSize':
|
|
5973
|
-
|
|
6013
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
5974
6014
|
...prev,
|
|
5975
6015
|
list: {
|
|
5976
6016
|
...prev?.list,
|
|
@@ -5989,7 +6029,7 @@ class AXPEntityMasterListViewModel {
|
|
|
5989
6029
|
}));
|
|
5990
6030
|
break;
|
|
5991
6031
|
case 'listPaging':
|
|
5992
|
-
|
|
6032
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
5993
6033
|
...prev,
|
|
5994
6034
|
list: {
|
|
5995
6035
|
...prev?.list,
|
|
@@ -6005,7 +6045,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6005
6045
|
}));
|
|
6006
6046
|
break;
|
|
6007
6047
|
case 'filters':
|
|
6008
|
-
|
|
6048
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
6009
6049
|
...prev,
|
|
6010
6050
|
list: {
|
|
6011
6051
|
...prev?.list,
|
|
@@ -6020,7 +6060,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6020
6060
|
}));
|
|
6021
6061
|
break;
|
|
6022
6062
|
case 'sorts':
|
|
6023
|
-
|
|
6063
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
6024
6064
|
...prev,
|
|
6025
6065
|
list: {
|
|
6026
6066
|
...prev?.list,
|
|
@@ -6035,7 +6075,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6035
6075
|
}));
|
|
6036
6076
|
break;
|
|
6037
6077
|
case 'expandedRows':
|
|
6038
|
-
|
|
6078
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
6039
6079
|
...prev,
|
|
6040
6080
|
list: {
|
|
6041
6081
|
...prev?.list,
|
|
@@ -6050,7 +6090,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6050
6090
|
}));
|
|
6051
6091
|
break;
|
|
6052
6092
|
case 'listLayout':
|
|
6053
|
-
|
|
6093
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
6054
6094
|
...prev,
|
|
6055
6095
|
list: {
|
|
6056
6096
|
...prev?.list,
|
|
@@ -6059,7 +6099,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6059
6099
|
}));
|
|
6060
6100
|
break;
|
|
6061
6101
|
case 'cardContentExpanded':
|
|
6062
|
-
|
|
6102
|
+
await this.enqueueSettingsUpdate((prev) => ({
|
|
6063
6103
|
...prev,
|
|
6064
6104
|
list: {
|
|
6065
6105
|
...prev?.list,
|
|
@@ -6325,9 +6365,7 @@ class AXPEntityMasterListViewModel {
|
|
|
6325
6365
|
}
|
|
6326
6366
|
async syncFiltersFromRouteQueryParam(filtersJson) {
|
|
6327
6367
|
const nextCanonical = AXPEntityMasterListViewModel.parseQueryParamFiltersToCanonical(filtersJson);
|
|
6328
|
-
const currentCanonical = this.
|
|
6329
|
-
? this.filtersQueryParamCanonical(this.filterQueries())
|
|
6330
|
-
: null;
|
|
6368
|
+
const currentCanonical = this.filtersQueryParamCanonical(this.filterQueries());
|
|
6331
6369
|
if (nextCanonical === currentCanonical) {
|
|
6332
6370
|
return false;
|
|
6333
6371
|
}
|
|
@@ -6844,12 +6882,12 @@ const AXPEntityListViewModelResolver = async (route, state, service = inject(AXP
|
|
|
6844
6882
|
const entityName = route.paramMap.get('entity');
|
|
6845
6883
|
try {
|
|
6846
6884
|
const vm = await service.create(moduleName, entityName);
|
|
6847
|
-
//
|
|
6885
|
+
// URL `filters` are for one-off deep links only; persisted list state loads from user settings.
|
|
6848
6886
|
const filtersParam = route.queryParamMap.get('filters');
|
|
6849
|
-
|
|
6887
|
+
const shouldLoadPersisted = await vm.shouldLoadPersistedListState();
|
|
6888
|
+
if (filtersParam && !shouldLoadPersisted) {
|
|
6850
6889
|
const applied = vm.applyFiltersFromQueryParams(filtersParam);
|
|
6851
6890
|
if (applied) {
|
|
6852
|
-
// Trigger filter and sort application
|
|
6853
6891
|
await vm.applyFilterAndSort();
|
|
6854
6892
|
}
|
|
6855
6893
|
}
|
|
@@ -19511,11 +19549,74 @@ function resolveFileUploaderEntityScope(options, rowData, fieldFallback) {
|
|
|
19511
19549
|
}
|
|
19512
19550
|
return { name: entityName.trim(), id: entityId, field: field.trim() };
|
|
19513
19551
|
}
|
|
19552
|
+
/**
|
|
19553
|
+
* Attachment field names registered by the attachments plugin (`extensions.attachments`)
|
|
19554
|
+
* or properties using the `attachments` widget interface.
|
|
19555
|
+
*/
|
|
19556
|
+
function resolveEntityAttachmentFieldNames(def) {
|
|
19557
|
+
const fields = new Set();
|
|
19558
|
+
const attachCfg = def?.extensions?.attachments;
|
|
19559
|
+
if (attachCfg != null && typeof attachCfg === 'object') {
|
|
19560
|
+
for (const key of Object.keys(attachCfg)) {
|
|
19561
|
+
if (key.trim()) {
|
|
19562
|
+
fields.add(key);
|
|
19563
|
+
}
|
|
19564
|
+
}
|
|
19565
|
+
}
|
|
19566
|
+
const props = def?.properties ?? [];
|
|
19567
|
+
for (const prop of props) {
|
|
19568
|
+
if (prop?.name?.trim() && prop.schema?.interface?.type === 'attachments') {
|
|
19569
|
+
fields.add(prop.name);
|
|
19570
|
+
}
|
|
19571
|
+
}
|
|
19572
|
+
return fields;
|
|
19573
|
+
}
|
|
19574
|
+
/** True when a hydrated key path belongs to a lazy attachment plugin field (top-level property). */
|
|
19575
|
+
function isLazyAttachmentFieldPath(keyPath, lazyFields) {
|
|
19576
|
+
if (!lazyFields.size || !keyPath.trim()) {
|
|
19577
|
+
return false;
|
|
19578
|
+
}
|
|
19579
|
+
const root = keyPath.split(/[.[\]]/)[0];
|
|
19580
|
+
return lazyFields.has(root);
|
|
19581
|
+
}
|
|
19514
19582
|
//#endregion
|
|
19515
19583
|
|
|
19516
19584
|
/** Trace namespace for file-uploader attachment column, load/save, and hydration. */
|
|
19517
19585
|
const FILE_UPLOADER_TRACE_NS = 'file-uploader-attachments';
|
|
19518
19586
|
|
|
19587
|
+
/**
|
|
19588
|
+
* Loads and hydrates entity attachment field values via `FileUploader:LoadFiles`.
|
|
19589
|
+
* Used when read middleware keeps storage refs and the UI mounts the attachments widget.
|
|
19590
|
+
*/
|
|
19591
|
+
async function fetchHydratedEntityAttachments(queryExecutor, scope) {
|
|
19592
|
+
AXPDebugService.instance?.trace(FILE_UPLOADER_TRACE_NS, 'lazy-hydrate', 'Loading attachments on widget display', () => ({
|
|
19593
|
+
entity: scope.name,
|
|
19594
|
+
entityId: scope.id,
|
|
19595
|
+
field: scope.field,
|
|
19596
|
+
}));
|
|
19597
|
+
try {
|
|
19598
|
+
const result = await queryExecutor.fetch('FileUploader:LoadFiles', scope);
|
|
19599
|
+
const files = result?.files ?? [];
|
|
19600
|
+
AXPDebugService.instance?.trace(FILE_UPLOADER_TRACE_NS, 'lazy-hydrate', 'Attachments loaded on widget display', () => ({
|
|
19601
|
+
entity: scope.name,
|
|
19602
|
+
entityId: scope.id,
|
|
19603
|
+
field: scope.field,
|
|
19604
|
+
fileCount: files.length,
|
|
19605
|
+
fileNames: files.map((file) => file.name),
|
|
19606
|
+
}));
|
|
19607
|
+
return files;
|
|
19608
|
+
}
|
|
19609
|
+
catch (error) {
|
|
19610
|
+
AXPDebugService.instance?.warn(FILE_UPLOADER_TRACE_NS, 'lazy-hydrate', 'Failed to load attachments on widget display', () => ({
|
|
19611
|
+
entity: scope.name,
|
|
19612
|
+
entityId: scope.id,
|
|
19613
|
+
field: scope.field,
|
|
19614
|
+
error: error instanceof Error ? error.message : String(error),
|
|
19615
|
+
}));
|
|
19616
|
+
throw error;
|
|
19617
|
+
}
|
|
19618
|
+
}
|
|
19619
|
+
|
|
19519
19620
|
class AXPFileUploaderLoadFilesQuery {
|
|
19520
19621
|
constructor() {
|
|
19521
19622
|
//#region ---- Services & Dependencies ----
|
|
@@ -19828,6 +19929,7 @@ class AXPFileUploaderWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
19828
19929
|
this.hooks = inject(AXPHookService);
|
|
19829
19930
|
this.fileActionsService = inject(AXPFileActionsService);
|
|
19830
19931
|
this.commandExecutor = inject(AXPCommandExecutor);
|
|
19932
|
+
this.queryExecutor = inject(AXPQueryExecutor);
|
|
19831
19933
|
this.toastService = inject(AXToastService);
|
|
19832
19934
|
this.translateService = inject(AXTranslationService);
|
|
19833
19935
|
//#region ---- Dirty tracking (deferred save pages) ----
|
|
@@ -19841,17 +19943,30 @@ class AXPFileUploaderWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
19841
19943
|
/** Status before soft-delete; used for restore when baseline was not synced (section layout). */
|
|
19842
19944
|
this.statusBeforeDelete = new Map();
|
|
19843
19945
|
this.autoBaselineSynced = signal(false, ...(ngDevMode ? [{ debugName: "autoBaselineSynced" }] : /* istanbul ignore next */ []));
|
|
19946
|
+
this.hydrateRequestId = 0;
|
|
19844
19947
|
/** Sync baseline from context when not wired by a deferred-save page (section layout). */
|
|
19845
19948
|
this.baselineInitEffect = effect(() => {
|
|
19846
19949
|
if (this.autoBaselineSynced()) {
|
|
19847
19950
|
return;
|
|
19848
19951
|
}
|
|
19849
19952
|
const value = this.getValue();
|
|
19850
|
-
if (value == null) {
|
|
19953
|
+
if (value == null || attachmentNeedsHydration(value)) {
|
|
19851
19954
|
return;
|
|
19852
19955
|
}
|
|
19853
19956
|
this.syncBaseline(value);
|
|
19854
19957
|
}, ...(ngDevMode ? [{ debugName: "baselineInitEffect" }] : /* istanbul ignore next */ []));
|
|
19958
|
+
/** Hydrate attachment refs when the widget is shown (read middleware keeps refs lazy). */
|
|
19959
|
+
this.lazyHydrateEffect = effect(() => {
|
|
19960
|
+
const value = this.getValue();
|
|
19961
|
+
if (!attachmentNeedsHydration(value)) {
|
|
19962
|
+
return;
|
|
19963
|
+
}
|
|
19964
|
+
const scope = resolveFileUploaderEntityScope(this.options(), this.contextService.snapshot(), resolveAttachmentFieldPath(this.options(), this.path));
|
|
19965
|
+
if (!scope?.id) {
|
|
19966
|
+
return;
|
|
19967
|
+
}
|
|
19968
|
+
void this.hydrateAttachments(scope);
|
|
19969
|
+
}, ...(ngDevMode ? [{ debugName: "lazyHydrateEffect" }] : /* istanbul ignore next */ []));
|
|
19855
19970
|
//#endregion
|
|
19856
19971
|
this.multiple = computed(() => this.options()['multiple'], ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
19857
19972
|
this.acceptOverride = signal(undefined, ...(ngDevMode ? [{ debugName: "acceptOverride" }] : /* istanbul ignore next */ []));
|
|
@@ -19928,6 +20043,24 @@ class AXPFileUploaderWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
19928
20043
|
this.configureFromHooks();
|
|
19929
20044
|
this.loadActions();
|
|
19930
20045
|
}
|
|
20046
|
+
async hydrateAttachments(scope) {
|
|
20047
|
+
const requestId = ++this.hydrateRequestId;
|
|
20048
|
+
try {
|
|
20049
|
+
const files = await fetchHydratedEntityAttachments(this.queryExecutor, scope);
|
|
20050
|
+
if (requestId !== this.hydrateRequestId) {
|
|
20051
|
+
return;
|
|
20052
|
+
}
|
|
20053
|
+
this.skipDirtyEvaluation = true;
|
|
20054
|
+
this.setValue(cloneDeep(files));
|
|
20055
|
+
this.skipDirtyEvaluation = false;
|
|
20056
|
+
this.syncBaseline(files);
|
|
20057
|
+
}
|
|
20058
|
+
catch {
|
|
20059
|
+
if (requestId !== this.hydrateRequestId) {
|
|
20060
|
+
return;
|
|
20061
|
+
}
|
|
20062
|
+
}
|
|
20063
|
+
}
|
|
19931
20064
|
setValue(value) {
|
|
19932
20065
|
super.setValue(value);
|
|
19933
20066
|
if (this.skipDirtyEvaluation) {
|
|
@@ -20485,8 +20618,21 @@ var fileUploaderWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
|
20485
20618
|
|
|
20486
20619
|
class AXPFileUploaderWidgetViewComponent extends AXPValueWidgetComponent {
|
|
20487
20620
|
constructor() {
|
|
20488
|
-
super(
|
|
20621
|
+
super();
|
|
20622
|
+
this.queryExecutor = inject(AXPQueryExecutor);
|
|
20623
|
+
this.hydrateRequestId = 0;
|
|
20489
20624
|
this.files = computed(() => (this.getValue() ?? []).filter(file => file.status !== 'deleted') ?? [], ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
20625
|
+
effect(() => {
|
|
20626
|
+
const value = this.getValue();
|
|
20627
|
+
if (!attachmentNeedsHydration(value)) {
|
|
20628
|
+
return;
|
|
20629
|
+
}
|
|
20630
|
+
const scope = resolveFileUploaderEntityScope(this.options(), this.contextService.snapshot(), resolveAttachmentFieldPath(this.options(), this.path));
|
|
20631
|
+
if (!scope?.id) {
|
|
20632
|
+
return;
|
|
20633
|
+
}
|
|
20634
|
+
void this.hydrateAttachments(scope);
|
|
20635
|
+
});
|
|
20490
20636
|
}
|
|
20491
20637
|
get __class() {
|
|
20492
20638
|
const cls = {};
|
|
@@ -20494,7 +20640,24 @@ class AXPFileUploaderWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
20494
20640
|
cls[`ax-flex-1`] = true;
|
|
20495
20641
|
return cls;
|
|
20496
20642
|
}
|
|
20497
|
-
|
|
20643
|
+
async hydrateAttachments(scope) {
|
|
20644
|
+
const requestId = ++this.hydrateRequestId;
|
|
20645
|
+
try {
|
|
20646
|
+
const files = await fetchHydratedEntityAttachments(this.queryExecutor, scope);
|
|
20647
|
+
if (requestId !== this.hydrateRequestId) {
|
|
20648
|
+
return;
|
|
20649
|
+
}
|
|
20650
|
+
const path = this.fullPath();
|
|
20651
|
+
if (!path) {
|
|
20652
|
+
return;
|
|
20653
|
+
}
|
|
20654
|
+
this.contextService.update(path, files, { origin: 'system' });
|
|
20655
|
+
}
|
|
20656
|
+
catch {
|
|
20657
|
+
/* keep refs; popover / edit can retry */
|
|
20658
|
+
}
|
|
20659
|
+
}
|
|
20660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFileUploaderWidgetViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20498
20661
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPFileUploaderWidgetViewComponent, isStandalone: true, selector: "axp-file-uploader-widget-view", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
|
|
20499
20662
|
<axp-file-list [files]="files()" [readonly]="true"></axp-file-list>
|
|
20500
20663
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXUploaderModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPFileListComponent, selector: "axp-file-list", inputs: ["readonly", "fileEditable", "enableTitleDescription", "multiple", "look", "titleKey", "showLabel", "linksLayout", "files", "plugins", "excludePlugins", "capabilities"], outputs: ["onRemove", "onRevert", "onRename"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -20519,7 +20682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
20519
20682
|
],
|
|
20520
20683
|
inputs: [],
|
|
20521
20684
|
}]
|
|
20522
|
-
}], propDecorators: { __class: [{
|
|
20685
|
+
}], ctorParameters: () => [], propDecorators: { __class: [{
|
|
20523
20686
|
type: HostBinding,
|
|
20524
20687
|
args: ['class']
|
|
20525
20688
|
}] } });
|
|
@@ -20687,10 +20850,12 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
20687
20850
|
AXPFileUploaderWidgetEditComponent: AXPFileUploaderWidgetEditComponent,
|
|
20688
20851
|
AXPFileUploaderWidgetService: AXPFileUploaderWidgetService,
|
|
20689
20852
|
AXPFileUploaderWidgetViewComponent: AXPFileUploaderWidgetViewComponent,
|
|
20853
|
+
FILE_UPLOADER_TRACE_NS: FILE_UPLOADER_TRACE_NS,
|
|
20690
20854
|
attachmentFieldCount: attachmentFieldCount,
|
|
20691
20855
|
attachmentNeedsHydration: attachmentNeedsHydration,
|
|
20692
20856
|
attachmentsSemanticallyEqual: attachmentsSemanticallyEqual,
|
|
20693
20857
|
committedAttachments: committedAttachments,
|
|
20858
|
+
fetchHydratedEntityAttachments: fetchHydratedEntityAttachments,
|
|
20694
20859
|
fingerprintAttachmentItem: fingerprintAttachmentItem,
|
|
20695
20860
|
fingerprintAttachments: fingerprintAttachments,
|
|
20696
20861
|
hasFileUploaderTitleOrDescriptionFields: hasFileUploaderTitleOrDescriptionFields,
|
|
@@ -20700,9 +20865,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
20700
20865
|
isAttachmentStorageRef: isAttachmentStorageRef,
|
|
20701
20866
|
isFileListItem: isFileListItem,
|
|
20702
20867
|
isFileUploaderEditDialogAuto: isFileUploaderEditDialogAuto,
|
|
20868
|
+
isLazyAttachmentFieldPath: isLazyAttachmentFieldPath,
|
|
20703
20869
|
normalizeEntityFieldToFileList: normalizeEntityFieldToFileList,
|
|
20704
20870
|
persistedAttachments: persistedAttachments,
|
|
20705
20871
|
resolveAttachmentFieldPath: resolveAttachmentFieldPath,
|
|
20872
|
+
resolveEntityAttachmentFieldNames: resolveEntityAttachmentFieldNames,
|
|
20706
20873
|
resolveFileUploaderEditDialog: resolveFileUploaderEditDialog,
|
|
20707
20874
|
resolveFileUploaderEntityScope: resolveFileUploaderEntityScope
|
|
20708
20875
|
});
|
|
@@ -26497,5 +26664,5 @@ function detectEntityChanges(oldObj, newObj) {
|
|
|
26497
26664
|
* Generated bundle index. Do not edit.
|
|
26498
26665
|
*/
|
|
26499
26666
|
|
|
26500
|
-
export { ATTACHMENTS_PAGE_COMPONENT_KEY, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEditFileUploaderCommand, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorRowActionsService, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityFormBuilderService, AXPEntityListPersistenceModeDefault, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewCardFieldViewModel, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListCardSelectActionName, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPFileListComponent, AXPFileUploaderLoadFilesQuery, AXPFileUploaderSaveFilesCommand, AXPFileUploaderWidget, AXPFileUploaderWidgetColumnComponent, AXPFileUploaderWidgetEditComponent, AXPFileUploaderWidgetService, AXPFileUploaderWidgetViewComponent, 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_APPEARANCE_SECTION_ORDER, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_CLASSIFICATION_SECTION_ORDER, 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, ENTITY_LIST_ROUTE_CONTEXT_SESSION_KEY, EntityBuilder, EntityDataAccessor, actionExists, applyDataSourcePagingWithoutLoad, attachmentFieldCount, attachmentNeedsHydration, attachmentsPlugin, attachmentsSemanticallyEqual, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, canPersistEntityListState, cloneLayoutArrays, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, commandMessageTextForError, committedAttachments, computeEntityAggregates, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultCardLayoutMiddleware, defaultCardLayoutMiddlewareProvider, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, eventDispatchMiddleware, filterSortEntityRows, findEntityListRowDataInTree, fingerprintAttachmentItem, fingerprintAttachments, formatLookupItemDisplay, formatLookupItemDisplayAsync, getDataSourcePageIndex, getEntityListRowId, getMasterInterfacePropertySortKey, hasFileUploaderTitleOrDescriptionFields, hydrateAttachmentFieldToFileList, isAXPMiddlewareAbortError, isAttachmentFieldPresentOnRow, isAttachmentListEntry, isAttachmentStorageRef, isCategoryEntity, isCategoryFilter, isFileListItem, isFileUploaderEditDialogAuto, isLegacyEntityDataSelectorOptions, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mapEntityStorageErrorToCommandResult, mapLegacyEntityDataSelectorOptions, normalizeEntityDataSelectorOptions, normalizeEntityFieldToFileList, normalizeEntityListPersistenceMode, normalizeListPaging, persistedAttachments, provideEntity, resolveAttachmentFieldPath, resolveEntityPluginDetailPageOrder, resolveFileUploaderEditDialog, resolveFileUploaderEntityScope, resolveLookupDisplayField, resolveLookupDisplayTemplate, restoreEntityListExpandedRows, runEntityQuery, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider, shouldLoadEntityListStateFromStorage, shouldResetEntityListStateOnRouteEntry };
|
|
26667
|
+
export { ATTACHMENTS_PAGE_COMPONENT_KEY, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEditFileUploaderCommand, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorRowActionsService, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityFormBuilderService, AXPEntityListPersistenceModeDefault, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewCardFieldViewModel, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListCardSelectActionName, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPFileListComponent, AXPFileUploaderLoadFilesQuery, AXPFileUploaderSaveFilesCommand, AXPFileUploaderWidget, AXPFileUploaderWidgetColumnComponent, AXPFileUploaderWidgetEditComponent, AXPFileUploaderWidgetService, AXPFileUploaderWidgetViewComponent, 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_APPEARANCE_SECTION_ORDER, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_CLASSIFICATION_SECTION_ORDER, 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, ENTITY_FORM_ACTION_FIRST_STEP_CONTINUE, ENTITY_LIST_ROUTE_CONTEXT_SESSION_KEY, EntityBuilder, EntityDataAccessor, FILE_UPLOADER_TRACE_NS, actionExists, applyDataSourcePagingWithoutLoad, attachmentFieldCount, attachmentNeedsHydration, attachmentsPlugin, attachmentsSemanticallyEqual, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, canPersistEntityListState, cloneLayoutArrays, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, commandMessageTextForError, committedAttachments, computeEntityAggregates, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultCardLayoutMiddleware, defaultCardLayoutMiddlewareProvider, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, eventDispatchMiddleware, fetchHydratedEntityAttachments, filterSortEntityRows, findEntityListRowDataInTree, fingerprintAttachmentItem, fingerprintAttachments, formatLookupItemDisplay, formatLookupItemDisplayAsync, getDataSourcePageIndex, getEntityListRowId, getMasterInterfacePropertySortKey, hasFileUploaderTitleOrDescriptionFields, hydrateAttachmentFieldToFileList, isAXPMiddlewareAbortError, isAttachmentFieldPresentOnRow, isAttachmentListEntry, isAttachmentStorageRef, isCategoryEntity, isCategoryFilter, isFileListItem, isFileUploaderEditDialogAuto, isLazyAttachmentFieldPath, isLegacyEntityDataSelectorOptions, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mapEntityStorageErrorToCommandResult, mapLegacyEntityDataSelectorOptions, normalizeEntityDataSelectorOptions, normalizeEntityFieldToFileList, normalizeEntityListPersistenceMode, normalizeListPaging, persistedAttachments, provideEntity, resolveAttachmentFieldPath, resolveEntityAttachmentFieldNames, resolveEntityPluginDetailPageOrder, resolveFileUploaderEditDialog, resolveFileUploaderEntityScope, resolveLookupDisplayField, resolveLookupDisplayTemplate, restoreEntityListExpandedRows, runEntityQuery, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider, shouldLoadEntityListStateFromStorage, shouldResetEntityListStateOnRouteEntry };
|
|
26501
26668
|
//# sourceMappingURL=acorex-platform-layout-entity.mjs.map
|