@acorex/platform 21.0.0-next.7 → 21.0.0-next.71
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 +281 -23
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs +163 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +1381 -276
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +1538 -611
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +557 -826
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +1372 -210
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +6298 -1929
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +456 -204
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity-attachments-page.component-D8iQnT-R.mjs +371 -0
- package/fesm2022/acorex-platform-layout-entity-attachments-page.component-D8iQnT-R.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs +100 -0
- package/fesm2022/acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +22537 -9975
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +865 -218
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +2138 -487
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs +116 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-BcpRkpJp.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-BcpRkpJp.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-DQtK4lxl.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-DQtK4lxl.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +10434 -7982
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +8 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +391 -166
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs} +21 -28
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs → acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs → acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +2289 -90
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs} +52 -33
- package/fesm2022/acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs +86 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +790 -612
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +978 -238
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/fesm2022/acorex-platform.mjs.map +1 -1
- package/package.json +40 -38
- package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +241 -4
- package/{common/index.d.ts → types/acorex-platform-common.d.ts} +833 -89
- package/{core/index.d.ts → types/acorex-platform-core.d.ts} +779 -164
- package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
- package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +277 -55
- package/types/acorex-platform-layout-components.d.ts +3257 -0
- package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
- package/types/acorex-platform-layout-entity.d.ts +4492 -0
- package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +247 -62
- package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +437 -131
- package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +1140 -506
- package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
- package/types/acorex-platform-runtime.d.ts +571 -0
- package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +254 -7
- package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +30 -2
- package/{workflow/index.d.ts → types/acorex-platform-workflow.d.ts} +620 -617
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs +0 -71
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs +0 -135
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs +0 -1542
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs +0 -65
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs +0 -64
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
- package/layout/components/index.d.ts +0 -1669
- package/layout/entity/index.d.ts +0 -2287
- package/runtime/index.d.ts +0 -307
- /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex/platform/layout/views';
|
|
2
|
+
import * as i3 from '@acorex/platform/layout/widget-core';
|
|
3
|
+
import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
4
|
+
import { AXPEntityDefinitionRegistryService, persistedAttachments } from './acorex-platform-layout-entity.mjs';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { input, inject, DestroyRef, viewChild, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { ActivatedRoute } from '@angular/router';
|
|
9
|
+
import { merge, get } from 'lodash-es';
|
|
10
|
+
import { Subject } from 'rxjs';
|
|
11
|
+
|
|
12
|
+
const ATTACHMENTS_PAGE_SAVE_COMMAND = 'EntityAttachmentsPage:Save';
|
|
13
|
+
const ATTACHMENTS_PAGE_DISCARD_COMMAND = 'EntityAttachmentsPage:Discard';
|
|
14
|
+
const ATTACHMENTS_PAGE_UPLOAD_COMMAND = 'EntityAttachmentsPage:Upload';
|
|
15
|
+
//#region ---- Attachments Page Component ----
|
|
16
|
+
/**
|
|
17
|
+
* Page component that renders the attachments property using the file-uploader widget.
|
|
18
|
+
* Used when attachments plugin has display: 'page'.
|
|
19
|
+
* Exposes Save/Discard footer actions (same pattern as questionnaire-questions-page).
|
|
20
|
+
*/
|
|
21
|
+
class AXMAttachmentsPageComponent extends AXPPageLayoutBaseComponent {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
/** Default `{}`: avoid NG0950 before page-component-renderer calls setInput. */
|
|
25
|
+
this.rootContext = input({}, ...(ngDevMode ? [{ debugName: "rootContext" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.pageConfig = input(...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.route = inject(ActivatedRoute);
|
|
28
|
+
this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
|
|
29
|
+
this.hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });
|
|
30
|
+
this.destroyRef = inject(DestroyRef);
|
|
31
|
+
this.containerRef = viewChild('containerRef', ...(ngDevMode ? [{ debugName: "containerRef" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.entityDef = signal(null, ...(ngDevMode ? [{ debugName: "entityDef" }] : /* istanbul ignore next */ []));
|
|
33
|
+
this.localContext = signal(null, ...(ngDevMode ? [{ debugName: "localContext" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.isDirty = signal(false, ...(ngDevMode ? [{ debugName: "isDirty" }] : /* istanbul ignore next */ []));
|
|
35
|
+
this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
36
|
+
this.previousRecordId = signal(undefined, ...(ngDevMode ? [{ debugName: "previousRecordId" }] : /* istanbul ignore next */ []));
|
|
37
|
+
/** Recreates the inner widget container on discard so the file list resets. */
|
|
38
|
+
this.widgetRenderKey = signal(0, ...(ngDevMode ? [{ debugName: "widgetRenderKey" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this.widgetWireGeneration = 0;
|
|
40
|
+
this.context = computed(() => {
|
|
41
|
+
const local = this.localContext();
|
|
42
|
+
if (local != null) {
|
|
43
|
+
return local;
|
|
44
|
+
}
|
|
45
|
+
return this.rootContext() ?? {};
|
|
46
|
+
}, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.fieldName = computed(() => {
|
|
48
|
+
const config = this.pageConfig();
|
|
49
|
+
return config && typeof config.field === 'string'
|
|
50
|
+
? config.field
|
|
51
|
+
: 'attachments';
|
|
52
|
+
}, ...(ngDevMode ? [{ debugName: "fieldName" }] : /* istanbul ignore next */ []));
|
|
53
|
+
this.recordId = computed(() => {
|
|
54
|
+
const id = this.rootContext()?.['id'];
|
|
55
|
+
return typeof id === 'string' && id.length > 0 ? id : undefined;
|
|
56
|
+
}, ...(ngDevMode ? [{ debugName: "recordId" }] : /* istanbul ignore next */ []));
|
|
57
|
+
this.node = computed(() => {
|
|
58
|
+
const field = this.fieldName();
|
|
59
|
+
const entity = this.entityDef();
|
|
60
|
+
if (!entity?.properties) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const prop = entity.properties.find((p) => p.name === field);
|
|
64
|
+
if (!prop?.schema?.interface) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const widget = prop.schema.interface;
|
|
68
|
+
return {
|
|
69
|
+
type: widget.type,
|
|
70
|
+
path: field,
|
|
71
|
+
name: field,
|
|
72
|
+
children: widget.children,
|
|
73
|
+
valueTransforms: widget.valueTransforms,
|
|
74
|
+
options: merge({}, widget.options),
|
|
75
|
+
};
|
|
76
|
+
}, ...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
77
|
+
this.showAddItemButton = computed(() => {
|
|
78
|
+
const options = this.node()?.options;
|
|
79
|
+
return options?.['showAddItemButton'] !== false;
|
|
80
|
+
}, ...(ngDevMode ? [{ debugName: "showAddItemButton" }] : /* istanbul ignore next */ []));
|
|
81
|
+
effect((onCleanup) => {
|
|
82
|
+
const moduleName = this.route.snapshot.parent?.paramMap.get('module');
|
|
83
|
+
const entityName = this.route.snapshot.paramMap.get('entity');
|
|
84
|
+
if (!moduleName || !entityName) {
|
|
85
|
+
this.entityDef.set(null);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let cancelled = false;
|
|
89
|
+
this.entityRegistry.resolve(moduleName, entityName).then((entity) => {
|
|
90
|
+
if (!cancelled) {
|
|
91
|
+
this.entityDef.set(entity);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
onCleanup(() => {
|
|
95
|
+
cancelled = true;
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
effect(() => {
|
|
99
|
+
const ctx = this.rootContext();
|
|
100
|
+
const recordId = typeof ctx?.['id'] === 'string' && ctx['id'].length > 0 ? ctx['id'] : undefined;
|
|
101
|
+
if (!recordId || recordId === this.previousRecordId()) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.previousRecordId.set(recordId);
|
|
105
|
+
this.localContext.set(null);
|
|
106
|
+
this.isDirty.set(false);
|
|
107
|
+
this.widgetRenderKey.update((key) => key + 1);
|
|
108
|
+
});
|
|
109
|
+
effect(() => {
|
|
110
|
+
const field = this.fieldName();
|
|
111
|
+
const node = this.node();
|
|
112
|
+
const renderKey = this.widgetRenderKey();
|
|
113
|
+
if (!node || !field) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
void this.wireUploaderWidget(field, renderKey);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async getPrimaryMenuItems() {
|
|
120
|
+
const dirty = this.isDirty();
|
|
121
|
+
const saving = this.isSaving();
|
|
122
|
+
const uploadActions = this.showAddItemButton() ? [] : await this.buildUploadPrimaryActions();
|
|
123
|
+
const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';
|
|
124
|
+
const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';
|
|
125
|
+
return [
|
|
126
|
+
...uploadActions,
|
|
127
|
+
{
|
|
128
|
+
title: discardTitle,
|
|
129
|
+
icon: 'fa-light fa-rotate-left',
|
|
130
|
+
zone: 'footer',
|
|
131
|
+
priority: 'secondary',
|
|
132
|
+
color: 'default',
|
|
133
|
+
visible: dirty,
|
|
134
|
+
disabled: saving,
|
|
135
|
+
command: { name: ATTACHMENTS_PAGE_DISCARD_COMMAND, options: {} },
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: saveTitle,
|
|
139
|
+
icon: 'fa-light fa-floppy-disk',
|
|
140
|
+
zone: 'footer',
|
|
141
|
+
priority: 'primary',
|
|
142
|
+
color: 'primary',
|
|
143
|
+
visible: dirty,
|
|
144
|
+
disabled: saving,
|
|
145
|
+
command: { name: ATTACHMENTS_PAGE_SAVE_COMMAND, options: {} },
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
onContextChanged(event) {
|
|
150
|
+
if (event.state !== 'changed' || this.isSaving()) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const field = this.fieldName();
|
|
154
|
+
const attachments = get(event.data, field);
|
|
155
|
+
const base = this.localContext() ?? this.rootContext() ?? {};
|
|
156
|
+
this.localContext.set({ ...base, [field]: attachments });
|
|
157
|
+
}
|
|
158
|
+
execute(command) {
|
|
159
|
+
if (command.name === ATTACHMENTS_PAGE_DISCARD_COMMAND) {
|
|
160
|
+
this.handleDiscard();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (command.name === ATTACHMENTS_PAGE_UPLOAD_COMMAND) {
|
|
164
|
+
void this.handleUploadAction(command);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (command.name !== ATTACHMENTS_PAGE_SAVE_COMMAND) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
return this.handleSave();
|
|
171
|
+
}
|
|
172
|
+
handleDiscard() {
|
|
173
|
+
const field = this.fieldName();
|
|
174
|
+
this.localContext.set(null);
|
|
175
|
+
this.isDirty.set(false);
|
|
176
|
+
this.widgetRenderKey.update((key) => key + 1);
|
|
177
|
+
this.recompute();
|
|
178
|
+
}
|
|
179
|
+
async handleSave() {
|
|
180
|
+
const field = this.fieldName();
|
|
181
|
+
const id = this.recordId();
|
|
182
|
+
const entity = this.entityDef();
|
|
183
|
+
const updateExec = entity?.commands?.update?.execute;
|
|
184
|
+
const ctx = this.localContext() ?? this.rootContext() ?? {};
|
|
185
|
+
const attachments = get(ctx, field);
|
|
186
|
+
if (!field || !id || !updateExec) {
|
|
187
|
+
return {
|
|
188
|
+
success: false,
|
|
189
|
+
message: {
|
|
190
|
+
text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
this.isSaving.set(true);
|
|
195
|
+
this.recompute();
|
|
196
|
+
try {
|
|
197
|
+
await updateExec({ id, [field]: attachments });
|
|
198
|
+
const persisted = persistedAttachments(attachments);
|
|
199
|
+
// Keep displaying saved attachments; drop soft-deleted rows (onContextChanged is skipped while isSaving).
|
|
200
|
+
this.localContext.set({ ...(this.rootContext() ?? {}), [field]: persisted });
|
|
201
|
+
const uploader = await this.getUploaderWidget();
|
|
202
|
+
uploader?.markSaved?.();
|
|
203
|
+
this.isDirty.set(false);
|
|
204
|
+
this.recompute();
|
|
205
|
+
this.toastService.show({
|
|
206
|
+
color: 'success',
|
|
207
|
+
title: await this.translateService.translateAsync('@general:messages.generic.success.title'),
|
|
208
|
+
content: await this.translateService.translateAsync('@general:messages.generic.success.description'),
|
|
209
|
+
location: 'bottom-center',
|
|
210
|
+
closeButton: true,
|
|
211
|
+
timeOut: 3000,
|
|
212
|
+
timeOutProgress: true,
|
|
213
|
+
});
|
|
214
|
+
return { success: true };
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
this.toastService.show({
|
|
218
|
+
color: 'danger',
|
|
219
|
+
title: await this.translateService.translateAsync('@general:messages.error.title'),
|
|
220
|
+
content: await this.translateService.translateAsync('@general:messages.entity.update-failed'),
|
|
221
|
+
});
|
|
222
|
+
return { success: false };
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
this.isSaving.set(false);
|
|
226
|
+
this.recompute();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async wireUploaderWidget(field, renderKey) {
|
|
230
|
+
const generation = ++this.widgetWireGeneration;
|
|
231
|
+
const container = this.containerRef();
|
|
232
|
+
if (!container) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const widget = await container.find(field);
|
|
236
|
+
if (!widget || generation !== this.widgetWireGeneration) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.dirtySubscription?.unsubscribe();
|
|
240
|
+
const api = widget.api();
|
|
241
|
+
const savedAttachments = get(this.rootContext(), field);
|
|
242
|
+
api.syncBaseline?.(savedAttachments);
|
|
243
|
+
if (api.onDirtyChange instanceof Subject) {
|
|
244
|
+
this.dirtySubscription = api.onDirtyChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((dirty) => {
|
|
245
|
+
if (generation !== this.widgetWireGeneration) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
this.isDirty.set(dirty);
|
|
249
|
+
this.recompute();
|
|
250
|
+
});
|
|
251
|
+
this.isDirty.set(api.isDirty?.() ?? false);
|
|
252
|
+
this.recompute();
|
|
253
|
+
}
|
|
254
|
+
if (api.onUploadActionsChanged instanceof Subject) {
|
|
255
|
+
this.uploadActionsSubscription?.unsubscribe();
|
|
256
|
+
this.uploadActionsSubscription = api.onUploadActionsChanged
|
|
257
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
258
|
+
.subscribe(() => {
|
|
259
|
+
if (generation !== this.widgetWireGeneration) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
this.recompute();
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async buildUploadPrimaryActions() {
|
|
267
|
+
const uploader = await this.getUploaderWidget();
|
|
268
|
+
const actions = uploader?.getUploadActions?.() ?? [];
|
|
269
|
+
const readonly = Boolean(this.node()?.options?.['readonly']);
|
|
270
|
+
if (readonly || actions.length === 0) {
|
|
271
|
+
return [];
|
|
272
|
+
}
|
|
273
|
+
const items = [];
|
|
274
|
+
for (const action of actions) {
|
|
275
|
+
items.push({
|
|
276
|
+
title: action.textKey ?? action.text ?? action.plugin,
|
|
277
|
+
icon: this.normalizePageDropdownIcon(action.icon),
|
|
278
|
+
command: {
|
|
279
|
+
name: ATTACHMENTS_PAGE_UPLOAD_COMMAND,
|
|
280
|
+
options: { plugin: action.plugin },
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return [
|
|
285
|
+
{
|
|
286
|
+
title: '@general:actions.add-item.title',
|
|
287
|
+
icon: 'fa-light fa-plus',
|
|
288
|
+
zone: 'header',
|
|
289
|
+
priority: 'primary',
|
|
290
|
+
color: 'primary',
|
|
291
|
+
items,
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
}
|
|
295
|
+
/** Page layout dropdown renders `fa-light {{ icon }}`; strip existing style prefix from widget actions. */
|
|
296
|
+
normalizePageDropdownIcon(icon) {
|
|
297
|
+
if (!icon) {
|
|
298
|
+
return 'fa-file-arrow-up';
|
|
299
|
+
}
|
|
300
|
+
return icon.replace(/^(fa-light|fa-solid|fa-regular)\s+/, '');
|
|
301
|
+
}
|
|
302
|
+
async handleUploadAction(command) {
|
|
303
|
+
const plugin = command.options?.['plugin'];
|
|
304
|
+
if (typeof plugin !== 'string' || plugin.length === 0) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const uploader = await this.getUploaderWidget();
|
|
308
|
+
await uploader?.runUploadAction?.(plugin);
|
|
309
|
+
}
|
|
310
|
+
async getUploaderWidget() {
|
|
311
|
+
const container = this.containerRef();
|
|
312
|
+
if (!container) {
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
const widget = await container.find(this.fieldName());
|
|
316
|
+
if (!widget) {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
return widget.api();
|
|
320
|
+
}
|
|
321
|
+
recompute() {
|
|
322
|
+
super.recompute();
|
|
323
|
+
const maybeLayout = this.hostPageLayout;
|
|
324
|
+
maybeLayout?.recompute?.();
|
|
325
|
+
}
|
|
326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMAttachmentsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
327
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMAttachmentsPageComponent, isStandalone: true, selector: "axm-attachments-page", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.axp-page-layout-base": "true" } }, providers: [
|
|
328
|
+
{
|
|
329
|
+
provide: AXPPageLayoutBase,
|
|
330
|
+
useExisting: AXMAttachmentsPageComponent,
|
|
331
|
+
},
|
|
332
|
+
], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["containerRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
333
|
+
@for (renderKey of [widgetRenderKey()]; track renderKey) {
|
|
334
|
+
<axp-widgets-container #containerRef [context]="context()" (onContextChanged)="onContextChanged($event)">
|
|
335
|
+
@if (node(); as n) {
|
|
336
|
+
<ng-container axp-widget-renderer [node]="n" [mode]="'edit'"></ng-container>
|
|
337
|
+
}
|
|
338
|
+
</axp-widgets-container>
|
|
339
|
+
}
|
|
340
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: i3.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged", "onLoad"], exportAs: ["widgetRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
341
|
+
}
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMAttachmentsPageComponent, decorators: [{
|
|
343
|
+
type: Component,
|
|
344
|
+
args: [{
|
|
345
|
+
selector: 'axm-attachments-page',
|
|
346
|
+
standalone: true,
|
|
347
|
+
imports: [AXPWidgetCoreModule],
|
|
348
|
+
providers: [
|
|
349
|
+
{
|
|
350
|
+
provide: AXPPageLayoutBase,
|
|
351
|
+
useExisting: AXMAttachmentsPageComponent,
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
template: `
|
|
355
|
+
@for (renderKey of [widgetRenderKey()]; track renderKey) {
|
|
356
|
+
<axp-widgets-container #containerRef [context]="context()" (onContextChanged)="onContextChanged($event)">
|
|
357
|
+
@if (node(); as n) {
|
|
358
|
+
<ng-container axp-widget-renderer [node]="n" [mode]="'edit'"></ng-container>
|
|
359
|
+
}
|
|
360
|
+
</axp-widgets-container>
|
|
361
|
+
}
|
|
362
|
+
`,
|
|
363
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
364
|
+
host: {
|
|
365
|
+
'[class.axp-page-layout-base]': 'true',
|
|
366
|
+
},
|
|
367
|
+
}]
|
|
368
|
+
}], ctorParameters: () => [], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], containerRef: [{ type: i0.ViewChild, args: ['containerRef', { isSignal: true }] }] } });
|
|
369
|
+
|
|
370
|
+
export { AXMAttachmentsPageComponent };
|
|
371
|
+
//# sourceMappingURL=acorex-platform-layout-entity-attachments-page.component-D8iQnT-R.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-layout-entity-attachments-page.component-D8iQnT-R.mjs","sources":["../../../../libs/platform/layout/entity/src/lib/features/attachments-plugin/attachments-page/attachments-page.component.ts"],"sourcesContent":["import { AXPEntity } from '@acorex/platform/common';\nimport {\n AXPContextChangeEvent,\n AXPExecuteCommand,\n AXPExecuteCommandResult,\n type AXPActionMenuItem,\n} from '@acorex/platform/core';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n type AXPLayoutDetailsViewAction,\n} from '@acorex/platform/layout/views';\nimport {\n AXPWidgetContainerComponent,\n AXPWidgetCoreModule,\n AXPWidgetNode,\n type AXPWidgetCoreElement,\n type AXPWidgetCoreElementAPI,\n} from '@acorex/platform/layout/widget-core';\nimport { AXPEntityDefinitionRegistryService } from '../../../entity-registery.service';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n input,\n signal,\n Signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { get, merge } from 'lodash-es';\nimport { Subject, Subscription } from 'rxjs';\nimport {\n persistedAttachments,\n type AXPFileUploaderUploadActionDescriptor,\n} from '../../../widgets/file-uploader-widget';\n\nconst ATTACHMENTS_PAGE_SAVE_COMMAND = 'EntityAttachmentsPage:Save';\nconst ATTACHMENTS_PAGE_DISCARD_COMMAND = 'EntityAttachmentsPage:Discard';\nconst ATTACHMENTS_PAGE_UPLOAD_COMMAND = 'EntityAttachmentsPage:Upload';\n\ntype AttachmentsUploaderApi = AXPWidgetCoreElementAPI & {\n onDirtyChange?: Subject<boolean>;\n onUploadActionsChanged?: Subject<void>;\n getUploadActions?: () => AXPFileUploaderUploadActionDescriptor[];\n runUploadAction?: (plugin: string) => void | Promise<void>;\n markSaved?: () => void;\n syncBaseline?: (saved: unknown) => void;\n discardToBaseline?: () => void;\n isDirty?: () => boolean;\n};\n\n//#region ---- Attachments Page Component ----\n\n/**\n * Page component that renders the attachments property using the file-uploader widget.\n * Used when attachments plugin has display: 'page'.\n * Exposes Save/Discard footer actions (same pattern as questionnaire-questions-page).\n */\n@Component({\n selector: 'axm-attachments-page',\n standalone: true,\n imports: [AXPWidgetCoreModule],\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMAttachmentsPageComponent,\n },\n ],\n template: `\n @for (renderKey of [widgetRenderKey()]; track renderKey) {\n <axp-widgets-container #containerRef [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n @if (node(); as n) {\n <ng-container axp-widget-renderer [node]=\"n\" [mode]=\"'edit'\"></ng-container>\n }\n </axp-widgets-container>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.axp-page-layout-base]': 'true',\n },\n})\nexport class AXMAttachmentsPageComponent extends AXPPageLayoutBaseComponent {\n /** Default `{}`: avoid NG0950 before page-component-renderer calls setInput. */\n rootContext = input<Record<string, unknown>>({});\n pageConfig = input<Record<string, unknown>>();\n\n private route = inject(ActivatedRoute);\n private entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n private destroyRef = inject(DestroyRef);\n\n private containerRef = viewChild<AXPWidgetContainerComponent>('containerRef');\n\n private entityDef = signal<AXPEntity | null>(null);\n private localContext = signal<Record<string, unknown> | null>(null);\n protected isDirty = signal(false);\n private isSaving = signal(false);\n private previousRecordId = signal<string | undefined>(undefined);\n /** Recreates the inner widget container on discard so the file list resets. */\n protected widgetRenderKey = signal(0);\n private widgetWireGeneration = 0;\n private dirtySubscription?: Subscription;\n private uploadActionsSubscription?: Subscription;\n\n constructor() {\n super();\n\n effect((onCleanup) => {\n const moduleName = this.route.snapshot.parent?.paramMap.get('module');\n const entityName = this.route.snapshot.paramMap.get('entity');\n if (!moduleName || !entityName) {\n this.entityDef.set(null);\n return;\n }\n let cancelled = false;\n this.entityRegistry.resolve(moduleName, entityName).then((entity) => {\n if (!cancelled) {\n this.entityDef.set(entity);\n }\n });\n onCleanup(() => {\n cancelled = true;\n });\n });\n\n effect(() => {\n const ctx = this.rootContext();\n const recordId = typeof ctx?.['id'] === 'string' && ctx['id'].length > 0 ? ctx['id'] : undefined;\n if (!recordId || recordId === this.previousRecordId()) {\n return;\n }\n this.previousRecordId.set(recordId);\n this.localContext.set(null);\n this.isDirty.set(false);\n this.widgetRenderKey.update((key) => key + 1);\n });\n\n effect(() => {\n const field = this.fieldName();\n const node = this.node();\n const renderKey = this.widgetRenderKey();\n if (!node || !field) {\n return;\n }\n void this.wireUploaderWidget(field, renderKey);\n });\n }\n\n context: Signal<Record<string, unknown>> = computed(() => {\n const local = this.localContext();\n if (local != null) {\n return local;\n }\n return this.rootContext() ?? {};\n });\n\n protected fieldName = computed(() => {\n const config = this.pageConfig();\n return config && typeof (config as { field?: string }).field === 'string'\n ? (config as { field: string }).field\n : 'attachments';\n });\n\n protected recordId = computed((): string | undefined => {\n const id = this.rootContext()?.['id'];\n return typeof id === 'string' && id.length > 0 ? id : undefined;\n });\n\n node = computed<AXPWidgetNode | null>(() => {\n const field = this.fieldName();\n const entity = this.entityDef();\n if (!entity?.properties) {\n return null;\n }\n const prop = entity.properties.find((p: { name: string }) => p.name === field);\n if (!prop?.schema?.interface) {\n return null;\n }\n const widget = prop.schema.interface;\n return {\n type: widget.type,\n path: field,\n name: field,\n children: widget.children,\n valueTransforms: widget.valueTransforms,\n options: merge({}, widget.options),\n } as AXPWidgetNode;\n });\n\n protected showAddItemButton = computed(() => {\n const options = this.node()?.options;\n return options?.['showAddItemButton'] !== false;\n });\n\n override async getPrimaryMenuItems(): Promise<AXPLayoutDetailsViewAction[]> {\n const dirty = this.isDirty();\n const saving = this.isSaving();\n\n const uploadActions = this.showAddItemButton() ? [] : await this.buildUploadPrimaryActions();\n\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n\n return [\n ...uploadActions,\n {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: dirty,\n disabled: saving,\n command: { name: ATTACHMENTS_PAGE_DISCARD_COMMAND, options: {} },\n },\n {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: dirty,\n disabled: saving,\n command: { name: ATTACHMENTS_PAGE_SAVE_COMMAND, options: {} },\n },\n ];\n }\n\n onContextChanged(event: AXPContextChangeEvent): void {\n if (event.state !== 'changed' || this.isSaving()) {\n return;\n }\n\n const field = this.fieldName();\n const attachments = get(event.data, field);\n const base = this.localContext() ?? this.rootContext() ?? {};\n this.localContext.set({ ...base, [field]: attachments });\n }\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === ATTACHMENTS_PAGE_DISCARD_COMMAND) {\n this.handleDiscard();\n return;\n }\n if (command.name === ATTACHMENTS_PAGE_UPLOAD_COMMAND) {\n void this.handleUploadAction(command);\n return;\n }\n if (command.name !== ATTACHMENTS_PAGE_SAVE_COMMAND) {\n return;\n }\n return this.handleSave() as unknown as Promise<void>;\n }\n\n private handleDiscard(): void {\n const field = this.fieldName();\n this.localContext.set(null);\n this.isDirty.set(false);\n this.widgetRenderKey.update((key) => key + 1);\n this.recompute();\n }\n\n private async handleSave(): Promise<AXPExecuteCommandResult> {\n const field = this.fieldName();\n const id = this.recordId();\n const entity = this.entityDef();\n const updateExec = entity?.commands?.update?.execute as\n | ((payload: Record<string, unknown>) => Promise<unknown>)\n | undefined;\n const ctx = this.localContext() ?? this.rootContext() ?? {};\n const attachments = get(ctx, field);\n\n if (!field || !id || !updateExec) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n this.isSaving.set(true);\n this.recompute();\n try {\n await updateExec({ id, [field]: attachments });\n\n const persisted = persistedAttachments(attachments);\n\n // Keep displaying saved attachments; drop soft-deleted rows (onContextChanged is skipped while isSaving).\n this.localContext.set({ ...(this.rootContext() ?? {}), [field]: persisted });\n\n const uploader = await this.getUploaderWidget();\n uploader?.markSaved?.();\n this.isDirty.set(false);\n this.recompute();\n\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translateService.translateAsync('@general:messages.generic.success.description'),\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n return { success: true };\n } catch {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.error.title'),\n content: await this.translateService.translateAsync('@general:messages.entity.update-failed'),\n });\n return { success: false };\n } finally {\n this.isSaving.set(false);\n this.recompute();\n }\n }\n\n private async wireUploaderWidget(field: string, renderKey: number): Promise<void> {\n const generation = ++this.widgetWireGeneration;\n const container = this.containerRef();\n if (!container) {\n return;\n }\n\n const widget = await container.find(field);\n if (!widget || generation !== this.widgetWireGeneration) {\n return;\n }\n\n this.dirtySubscription?.unsubscribe();\n const api = (widget as AXPWidgetCoreElement).api() as AttachmentsUploaderApi;\n const savedAttachments = get(this.rootContext(), field);\n api.syncBaseline?.(savedAttachments);\n\n if (api.onDirtyChange instanceof Subject) {\n this.dirtySubscription = api.onDirtyChange.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((dirty) => {\n if (generation !== this.widgetWireGeneration) {\n return;\n }\n this.isDirty.set(dirty);\n this.recompute();\n });\n this.isDirty.set(api.isDirty?.() ?? false);\n this.recompute();\n }\n\n if (api.onUploadActionsChanged instanceof Subject) {\n this.uploadActionsSubscription?.unsubscribe();\n this.uploadActionsSubscription = api.onUploadActionsChanged\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (generation !== this.widgetWireGeneration) {\n return;\n }\n this.recompute();\n });\n }\n }\n\n private async buildUploadPrimaryActions(): Promise<AXPLayoutDetailsViewAction[]> {\n const uploader = await this.getUploaderWidget();\n const actions = uploader?.getUploadActions?.() ?? [];\n const readonly = Boolean(this.node()?.options?.['readonly']);\n\n if (readonly || actions.length === 0) {\n return [];\n }\n\n const items: AXPActionMenuItem[] = [];\n for (const action of actions) {\n items.push({\n title: action.textKey ?? action.text ?? action.plugin,\n icon: this.normalizePageDropdownIcon(action.icon),\n command: {\n name: ATTACHMENTS_PAGE_UPLOAD_COMMAND,\n options: { plugin: action.plugin },\n },\n });\n }\n\n return [\n {\n title: '@general:actions.add-item.title',\n icon: 'fa-light fa-plus',\n zone: 'header',\n priority: 'primary',\n color: 'primary',\n items,\n },\n ];\n }\n\n /** Page layout dropdown renders `fa-light {{ icon }}`; strip existing style prefix from widget actions. */\n private normalizePageDropdownIcon(icon?: string): string {\n if (!icon) {\n return 'fa-file-arrow-up';\n }\n return icon.replace(/^(fa-light|fa-solid|fa-regular)\\s+/, '');\n }\n\n private async handleUploadAction(command: AXPExecuteCommand): Promise<void> {\n const plugin = command.options?.['plugin'];\n if (typeof plugin !== 'string' || plugin.length === 0) {\n return;\n }\n const uploader = await this.getUploaderWidget();\n await uploader?.runUploadAction?.(plugin);\n }\n\n private async getUploaderWidget(): Promise<AttachmentsUploaderApi | undefined> {\n const container = this.containerRef();\n if (!container) {\n return undefined;\n }\n const widget = await container.find(this.fieldName());\n if (!widget) {\n return undefined;\n }\n return (widget as AXPWidgetCoreElement).api() as AttachmentsUploaderApi;\n }\n\n protected override recompute(): void {\n super.recompute();\n const maybeLayout = this.hostPageLayout as unknown as { recompute?: () => void };\n maybeLayout?.recompute?.();\n }\n}\n\n//#endregion\n"],"names":["i1"],"mappings":";;;;;;;;;;;AA0CA,MAAM,6BAA6B,GAAG,4BAA4B;AAClE,MAAM,gCAAgC,GAAG,+BAA+B;AACxE,MAAM,+BAA+B,GAAG,8BAA8B;AAatE;AAEA;;;;AAIG;AAyBG,MAAO,2BAA4B,SAAQ,0BAA0B,CAAA;AAuBzE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAtBT,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAA0B,EAAE,kFAAC;QAChD,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAErC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC3D,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC9E,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE/B,QAAA,IAAA,CAAA,YAAY,GAAG,SAAS,CAA8B,cAAc,mFAAC;AAErE,QAAA,IAAA,C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kBAxBvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC9B,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,2BAA6B;AACzC,yBAAA;AACF,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;AAQT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,8BAA8B,EAAE,MAAM;AACvC,qBAAA;AACF,iBAAA;8SAW+D,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as i1 from '@acorex/components/button';
|
|
2
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
3
|
+
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
4
|
+
import * as i3 from '@acorex/components/decorators';
|
|
5
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
6
|
+
import { AXLabelModule } from '@acorex/components/label';
|
|
7
|
+
import { AXBasePageComponent } from '@acorex/components/page';
|
|
8
|
+
import * as i6 from '@acorex/core/translation';
|
|
9
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
|
10
|
+
import * as i5 from '@angular/common';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
12
|
+
import * as i0 from '@angular/core';
|
|
13
|
+
import { input, computed, linkedSignal, Component } from '@angular/core';
|
|
14
|
+
import * as i3$1 from '@acorex/platform/layout/widget-core';
|
|
15
|
+
import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
16
|
+
|
|
17
|
+
class AXPFileListPopupComponent extends AXBasePageComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
//#region ---- Component Properties ----
|
|
21
|
+
/** Hydrated file rows only; storage prefixes are resolved in entity/mock middleware before UI. */
|
|
22
|
+
this.files = input([], ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/**
|
|
24
|
+
* When true, same as file-uploader `options.readonly` (no add/upload, list actions download-only).
|
|
25
|
+
* Use property name `isReadonly` in popup `data` so host/popup binding resolves the input.
|
|
26
|
+
*/
|
|
27
|
+
this.isReadonly = input(false, ...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
29
|
+
this.fileEditable = input(true, ...(ngDevMode ? [{ debugName: "fileEditable" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.accept = input('*', ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.maxFileSize = input(1024 * 1024 * 100, ...(ngDevMode ? [{ debugName: "maxFileSize" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Same as widget plugins (e.g. document) so hooks/actions run in popup too. */
|
|
33
|
+
this.plugins = input([], ...(ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.showAddItemButton = input(true, ...(ngDevMode ? [{ debugName: "showAddItemButton" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** File edit dialog options (mode + visible fields). */
|
|
36
|
+
this.editDialog = input(undefined, ...(ngDevMode ? [{ debugName: "editDialog" }] : /* istanbul ignore next */ []));
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ---- Computed Properties ----
|
|
39
|
+
/**
|
|
40
|
+
* Always render the edit widget so `options` (readonly, plugins, editDialog, …) match the entity form.
|
|
41
|
+
* Readonly behavior comes from `node.options.readonly`, not from view mode.
|
|
42
|
+
*/
|
|
43
|
+
this.mode = computed(() => 'edit', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ---- Context & Node Management ----
|
|
46
|
+
this.context = linkedSignal(() => ({}), ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.node = computed(() => ({
|
|
48
|
+
type: 'attachments',
|
|
49
|
+
path: 'files',
|
|
50
|
+
defaultValue: Array.isArray(this.files()) ? this.files() : [],
|
|
51
|
+
options: {
|
|
52
|
+
readonly: this.isReadonly(),
|
|
53
|
+
multiple: this.multiple(),
|
|
54
|
+
accept: this.accept(),
|
|
55
|
+
maxFileSize: this.maxFileSize(),
|
|
56
|
+
fileEditable: this.fileEditable(),
|
|
57
|
+
showAddItemButton: this.showAddItemButton(),
|
|
58
|
+
plugins: this.resolveInput(this.plugins, []),
|
|
59
|
+
editDialog: this.editDialog(),
|
|
60
|
+
},
|
|
61
|
+
}), ...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
62
|
+
}
|
|
63
|
+
onContextChanged(event) {
|
|
64
|
+
this.context.set(event.data);
|
|
65
|
+
}
|
|
66
|
+
/** Resolves input that may be a signal (input()) or a raw value when popup injects data. */
|
|
67
|
+
resolveInput(value, fallback) {
|
|
68
|
+
return typeof value === 'function' ? value() : (value ?? fallback);
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ---- UI Handlers ----
|
|
72
|
+
apply() {
|
|
73
|
+
this.close({
|
|
74
|
+
data: this.context(),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFileListPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
78
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPFileListPopupComponent, isStandalone: true, selector: "ng-component", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, fileEditable: { classPropertyName: "fileEditable", publicName: "fileEditable", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, showAddItemButton: { classPropertyName: "showAddItemButton", publicName: "showAddItemButton", isSignal: true, isRequired: false, transformFunction: null }, editDialog: { classPropertyName: "editDialog", publicName: "editDialog", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-p-2\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"node()\" [mode]=\"mode()\"></ng-container>\n </axp-widgets-container>\n</div>\n<ax-footer>\n <ax-suffix>\n @if (isReadonly()) {\n <ax-button [text]=\"'@general:actions.close.title' | translate | async\" (click)=\"close()\"></ax-button>\n } @else {\n <ax-button [text]=\"'@general:actions.discard.title' | translate | async\" (click)=\"close()\"></ax-button>\n <ax-button\n [text]=\"'@general:actions.apply.title' | translate | async\"\n (click)=\"apply()\"\n [color]=\"'primary'\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type:
|
|
79
|
+
//
|
|
80
|
+
AXLabelModule }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.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: 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: AXTranslationModule }, { kind: "ngmodule", type:
|
|
81
|
+
//
|
|
82
|
+
AXPWidgetCoreModule }, { kind: "component", type: i3$1.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged", "onLoad"], exportAs: ["widgetRenderer"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }] }); }
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFileListPopupComponent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{ imports: [
|
|
87
|
+
CommonModule,
|
|
88
|
+
//
|
|
89
|
+
AXLabelModule,
|
|
90
|
+
AXCheckBoxModule,
|
|
91
|
+
AXDecoratorModule,
|
|
92
|
+
AXButtonModule,
|
|
93
|
+
AXTranslationModule,
|
|
94
|
+
//
|
|
95
|
+
AXPWidgetCoreModule,
|
|
96
|
+
], template: "<div class=\"ax-p-2\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"node()\" [mode]=\"mode()\"></ng-container>\n </axp-widgets-container>\n</div>\n<ax-footer>\n <ax-suffix>\n @if (isReadonly()) {\n <ax-button [text]=\"'@general:actions.close.title' | translate | async\" (click)=\"close()\"></ax-button>\n } @else {\n <ax-button [text]=\"'@general:actions.discard.title' | translate | async\" (click)=\"close()\"></ax-button>\n <ax-button\n [text]=\"'@general:actions.apply.title' | translate | async\"\n (click)=\"apply()\"\n [color]=\"'primary'\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n" }]
|
|
97
|
+
}], propDecorators: { files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], fileEditable: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileEditable", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }], showAddItemButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAddItemButton", required: false }] }], editDialog: [{ type: i0.Input, args: [{ isSignal: true, alias: "editDialog", required: false }] }] } });
|
|
98
|
+
|
|
99
|
+
export { AXPFileListPopupComponent };
|
|
100
|
+
//# sourceMappingURL=acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs","sources":["../../../../libs/platform/layout/entity/src/lib/widgets/file-uploader-widget/file-list-popup/file-list-popup.component.ts","../../../../libs/platform/layout/entity/src/lib/widgets/file-uploader-widget/file-list-popup/file-list-popup.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLabelModule } from '@acorex/components/label';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPContextChangeEvent, AXPFileListItem } from '@acorex/platform/core';\nimport { CommonModule } from '@angular/common';\nimport { Component, computed, input, linkedSignal } from '@angular/core';\nimport { AXPWidgetCoreModule, AXPWidgetNode } from '@acorex/platform/layout/widget-core';\nimport type { AXPFileUploaderEditDialogOptions } from '../file-uploader-widget.types';\n\n@Component({\n imports: [\n CommonModule,\n //\n AXLabelModule,\n AXCheckBoxModule,\n AXDecoratorModule,\n AXButtonModule,\n AXTranslationModule,\n //\n AXPWidgetCoreModule,\n ],\n templateUrl: './file-list-popup.component.html',\n})\nexport class AXPFileListPopupComponent extends AXBasePageComponent {\n //#region ---- Component Properties ----\n\n /** Hydrated file rows only; storage prefixes are resolved in entity/mock middleware before UI. */\n files = input<AXPFileListItem[]>([]);\n /**\n * When true, same as file-uploader `options.readonly` (no add/upload, list actions download-only).\n * Use property name `isReadonly` in popup `data` so host/popup binding resolves the input.\n */\n isReadonly = input<boolean>(false);\n multiple = input<boolean>(false);\n fileEditable = input<boolean>(true);\n accept = input<string>('*');\n maxFileSize = input<number>(1024 * 1024 * 100);\n /** Same as widget plugins (e.g. document) so hooks/actions run in popup too. */\n plugins = input<{ name: string; options?: unknown }[]>([]);\n showAddItemButton = input<boolean>(true);\n /** File edit dialog options (mode + visible fields). */\n editDialog = input<AXPFileUploaderEditDialogOptions | undefined>(undefined);\n\n //#endregion\n\n //#region ---- Computed Properties ----\n\n /**\n * Always render the edit widget so `options` (readonly, plugins, editDialog, …) match the entity form.\n * Readonly behavior comes from `node.options.readonly`, not from view mode.\n */\n protected mode = computed(() => 'edit' as const);\n\n //#endregion\n\n //#region ---- Context & Node Management ----\n\n protected context = linkedSignal<{}>(() => ({}));\n\n protected onContextChanged(event: AXPContextChangeEvent) {\n this.context.set(event.data);\n }\n\n /** Resolves input that may be a signal (input()) or a raw value when popup injects data. */\n private resolveInput<T>(value: (() => T) | T, fallback: T): T {\n return typeof value === 'function' ? (value as () => T)() : (value ?? fallback);\n }\n\n protected node = computed<AXPWidgetNode>(() => ({\n type: 'attachments',\n path: 'files',\n defaultValue: Array.isArray(this.files()) ? this.files() : [],\n options: {\n readonly: this.isReadonly(),\n multiple: this.multiple(),\n accept: this.accept(),\n maxFileSize: this.maxFileSize(),\n fileEditable: this.fileEditable(),\n showAddItemButton: this.showAddItemButton(),\n plugins: this.resolveInput(this.plugins, []),\n editDialog: this.editDialog(),\n },\n }));\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n apply() {\n this.close({\n data: this.context(),\n });\n }\n\n //#endregion\n}\n","<div class=\"ax-p-2\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"node()\" [mode]=\"mode()\"></ng-container>\n </axp-widgets-container>\n</div>\n<ax-footer>\n <ax-suffix>\n @if (isReadonly()) {\n <ax-button [text]=\"'@general:actions.close.title' | translate | async\" (click)=\"close()\"></ax-button>\n } @else {\n <ax-button [text]=\"'@general:actions.discard.title' | translate | async\" (click)=\"close()\"></ax-button>\n <ax-button\n [text]=\"'@general:actions.apply.title' | translate | async\"\n (click)=\"apply()\"\n [color]=\"'primary'\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n"],"names":["i1","i3","i4","i5"],"mappings":";;;;;;;;;;;;;;;;AA0BM,MAAO,yBAA0B,SAAQ,mBAAmB,CAAA;AAdlE,IAAA,WAAA,GAAA;;;;AAkBE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAoB,EAAE,4EAAC;AACpC;;;AAGG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,KAAK,iFAAC;AAClC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;AAChC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,IAAI,mFAAC;AACnC,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,GAAG,6EAAC;QAC3B,IAAA,CAA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