@acorex/modules 19.1.6 → 19.1.7
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-modules-form-template-management.mjs +538 -507
- package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +23 -1
- package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-text-template-management.mjs +27 -1
- package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
- package/form-template-management/lib/search-definition.provider.d.ts +4 -0
- package/package.json +4 -8
- package/platform-management/index.d.ts +1 -0
- package/platform-management/lib/const.d.ts +1 -0
- package/platform-management/lib/text-search/index.d.ts +2 -0
- package/platform-management/lib/text-search/text-search.service.d.ts +10 -0
- package/platform-management/lib/text-search/text-search.types.d.ts +9 -0
- package/text-template-management/lib/search-definition.provider.d.ts +4 -0
- package/backend/README.md +0 -4
- package/backend/index.d.ts +0 -4
- package/backend/lib/auth/oidc/application.loader.d.ts +0 -16
- package/backend/lib/auth/oidc/configuration.service.d.ts +0 -60
- package/backend/lib/auth/oidc/feature.loader.d.ts +0 -6
- package/backend/lib/auth/oidc/index.d.ts +0 -6
- package/backend/lib/auth/oidc/oidc.strategy.d.ts +0 -50
- package/backend/lib/auth/oidc/permission.loader.d.ts +0 -14
- package/backend/lib/auth/oidc/signincallback.component.d.ts +0 -12
- package/backend/lib/auth/oidc/tenant.loader.d.ts +0 -16
- package/backend/lib/backend.configs.d.ts +0 -94
- package/backend/lib/backend.module.d.ts +0 -9
- package/backend/lib/data/api/comment.service.d.ts +0 -16
- package/backend/lib/data/api/data-provider.d.ts +0 -26
- package/backend/lib/data/api/file.service.d.ts +0 -16
- package/backend/lib/data/api/module-designer.service.d.ts +0 -43
- package/backend/lib/data/index.d.ts +0 -4
- package/fesm2022/acorex-modules-backend.mjs +0 -943
- package/fesm2022/acorex-modules-backend.mjs.map +0 -1
@@ -1,21 +1,391 @@
|
|
1
|
-
import { AXMEntityCrudServiceImpl, AXPDataGenerator, AXPWorkflowNavigateAction, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
1
|
+
import { AXMEntityCrudServiceImpl, AXPDataGenerator, AXPWorkflowNavigateAction, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
2
|
+
import * as i2 from '@acorex/platform/layout/builder';
|
3
|
+
import { AXPWidgetComponent, AXPLayoutBuilderModule, AXP_WIDGETS_ADVANCE_GROUP, createStringProperty, AXP_WIDGETS_LAYOUT_GROUP, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
4
|
+
import { AXPDesignerService, AXPWidgetDesignerRendererDirective, AXPDesignerAddWidgetMiniButtonComponent, AXPDesignerConnector } from '@acorex/platform/layout/designer';
|
2
5
|
import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
3
6
|
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_BEHAVIOR_PROPERTY_GROUP, AXPWidgetsModule } from '@acorex/platform/widgets';
|
7
|
+
import * as i2$1 from '@acorex/platform/workflow';
|
8
|
+
import { AXPWorkflowService, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
|
4
9
|
import * as i0 from '@angular/core';
|
5
|
-
import {
|
10
|
+
import { InjectionToken, inject, Injectable, computed, signal, effect, Component, ChangeDetectionStrategy, HostBinding, NgModule, Injector } from '@angular/core';
|
6
11
|
import { ROUTES } from '@angular/router';
|
7
|
-
import * as i2 from '@acorex/platform/layout/builder';
|
8
|
-
import { AXPWidgetComponent, AXP_WIDGETS_LAYOUT_GROUP, AXPLayoutBuilderModule, AXP_WIDGETS_ADVANCE_GROUP, createStringProperty, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
9
|
-
import { AXButtonModule } from '@acorex/components/button';
|
10
12
|
import * as i3 from '@acorex/core/translation';
|
11
13
|
import { AXTranslationModule } from '@acorex/core/translation';
|
12
|
-
import * as i2$1 from '@acorex/platform/workflow';
|
13
|
-
import { AXPWorkflowService, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
|
14
14
|
import * as i1 from '@angular/common';
|
15
15
|
import { CommonModule } from '@angular/common';
|
16
|
-
import {
|
17
|
-
import { get, sortBy } from 'lodash-es';
|
16
|
+
import { sortBy, get } from 'lodash-es';
|
18
17
|
import { AXPopupService } from '@acorex/components/popup';
|
18
|
+
import { AXButtonModule } from '@acorex/components/button';
|
19
|
+
|
20
|
+
const AXP_TEMPLATE_WIDGET_PROVIDER = new InjectionToken('AXP_TEMPLATE_WIDGET_PROVIDER');
|
21
|
+
class AXPTemplateWidgetProviderService {
|
22
|
+
constructor() {
|
23
|
+
this.popupService = inject(AXPopupService);
|
24
|
+
this.providers = inject(AXP_TEMPLATE_WIDGET_PROVIDER, { optional: true });
|
25
|
+
}
|
26
|
+
async items(query) {
|
27
|
+
if (Array.isArray(this.providers)) {
|
28
|
+
const result = [];
|
29
|
+
for (const provider of this.providers) {
|
30
|
+
const items = await provider.items(query);
|
31
|
+
if (items) {
|
32
|
+
result.push(...items);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return result;
|
36
|
+
}
|
37
|
+
else {
|
38
|
+
return [];
|
39
|
+
}
|
40
|
+
}
|
41
|
+
async get(id) {
|
42
|
+
if (Array.isArray(this.providers)) {
|
43
|
+
for (const provider of this.providers) {
|
44
|
+
const node = await provider.get(id);
|
45
|
+
if (node) {
|
46
|
+
return node;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
return null;
|
51
|
+
}
|
52
|
+
async chooseTemplate() {
|
53
|
+
const com = await import('./acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs').then((c) => c.AXPTemplateWidgetPickerComponent);
|
54
|
+
const widgets = await this.items({
|
55
|
+
skip: 0,
|
56
|
+
take: 100,
|
57
|
+
filter: {
|
58
|
+
field: 'type.id',
|
59
|
+
value: 20,
|
60
|
+
operator: {
|
61
|
+
type: 'equal',
|
62
|
+
}
|
63
|
+
}
|
64
|
+
});
|
65
|
+
const result = await this.popupService.open(com, {
|
66
|
+
title: 'Widget Template Gallery',
|
67
|
+
size: 'md',
|
68
|
+
closeButton: true,
|
69
|
+
data: {
|
70
|
+
widgets: sortBy(widgets, (c) => c.title),
|
71
|
+
},
|
72
|
+
});
|
73
|
+
if (result.data) {
|
74
|
+
const selected = result.data?.widgets;
|
75
|
+
return selected[0];
|
76
|
+
}
|
77
|
+
return null;
|
78
|
+
}
|
79
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
80
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, providedIn: 'root' }); }
|
81
|
+
}
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, decorators: [{
|
83
|
+
type: Injectable,
|
84
|
+
args: [{ providedIn: 'root' }]
|
85
|
+
}] });
|
86
|
+
|
87
|
+
class AXPTemplateWidgetViewComponent extends AXPWidgetComponent {
|
88
|
+
constructor() {
|
89
|
+
super();
|
90
|
+
this.metaKey = '__meta__';
|
91
|
+
this.templateProvider = inject(AXPTemplateWidgetProviderService);
|
92
|
+
this.templateId = computed(() => this.options()['templateId']);
|
93
|
+
this.nodes = signal([]);
|
94
|
+
//
|
95
|
+
effect(async () => {
|
96
|
+
this.nodes.set([]);
|
97
|
+
const value = this.getValue();
|
98
|
+
const templateId = get(value, `${this.metaKey}.templateId`) ?? this.templateId();
|
99
|
+
if (templateId) {
|
100
|
+
const item = await this.templateProvider.get(templateId);
|
101
|
+
if (item) {
|
102
|
+
this.nodes.set(item.nodes);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
});
|
106
|
+
}
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
108
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetViewComponent, isStandalone: true, selector: "axp-template-widget-view", usesInheritance: true, ngImport: i0, template: `
|
109
|
+
@for (node of nodes(); track $index) {
|
110
|
+
<ng-container axp-widget-renderer
|
111
|
+
[node]="node"
|
112
|
+
[parentNode]="this"
|
113
|
+
[mode]="this.mode"
|
114
|
+
>
|
115
|
+
</ng-container>
|
116
|
+
}
|
117
|
+
@empty {
|
118
|
+
<span class="ax-underline ax-decoration-dotted ax-underline-offset-8 ax-text-gray-400">
|
119
|
+
{{ 'empty-template' | translate : { scope: 'form-template-management' } | async }}
|
120
|
+
</span>
|
121
|
+
}
|
122
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "directive", type: i2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
123
|
+
}
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetViewComponent, decorators: [{
|
125
|
+
type: Component,
|
126
|
+
args: [{
|
127
|
+
selector: 'axp-template-widget-view',
|
128
|
+
template: `
|
129
|
+
@for (node of nodes(); track $index) {
|
130
|
+
<ng-container axp-widget-renderer
|
131
|
+
[node]="node"
|
132
|
+
[parentNode]="this"
|
133
|
+
[mode]="this.mode"
|
134
|
+
>
|
135
|
+
</ng-container>
|
136
|
+
}
|
137
|
+
@empty {
|
138
|
+
<span class="ax-underline ax-decoration-dotted ax-underline-offset-8 ax-text-gray-400">
|
139
|
+
{{ 'empty-template' | translate : { scope: 'form-template-management' } | async }}
|
140
|
+
</span>
|
141
|
+
}
|
142
|
+
`,
|
143
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
144
|
+
imports: [CommonModule, AXPLayoutBuilderModule, AXTranslationModule]
|
145
|
+
}]
|
146
|
+
}], ctorParameters: () => [] });
|
147
|
+
|
148
|
+
var templateWidgetView_component = /*#__PURE__*/Object.freeze({
|
149
|
+
__proto__: null,
|
150
|
+
AXPTemplateWidgetViewComponent: AXPTemplateWidgetViewComponent
|
151
|
+
});
|
152
|
+
|
153
|
+
const AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU = {
|
154
|
+
text: 'Choose Template',
|
155
|
+
name: 'choose',
|
156
|
+
icon: 'fa-solid fa-folder-open',
|
157
|
+
};
|
158
|
+
class AXPTemplateWidgetDesignerComponent extends AXPWidgetComponent {
|
159
|
+
constructor() {
|
160
|
+
super();
|
161
|
+
this.templateProvider = inject(AXPTemplateWidgetProviderService);
|
162
|
+
this.designerService = inject(AXPDesignerService);
|
163
|
+
this.templateId = computed(() => this.options()['templateId']);
|
164
|
+
this.nodes = signal([]);
|
165
|
+
this.title = signal(null);
|
166
|
+
//
|
167
|
+
effect(async () => {
|
168
|
+
this.nodes.set([]);
|
169
|
+
if (this.templateId()) {
|
170
|
+
const item = await this.templateProvider.get(this.templateId());
|
171
|
+
if (item && item.nodes?.length > 0) {
|
172
|
+
this.title.set(item.title);
|
173
|
+
this.nodes.set(item.nodes);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
});
|
177
|
+
}
|
178
|
+
// override async ngOnInit() {
|
179
|
+
// super.ngOnInit();
|
180
|
+
// if (!this.templateId()) {
|
181
|
+
// this.handleChooseWidget();
|
182
|
+
// }
|
183
|
+
// }
|
184
|
+
async handleChooseWidget() {
|
185
|
+
const result = await this.templateProvider.chooseTemplate();
|
186
|
+
if (result) {
|
187
|
+
this.designerService.update({
|
188
|
+
mode: 'update',
|
189
|
+
values: { options: { templateId: result.id } },
|
190
|
+
widget: this.node,
|
191
|
+
});
|
192
|
+
}
|
193
|
+
}
|
194
|
+
get __class() {
|
195
|
+
const cls = {};
|
196
|
+
//
|
197
|
+
cls[`ax-w-full`] = true;
|
198
|
+
cls[`ax-widget-outline`] = true;
|
199
|
+
//
|
200
|
+
cls[`ax-block`] = true;
|
201
|
+
return cls;
|
202
|
+
}
|
203
|
+
onContextMenu(context) {
|
204
|
+
const items = [
|
205
|
+
AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU
|
206
|
+
];
|
207
|
+
items[items.length - 1].break = true;
|
208
|
+
context.items.unshift(...items);
|
209
|
+
}
|
210
|
+
async executeCommand(command) {
|
211
|
+
switch (command.name) {
|
212
|
+
case AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU.name:
|
213
|
+
await this.handleChooseWidget();
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
return Promise.resolve();
|
217
|
+
}
|
218
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
219
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetDesignerComponent, isStandalone: true, selector: "axp-template-widget-designer", host: { properties: { "class": "this.__class" } }, providers: [
|
220
|
+
{
|
221
|
+
provide: AXPTemplateWidgetDesignerComponent,
|
222
|
+
useExisting: AXPWidgetComponent,
|
223
|
+
},
|
224
|
+
], usesInheritance: true, ngImport: i0, template: `
|
225
|
+
@if(nodes().length) {
|
226
|
+
<div class="ax-relative ax-block ax-w-full ax-pointer-events-none">
|
227
|
+
@for (node of nodes(); track $index) {
|
228
|
+
<ng-container axp-widget-designer-renderer [locked]="true" [node]="node" [parentNode]="this" [mode]="this.mode"> </ng-container>
|
229
|
+
}
|
230
|
+
<div
|
231
|
+
class="ax-absolute ax-top-0 ax-bottom-0 ax-left-0 ax-right-0 ax-bg-blue-400 ax-opacity-30 ax-flex ax-justify-center ax-items-center ax-z-[400]"
|
232
|
+
>
|
233
|
+
<span class="ax-capitalize ax-font-semibold ax-text-primary-700"> {{ title() }}</span>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
} @else {
|
237
|
+
<axp-designer-add-widget-mini-button
|
238
|
+
class="ax-flex-1 ax-self-center ax-place-self-end"
|
239
|
+
(onClick)="handleChooseWidget()"
|
240
|
+
>
|
241
|
+
</axp-designer-add-widget-mini-button>
|
242
|
+
}
|
243
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "directive", type: AXPWidgetDesignerRendererDirective, selector: "[axp-widget-designer-renderer]", inputs: ["parentNode", "index", "locked", "mode", "node"] }, { kind: "component", type: AXPDesignerAddWidgetMiniButtonComponent, selector: "axp-designer-add-widget-mini-button", outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
244
|
+
}
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetDesignerComponent, decorators: [{
|
246
|
+
type: Component,
|
247
|
+
args: [{
|
248
|
+
selector: 'axp-template-widget-designer',
|
249
|
+
template: `
|
250
|
+
@if(nodes().length) {
|
251
|
+
<div class="ax-relative ax-block ax-w-full ax-pointer-events-none">
|
252
|
+
@for (node of nodes(); track $index) {
|
253
|
+
<ng-container axp-widget-designer-renderer [locked]="true" [node]="node" [parentNode]="this" [mode]="this.mode"> </ng-container>
|
254
|
+
}
|
255
|
+
<div
|
256
|
+
class="ax-absolute ax-top-0 ax-bottom-0 ax-left-0 ax-right-0 ax-bg-blue-400 ax-opacity-30 ax-flex ax-justify-center ax-items-center ax-z-[400]"
|
257
|
+
>
|
258
|
+
<span class="ax-capitalize ax-font-semibold ax-text-primary-700"> {{ title() }}</span>
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
} @else {
|
262
|
+
<axp-designer-add-widget-mini-button
|
263
|
+
class="ax-flex-1 ax-self-center ax-place-self-end"
|
264
|
+
(onClick)="handleChooseWidget()"
|
265
|
+
>
|
266
|
+
</axp-designer-add-widget-mini-button>
|
267
|
+
}
|
268
|
+
`,
|
269
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
270
|
+
imports: [
|
271
|
+
CommonModule,
|
272
|
+
AXPLayoutBuilderModule,
|
273
|
+
AXPWidgetDesignerRendererDirective,
|
274
|
+
AXPDesignerAddWidgetMiniButtonComponent,
|
275
|
+
],
|
276
|
+
providers: [
|
277
|
+
{
|
278
|
+
provide: AXPTemplateWidgetDesignerComponent,
|
279
|
+
useExisting: AXPWidgetComponent,
|
280
|
+
},
|
281
|
+
]
|
282
|
+
}]
|
283
|
+
}], ctorParameters: () => [], propDecorators: { __class: [{
|
284
|
+
type: HostBinding,
|
285
|
+
args: ['class']
|
286
|
+
}] } });
|
287
|
+
|
288
|
+
var templateWidgetDesigner_component = /*#__PURE__*/Object.freeze({
|
289
|
+
__proto__: null,
|
290
|
+
AXPTemplateWidgetDesignerComponent: AXPTemplateWidgetDesignerComponent,
|
291
|
+
AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU: AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU
|
292
|
+
});
|
293
|
+
|
294
|
+
const AXPTemplateWidget = {
|
295
|
+
name: 'template',
|
296
|
+
title: 'Template',
|
297
|
+
type: 'container',
|
298
|
+
icon: 'fa-solid fa-file-invoice',
|
299
|
+
group: AXP_WIDGETS_ADVANCE_GROUP,
|
300
|
+
visible: true,
|
301
|
+
options: {
|
302
|
+
canInsert: false,
|
303
|
+
},
|
304
|
+
properties: [
|
305
|
+
AXP_NAME_PROPERTY,
|
306
|
+
AXP_DATA_PATH_PROPERTY,
|
307
|
+
createStringProperty({
|
308
|
+
name: 'options.templateId',
|
309
|
+
title: 'Template',
|
310
|
+
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
311
|
+
visible: false,
|
312
|
+
}),
|
313
|
+
],
|
314
|
+
components: {
|
315
|
+
view: {
|
316
|
+
component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
|
317
|
+
},
|
318
|
+
edit: {
|
319
|
+
component: () => import('./acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs').then((c) => c.AXPTemplateWidgetEditComponent),
|
320
|
+
},
|
321
|
+
print: {
|
322
|
+
component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
|
323
|
+
},
|
324
|
+
designer: {
|
325
|
+
component: () => Promise.resolve().then(function () { return templateWidgetDesigner_component; }).then((c) => c.AXPTemplateWidgetDesignerComponent),
|
326
|
+
},
|
327
|
+
},
|
328
|
+
};
|
329
|
+
|
330
|
+
class AXPTemplateDesignerWidgetViewComponent extends AXPWidgetComponent {
|
331
|
+
constructor() {
|
332
|
+
super(...arguments);
|
333
|
+
this.workflow = inject(AXPWorkflowService);
|
334
|
+
}
|
335
|
+
async handleClick() {
|
336
|
+
await this.workflow.execute('design-form-template', { data: { id: this.extractValue('id') } });
|
337
|
+
}
|
338
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateDesignerWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
339
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXPTemplateDesignerWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
340
|
+
<span
|
341
|
+
class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
|
342
|
+
(click)="handleClick()"
|
343
|
+
>
|
344
|
+
{{ 't("edit-template",{ scope:"form-template-management" })' | translate | async }}
|
345
|
+
</span>
|
346
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
347
|
+
}
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateDesignerWidgetViewComponent, decorators: [{
|
349
|
+
type: Component,
|
350
|
+
args: [{
|
351
|
+
template: `
|
352
|
+
<span
|
353
|
+
class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
|
354
|
+
(click)="handleClick()"
|
355
|
+
>
|
356
|
+
{{ 't("edit-template",{ scope:"form-template-management" })' | translate | async }}
|
357
|
+
</span>
|
358
|
+
`,
|
359
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
360
|
+
imports: [CommonModule, AXButtonModule, AXTranslationModule]
|
361
|
+
}]
|
362
|
+
}] });
|
363
|
+
|
364
|
+
var templateDesignerWidgetView_component = /*#__PURE__*/Object.freeze({
|
365
|
+
__proto__: null,
|
366
|
+
AXPTemplateDesignerWidgetViewComponent: AXPTemplateDesignerWidgetViewComponent
|
367
|
+
});
|
368
|
+
|
369
|
+
const AXPTemplateDesignerWidget = {
|
370
|
+
name: "template-designer",
|
371
|
+
title: "Template Designer",
|
372
|
+
icon: "fa-solid fa-square",
|
373
|
+
type: 'editor',
|
374
|
+
group: AXP_WIDGETS_LAYOUT_GROUP,
|
375
|
+
visible: false,
|
376
|
+
properties: [
|
377
|
+
AXP_NAME_PROPERTY,
|
378
|
+
AXP_DATA_PATH_PROPERTY,
|
379
|
+
],
|
380
|
+
components: {
|
381
|
+
view: {
|
382
|
+
component: () => Promise.resolve().then(function () { return templateDesignerWidgetView_component; }).then((c) => c.AXPTemplateDesignerWidgetViewComponent),
|
383
|
+
},
|
384
|
+
edit: {
|
385
|
+
component: () => Promise.resolve().then(function () { return templateDesignerWidgetView_component; }).then((c) => c.AXPTemplateDesignerWidgetViewComponent),
|
386
|
+
}
|
387
|
+
}
|
388
|
+
};
|
19
389
|
|
20
390
|
const AXMFormTemplateManagementModuleConst = {
|
21
391
|
moduleName: 'FormTemplateManagement',
|
@@ -157,104 +527,32 @@ class AXMMenuProvider {
|
|
157
527
|
}
|
158
528
|
}
|
159
529
|
|
160
|
-
class
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateDesignerWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
169
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXPTemplateDesignerWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
170
|
-
<span
|
171
|
-
class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
|
172
|
-
(click)="handleClick()"
|
173
|
-
>
|
174
|
-
{{ 't("edit-template",{ scope:"form-template-management" })' | translate | async }}
|
175
|
-
</span>
|
176
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
177
|
-
}
|
178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateDesignerWidgetViewComponent, decorators: [{
|
179
|
-
type: Component,
|
180
|
-
args: [{
|
181
|
-
template: `
|
182
|
-
<span
|
183
|
-
class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
|
184
|
-
(click)="handleClick()"
|
185
|
-
>
|
186
|
-
{{ 't("edit-template",{ scope:"form-template-management" })' | translate | async }}
|
187
|
-
</span>
|
188
|
-
`,
|
189
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
190
|
-
imports: [CommonModule, AXButtonModule, AXTranslationModule]
|
191
|
-
}]
|
192
|
-
}] });
|
193
|
-
|
194
|
-
var templateDesignerWidgetView_component = /*#__PURE__*/Object.freeze({
|
195
|
-
__proto__: null,
|
196
|
-
AXPTemplateDesignerWidgetViewComponent: AXPTemplateDesignerWidgetViewComponent
|
197
|
-
});
|
198
|
-
|
199
|
-
const AXPTemplateDesignerWidget = {
|
200
|
-
name: "template-designer",
|
201
|
-
title: "Template Designer",
|
202
|
-
icon: "fa-solid fa-square",
|
203
|
-
type: 'editor',
|
204
|
-
group: AXP_WIDGETS_LAYOUT_GROUP,
|
205
|
-
visible: false,
|
206
|
-
properties: [
|
207
|
-
AXP_NAME_PROPERTY,
|
208
|
-
AXP_DATA_PATH_PROPERTY,
|
209
|
-
],
|
210
|
-
components: {
|
211
|
-
view: {
|
212
|
-
component: () => Promise.resolve().then(function () { return templateDesignerWidgetView_component; }).then((c) => c.AXPTemplateDesignerWidgetViewComponent),
|
213
|
-
},
|
214
|
-
edit: {
|
215
|
-
component: () => Promise.resolve().then(function () { return templateDesignerWidgetView_component; }).then((c) => c.AXPTemplateDesignerWidgetViewComponent),
|
216
|
-
}
|
217
|
-
}
|
218
|
-
};
|
219
|
-
|
220
|
-
const AXMCreateFormTemplateWorkflow = {
|
221
|
-
startStepId: 'create-form-template',
|
222
|
-
steps: {
|
223
|
-
"create-form-template": {
|
224
|
-
action: 'start-workflow',
|
225
|
-
input: {
|
226
|
-
workflow: "create-entity",
|
227
|
-
context: {
|
228
|
-
redirect: true,
|
229
|
-
entity: `${AXMFormTemplateManagementModuleConst.moduleName}.${AXMFormTemplateManagementModuleConst.templateEntity}`,
|
230
|
-
}
|
231
|
-
},
|
232
|
-
nextSteps: [
|
233
|
-
{
|
234
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
235
|
-
nextStepId: 'get-template-confirmaton',
|
530
|
+
class AXMFormTemplateManagementModuleSearchProvider {
|
531
|
+
async provide(context) {
|
532
|
+
context.addDefinition(`record.${AXMFormTemplateManagementModuleConst.moduleName}.${AXMFormTemplateManagementModuleConst.categoryEntity}`, 'Form Template Category', 'fa-solid fa-file-dashed-line', [
|
533
|
+
{
|
534
|
+
name: 'open',
|
535
|
+
command: {
|
536
|
+
name: 'view',
|
537
|
+
options: {},
|
236
538
|
},
|
237
|
-
|
238
|
-
|
239
|
-
"get-template-confirmaton": {
|
240
|
-
action: 'show-prompt-dialog',
|
241
|
-
input: {
|
242
|
-
title: 'Confirm Action',
|
243
|
-
message: `Would you like to proceed with starting template design?`,
|
244
|
-
type: 'primary',
|
539
|
+
type: 'view',
|
540
|
+
priority: 'primary',
|
245
541
|
},
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
542
|
+
]);
|
543
|
+
context.addDefinition(`record.${AXMFormTemplateManagementModuleConst.moduleName}.${AXMFormTemplateManagementModuleConst.templateEntity}`, 'Form Templates', 'fa-light fa-align-justify', [
|
544
|
+
{
|
545
|
+
name: 'open',
|
546
|
+
command: {
|
547
|
+
name: 'view',
|
548
|
+
options: {},
|
250
549
|
},
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
};
|
550
|
+
type: 'view',
|
551
|
+
priority: 'primary',
|
552
|
+
},
|
553
|
+
]);
|
554
|
+
}
|
555
|
+
}
|
258
556
|
|
259
557
|
class AXPDesignerConnectorImpl extends AXPDesignerConnector {
|
260
558
|
constructor() {
|
@@ -284,397 +582,59 @@ class AXPDesignerConnectorImpl extends AXPDesignerConnector {
|
|
284
582
|
type: AXMFormTemplateTypes.Widget,
|
285
583
|
template: content.json,
|
286
584
|
categoryId: (await this.categoryEntityService.query()).items[0]?.id
|
287
|
-
}
|
288
|
-
});
|
289
|
-
return result.getOutput('result');
|
290
|
-
}
|
291
|
-
async load(id) {
|
292
|
-
const item = await this.templateEntityService.getOne(id);
|
293
|
-
if (item) {
|
294
|
-
return item.template;
|
295
|
-
}
|
296
|
-
else {
|
297
|
-
throw Error("Invalid Id");
|
298
|
-
}
|
299
|
-
}
|
300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
301
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl }); }
|
302
|
-
}
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl, decorators: [{
|
304
|
-
type: Injectable
|
305
|
-
}] });
|
306
|
-
|
307
|
-
class AXMOpenFormTemplateDesignerAction extends AXPWorkflowAction {
|
308
|
-
constructor() {
|
309
|
-
super(...arguments);
|
310
|
-
this.navigation = inject(AXPWorkflowNavigateAction);
|
311
|
-
}
|
312
|
-
async execute(context) {
|
313
|
-
const { id } = context.getVariable('data');
|
314
|
-
context.setVariable('payload', {
|
315
|
-
commands: `forms/designer?id=${id}`,
|
316
|
-
target: 'blank'
|
317
|
-
});
|
318
|
-
await this.navigation.execute(context);
|
319
|
-
}
|
320
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
321
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction }); }
|
322
|
-
}
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction, decorators: [{
|
324
|
-
type: Injectable
|
325
|
-
}] });
|
326
|
-
const AXMDesignFormTemplateWorkflow = {
|
327
|
-
startStepId: 'open-design-designer',
|
328
|
-
steps: {
|
329
|
-
"open-design-designer": {
|
330
|
-
action: 'open-form-template-designer',
|
331
|
-
},
|
332
|
-
},
|
333
|
-
};
|
334
|
-
|
335
|
-
class AXPTemplateWidgetProviderImpl {
|
336
|
-
constructor() {
|
337
|
-
this.service = inject(AXMFormTemplateManagementTemplateEntityService);
|
338
|
-
}
|
339
|
-
async items(query) {
|
340
|
-
const result = ((await this.service.query(query)).items).map(c => ({
|
341
|
-
id: c.id,
|
342
|
-
title: c.title,
|
343
|
-
group: {
|
344
|
-
name: c.categoryId,
|
345
|
-
order: 2,
|
346
|
-
title: get(c, 'category.title') ?? 'Custom'
|
347
|
-
},
|
348
|
-
description: c.description
|
349
|
-
}));
|
350
|
-
return result;
|
351
|
-
}
|
352
|
-
async get(id) {
|
353
|
-
const item = await this.service.getOne(id);
|
354
|
-
if (item) {
|
355
|
-
const document = JSON.parse(item.template);
|
356
|
-
const page = document?.children?.[0];
|
357
|
-
return {
|
358
|
-
id: item.id,
|
359
|
-
nodes: page?.children ?? [],
|
360
|
-
title: item.title,
|
361
|
-
};
|
362
|
-
}
|
363
|
-
else {
|
364
|
-
throw Error("Invalid Id");
|
365
|
-
}
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
const AXP_TEMPLATE_WIDGET_PROVIDER = new InjectionToken('AXP_TEMPLATE_WIDGET_PROVIDER');
|
370
|
-
class AXPTemplateWidgetProviderService {
|
371
|
-
constructor() {
|
372
|
-
this.popupService = inject(AXPopupService);
|
373
|
-
this.providers = inject(AXP_TEMPLATE_WIDGET_PROVIDER, { optional: true });
|
374
|
-
}
|
375
|
-
async items(query) {
|
376
|
-
if (Array.isArray(this.providers)) {
|
377
|
-
const result = [];
|
378
|
-
for (const provider of this.providers) {
|
379
|
-
const items = await provider.items(query);
|
380
|
-
if (items) {
|
381
|
-
result.push(...items);
|
382
|
-
}
|
383
|
-
}
|
384
|
-
return result;
|
385
|
-
}
|
386
|
-
else {
|
387
|
-
return [];
|
388
|
-
}
|
389
|
-
}
|
390
|
-
async get(id) {
|
391
|
-
if (Array.isArray(this.providers)) {
|
392
|
-
for (const provider of this.providers) {
|
393
|
-
const node = await provider.get(id);
|
394
|
-
if (node) {
|
395
|
-
return node;
|
396
|
-
}
|
397
|
-
}
|
398
|
-
}
|
399
|
-
return null;
|
400
|
-
}
|
401
|
-
async chooseTemplate() {
|
402
|
-
const com = await import('./acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs').then((c) => c.AXPTemplateWidgetPickerComponent);
|
403
|
-
const widgets = await this.items({
|
404
|
-
skip: 0,
|
405
|
-
take: 100,
|
406
|
-
filter: {
|
407
|
-
field: 'type.id',
|
408
|
-
value: 20,
|
409
|
-
operator: {
|
410
|
-
type: 'equal',
|
411
|
-
}
|
412
|
-
}
|
413
|
-
});
|
414
|
-
const result = await this.popupService.open(com, {
|
415
|
-
title: 'Widget Template Gallery',
|
416
|
-
size: 'md',
|
417
|
-
closeButton: true,
|
418
|
-
data: {
|
419
|
-
widgets: sortBy(widgets, (c) => c.title),
|
420
|
-
},
|
421
|
-
});
|
422
|
-
if (result.data) {
|
423
|
-
const selected = result.data?.widgets;
|
424
|
-
return selected[0];
|
425
|
-
}
|
426
|
-
return null;
|
427
|
-
}
|
428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
429
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, providedIn: 'root' }); }
|
430
|
-
}
|
431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetProviderService, decorators: [{
|
432
|
-
type: Injectable,
|
433
|
-
args: [{ providedIn: 'root' }]
|
434
|
-
}] });
|
435
|
-
|
436
|
-
class AXPTemplateWidgetViewComponent extends AXPWidgetComponent {
|
437
|
-
constructor() {
|
438
|
-
super();
|
439
|
-
this.metaKey = '__meta__';
|
440
|
-
this.templateProvider = inject(AXPTemplateWidgetProviderService);
|
441
|
-
this.templateId = computed(() => this.options()['templateId']);
|
442
|
-
this.nodes = signal([]);
|
443
|
-
//
|
444
|
-
effect(async () => {
|
445
|
-
this.nodes.set([]);
|
446
|
-
const value = this.getValue();
|
447
|
-
const templateId = get(value, `${this.metaKey}.templateId`) ?? this.templateId();
|
448
|
-
if (templateId) {
|
449
|
-
const item = await this.templateProvider.get(templateId);
|
450
|
-
if (item) {
|
451
|
-
this.nodes.set(item.nodes);
|
452
|
-
}
|
453
|
-
}
|
454
|
-
});
|
455
|
-
}
|
456
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
457
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetViewComponent, isStandalone: true, selector: "axp-template-widget-view", usesInheritance: true, ngImport: i0, template: `
|
458
|
-
@for (node of nodes(); track $index) {
|
459
|
-
<ng-container axp-widget-renderer
|
460
|
-
[node]="node"
|
461
|
-
[parentNode]="this"
|
462
|
-
[mode]="this.mode"
|
463
|
-
>
|
464
|
-
</ng-container>
|
465
|
-
}
|
466
|
-
@empty {
|
467
|
-
<span class="ax-underline ax-decoration-dotted ax-underline-offset-8 ax-text-gray-400">
|
468
|
-
{{ 'empty-template' | translate : { scope: 'form-template-management' } | async }}
|
469
|
-
</span>
|
470
|
-
}
|
471
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "directive", type: i2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
472
|
-
}
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetViewComponent, decorators: [{
|
474
|
-
type: Component,
|
475
|
-
args: [{
|
476
|
-
selector: 'axp-template-widget-view',
|
477
|
-
template: `
|
478
|
-
@for (node of nodes(); track $index) {
|
479
|
-
<ng-container axp-widget-renderer
|
480
|
-
[node]="node"
|
481
|
-
[parentNode]="this"
|
482
|
-
[mode]="this.mode"
|
483
|
-
>
|
484
|
-
</ng-container>
|
485
|
-
}
|
486
|
-
@empty {
|
487
|
-
<span class="ax-underline ax-decoration-dotted ax-underline-offset-8 ax-text-gray-400">
|
488
|
-
{{ 'empty-template' | translate : { scope: 'form-template-management' } | async }}
|
489
|
-
</span>
|
490
|
-
}
|
491
|
-
`,
|
492
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
493
|
-
imports: [CommonModule, AXPLayoutBuilderModule, AXTranslationModule]
|
494
|
-
}]
|
495
|
-
}], ctorParameters: () => [] });
|
496
|
-
|
497
|
-
var templateWidgetView_component = /*#__PURE__*/Object.freeze({
|
498
|
-
__proto__: null,
|
499
|
-
AXPTemplateWidgetViewComponent: AXPTemplateWidgetViewComponent
|
500
|
-
});
|
501
|
-
|
502
|
-
const AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU = {
|
503
|
-
text: 'Choose Template',
|
504
|
-
name: 'choose',
|
505
|
-
icon: 'fa-solid fa-folder-open',
|
506
|
-
};
|
507
|
-
class AXPTemplateWidgetDesignerComponent extends AXPWidgetComponent {
|
508
|
-
constructor() {
|
509
|
-
super();
|
510
|
-
this.templateProvider = inject(AXPTemplateWidgetProviderService);
|
511
|
-
this.designerService = inject(AXPDesignerService);
|
512
|
-
this.templateId = computed(() => this.options()['templateId']);
|
513
|
-
this.nodes = signal([]);
|
514
|
-
this.title = signal(null);
|
515
|
-
//
|
516
|
-
effect(async () => {
|
517
|
-
this.nodes.set([]);
|
518
|
-
if (this.templateId()) {
|
519
|
-
const item = await this.templateProvider.get(this.templateId());
|
520
|
-
if (item && item.nodes?.length > 0) {
|
521
|
-
this.title.set(item.title);
|
522
|
-
this.nodes.set(item.nodes);
|
523
|
-
}
|
524
|
-
}
|
525
|
-
});
|
526
|
-
}
|
527
|
-
// override async ngOnInit() {
|
528
|
-
// super.ngOnInit();
|
529
|
-
// if (!this.templateId()) {
|
530
|
-
// this.handleChooseWidget();
|
531
|
-
// }
|
532
|
-
// }
|
533
|
-
async handleChooseWidget() {
|
534
|
-
const result = await this.templateProvider.chooseTemplate();
|
535
|
-
if (result) {
|
536
|
-
this.designerService.update({
|
537
|
-
mode: 'update',
|
538
|
-
values: { options: { templateId: result.id } },
|
539
|
-
widget: this.node,
|
540
|
-
});
|
585
|
+
}
|
586
|
+
});
|
587
|
+
return result.getOutput('result');
|
588
|
+
}
|
589
|
+
async load(id) {
|
590
|
+
const item = await this.templateEntityService.getOne(id);
|
591
|
+
if (item) {
|
592
|
+
return item.template;
|
593
|
+
}
|
594
|
+
else {
|
595
|
+
throw Error("Invalid Id");
|
541
596
|
}
|
542
597
|
}
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
598
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
599
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl }); }
|
600
|
+
}
|
601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDesignerConnectorImpl, decorators: [{
|
602
|
+
type: Injectable
|
603
|
+
}] });
|
604
|
+
|
605
|
+
class AXPTemplateWidgetProviderImpl {
|
606
|
+
constructor() {
|
607
|
+
this.service = inject(AXMFormTemplateManagementTemplateEntityService);
|
551
608
|
}
|
552
|
-
|
553
|
-
const
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
609
|
+
async items(query) {
|
610
|
+
const result = ((await this.service.query(query)).items).map(c => ({
|
611
|
+
id: c.id,
|
612
|
+
title: c.title,
|
613
|
+
group: {
|
614
|
+
name: c.categoryId,
|
615
|
+
order: 2,
|
616
|
+
title: get(c, 'category.title') ?? 'Custom'
|
617
|
+
},
|
618
|
+
description: c.description
|
619
|
+
}));
|
620
|
+
return result;
|
558
621
|
}
|
559
|
-
async
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
622
|
+
async get(id) {
|
623
|
+
const item = await this.service.getOne(id);
|
624
|
+
if (item) {
|
625
|
+
const document = JSON.parse(item.template);
|
626
|
+
const page = document?.children?.[0];
|
627
|
+
return {
|
628
|
+
id: item.id,
|
629
|
+
nodes: page?.children ?? [],
|
630
|
+
title: item.title,
|
631
|
+
};
|
632
|
+
}
|
633
|
+
else {
|
634
|
+
throw Error("Invalid Id");
|
564
635
|
}
|
565
|
-
return Promise.resolve();
|
566
|
-
}
|
567
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
568
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetDesignerComponent, isStandalone: true, selector: "axp-template-widget-designer", host: { properties: { "class": "this.__class" } }, providers: [
|
569
|
-
{
|
570
|
-
provide: AXPTemplateWidgetDesignerComponent,
|
571
|
-
useExisting: AXPWidgetComponent,
|
572
|
-
},
|
573
|
-
], usesInheritance: true, ngImport: i0, template: `
|
574
|
-
@if(nodes().length) {
|
575
|
-
<div class="ax-relative ax-block ax-w-full ax-pointer-events-none">
|
576
|
-
@for (node of nodes(); track $index) {
|
577
|
-
<ng-container axp-widget-designer-renderer [locked]="true" [node]="node" [parentNode]="this" [mode]="this.mode"> </ng-container>
|
578
|
-
}
|
579
|
-
<div
|
580
|
-
class="ax-absolute ax-top-0 ax-bottom-0 ax-left-0 ax-right-0 ax-bg-blue-400 ax-opacity-30 ax-flex ax-justify-center ax-items-center ax-z-[400]"
|
581
|
-
>
|
582
|
-
<span class="ax-capitalize ax-font-semibold ax-text-primary-700"> {{ title() }}</span>
|
583
|
-
</div>
|
584
|
-
</div>
|
585
|
-
} @else {
|
586
|
-
<axp-designer-add-widget-mini-button
|
587
|
-
class="ax-flex-1 ax-self-center ax-place-self-end"
|
588
|
-
(onClick)="handleChooseWidget()"
|
589
|
-
>
|
590
|
-
</axp-designer-add-widget-mini-button>
|
591
636
|
}
|
592
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "directive", type: AXPWidgetDesignerRendererDirective, selector: "[axp-widget-designer-renderer]", inputs: ["parentNode", "index", "locked", "mode", "node"] }, { kind: "component", type: AXPDesignerAddWidgetMiniButtonComponent, selector: "axp-designer-add-widget-mini-button", outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
593
637
|
}
|
594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetDesignerComponent, decorators: [{
|
595
|
-
type: Component,
|
596
|
-
args: [{
|
597
|
-
selector: 'axp-template-widget-designer',
|
598
|
-
template: `
|
599
|
-
@if(nodes().length) {
|
600
|
-
<div class="ax-relative ax-block ax-w-full ax-pointer-events-none">
|
601
|
-
@for (node of nodes(); track $index) {
|
602
|
-
<ng-container axp-widget-designer-renderer [locked]="true" [node]="node" [parentNode]="this" [mode]="this.mode"> </ng-container>
|
603
|
-
}
|
604
|
-
<div
|
605
|
-
class="ax-absolute ax-top-0 ax-bottom-0 ax-left-0 ax-right-0 ax-bg-blue-400 ax-opacity-30 ax-flex ax-justify-center ax-items-center ax-z-[400]"
|
606
|
-
>
|
607
|
-
<span class="ax-capitalize ax-font-semibold ax-text-primary-700"> {{ title() }}</span>
|
608
|
-
</div>
|
609
|
-
</div>
|
610
|
-
} @else {
|
611
|
-
<axp-designer-add-widget-mini-button
|
612
|
-
class="ax-flex-1 ax-self-center ax-place-self-end"
|
613
|
-
(onClick)="handleChooseWidget()"
|
614
|
-
>
|
615
|
-
</axp-designer-add-widget-mini-button>
|
616
|
-
}
|
617
|
-
`,
|
618
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
619
|
-
imports: [
|
620
|
-
CommonModule,
|
621
|
-
AXPLayoutBuilderModule,
|
622
|
-
AXPWidgetDesignerRendererDirective,
|
623
|
-
AXPDesignerAddWidgetMiniButtonComponent,
|
624
|
-
],
|
625
|
-
providers: [
|
626
|
-
{
|
627
|
-
provide: AXPTemplateWidgetDesignerComponent,
|
628
|
-
useExisting: AXPWidgetComponent,
|
629
|
-
},
|
630
|
-
]
|
631
|
-
}]
|
632
|
-
}], ctorParameters: () => [], propDecorators: { __class: [{
|
633
|
-
type: HostBinding,
|
634
|
-
args: ['class']
|
635
|
-
}] } });
|
636
|
-
|
637
|
-
var templateWidgetDesigner_component = /*#__PURE__*/Object.freeze({
|
638
|
-
__proto__: null,
|
639
|
-
AXPTemplateWidgetDesignerComponent: AXPTemplateWidgetDesignerComponent,
|
640
|
-
AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU: AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU
|
641
|
-
});
|
642
|
-
|
643
|
-
const AXPTemplateWidget = {
|
644
|
-
name: 'template',
|
645
|
-
title: 'Template',
|
646
|
-
type: 'container',
|
647
|
-
icon: 'fa-solid fa-file-invoice',
|
648
|
-
group: AXP_WIDGETS_ADVANCE_GROUP,
|
649
|
-
visible: true,
|
650
|
-
options: {
|
651
|
-
canInsert: false,
|
652
|
-
},
|
653
|
-
properties: [
|
654
|
-
AXP_NAME_PROPERTY,
|
655
|
-
AXP_DATA_PATH_PROPERTY,
|
656
|
-
createStringProperty({
|
657
|
-
name: 'options.templateId',
|
658
|
-
title: 'Template',
|
659
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
660
|
-
visible: false,
|
661
|
-
}),
|
662
|
-
],
|
663
|
-
components: {
|
664
|
-
view: {
|
665
|
-
component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
|
666
|
-
},
|
667
|
-
edit: {
|
668
|
-
component: () => import('./acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs').then((c) => c.AXPTemplateWidgetEditComponent),
|
669
|
-
},
|
670
|
-
print: {
|
671
|
-
component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
|
672
|
-
},
|
673
|
-
designer: {
|
674
|
-
component: () => Promise.resolve().then(function () { return templateWidgetDesigner_component; }).then((c) => c.AXPTemplateWidgetDesignerComponent),
|
675
|
-
},
|
676
|
-
},
|
677
|
-
};
|
678
638
|
|
679
639
|
class AXMSettingProvider {
|
680
640
|
async provide(context) {
|
@@ -736,6 +696,73 @@ class AXMSettingProvider {
|
|
736
696
|
}
|
737
697
|
}
|
738
698
|
|
699
|
+
const AXMCreateFormTemplateWorkflow = {
|
700
|
+
startStepId: 'create-form-template',
|
701
|
+
steps: {
|
702
|
+
"create-form-template": {
|
703
|
+
action: 'start-workflow',
|
704
|
+
input: {
|
705
|
+
workflow: "create-entity",
|
706
|
+
context: {
|
707
|
+
redirect: true,
|
708
|
+
entity: `${AXMFormTemplateManagementModuleConst.moduleName}.${AXMFormTemplateManagementModuleConst.templateEntity}`,
|
709
|
+
}
|
710
|
+
},
|
711
|
+
nextSteps: [
|
712
|
+
{
|
713
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
714
|
+
nextStepId: 'get-template-confirmaton',
|
715
|
+
},
|
716
|
+
],
|
717
|
+
},
|
718
|
+
"get-template-confirmaton": {
|
719
|
+
action: 'show-prompt-dialog',
|
720
|
+
input: {
|
721
|
+
title: 'Confirm Action',
|
722
|
+
message: `Would you like to proceed with starting template design?`,
|
723
|
+
type: 'primary',
|
724
|
+
},
|
725
|
+
nextSteps: [
|
726
|
+
{
|
727
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
728
|
+
nextStepId: 'template-design',
|
729
|
+
},
|
730
|
+
],
|
731
|
+
},
|
732
|
+
"template-design": {
|
733
|
+
action: 'open-form-template-designer',
|
734
|
+
},
|
735
|
+
},
|
736
|
+
};
|
737
|
+
|
738
|
+
class AXMOpenFormTemplateDesignerAction extends AXPWorkflowAction {
|
739
|
+
constructor() {
|
740
|
+
super(...arguments);
|
741
|
+
this.navigation = inject(AXPWorkflowNavigateAction);
|
742
|
+
}
|
743
|
+
async execute(context) {
|
744
|
+
const { id } = context.getVariable('data');
|
745
|
+
context.setVariable('payload', {
|
746
|
+
commands: `forms/designer?id=${id}`,
|
747
|
+
target: 'blank'
|
748
|
+
});
|
749
|
+
await this.navigation.execute(context);
|
750
|
+
}
|
751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
752
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction }); }
|
753
|
+
}
|
754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOpenFormTemplateDesignerAction, decorators: [{
|
755
|
+
type: Injectable
|
756
|
+
}] });
|
757
|
+
const AXMDesignFormTemplateWorkflow = {
|
758
|
+
startStepId: 'open-design-designer',
|
759
|
+
steps: {
|
760
|
+
"open-design-designer": {
|
761
|
+
action: 'open-form-template-designer',
|
762
|
+
},
|
763
|
+
},
|
764
|
+
};
|
765
|
+
|
739
766
|
function routesFacory() {
|
740
767
|
const routes = [
|
741
768
|
{
|
@@ -781,7 +808,7 @@ class AXMFormTemplateManagementModule {
|
|
781
808
|
},
|
782
809
|
{
|
783
810
|
provide: AXPDesignerConnector,
|
784
|
-
useClass: AXPDesignerConnectorImpl
|
811
|
+
useClass: AXPDesignerConnectorImpl,
|
785
812
|
},
|
786
813
|
{
|
787
814
|
provide: AXP_TEMPLATE_WIDGET_PROVIDER,
|
@@ -792,24 +819,26 @@ class AXMFormTemplateManagementModule {
|
|
792
819
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
793
820
|
useClass: AXMSettingProvider,
|
794
821
|
multi: true,
|
795
|
-
}
|
822
|
+
},
|
823
|
+
{
|
824
|
+
provide: AXP_SEARCH_DEFINITION_PROVIDER,
|
825
|
+
useClass: AXMFormTemplateManagementModuleSearchProvider,
|
826
|
+
multi: true,
|
827
|
+
},
|
796
828
|
], imports: [AXPWidgetsModule,
|
797
829
|
AXMFormTemplateManagementCategoryEntityModule,
|
798
830
|
AXMFormTemplateManagementTemplateEntityModule,
|
799
831
|
AXPLayoutBuilderModule.forChild({
|
800
|
-
widgets: [
|
801
|
-
AXPTemplateDesignerWidget,
|
802
|
-
AXPTemplateWidget
|
803
|
-
]
|
832
|
+
widgets: [AXPTemplateDesignerWidget, AXPTemplateWidget],
|
804
833
|
}),
|
805
834
|
AXPWorkflowModule.forChild({
|
806
835
|
actions: {
|
807
|
-
'open-form-template-designer': AXMOpenFormTemplateDesignerAction
|
836
|
+
'open-form-template-designer': AXMOpenFormTemplateDesignerAction,
|
808
837
|
},
|
809
838
|
workflows: {
|
810
839
|
'create-form-template': AXMCreateFormTemplateWorkflow,
|
811
|
-
'design-form-template': AXMDesignFormTemplateWorkflow
|
812
|
-
}
|
840
|
+
'design-form-template': AXMDesignFormTemplateWorkflow,
|
841
|
+
},
|
813
842
|
})] }); }
|
814
843
|
}
|
815
844
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMFormTemplateManagementModule, decorators: [{
|
@@ -820,20 +849,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
820
849
|
AXMFormTemplateManagementCategoryEntityModule,
|
821
850
|
AXMFormTemplateManagementTemplateEntityModule,
|
822
851
|
AXPLayoutBuilderModule.forChild({
|
823
|
-
widgets: [
|
824
|
-
AXPTemplateDesignerWidget,
|
825
|
-
AXPTemplateWidget
|
826
|
-
]
|
852
|
+
widgets: [AXPTemplateDesignerWidget, AXPTemplateWidget],
|
827
853
|
}),
|
828
854
|
AXPWorkflowModule.forChild({
|
829
855
|
actions: {
|
830
|
-
'open-form-template-designer': AXMOpenFormTemplateDesignerAction
|
856
|
+
'open-form-template-designer': AXMOpenFormTemplateDesignerAction,
|
831
857
|
},
|
832
858
|
workflows: {
|
833
859
|
'create-form-template': AXMCreateFormTemplateWorkflow,
|
834
|
-
'design-form-template': AXMDesignFormTemplateWorkflow
|
835
|
-
}
|
836
|
-
})
|
860
|
+
'design-form-template': AXMDesignFormTemplateWorkflow,
|
861
|
+
},
|
862
|
+
}),
|
837
863
|
],
|
838
864
|
exports: [],
|
839
865
|
declarations: [],
|
@@ -855,7 +881,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
855
881
|
},
|
856
882
|
{
|
857
883
|
provide: AXPDesignerConnector,
|
858
|
-
useClass: AXPDesignerConnectorImpl
|
884
|
+
useClass: AXPDesignerConnectorImpl,
|
859
885
|
},
|
860
886
|
{
|
861
887
|
provide: AXP_TEMPLATE_WIDGET_PROVIDER,
|
@@ -866,7 +892,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
866
892
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
867
893
|
useClass: AXMSettingProvider,
|
868
894
|
multi: true,
|
869
|
-
}
|
895
|
+
},
|
896
|
+
{
|
897
|
+
provide: AXP_SEARCH_DEFINITION_PROVIDER,
|
898
|
+
useClass: AXMFormTemplateManagementModuleSearchProvider,
|
899
|
+
multi: true,
|
900
|
+
},
|
870
901
|
],
|
871
902
|
}]
|
872
903
|
}] });
|