@eqproject/eqp-dynamic-module 2.10.58 → 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.
Files changed (21) hide show
  1. package/README.md +550 -259
  2. package/esm2020/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.mjs +2 -8
  3. package/esm2020/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.mjs +2 -5
  4. package/esm2020/lib/components/private/add-form-field/add-form-field.component.mjs +5 -5
  5. package/esm2020/lib/components/private/dynamic-module-field-fix/dynamic-module-field.component.mjs +3 -3
  6. package/esm2020/lib/components/private/field-templates/date-field-template/date-field-template.component.mjs +7 -6
  7. package/esm2020/lib/components/private/form-records/hlist-form-record/hlist-form-record.component.mjs +5 -4
  8. package/esm2020/lib/components/private/form-statistics/filter-templates/date-filter-template/date-filter-template.component.mjs +9 -8
  9. package/esm2020/lib/components/private/graphs/graphs.component.mjs +3 -3
  10. package/esm2020/lib/components/private/trigger-creator/trigger-templates/date-trigger-template/date-trigger-template.component.mjs +8 -7
  11. package/esm2020/lib/eqp-dynamic-module.module.mjs +17 -8
  12. package/esm2020/lib/models/baseField.model.mjs +2 -2
  13. package/fesm2015/eqproject-eqp-dynamic-module.mjs +73 -73
  14. package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
  15. package/fesm2020/eqproject-eqp-dynamic-module.mjs +73 -73
  16. package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
  17. package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +1 -2
  18. package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +1 -2
  19. package/lib/eqp-dynamic-module.module.d.ts +1 -1
  20. package/lib/models/baseField.model.d.ts +1 -1
  21. package/package.json +4 -2
