@eqproject/eqp-dynamic-module 2.10.60 → 2.10.62
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/README.md +550 -259
- package/esm2020/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.mjs +2 -8
- package/esm2020/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.mjs +2 -5
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +2 -11
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +2 -11
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +1 -2
- package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,259 +1,550 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
4
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
1
|
+
# @eqproject/eqp-dynamic-module
|
|
2
|
+
|
|
3
|
+
> Angular 15 library for building, rendering and managing dynamic forms with a no-code configurator.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@eqproject/eqp-dynamic-module)
|
|
6
|
+
[](https://angular.io/)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Table of Contents
|
|
11
|
+
|
|
12
|
+
- [Overview](#overview)
|
|
13
|
+
- [Prerequisites](#prerequisites)
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [Module Setup](#module-setup)
|
|
16
|
+
- [Components](#components)
|
|
17
|
+
- [eqp-dynamic-module — Form Viewer/Filler](#eqp-dynamic-module--form-viewerfiller)
|
|
18
|
+
- [eqp-dynamic-module-configurator — Form Builder](#eqp-dynamic-module-configurator--form-builder)
|
|
19
|
+
- [Configuration Models](#configuration-models)
|
|
20
|
+
- [View Modes](#view-modes)
|
|
21
|
+
- [Endpoint Configuration](#endpoint-configuration)
|
|
22
|
+
- [Data Models](#data-models)
|
|
23
|
+
- [Field Types Reference](#field-types-reference)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
`@eqproject/eqp-dynamic-module` exposes **two public components**:
|
|
30
|
+
|
|
31
|
+
| Component | Purpose |
|
|
32
|
+
|-----------|---------|
|
|
33
|
+
| `<eqp-dynamic-module>` | Runtime form viewer, filler, list, filter and graphs |
|
|
34
|
+
| `<eqp-dynamic-module-configurator>` | No-code form builder (create, edit, import, export) |
|
|
35
|
+
|
|
36
|
+
Forms are defined as JSON structures stored server-side and fetched at runtime. The library handles rendering, validation, data retrieval, CRUD operations and advanced features like formulas, triggers, action buttons and speech-to-text.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Prerequisites
|
|
41
|
+
|
|
42
|
+
Install the following peer dependencies in your project (if not already present):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @angular/cdk@^15.1.2 @angular/material@^15.1.2 @angular/material-luxon-adapter@^15.2.9 --legacy-peer-deps
|
|
46
|
+
npm install @angular-material-components/datetime-picker@^15.0.0 @angular-material-components/moment-adapter@^15.0.0 --legacy-peer-deps
|
|
47
|
+
npm install moment@^2.29.4 sweetalert2@^11.4.24 --legacy-peer-deps
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> **Note:** All `npm install` commands for this library require `--legacy-peer-deps`.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install @eqproject/eqp-dynamic-module --legacy-peer-deps
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Module Setup
|
|
63
|
+
|
|
64
|
+
Import `EqpDynamicModuleModule` in your `AppModule` (or the feature module where you need it):
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { EqpDynamicModuleModule } from '@eqproject/eqp-dynamic-module';
|
|
68
|
+
|
|
69
|
+
@NgModule({
|
|
70
|
+
imports: [
|
|
71
|
+
// ...
|
|
72
|
+
EqpDynamicModuleModule
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
export class AppModule {}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Add Angular Material theme and icons to your `angular.json` styles:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
"styles": [
|
|
82
|
+
"node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
|
|
83
|
+
"src/styles.css"
|
|
84
|
+
]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Components
|
|
90
|
+
|
|
91
|
+
### `eqp-dynamic-module` — Form Viewer/Filler
|
|
92
|
+
|
|
93
|
+
Renders a dynamic form in one of several [view modes](#view-modes). Handles loading form definitions, displaying fields, collecting responses and communicating with the server.
|
|
94
|
+
|
|
95
|
+
#### Basic usage
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import {
|
|
99
|
+
DynamicModuleGeneralConfig,
|
|
100
|
+
DynamicModuleViewModeEnum
|
|
101
|
+
} from '@eqproject/eqp-dynamic-module';
|
|
102
|
+
|
|
103
|
+
// component.ts
|
|
104
|
+
generalConfig = new DynamicModuleGeneralConfig(
|
|
105
|
+
'https://your-api.example.com/api',
|
|
106
|
+
this.userToken,
|
|
107
|
+
this.context,
|
|
108
|
+
null // endPointConfiguration — null uses defaults built from baseServerUrl
|
|
109
|
+
);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<eqp-dynamic-module
|
|
114
|
+
[configurations]="generalConfig"
|
|
115
|
+
[formID]="'your-form-id'"
|
|
116
|
+
[starterViewMode]="DynamicModuleViewModeEnum.LIST"
|
|
117
|
+
[userID]="currentUser.id"
|
|
118
|
+
(saveRecord)="onSave($event)"
|
|
119
|
+
(afterSaveRecord)="onAfterSave($event)">
|
|
120
|
+
</eqp-dynamic-module>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Inputs
|
|
124
|
+
|
|
125
|
+
| Input | Type | Default | Description |
|
|
126
|
+
|-------|------|---------|-------------|
|
|
127
|
+
| `configurations` | `DynamicModuleGeneralConfig` | — | **Required.** Server connection and endpoint configuration. |
|
|
128
|
+
| `formID` | `string` | — | **Required.** ID of the form to display. |
|
|
129
|
+
| `starterViewMode` | `DynamicModuleViewModeEnum` | `LIST` | Initial [view mode](#view-modes). |
|
|
130
|
+
| `userID` | `string` | `"0"` | User ID stamped on saved records. |
|
|
131
|
+
| `orgaID` | `string` | `"0"` | Organization ID for data scoping. |
|
|
132
|
+
| `showTitle` | `boolean` | `true` | Show/hide the form name in COMPILE and LIST modes. |
|
|
133
|
+
| `showBackButton` | `boolean` | `true` | Show/hide the back/cancel button. |
|
|
134
|
+
| `showSaveButton` | `boolean` | `true` | Show/hide the save button. |
|
|
135
|
+
| `values` | `Record[]` | `null` | Pre-load a set of records for LIST mode (bypasses server fetch). |
|
|
136
|
+
| `FormJSON` | `string` | `""` | JSON string of a form definition for REPAIR mode. |
|
|
137
|
+
| `formulaObject` | `any` | `{}` | Context object injected into formula evaluation (e.g. `{ role, user, patient }`). |
|
|
138
|
+
| `selectedRecord` | `Record \| string` | `null` | Pre-select a record by object or ID when opening in COMPILE/VIEW mode. |
|
|
139
|
+
| `externalButtons` | `RecordButton[]` | `[]` | Extra buttons rendered in the record action menu. |
|
|
140
|
+
| `actionButtons` | `ActionButton[]` | `[]` | Action buttons bound to form fields of type `Bottone`. |
|
|
141
|
+
| `defaultListActions` | `DynamicModuleListFormRecordActionsDefault` | all `true` | Toggle default list actions: add, view, edit, duplicate, delete, graphs. |
|
|
142
|
+
| `listViewRecordTitle` | `string[]` | `[]` | Field keys whose values compose the accordion title in list view. |
|
|
143
|
+
| `defaultListViewFunction` | `Function` | `null` | Override the default function called when the list view loads. |
|
|
144
|
+
| `onSaveBackToList` | `boolean` | `false` | Automatically navigate back to LIST after a successful save. |
|
|
145
|
+
| `onBackTo` | `DynamicModuleViewModeEnum` | `null` | View mode to navigate to when the back button is pressed. |
|
|
146
|
+
| `numberOfColumns` | `number` | `3` | Number of layout columns for form fields. |
|
|
147
|
+
| `showHiddenFields` | `boolean` | `true` | Show/hide fields marked as hidden. |
|
|
148
|
+
| `filterResultViewMode` | `DynamicModuleFilterResultViewModeEnum` | `INTERNAL_EQPTABLE` | How filter results are displayed. |
|
|
149
|
+
| `additionalParams` | `any` | `null` | Extra parameters forwarded to server-side filter calls. |
|
|
150
|
+
| `additionalInfo` | `any` | `null` | Extra data forwarded to client-side operations. |
|
|
151
|
+
| `prefilterParams` | `any` | `null` | Parameters applied before the user-driven filter. |
|
|
152
|
+
| `updateInfo` | `any` | `null` | Data used to update response values after load. |
|
|
153
|
+
| `contestualizationParams` | `any` | `null` | Contextualisation parameters for the result list. |
|
|
154
|
+
| `showNewSearchButton` | `boolean` | `true` | Show/hide the "new search" button in FILTER mode. |
|
|
155
|
+
| `highlightFilter` | `any` | — | Configuration for row/field highlighting in the result list. |
|
|
156
|
+
| `isDraggableListView` | `boolean` | `true` | Enable drag-and-drop reordering in list view. |
|
|
157
|
+
| `Statistic` | `FilterStatistic` | `null` | Statistics and filter configuration object. |
|
|
158
|
+
| `QueryEditorComponent` | `any` | — | Custom query-editor component injected into lookup fields. |
|
|
159
|
+
| `debugMode` | `boolean` | `false` | Log verbose debug information to the console. |
|
|
160
|
+
|
|
161
|
+
#### Outputs
|
|
162
|
+
|
|
163
|
+
| Output | Payload | Description |
|
|
164
|
+
|--------|---------|-------------|
|
|
165
|
+
| `(saveRecord)` | `Record` | Emitted when a record is saved and **no** save endpoint is configured. Handle persistence yourself. |
|
|
166
|
+
| `(afterSaveRecord)` | `Record` | Emitted after the library completes a server save call. |
|
|
167
|
+
| `(deleteRecord)` | `Record` | Emitted when a record is deleted and **no** delete endpoint is configured. |
|
|
168
|
+
| `(afterDeleteRecord)` | `Record` | Emitted after the library completes a server delete call. |
|
|
169
|
+
| `(SaveJSON)` | `string` | Emitted when the form JSON is exported/saved. |
|
|
170
|
+
| `(afterFilter)` | `DynRecord[]` | Emitted after a filter operation completes with the result set. |
|
|
171
|
+
| `(dragStarted)` | `Record` | Emitted when the user starts dragging a record. |
|
|
172
|
+
| `(dragReleased)` | `void` | Emitted when the drag operation ends. |
|
|
173
|
+
| `(clickDragIndicator)` | `Record` | Emitted when the drag handle icon is clicked. |
|
|
174
|
+
| `(out)` | `eventOut` | General-purpose output for external component communication. |
|
|
175
|
+
| `(fireTrigger)` | `FireTrigger` | Emitted when a form trigger fires; handle custom side-effects here. |
|
|
176
|
+
| `(afterOutputExternalFilters)` | `FilterStatistic` | Emitted after external filter outputs are applied. |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### `eqp-dynamic-module-configurator` — Form Builder
|
|
181
|
+
|
|
182
|
+
No-code designer for creating and editing form definitions. Supports four usage modes controlled by `viewMode` and the `formID` / `specific.form` inputs.
|
|
183
|
+
|
|
184
|
+
#### Usage modes
|
|
185
|
+
|
|
186
|
+
##### 1. Create a new form
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
const specific = new DynamicModuleConfiguratorSpecificConfig();
|
|
190
|
+
specific.UserID = this.currentUser.id;
|
|
191
|
+
specific.orgaID = this.currentOrga.id;
|
|
192
|
+
|
|
193
|
+
const general = new DynamicModuleGeneralConfig(this.baseServerUrl, this.userToken, this.context, null);
|
|
194
|
+
|
|
195
|
+
this.configuratorConfig = new DynamicModuleConfiguratorConfig(general, specific);
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<eqp-dynamic-module-configurator
|
|
200
|
+
*ngIf="configuratorConfig"
|
|
201
|
+
[configurations]="configuratorConfig"
|
|
202
|
+
(saveFormEvent)="onFormSaved($event)"
|
|
203
|
+
(afterSaveFormEvent)="onFormAfterSaved($event)">
|
|
204
|
+
</eqp-dynamic-module-configurator>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
##### 2. Edit an existing form
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
this.formID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'; // existing form ID
|
|
211
|
+
// same config setup as above
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```html
|
|
215
|
+
<eqp-dynamic-module-configurator
|
|
216
|
+
*ngIf="configuratorConfig"
|
|
217
|
+
[configurations]="configuratorConfig"
|
|
218
|
+
[formID]="formID"
|
|
219
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
220
|
+
</eqp-dynamic-module-configurator>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
##### 3. Export a form by ID
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<eqp-dynamic-module-configurator
|
|
227
|
+
*ngIf="configuratorConfig"
|
|
228
|
+
[configurations]="configuratorConfig"
|
|
229
|
+
[formID]="formID"
|
|
230
|
+
[viewMode]="'Export'"
|
|
231
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
232
|
+
</eqp-dynamic-module-configurator>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
##### 4. Import a form from JSON
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
specific.form = JSON.parse(this.formJsonString);
|
|
239
|
+
this.formID = null;
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
```html
|
|
243
|
+
<eqp-dynamic-module-configurator
|
|
244
|
+
*ngIf="configuratorConfig"
|
|
245
|
+
[configurations]="configuratorConfig"
|
|
246
|
+
[formID]="formID"
|
|
247
|
+
[viewMode]="'Export'"
|
|
248
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
249
|
+
</eqp-dynamic-module-configurator>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Inputs
|
|
253
|
+
|
|
254
|
+
| Input | Type | Default | Description |
|
|
255
|
+
|-------|------|---------|-------------|
|
|
256
|
+
| `configurations` | `DynamicModuleConfiguratorConfig` | — | **Required.** Configuration container. |
|
|
257
|
+
| `formID` | `string` | `null` | ID of the form to edit. `null` creates a new form. |
|
|
258
|
+
| `viewMode` | `string` | `"addOrEdit"` | `"addOrEdit"` for create/edit, `"Export"` for export/import. |
|
|
259
|
+
| `fieldsExtraConfig` | `FieldExtraConfig[]` | — | Extra configuration applied to specific fields. |
|
|
260
|
+
| `triggers` | `any` | — | Trigger definitions available in the trigger editor. |
|
|
261
|
+
| `actionButtons` | `any` | — | Action button definitions available in the button editor. |
|
|
262
|
+
| `contestualization` | `Contestualization[]` | — | Contextualisation options for lookup and filter fields. |
|
|
263
|
+
| `formulaObject` | `any` | — | Context object for formula preview and evaluation. |
|
|
264
|
+
| `QueryEditorComponent` | `DynamicLoaderDirectiveData` | — | Custom query editor component for lookup fields. |
|
|
265
|
+
| `debugMode` | `boolean` | `false` | Enable verbose console logging. |
|
|
266
|
+
|
|
267
|
+
#### Outputs
|
|
268
|
+
|
|
269
|
+
| Output | Payload | Description |
|
|
270
|
+
|--------|---------|-------------|
|
|
271
|
+
| `(saveFormEvent)` | `Form` | Emitted when a form is saved and **no** save endpoint is configured. |
|
|
272
|
+
| `(afterSaveFormEvent)` | `Form` | Emitted after the library completes a server save call. |
|
|
273
|
+
| `(out)` | `eventOut` | General-purpose external communication output. |
|
|
274
|
+
| `(fireTrigger)` | `FireTrigger` | Emitted when a trigger fires during configurator interaction. |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Configuration Models
|
|
279
|
+
|
|
280
|
+
### `DynamicModuleGeneralConfig`
|
|
281
|
+
|
|
282
|
+
Shared by both components. Describes the server connection.
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
const general = new DynamicModuleGeneralConfig(
|
|
286
|
+
baseServerUrl, // string — e.g. "https://api.example.com/api"
|
|
287
|
+
userToken, // string — bearer token / auth token
|
|
288
|
+
context, // Context — application context object
|
|
289
|
+
endPointConfiguration // EndPointConfiguration | null — null = use defaults
|
|
290
|
+
);
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
| Property | Type | Description |
|
|
294
|
+
|----------|------|-------------|
|
|
295
|
+
| `baseServerUrl` | `string` | Base API URL. Used to auto-build default endpoint URLs when `endPointConfiguration` is `null`. |
|
|
296
|
+
| `userToken` | `string` | Authentication token sent with API calls. |
|
|
297
|
+
| `endPointConfiguration` | `EndPointConfiguration \| null` | Full endpoint override. Leave `null` to use the standard route convention. |
|
|
298
|
+
| `context` | `Context` | Application context forwarded to every server call. |
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
### `DynamicModuleConfig`
|
|
303
|
+
|
|
304
|
+
Container for the viewer component configuration.
|
|
305
|
+
|
|
306
|
+
| Property | Type | Description |
|
|
307
|
+
|----------|------|-------------|
|
|
308
|
+
| `dynamicModuleGeneralConfig` | `DynamicModuleGeneralConfig` | Server connection settings. |
|
|
309
|
+
| `dynamicModuleCompileConfig` | `DynamicModuleCompileConfig` | COMPILE mode settings. |
|
|
310
|
+
| `dynamicModuleListConfig` | `DynamicModuleListConfig` | LIST mode settings. |
|
|
311
|
+
| `dynamicModuleRepairConfig` | `DynamicModuleRepairConfig` | REPAIR mode settings. |
|
|
312
|
+
|
|
313
|
+
#### `DynamicModuleCompileConfig`
|
|
314
|
+
|
|
315
|
+
| Property | Type | Default | Description |
|
|
316
|
+
|----------|------|---------|-------------|
|
|
317
|
+
| `showTitle` | `boolean` | `true` | Show/hide the form name. |
|
|
318
|
+
| `showSaveButton` | `boolean` | `true` | Show/hide the save button. |
|
|
319
|
+
| `showBackButton` | `boolean` | `true` | Show/hide the back button. |
|
|
320
|
+
| `userID` | `string` | `"0"` | User ID stamped on saved records. |
|
|
321
|
+
| `additionalParams` | `any` | `null` | Extra server-side filter parameters. |
|
|
322
|
+
| `additionalInfo` | `any` | `null` | Extra client-side operation data. |
|
|
323
|
+
| `prefilterParams` | `any` | `null` | Pre-filter parameters. |
|
|
324
|
+
| `showNewSearchButton` | `boolean` | `true` | Show/hide the new search button. |
|
|
325
|
+
|
|
326
|
+
#### `DynamicModuleListConfig`
|
|
327
|
+
|
|
328
|
+
| Property | Type | Description |
|
|
329
|
+
|----------|------|-------------|
|
|
330
|
+
| `showTitle` | `boolean` | Show/hide the form name in LIST mode. |
|
|
331
|
+
| `defaultListActions` | `DynamicModuleListFormRecordActionsDefault` | Toggle default record actions (add, view, edit, duplicate, delete, graphs). |
|
|
332
|
+
| `values` | `Record[]` | Pre-loaded records (skips server fetch). |
|
|
333
|
+
| `externalButtons` | `RecordButton[]` | Extra buttons in the record action menu. |
|
|
334
|
+
| `updateInfo` | `any` | Data used to update response values after load. |
|
|
335
|
+
| `listViewRecordTitle` | `string[]` | Field keys composing the accordion record title. |
|
|
336
|
+
| `userID` | `string` | User ID for server-side filtering. |
|
|
337
|
+
| `isDraggableListView` | `boolean` | Enable drag-and-drop reordering. |
|
|
338
|
+
|
|
339
|
+
#### `DynamicModuleRepairConfig`
|
|
340
|
+
|
|
341
|
+
| Property | Type | Description |
|
|
342
|
+
|----------|------|-------------|
|
|
343
|
+
| `FormJSON` | `string` | JSON string of the form to review/repair. |
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
### `DynamicModuleConfiguratorConfig`
|
|
348
|
+
|
|
349
|
+
Container for the configurator component configuration.
|
|
350
|
+
|
|
351
|
+
| Property | Type | Description |
|
|
352
|
+
|----------|------|-------------|
|
|
353
|
+
| `dynamicModuleGeneralConfig` | `DynamicModuleGeneralConfig` | Server connection settings. |
|
|
354
|
+
| `dynamicModuleConfiguratorSpecificConfig` | `DynamicModuleConfiguratorSpecificConfig` | Configurator-specific settings. |
|
|
355
|
+
|
|
356
|
+
#### `DynamicModuleConfiguratorSpecificConfig`
|
|
357
|
+
|
|
358
|
+
| Property | Type | Description |
|
|
359
|
+
|----------|------|-------------|
|
|
360
|
+
| `orgaID` | `string` | Organization ID associated with the form. |
|
|
361
|
+
| `UserID` | `number` | User ID for creation/modification tracking. |
|
|
362
|
+
| `form` | `Form` | Pre-populate with a `Form` object for import mode. |
|
|
363
|
+
| `innerFormManagment` | `boolean` | `true` when the configurator is opened inside a dialog. |
|
|
364
|
+
| `innerFormRef` | `MatDialogRef<TemplateRef<any>>` | Dialog reference when opened in a dialog context. |
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
### `DynamicModuleListFormRecordActionsDefault`
|
|
369
|
+
|
|
370
|
+
Controls which default actions appear in the record action menu in LIST mode.
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
const actions = new DynamicModuleListFormRecordActionsDefault();
|
|
374
|
+
actions.add = true; // "Add new record" button in list header
|
|
375
|
+
actions.view = true; // View record (read-only)
|
|
376
|
+
actions.edit = true; // Edit record
|
|
377
|
+
actions.duplicate = false; // Duplicate record
|
|
378
|
+
actions.delete = true; // Delete record
|
|
379
|
+
actions.graphs = false; // Show graphs for record
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## View Modes
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
import { DynamicModuleViewModeEnum } from '@eqproject/eqp-dynamic-module';
|
|
388
|
+
|
|
389
|
+
enum DynamicModuleViewModeEnum {
|
|
390
|
+
NONE = 0, // No view rendered
|
|
391
|
+
VIEW = 1, // Read-only display of a single record
|
|
392
|
+
COMPILE = 2, // Fill / edit a single record
|
|
393
|
+
LIST = 3, // List of records with add/view/edit/delete actions
|
|
394
|
+
REPAIR = 4, // Review and repair a form definition
|
|
395
|
+
LISTWIEW = 5, // Alternative compact list view
|
|
396
|
+
FILTER = 6, // Filter / search mode
|
|
397
|
+
GRAPHS = 7, // Statistics and charts
|
|
398
|
+
HLIST = 8, // Horizontal scrollable list
|
|
399
|
+
EXTERNAL_FILTER = 9 // Filter driven by an external parent component
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Endpoint Configuration
|
|
406
|
+
|
|
407
|
+
By default the library builds all endpoint URLs from `baseServerUrl` using a standard convention. Pass a custom `EndPointConfiguration` to override individual routes.
|
|
408
|
+
|
|
409
|
+
```typescript
|
|
410
|
+
import {
|
|
411
|
+
EndPointConfiguration,
|
|
412
|
+
EndPointData,
|
|
413
|
+
EndPointDataParams,
|
|
414
|
+
RequestMethodEnum,
|
|
415
|
+
ParamTypeEnum
|
|
416
|
+
} from '@eqproject/eqp-dynamic-module';
|
|
417
|
+
|
|
418
|
+
const endPoints = new EndPointConfiguration();
|
|
419
|
+
|
|
420
|
+
// Override the "save record" endpoint
|
|
421
|
+
endPoints.Records.SaveEndPoint = new EndPointData();
|
|
422
|
+
endPoints.Records.SaveEndPoint.Url = 'https://custom-api.example.com/records/save';
|
|
423
|
+
endPoints.Records.SaveEndPoint.RequestMethod = RequestMethodEnum.POST;
|
|
424
|
+
endPoints.Records.SaveEndPoint.Params = [
|
|
425
|
+
{
|
|
426
|
+
ParamName: 'orgId',
|
|
427
|
+
ParamValue: this.orgaId,
|
|
428
|
+
ParamType: ParamTypeEnum['Query param']
|
|
429
|
+
}
|
|
430
|
+
];
|
|
431
|
+
|
|
432
|
+
const general = new DynamicModuleGeneralConfig(baseUrl, token, context, endPoints);
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Available endpoints
|
|
436
|
+
|
|
437
|
+
#### `EndPointConfiguration.Records`
|
|
438
|
+
|
|
439
|
+
| Key | Default route | Description |
|
|
440
|
+
|-----|--------------|-------------|
|
|
441
|
+
| `GetWithContextualizationByFormCodeEndPoint` | `GET /records/getbyformcode` | Fetch records with contextualisation by form code. |
|
|
442
|
+
| `GetByFormIDEndPoint` | `GET /records/getbyformid` | Fetch records by form ID. |
|
|
443
|
+
| `GetByFormCodeEndPoint` | `GET /records/getbyformcode` | Fetch records by form code. |
|
|
444
|
+
| `GetAllByEntAndUserIDEndPoint` | `GET /records/getallbyentanduserid` | Fetch all records for an entity + user. |
|
|
445
|
+
| `GetByIDEndPoint` | `GET /records/getbyid` | Fetch a single record by its ID. |
|
|
446
|
+
| `SaveEndPoint` | `POST /records/save` | Create or update a record. |
|
|
447
|
+
| `DuplicateEndPoint` | `POST /records/duplicate` | Duplicate an existing record. |
|
|
448
|
+
| `DeleteEndPoint` | `DELETE /records/delete` | Delete a record. |
|
|
449
|
+
| `RepairEndPoint` | `POST /records/repair` | Repair/review a form record. |
|
|
450
|
+
| `ApplyFilter` | `POST /records/filter` | Apply server-side filter. |
|
|
451
|
+
| `GetAllAttachmentsEndPoint` | `GET /records/attachments` | Fetch all attachments for a record. |
|
|
452
|
+
|
|
453
|
+
#### `EndPointConfiguration.Forms`
|
|
454
|
+
|
|
455
|
+
| Key | Default route | Description |
|
|
456
|
+
|-----|--------------|-------------|
|
|
457
|
+
| `GetByIDEndPoint` | `GET /forms/getbyid` | Fetch a form definition by ID. |
|
|
458
|
+
| `GetAllFormEndPoint` | `GET /forms/getall` | Fetch all form definitions. |
|
|
459
|
+
| `GetByIDAndVersionEndPoint` | `GET /forms/getbyidandversion` | Fetch a specific form version. |
|
|
460
|
+
| `SaveEndPoint` | `POST /forms/save` | Save a form definition. |
|
|
461
|
+
| `SaveAttachmentEndPoint` | `POST /forms/saveattachment` | Save a form attachment. |
|
|
462
|
+
| `ExportByIDEndPoint` | `GET /forms/exportbyid` | Export a form definition by ID. |
|
|
463
|
+
| `GetAttachmentWithBases64` | `GET /forms/attachment` | Fetch attachment with Base64 encoding. |
|
|
464
|
+
| `SpeechToFormEditEndPoint` | `POST /forms/speechtoedit` | Apply speech-to-text edits to a form. |
|
|
465
|
+
|
|
466
|
+
### `EndPointData`
|
|
467
|
+
|
|
468
|
+
| Property | Type | Description |
|
|
469
|
+
|----------|------|-------------|
|
|
470
|
+
| `Url` | `string` | Full endpoint URL. |
|
|
471
|
+
| `Token` | `string` | Per-endpoint auth token (overrides the general `userToken`). |
|
|
472
|
+
| `RequestMethod` | `RequestMethodEnum` | `GET`, `POST`, `PUT` or `DELETE`. |
|
|
473
|
+
| `Params` | `EndPointDataParams[]` | Parameters to include with the request. |
|
|
474
|
+
|
|
475
|
+
### `EndPointDataParams`
|
|
476
|
+
|
|
477
|
+
| Property | Type | Description |
|
|
478
|
+
|----------|------|-------------|
|
|
479
|
+
| `ParamName` | `string` | Parameter name. |
|
|
480
|
+
| `ParamValue` | `any` | Parameter value. |
|
|
481
|
+
| `ParamType` | `ParamTypeEnum` | `1` = query string, `2` = route segment, `3` = request body. |
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Data Models
|
|
486
|
+
|
|
487
|
+
### `Record`
|
|
488
|
+
|
|
489
|
+
Represents a filled form response.
|
|
490
|
+
|
|
491
|
+
| Property | Type | Description |
|
|
492
|
+
|----------|------|-------------|
|
|
493
|
+
| `ID` | `string` | Unique record identifier. |
|
|
494
|
+
| `EntID` | `string` | ID of the form (entity) this record belongs to. |
|
|
495
|
+
| `Version` | `number` | Form version at the time of compilation. |
|
|
496
|
+
| `userID` | `string` | ID of the user who created the record. |
|
|
497
|
+
| `AnswerDate` | `string` | ISO date string of when the record was filled. |
|
|
498
|
+
| `HTMLreadableValues` | `string` | Pre-rendered HTML representation of field values. |
|
|
499
|
+
| `AdditionalParams` | `any` | Extra parameters stored with the record. |
|
|
500
|
+
| `AdditionalInfo` | `any` | Extra information stored with the record. |
|
|
501
|
+
|
|
502
|
+
### `Form`
|
|
503
|
+
|
|
504
|
+
Describes a form definition returned by `(saveFormEvent)`.
|
|
505
|
+
|
|
506
|
+
| Property | Type | Description |
|
|
507
|
+
|----------|------|-------------|
|
|
508
|
+
| `ID` | `string` | Unique form identifier (GUID). |
|
|
509
|
+
| `Code` | `string` | Short form code (uppercase, no special characters). |
|
|
510
|
+
| `Name` | `string` | Display name. |
|
|
511
|
+
| `Description` | `string` | Optional description. |
|
|
512
|
+
| `Version` | `number` | Form version number. |
|
|
513
|
+
| `OrgaID` | `string` | Owning organisation ID. |
|
|
514
|
+
| `FormScalarType` | `FormScalarTypeEnum` | Layout: `Semplice` (1), `A step` (2), `In tab` (3), `In accordion` (4). |
|
|
515
|
+
| `Fields` | `BaseField[]` | Ordered array of form fields. |
|
|
516
|
+
| `Triggers` | `Trigger[]` | Automation triggers. |
|
|
517
|
+
| `ActionButtons` | `ActionButton[]` | Action buttons. |
|
|
518
|
+
| `InnerForms` | `Form[]` | Nested detail forms. |
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## Field Types Reference
|
|
523
|
+
|
|
524
|
+
The `FieldTypeEnum` describes every field type available in the form builder.
|
|
525
|
+
|
|
526
|
+
| Value | Key | Description |
|
|
527
|
+
|-------|-----|-------------|
|
|
528
|
+
| `1` | `Campo di testo` | Single-line text input. |
|
|
529
|
+
| `2` | `Area di testo` | Multi-line textarea. |
|
|
530
|
+
| `3` | `Booleano` | Checkbox / boolean toggle. |
|
|
531
|
+
| `4` | `Data e/ora` | Date and/or time picker. |
|
|
532
|
+
| `5` | `Campo numerico` | Numeric input with mask. |
|
|
533
|
+
| `6` | `Allegato` | File attachment upload. |
|
|
534
|
+
| `7` | `Immagine` | Image upload with optional cropping. |
|
|
535
|
+
| `8` | `Elenco generico` | Dropdown / multi-select list. |
|
|
536
|
+
| `9` | `Lookup` | Server-side lookup with configurable query. |
|
|
537
|
+
| `10` | `Form di dettaglio` | Embedded detail (inner) form. |
|
|
538
|
+
| `11` | `Elenco immagini` | Image selector list. |
|
|
539
|
+
| `12` | `Etichetta` | Display-only label. |
|
|
540
|
+
| `13` | `Immagine con markers` | Image with interactive annotation markers. |
|
|
541
|
+
| `14` | `Bottone` | Action button field. |
|
|
542
|
+
|
|
543
|
+
### Field value sources (`DataGetterTypeEnum`)
|
|
544
|
+
|
|
545
|
+
| Value | Description |
|
|
546
|
+
|-------|-------------|
|
|
547
|
+
| `Manuale` (1) | User enters the value manually. |
|
|
548
|
+
| `Formula` (2) | Value is computed from a formula expression. |
|
|
549
|
+
| `Da database` (3) | Value is fetched from a database query. |
|
|
550
|
+
| `Da modulo dinamico` (4) | Value is pulled from another dynamic form record. |
|