package/README.md CHANGED
@@ -1,259 +1,550 @@
1
- # EqpDynamicModule
2
-
3
- Progetto effettivo del modulo dinamico
4
-
5
- ## Struttura del codice
6
- Nella cartella **exported** ci sono i componenti pubblici utilizzabili dall'esterno
7
-
8
- Nella cartella **private** ci sono i componenti privati del progetto non utilizzabili dall'esterno
9
-
10
- ## Componenti pubblici
11
- I componenti pubblici sono due:
12
- 1. eqp-dynamic-module : visualizza la form dinamica;
13
- 2. eqp-dynamic-module-configuration: permette la configurazione delle form dinamiche
14
-
15
-
16
- ### eqp-dynamic-module
17
- Componente che visualizza la form dinamica.
18
-
19
- Input
20
- | Input | obbligatorio/default | descrizione
21
- | ----- | ----------- | ----------- | ----------- |
22
- | configurations: dynamicModuleGeneralConfig | obbligatorio | configurazioni generiche per la connessione al DB
23
- | formID: string | obbligatorio | ID del form da compilare, visualizzare,
24
- | starterViewMode: EndPointConfiguration | LIST |
25
- | userID: string | 0 | Set user id for save |
26
- | showTitle | boolean | true | Show/Hide module name in COMPILE |
27
- | userMode | boolean | false | Show/Hide the buttons for "save" and "back" |
28
- | showSaveButton | true | boolean | Show/Hide form save button when userMode is true |
29
- | values: Record[] | null |
30
- | FormJSON: string | "" |
31
-
32
-
33
- #### DynamicModuleConfig Outputs
34
- | Output | Event Arguments | Required | Description |
35
- | ------------- | ------------- | ------------- | ------------- |
36
- | saveRecord | EventEmitter<Record> | - | Evento emesso quando si salva un record se non è stato specificato un endpoint da chiamare.
37
- | afterSaveRecord | EventEmitter<Record> | - | Evento emesso DOPO aver eseguito una chiamata al server per il salvataggio di un record all'endpoint specificato.
38
- | deleteRecord | EventEmitter<Record> | - | Evento emesso quando si elimina un record se non è stato specificato un endpoint da chiamare.
39
- | afterDeleteRecord | EventEmitter<Record> | - | Evento emesso DOPO aver eseguito una chiamata al server per il l'eliminazione di un record all'endpoint specificato.
40
- | duplicateRecord | EventEmitter<Record> | - | Evento emesso quando si duplica un record se non è stato specificato un endpoint da chiamare.
41
- | afterDuplicateRecord | EventEmitter<Record> | - | Evento emesso DOPO aver eseguito una chiamata al server per la duplicazione di un record all'endpoint specificato.
42
- | SaveJSON | EventEmitter<string> | - | Evento emesso quando si
43
-
44
- ### eqp-dynamic-module-configurator
45
- Componente che permette la configurazione delle form dinamiche
46
-
47
- 4 modalità d'uso:
48
- ## Nuovo Modulo:
49
- ```js
50
- let specific: DynamicModuleConfiguratorSpecificConfig = new DynamicModuleConfiguratorSpecificConfig();
51
- specific.UserID = this.currentUser.ID
52
- specific.orgaID = this.currentOrga.ID;
53
- let general: DynamicModuleGeneralConfig = new DynamicModuleGeneralConfig(this.baseServerUrl, "", this.context, null)
54
-
55
- this.config = new DynamicModuleConfiguratorConfig(general, specific)
56
- this.loader=true;
57
- ```
58
- ```html
59
- <eqp-dynamic-module-configurator
60
- *ngIf="loader"
61
- [configurations] = "config"
62
- (saveFormEvent)="onSaveForm($event)">
63
- </eqp-dynamic-module-configurator>
64
- ```
65
-
66
- ## Modifica di un modulo esistente:
67
- ```js
68
- let specific: DynamicModuleConfiguratorSpecificConfig = new DynamicModuleConfiguratorSpecificConfig();
69
- specific.UserID = this.currentOrga.ID
70
- specific.orgaID = "2";
71
- let general: DynamicModuleGeneralConfig = new DynamicModuleGeneralConfig(this.baseServerUrl, "", this.context, null)
72
-
73
- this.config = new DynamicModuleConfiguratorConfig(general, specific)
74
- this.formID = "xxxxxx-xxxxxx-xxxxxx";
75
- this.loader=true;
76
- ```
77
- ```html
78
- <eqp-dynamic-module-configurator
79
- *ngIf="loader"
80
- [configurations] = "config"
81
- [formID]="formID"
82
- (saveFormEvent)="onSaveForm($event)">
83
- </eqp-dynamic-module-configurator>
84
- ```
85
- ## Esportazione di un modulo dato l'ID:
86
- ```js
87
- let specific: DynamicModuleConfiguratorSpecificConfig = new DynamicModuleConfiguratorSpecificConfig();
88
- specific.UserID = this.currentOrga.ID
89
- specific.orgaID = "2";
90
- let general: DynamicModuleGeneralConfig = new DynamicModuleGeneralConfig(this.baseServerUrl, "", this.context, null)
91
-
92
- this.config = new DynamicModuleConfiguratorConfig(general, specific)
93
- this.formID = "xxxxxx-xxxxxx-xxxxxx";
94
- this.loader=true;
95
- ```
96
- ```html
97
- <eqp-dynamic-module-configurator
98
- *ngIf="loader"
99
- [configurations] = "config"
100
- [formID]="formID"
101
- [viewMode] = "'Export'"
102
- (saveFormEvent)="onSaveForm($event)">
103
- </eqp-dynamic-module-configurator>
104
- ```
105
- ## importazione di un modulo dato il JSON:
106
- ```js
107
- let specific: DynamicModuleConfiguratorSpecificConfig = new DynamicModuleConfiguratorSpecificConfig();
108
- specific.UserID = this.currentOrga.ID
109
- specific.orgaID = "2";
110
- specific.form = JSON.parse(this.stringForm)
111
- let general: DynamicModuleGeneralConfig = new DynamicModuleGeneralConfig(this.baseServerUrl, "", this.context, null)
112
-
113
- this.config = new DynamicModuleConfiguratorConfig(general, specific)
114
- this.formID = null;
115
- this.loader=true;
116
- ```
117
- ```html
118
- <eqp-dynamic-module-configurator
119
- *ngIf="loader"
120
- [configurations] = "config"
121
- [formID]="formID"
122
- [viewMode] = "'Export'"
123
- (saveFormEvent)="onSaveForm($event)">
124
- </eqp-dynamic-module-configurator>
125
- ```
126
-
127
-
128
- | Input | Descrizione |
129
- | ----- | ----------- |
130
- | configurations: DynamicModuleConfiguratorConfig | an object that is a configurations container. It holds 2 objects: dynamicModuleGeneralConfig, DynamicModuleConfiguratorSpecificConfig |
131
- | formID: string | obbligatorio | ID del form da compilare, visualizzare,
132
-
133
- #### DynamicModuleConfiguratorConfig Outputs
134
- | Output | Event Arguments | Required | Description |
135
- | ------------- | ------------- | ------------- | ------------- |
136
- | (saveFormEvent) | `EventEmitter<Form>` | - | Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare. |
137
- | (afterSaveFormEvent) | `EventEmitter<Form>` | - | Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato. |
138
-
139
- ## Models used
140
-
141
- ### DynamicModuleConfiguratorConfig
142
- | Property | Type | Description | Examples |
143
- | ------------- | ------------- | ------------- | ------------- |
144
- | dynamicModuleGeneralConfig | dynamicModuleGeneralConfig | contiene le informazioni generali comuni per la visualizzazione |
145
- | DynamicModuleConfiguratorSpecificConfig | dynamicModuleGeneralConfig | contiene le informazioni generali comuni per la visualizzazione |
146
-
147
-
148
- ### DynamicModuleConfig
149
- | Property | Type | Description | Examples |
150
- | ------------- | ------------- | ------------- | ------------- |
151
- | dynamicModuleGeneralConfig | dynamicModuleGeneralConfig | contiene le informazioni generali comuni per la visualizzazione |
152
- | dynamicModuleCompileConfig | dynamicModuleCompileConfig | contiene le informazioni specifiche per la visualizzazione della risposta |
153
- | dynamicModuleListConfig | dynamicModuleListConfig | contiene le informazioni specifiche per la visualizzazione della lista di risposte |
154
- | dynamicModuleRepairConfig | dynamicModuleRepairConfig | contiene le configurazioni specifiche per la modalità repair |
155
-
156
-
157
- ### DynamicModuleConfiguratorSpecificConfig | contiene le informazioni generali comuni per la visualizzazione
158
- | Property | Type | Description | Examples |
159
- | ------------- | ------------- | ------------- | ------------- |
160
- | form | Form |
161
- | orgaID | string |
162
- | UserID | number |
163
- | innerFormManagment | boolean |
164
- | innerFormRef | MatDialogRef<TemplateRef<any>> |
165
-
166
- ### dynamicModuleGeneralConfig | contiene le informazioni generali comuni per la visualizzazione
167
- | Property | Type | Description | Examples |
168
- | ------------- | ------------- | ------------- | ------------- |
169
- | baseServerUrl | string | server Url to call for API | "http://localhost:5015/api"
170
- | userToken | string | Token dell'utente |
171
- | endPointConfiguration | EndPointConfiguration | Configurazione degli endpoint da chiamare per recuperare o salvare i dati. Può essere definita dall'utente oppure lasciata null, viene popolata con dei valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti viene lasciata null e non viene eseguita nessuna chiamata al server. |
172
- | context | Context | Contesto |
173
-
174
-
175
- Note:
176
- - se non viene fornita una configurazione degli EndPoint si utilizza la configurazione standard
177
-
178
- ### dynamicModuleCompileConfig | contiene le informazioni specifiche per la visualizzazione della risposta
179
- | Property | Type | Description | Examples |
180
- | ------------- | ------------- | ------------- | ------------- |
181
- | showTitle | boolean | Show/Hide module name in COMPILE |
182
- | userMode | boolean | Show/Hide the buttons for "save" and "back" |
183
- | showSaveButton | boolean | Show/Hide form save button when userMode is true |
184
- | userID | string | Set user id for save |
185
-
186
- ### dynamicModuleListConfig | contiene le informazioni specifiche per la visualizzazione della lista di risposte
187
- | Property | Type | Description | Examples |
188
- | ------------- | ------------- | ------------- | ------------- |
189
- | showTitle | boolean | Show/Hide module name in LIST |
190
- | defaultListActions | dynamicModuleListFormRecordActionsDefault | Lista delle azioni di default da mostrare per visualizzare/modificare/duplicare/eliminare in LIST MODE |
191
- | values | Array<Record> |Lista dei record da mostrare in LIST MODE |
192
-
193
- ### dynamicModuleRepairConfig | contiene le configurazioni specifiche per la modalità repair
194
- | Property | Type | Description | Examples |
195
- | ------------- | ------------- | ------------- | ------------- |
196
- | FormJSON | string | stringa rappresentante il json del form da revisionare in REPAIR MODE |
197
-
198
-
199
-
200
-
201
- ### EndPointConfiguration
202
-
203
- example
204
- ```js
205
- export class EndPointConfiguration {
206
- Records: {
207
- GetByFormIDEndPoint?: EndPointData;
208
- GetAllByEntAndUserIDEndPoint?: EndPointData;
209
- GetByIDEndPoint?: EndPointData;
210
- SaveEndPoint?: EndPointData;
211
- DuplicateEndPoint?: EndPointData;
212
- DeleteEndPoint?: EndPointData;
213
- RepairEndPoint?: EndPointData;
214
- };
215
- Forms: {
216
- GetByIDEndPoint: EndPointData;
217
- GetByIDAndVersionEndPoint: EndPointData;
218
- SaveEndPoint: EndPointData;
219
- }
220
- }
221
- ```
222
-
223
- ### EndPointData
224
- export class EndPointData {
225
- Url: string;
226
- Token?: string;
227
- RequestMethod: RequestMethodEnum;
228
- Params?: EndPointDataParams[];
229
- }
230
-
231
- ### EndPointDataParams
232
- export class EndPointDataParams {
233
- ParamName: string;
234
- ParamValue: any = null;
235
- ParamType: ParamTypeEnum;
236
- }
237
-
238
- ### ParamTypeEnum
239
- ```js
240
- export enum ParamTypeEnum {
241
- "Query param" = 1,
242
- "In route" = 2,
243
- "In Body" = 3
244
- }
245
- ```
246
-
247
- ### RequestMethodEnum
248
-
249
- ```js
250
- export enum RequestMethodEnum {
251
- GET = 'GET',
252
- POST = 'POST',
253
- PUT = 'PUT',
254
- DELETE = 'DELETE'
255
- }
256
- ```
257
-
258
- ### Componenti privati
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
+ [![npm version](https://img.shields.io/npm/v/@eqproject/eqp-dynamic-module.svg)](https://www.npmjs.com/package/@eqproject/eqp-dynamic-module)
6
+ [![Angular](https://img.shields.io/badge/Angular-15-red.svg)](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. |