@eqproject/eqp-dynamic-module 2.10.62 → 2.10.63
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 +499 -347
- package/USERGUIDE.md +437 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,45 +1,63 @@
|
|
|
1
1
|
# @eqproject/eqp-dynamic-module
|
|
2
2
|
|
|
3
|
-
> Angular 15 library for building, rendering and managing dynamic forms with a no-code configurator.
|
|
4
|
-
|
|
5
3
|
[](https://www.npmjs.com/package/@eqproject/eqp-dynamic-module)
|
|
6
4
|
[](https://angular.io/)
|
|
7
5
|
|
|
6
|
+
> Libreria Angular 15 per la creazione, visualizzazione e gestione di form dinamiche con configuratore no-code.
|
|
7
|
+
> Angular 15 library for building, rendering and managing dynamic forms with a no-code configurator.
|
|
8
|
+
|
|
9
|
+
📖 **[Guida utente / User Guide →](./USERGUIDE.md)**
|
|
10
|
+
|
|
8
11
|
---
|
|
9
12
|
|
|
10
|
-
##
|
|
13
|
+
## Changelog
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
15
|
+
### v2.10.63
|
|
16
|
+
- README riscritto in formato bilingue (italiano completo + inglese completo).
|
|
17
|
+
- Aggiunto `USERGUIDE.md` con guida pratica per scenari d'uso comuni e sezione prompt AI di esempio.
|
|
18
|
+
- `USERGUIDE.md` incluso nel pacchetto npm tramite `ng-package.json` assets.
|
|
19
|
+
|
|
20
|
+
### v2.10.62
|
|
21
|
+
- Migrazione da `tmw-picker` 1.0.x a 1.1.0: NgModule → standalone components, moment.js → Luxon, aggiornamento di tutti i token formato data (`DD/MM/YYYY` → `dd/MM/yyyy`).
|
|
22
|
+
- Rimossi input inutilizzati: `answerToDuplicateId` da `eqp-dynamic-module`, `ProjectName` da `eqp-dynamic-module-configurator`.
|
|
23
|
+
- Documentazione NPM riscritta completamente (bilingue IT/EN).
|
|
24
|
+
|
|
25
|
+
### v2.10.60
|
|
26
|
+
- Aggiornamenti interni e correzioni bug.
|
|
24
27
|
|
|
25
28
|
---
|
|
26
29
|
|
|
27
|
-
##
|
|
30
|
+
## Versione italiana
|
|
31
|
+
|
|
32
|
+
- [Panoramica](#panoramica)
|
|
33
|
+
- [Prerequisiti](#prerequisiti)
|
|
34
|
+
- [Installazione](#installazione)
|
|
35
|
+
- [Configurazione del modulo](#configurazione-del-modulo)
|
|
36
|
+
- [Componenti](#componenti)
|
|
37
|
+
- [eqp-dynamic-module — Visualizzatore form](#eqp-dynamic-module--visualizzatore-form)
|
|
38
|
+
- [eqp-dynamic-module-configurator — Builder form](#eqp-dynamic-module-configurator--builder-form)
|
|
39
|
+
- [Modelli di configurazione](#modelli-di-configurazione)
|
|
40
|
+
- [Modalità di visualizzazione](#modalità-di-visualizzazione)
|
|
41
|
+
- [Configurazione endpoint](#configurazione-endpoint)
|
|
42
|
+
- [Modelli dati](#modelli-dati)
|
|
43
|
+
- [Tipi di campo](#tipi-di-campo)
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
---
|
|
30
46
|
|
|
31
|
-
|
|
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) |
|
|
47
|
+
### Panoramica
|
|
35
48
|
|
|
36
|
-
|
|
49
|
+
`@eqproject/eqp-dynamic-module` espone **due componenti pubblici**:
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
| Componente | Scopo |
|
|
52
|
+
|-----------|-------|
|
|
53
|
+
| `<eqp-dynamic-module>` | Visualizzatore, compilatore, lista, filtro e grafici a runtime |
|
|
54
|
+
| `<eqp-dynamic-module-configurator>` | Builder no-code per creare e modificare le definizioni form |
|
|
55
|
+
|
|
56
|
+
Le form sono strutture JSON salvate lato server e recuperate a runtime. La libreria gestisce rendering, validazione, recupero dati, operazioni CRUD e funzionalità avanzate come formule, trigger, action button e speech-to-text.
|
|
39
57
|
|
|
40
|
-
|
|
58
|
+
---
|
|
41
59
|
|
|
42
|
-
|
|
60
|
+
### Prerequisiti
|
|
43
61
|
|
|
44
62
|
```bash
|
|
45
63
|
npm install @angular/cdk@^15.1.2 @angular/material@^15.1.2 @angular/material-luxon-adapter@^15.2.9 --legacy-peer-deps
|
|
@@ -47,11 +65,11 @@ npm install @angular-material-components/datetime-picker@^15.0.0 @angular-materi
|
|
|
47
65
|
npm install moment@^2.29.4 sweetalert2@^11.4.24 --legacy-peer-deps
|
|
48
66
|
```
|
|
49
67
|
|
|
50
|
-
>
|
|
68
|
+
> Tutti i comandi `npm install` per questa libreria richiedono il flag `--legacy-peer-deps`.
|
|
51
69
|
|
|
52
70
|
---
|
|
53
71
|
|
|
54
|
-
|
|
72
|
+
### Installazione
|
|
55
73
|
|
|
56
74
|
```bash
|
|
57
75
|
npm install @eqproject/eqp-dynamic-module --legacy-peer-deps
|
|
@@ -59,23 +77,20 @@ npm install @eqproject/eqp-dynamic-module --legacy-peer-deps
|
|
|
59
77
|
|
|
60
78
|
---
|
|
61
79
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Import `EqpDynamicModuleModule` in your `AppModule` (or the feature module where you need it):
|
|
80
|
+
### Configurazione del modulo
|
|
65
81
|
|
|
66
82
|
```typescript
|
|
67
83
|
import { EqpDynamicModuleModule } from '@eqproject/eqp-dynamic-module';
|
|
68
84
|
|
|
69
85
|
@NgModule({
|
|
70
86
|
imports: [
|
|
71
|
-
// ...
|
|
72
87
|
EqpDynamicModuleModule
|
|
73
88
|
]
|
|
74
89
|
})
|
|
75
90
|
export class AppModule {}
|
|
76
91
|
```
|
|
77
92
|
|
|
78
|
-
|
|
93
|
+
In `angular.json`, aggiungi il tema Material agli stili:
|
|
79
94
|
|
|
80
95
|
```json
|
|
81
96
|
"styles": [
|
|
@@ -86,442 +101,588 @@ Add Angular Material theme and icons to your `angular.json` styles:
|
|
|
86
101
|
|
|
87
102
|
---
|
|
88
103
|
|
|
89
|
-
|
|
104
|
+
### Componenti
|
|
90
105
|
|
|
91
|
-
|
|
106
|
+
#### `eqp-dynamic-module` — Visualizzatore form
|
|
92
107
|
|
|
93
|
-
|
|
108
|
+
Visualizza una form dinamica in una delle [modalità disponibili](#modalità-di-visualizzazione).
|
|
94
109
|
|
|
95
|
-
|
|
110
|
+
**Utilizzo base**
|
|
96
111
|
|
|
97
112
|
```typescript
|
|
98
|
-
import {
|
|
99
|
-
DynamicModuleGeneralConfig,
|
|
100
|
-
DynamicModuleViewModeEnum
|
|
101
|
-
} from '@eqproject/eqp-dynamic-module';
|
|
113
|
+
import { DynamicModuleGeneralConfig, DynamicModuleViewModeEnum } from '@eqproject/eqp-dynamic-module';
|
|
102
114
|
|
|
103
|
-
// component.ts
|
|
104
115
|
generalConfig = new DynamicModuleGeneralConfig(
|
|
105
|
-
'https://
|
|
116
|
+
'https://tua-api.esempio.it/api',
|
|
106
117
|
this.userToken,
|
|
107
118
|
this.context,
|
|
108
|
-
null
|
|
119
|
+
null
|
|
109
120
|
);
|
|
110
121
|
```
|
|
111
122
|
|
|
112
123
|
```html
|
|
113
124
|
<eqp-dynamic-module
|
|
114
125
|
[configurations]="generalConfig"
|
|
115
|
-
[formID]="'
|
|
126
|
+
[formID]="'id-del-form'"
|
|
116
127
|
[starterViewMode]="DynamicModuleViewModeEnum.LIST"
|
|
117
128
|
[userID]="currentUser.id"
|
|
118
|
-
(saveRecord)="
|
|
119
|
-
(afterSaveRecord)="
|
|
129
|
+
(saveRecord)="onSalvataggio($event)"
|
|
130
|
+
(afterSaveRecord)="dopoSalvataggio($event)">
|
|
120
131
|
</eqp-dynamic-module>
|
|
121
132
|
```
|
|
122
133
|
|
|
123
|
-
|
|
134
|
+
**Input**
|
|
124
135
|
|
|
125
|
-
| Input |
|
|
136
|
+
| Input | Tipo | Default | Descrizione |
|
|
126
137
|
|-------|------|---------|-------------|
|
|
127
|
-
| `configurations` | `DynamicModuleGeneralConfig` | — | **
|
|
128
|
-
| `formID` | `string` | — | **
|
|
129
|
-
| `starterViewMode` | `DynamicModuleViewModeEnum` | `LIST` |
|
|
130
|
-
| `userID` | `string` | `"0"` |
|
|
131
|
-
| `orgaID` | `string` | `"0"` |
|
|
132
|
-
| `showTitle` | `boolean` | `true` |
|
|
133
|
-
| `showBackButton` | `boolean` | `true` |
|
|
134
|
-
| `showSaveButton` | `boolean` | `true` |
|
|
135
|
-
| `values` | `Record[]` | `null` |
|
|
136
|
-
| `FormJSON` | `string` | `""` | JSON
|
|
137
|
-
| `formulaObject` | `any` | `{}` |
|
|
138
|
-
| `selectedRecord` | `Record \| string` | `null` |
|
|
139
|
-
| `externalButtons` | `RecordButton[]` | `[]` |
|
|
140
|
-
| `actionButtons` | `ActionButton[]` | `[]` |
|
|
141
|
-
| `defaultListActions` | `DynamicModuleListFormRecordActionsDefault` |
|
|
142
|
-
| `listViewRecordTitle` | `string[]` | `[]` |
|
|
143
|
-
| `defaultListViewFunction` | `Function` | `null` |
|
|
144
|
-
| `onSaveBackToList` | `boolean` | `false` |
|
|
145
|
-
| `onBackTo` | `DynamicModuleViewModeEnum` | `null` |
|
|
146
|
-
| `numberOfColumns` | `number` | `3` |
|
|
147
|
-
| `showHiddenFields` | `boolean` | `true` |
|
|
148
|
-
| `filterResultViewMode` | `DynamicModuleFilterResultViewModeEnum` | `INTERNAL_EQPTABLE` |
|
|
149
|
-
| `additionalParams` | `any` | `null` |
|
|
150
|
-
| `additionalInfo` | `any` | `null` |
|
|
151
|
-
| `prefilterParams` | `any` | `null` |
|
|
152
|
-
| `updateInfo` | `any` | `null` |
|
|
153
|
-
| `contestualizationParams` | `any` | `null` |
|
|
154
|
-
| `showNewSearchButton` | `boolean` | `true` |
|
|
155
|
-
| `highlightFilter` | `any` | — |
|
|
156
|
-
| `isDraggableListView` | `boolean` | `true` |
|
|
157
|
-
| `Statistic` | `FilterStatistic` | `null` |
|
|
158
|
-
| `QueryEditorComponent` | `any` | — |
|
|
159
|
-
| `debugMode` | `boolean` | `false` |
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| Output | Payload |
|
|
138
|
+
| `configurations` | `DynamicModuleGeneralConfig` | — | **Obbligatorio.** Configurazione connessione server. |
|
|
139
|
+
| `formID` | `string` | — | **Obbligatorio.** ID del form da visualizzare. |
|
|
140
|
+
| `starterViewMode` | `DynamicModuleViewModeEnum` | `LIST` | Modalità iniziale. |
|
|
141
|
+
| `userID` | `string` | `"0"` | ID utente per il salvataggio record. |
|
|
142
|
+
| `orgaID` | `string` | `"0"` | ID organizzazione. |
|
|
143
|
+
| `showTitle` | `boolean` | `true` | Mostra/nasconde il nome del form. |
|
|
144
|
+
| `showBackButton` | `boolean` | `true` | Mostra/nasconde il pulsante indietro. |
|
|
145
|
+
| `showSaveButton` | `boolean` | `true` | Mostra/nasconde il pulsante salva. |
|
|
146
|
+
| `values` | `Record[]` | `null` | Record pre-caricati per la modalità LIST. |
|
|
147
|
+
| `FormJSON` | `string` | `""` | JSON del form per la modalità REPAIR. |
|
|
148
|
+
| `formulaObject` | `any` | `{}` | Oggetto contesto per le formule (es. `{ role, user }`). |
|
|
149
|
+
| `selectedRecord` | `Record \| string` | `null` | Record pre-selezionato (oggetto o ID). |
|
|
150
|
+
| `externalButtons` | `RecordButton[]` | `[]` | Pulsanti extra nel menu azioni record. |
|
|
151
|
+
| `actionButtons` | `ActionButton[]` | `[]` | Pulsanti azione per i campi di tipo `Bottone`. |
|
|
152
|
+
| `defaultListActions` | `DynamicModuleListFormRecordActionsDefault` | tutti `true` | Azioni default lista: add, view, edit, duplicate, delete, graphs. |
|
|
153
|
+
| `listViewRecordTitle` | `string[]` | `[]` | Chiavi dei campi che compongono il titolo accordion. |
|
|
154
|
+
| `defaultListViewFunction` | `Function` | `null` | Funzione custom al caricamento della lista. |
|
|
155
|
+
| `onSaveBackToList` | `boolean` | `false` | Torna alla LIST dopo il salvataggio. |
|
|
156
|
+
| `onBackTo` | `DynamicModuleViewModeEnum` | `null` | Modalità di destinazione del pulsante indietro. |
|
|
157
|
+
| `numberOfColumns` | `number` | `3` | Numero di colonne del layout. |
|
|
158
|
+
| `showHiddenFields` | `boolean` | `true` | Mostra/nasconde i campi marcati come nascosti. |
|
|
159
|
+
| `filterResultViewMode` | `DynamicModuleFilterResultViewModeEnum` | `INTERNAL_EQPTABLE` | Modalità visualizzazione risultati filtro. |
|
|
160
|
+
| `additionalParams` | `any` | `null` | Parametri extra per le chiamate filtro server. |
|
|
161
|
+
| `additionalInfo` | `any` | `null` | Dati extra per operazioni client-side. |
|
|
162
|
+
| `prefilterParams` | `any` | `null` | Parametri pre-filtro. |
|
|
163
|
+
| `updateInfo` | `any` | `null` | Dati per aggiornare i valori delle risposte. |
|
|
164
|
+
| `contestualizationParams` | `any` | `null` | Parametri di contestualizzazione della lista risultati. |
|
|
165
|
+
| `showNewSearchButton` | `boolean` | `true` | Mostra/nasconde il pulsante "nuova ricerca". |
|
|
166
|
+
| `highlightFilter` | `any` | — | Configurazione evidenziazione righe/campi. |
|
|
167
|
+
| `isDraggableListView` | `boolean` | `true` | Abilita drag-and-drop nella lista. |
|
|
168
|
+
| `Statistic` | `FilterStatistic` | `null` | Configurazione statistiche e filtri. |
|
|
169
|
+
| `QueryEditorComponent` | `any` | — | Componente query editor custom per i lookup. |
|
|
170
|
+
| `debugMode` | `boolean` | `false` | Abilita log dettagliati in console. |
|
|
171
|
+
|
|
172
|
+
**Output**
|
|
173
|
+
|
|
174
|
+
| Output | Payload | Descrizione |
|
|
164
175
|
|--------|---------|-------------|
|
|
165
|
-
| `(saveRecord)` | `Record` |
|
|
166
|
-
| `(afterSaveRecord)` | `Record` |
|
|
167
|
-
| `(deleteRecord)` | `Record` |
|
|
168
|
-
| `(afterDeleteRecord)` | `Record` |
|
|
169
|
-
| `(SaveJSON)` | `string` |
|
|
170
|
-
| `(afterFilter)` | `DynRecord[]` |
|
|
171
|
-
| `(dragStarted)` | `Record` |
|
|
172
|
-
| `(dragReleased)` | `void` |
|
|
173
|
-
| `(clickDragIndicator)` | `Record` |
|
|
174
|
-
| `(out)` | `eventOut` |
|
|
175
|
-
| `(fireTrigger)` | `FireTrigger` |
|
|
176
|
-
| `(afterOutputExternalFilters)` | `FilterStatistic` |
|
|
176
|
+
| `(saveRecord)` | `Record` | Emesso al salvataggio **senza** endpoint configurato. |
|
|
177
|
+
| `(afterSaveRecord)` | `Record` | Emesso dopo la chiamata server di salvataggio. |
|
|
178
|
+
| `(deleteRecord)` | `Record` | Emesso all'eliminazione **senza** endpoint configurato. |
|
|
179
|
+
| `(afterDeleteRecord)` | `Record` | Emesso dopo la chiamata server di eliminazione. |
|
|
180
|
+
| `(SaveJSON)` | `string` | Emesso all'esportazione del JSON del form. |
|
|
181
|
+
| `(afterFilter)` | `DynRecord[]` | Emesso dopo l'applicazione di un filtro. |
|
|
182
|
+
| `(dragStarted)` | `Record` | Emesso all'inizio di un drag. |
|
|
183
|
+
| `(dragReleased)` | `void` | Emesso al rilascio del drag. |
|
|
184
|
+
| `(clickDragIndicator)` | `Record` | Emesso al click sull'icona drag. |
|
|
185
|
+
| `(out)` | `eventOut` | Output generico per comunicazione esterna. |
|
|
186
|
+
| `(fireTrigger)` | `FireTrigger` | Emesso quando scatta un trigger. |
|
|
187
|
+
| `(afterOutputExternalFilters)` | `FilterStatistic` | Emesso dopo filtri esterni applicati. |
|
|
177
188
|
|
|
178
189
|
---
|
|
179
190
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
No-code designer for creating and editing form definitions. Supports four usage modes controlled by `viewMode` and the `formID` / `specific.form` inputs.
|
|
191
|
+
#### `eqp-dynamic-module-configurator` — Builder form
|
|
183
192
|
|
|
184
|
-
|
|
193
|
+
Designer no-code per creare e modificare definizioni form.
|
|
185
194
|
|
|
186
|
-
|
|
195
|
+
**Modalità d'uso**
|
|
187
196
|
|
|
188
197
|
```typescript
|
|
198
|
+
// Nuovo form
|
|
189
199
|
const specific = new DynamicModuleConfiguratorSpecificConfig();
|
|
190
200
|
specific.UserID = this.currentUser.id;
|
|
191
201
|
specific.orgaID = this.currentOrga.id;
|
|
192
|
-
|
|
193
202
|
const general = new DynamicModuleGeneralConfig(this.baseServerUrl, this.userToken, this.context, null);
|
|
194
|
-
|
|
195
|
-
this.configuratorConfig = new DynamicModuleConfiguratorConfig(general, specific);
|
|
203
|
+
this.config = new DynamicModuleConfiguratorConfig(general, specific);
|
|
196
204
|
```
|
|
197
205
|
|
|
198
206
|
```html
|
|
207
|
+
<!-- Nuovo form -->
|
|
199
208
|
<eqp-dynamic-module-configurator
|
|
200
|
-
*ngIf="
|
|
201
|
-
[configurations]="
|
|
202
|
-
(saveFormEvent)="
|
|
203
|
-
(afterSaveFormEvent)="onFormAfterSaved($event)">
|
|
209
|
+
*ngIf="config"
|
|
210
|
+
[configurations]="config"
|
|
211
|
+
(saveFormEvent)="onSalvaForm($event)">
|
|
204
212
|
</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
213
|
|
|
214
|
-
|
|
214
|
+
<!-- Modifica form esistente -->
|
|
215
215
|
<eqp-dynamic-module-configurator
|
|
216
|
-
*ngIf="
|
|
217
|
-
[configurations]="
|
|
216
|
+
*ngIf="config"
|
|
217
|
+
[configurations]="config"
|
|
218
218
|
[formID]="formID"
|
|
219
|
-
(saveFormEvent)="
|
|
219
|
+
(saveFormEvent)="onSalvaForm($event)">
|
|
220
220
|
</eqp-dynamic-module-configurator>
|
|
221
|
-
```
|
|
222
221
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
```html
|
|
222
|
+
<!-- Esportazione -->
|
|
226
223
|
<eqp-dynamic-module-configurator
|
|
227
|
-
|
|
228
|
-
[configurations]="configuratorConfig"
|
|
224
|
+
[configurations]="config"
|
|
229
225
|
[formID]="formID"
|
|
230
226
|
[viewMode]="'Export'"
|
|
231
|
-
(saveFormEvent)="
|
|
227
|
+
(saveFormEvent)="onSalvaForm($event)">
|
|
228
|
+
</eqp-dynamic-module-configurator>
|
|
229
|
+
|
|
230
|
+
<!-- Importazione da JSON -->
|
|
231
|
+
<eqp-dynamic-module-configurator
|
|
232
|
+
[configurations]="config"
|
|
233
|
+
[formID]="null"
|
|
234
|
+
[viewMode]="'Export'"
|
|
235
|
+
(saveFormEvent)="onSalvaForm($event)">
|
|
232
236
|
</eqp-dynamic-module-configurator>
|
|
233
237
|
```
|
|
234
238
|
|
|
235
|
-
|
|
239
|
+
**Input**
|
|
240
|
+
|
|
241
|
+
| Input | Tipo | Default | Descrizione |
|
|
242
|
+
|-------|------|---------|-------------|
|
|
243
|
+
| `configurations` | `DynamicModuleConfiguratorConfig` | — | **Obbligatorio.** Contenitore configurazione. |
|
|
244
|
+
| `formID` | `string` | `null` | ID del form da modificare. `null` crea un nuovo form. |
|
|
245
|
+
| `viewMode` | `string` | `"addOrEdit"` | `"addOrEdit"` per creare/modificare, `"Export"` per esportare/importare. |
|
|
246
|
+
| `fieldsExtraConfig` | `FieldExtraConfig[]` | — | Configurazione extra per campi specifici. |
|
|
247
|
+
| `triggers` | `any` | — | Definizioni trigger disponibili nell'editor. |
|
|
248
|
+
| `actionButtons` | `any` | — | Definizioni action button disponibili. |
|
|
249
|
+
| `contestualization` | `Contestualization[]` | — | Opzioni di contestualizzazione per lookup e filtri. |
|
|
250
|
+
| `formulaObject` | `any` | — | Contesto per l'anteprima delle formule. |
|
|
251
|
+
| `QueryEditorComponent` | `DynamicLoaderDirectiveData` | — | Componente query editor custom. |
|
|
252
|
+
| `debugMode` | `boolean` | `false` | Abilita log dettagliati. |
|
|
253
|
+
|
|
254
|
+
**Output**
|
|
255
|
+
|
|
256
|
+
| Output | Payload | Descrizione |
|
|
257
|
+
|--------|---------|-------------|
|
|
258
|
+
| `(saveFormEvent)` | `Form` | Emesso al salvataggio **senza** endpoint configurato. |
|
|
259
|
+
| `(afterSaveFormEvent)` | `Form` | Emesso dopo la chiamata server di salvataggio. |
|
|
260
|
+
| `(out)` | `eventOut` | Output generico per comunicazione esterna. |
|
|
261
|
+
| `(fireTrigger)` | `FireTrigger` | Emesso quando scatta un trigger. |
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Modelli di configurazione
|
|
266
|
+
|
|
267
|
+
#### `DynamicModuleGeneralConfig`
|
|
236
268
|
|
|
237
269
|
```typescript
|
|
238
|
-
|
|
239
|
-
|
|
270
|
+
const general = new DynamicModuleGeneralConfig(
|
|
271
|
+
'https://api.esempio.it/api', // baseServerUrl
|
|
272
|
+
userToken, // token autenticazione
|
|
273
|
+
context, // oggetto Context
|
|
274
|
+
null // EndPointConfiguration (null = usa default)
|
|
275
|
+
);
|
|
240
276
|
```
|
|
241
277
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
278
|
+
| Proprietà | Tipo | Descrizione |
|
|
279
|
+
|-----------|------|-------------|
|
|
280
|
+
| `baseServerUrl` | `string` | URL base API. Usato per costruire automaticamente gli endpoint se `endPointConfiguration` è `null`. |
|
|
281
|
+
| `userToken` | `string` | Token di autenticazione inviato con ogni chiamata. |
|
|
282
|
+
| `endPointConfiguration` | `EndPointConfiguration \| null` | Override completo degli endpoint. `null` usa le rotte standard. |
|
|
283
|
+
| `context` | `Context` | Contesto applicativo. |
|
|
284
|
+
|
|
285
|
+
#### `DynamicModuleListFormRecordActionsDefault`
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
const actions = new DynamicModuleListFormRecordActionsDefault();
|
|
289
|
+
actions.add = true; // Pulsante "Aggiungi" nell'header lista
|
|
290
|
+
actions.view = true; // Visualizza record (solo lettura)
|
|
291
|
+
actions.edit = true; // Modifica record
|
|
292
|
+
actions.duplicate = false; // Duplica record
|
|
293
|
+
actions.delete = true; // Elimina record
|
|
294
|
+
actions.graphs = false; // Grafici record
|
|
250
295
|
```
|
|
251
296
|
|
|
252
|
-
|
|
297
|
+
---
|
|
253
298
|
|
|
254
|
-
|
|
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. |
|
|
299
|
+
### Modalità di visualizzazione
|
|
266
300
|
|
|
267
|
-
|
|
301
|
+
```typescript
|
|
302
|
+
import { DynamicModuleViewModeEnum } from '@eqproject/eqp-dynamic-module';
|
|
268
303
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
304
|
+
enum DynamicModuleViewModeEnum {
|
|
305
|
+
NONE = 0, // Nessuna visualizzazione
|
|
306
|
+
VIEW = 1, // Sola lettura
|
|
307
|
+
COMPILE = 2, // Compilazione / modifica
|
|
308
|
+
LIST = 3, // Lista record
|
|
309
|
+
REPAIR = 4, // Revisione form
|
|
310
|
+
LISTWIEW = 5, // Lista compatta alternativa
|
|
311
|
+
FILTER = 6, // Filtro / ricerca
|
|
312
|
+
GRAPHS = 7, // Statistiche e grafici
|
|
313
|
+
HLIST = 8, // Lista orizzontale
|
|
314
|
+
EXTERNAL_FILTER = 9 // Filtro guidato dal componente padre
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
### Configurazione endpoint
|
|
321
|
+
|
|
322
|
+
Per default la libreria costruisce tutti gli URL dagli endpoint a partire da `baseServerUrl`. Passa un `EndPointConfiguration` custom per sovrascrivere singole rotte.
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
import { EndPointConfiguration, EndPointData, RequestMethodEnum, ParamTypeEnum } from '@eqproject/eqp-dynamic-module';
|
|
326
|
+
|
|
327
|
+
const endPoints = new EndPointConfiguration();
|
|
328
|
+
endPoints.Records.SaveEndPoint = new EndPointData();
|
|
329
|
+
endPoints.Records.SaveEndPoint.Url = 'https://custom-api.esempio.it/records/save';
|
|
330
|
+
endPoints.Records.SaveEndPoint.RequestMethod = RequestMethodEnum.POST;
|
|
331
|
+
endPoints.Records.SaveEndPoint.Params = [{
|
|
332
|
+
ParamName: 'orgId',
|
|
333
|
+
ParamValue: this.orgaId,
|
|
334
|
+
ParamType: ParamTypeEnum['Query param']
|
|
335
|
+
}];
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Endpoint Records disponibili:** `GetWithContextualizationByFormCodeEndPoint`, `GetByFormIDEndPoint`, `GetByFormCodeEndPoint`, `GetAllByEntAndUserIDEndPoint`, `GetByIDEndPoint`, `SaveEndPoint`, `DuplicateEndPoint`, `DeleteEndPoint`, `RepairEndPoint`, `ApplyFilter`, `GetAllAttachmentsEndPoint`.
|
|
339
|
+
|
|
340
|
+
**Endpoint Forms disponibili:** `GetByIDEndPoint`, `GetAllFormEndPoint`, `GetByIDAndVersionEndPoint`, `SaveEndPoint`, `SaveAttachmentEndPoint`, `ExportByIDEndPoint`, `GetAttachmentWithBases64`, `SpeechToFormEditEndPoint`.
|
|
275
341
|
|
|
276
342
|
---
|
|
277
343
|
|
|
278
|
-
|
|
344
|
+
### Modelli dati
|
|
345
|
+
|
|
346
|
+
#### `Record`
|
|
347
|
+
|
|
348
|
+
| Proprietà | Tipo | Descrizione |
|
|
349
|
+
|-----------|------|-------------|
|
|
350
|
+
| `ID` | `string` | Identificatore unico. |
|
|
351
|
+
| `EntID` | `string` | ID del form (entità) di appartenenza. |
|
|
352
|
+
| `Version` | `number` | Versione del form al momento della compilazione. |
|
|
353
|
+
| `userID` | `string` | ID utente che ha creato il record. |
|
|
354
|
+
| `AnswerDate` | `string` | Data di compilazione (ISO). |
|
|
355
|
+
| `HTMLreadableValues` | `string` | Valori in formato HTML leggibile. |
|
|
356
|
+
| `AdditionalParams` | `any` | Parametri aggiuntivi. |
|
|
357
|
+
| `AdditionalInfo` | `any` | Informazioni aggiuntive. |
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### Tipi di campo
|
|
362
|
+
|
|
363
|
+
| Valore | Chiave | Descrizione |
|
|
364
|
+
|--------|--------|-------------|
|
|
365
|
+
| `1` | `Campo di testo` | Input testo singola riga. |
|
|
366
|
+
| `2` | `Area di testo` | Textarea multiriga. |
|
|
367
|
+
| `3` | `Booleano` | Checkbox / toggle. |
|
|
368
|
+
| `4` | `Data e/ora` | Selettore data e/o ora. |
|
|
369
|
+
| `5` | `Campo numerico` | Input numerico con maschera. |
|
|
370
|
+
| `6` | `Allegato` | Upload file. |
|
|
371
|
+
| `7` | `Immagine` | Upload immagine con crop. |
|
|
372
|
+
| `8` | `Elenco generico` | Dropdown / selezione multipla. |
|
|
373
|
+
| `9` | `Lookup` | Lookup server-side con query configurabile. |
|
|
374
|
+
| `10` | `Form di dettaglio` | Form di dettaglio annidato. |
|
|
375
|
+
| `11` | `Elenco immagini` | Selettore lista immagini. |
|
|
376
|
+
| `12` | `Etichetta` | Solo visualizzazione. |
|
|
377
|
+
| `13` | `Immagine con markers` | Immagine con annotazioni interattive. |
|
|
378
|
+
| `14` | `Bottone` | Campo pulsante azione. |
|
|
379
|
+
|
|
380
|
+
---
|
|
279
381
|
|
|
280
|
-
|
|
382
|
+
## English version
|
|
281
383
|
|
|
282
|
-
|
|
384
|
+
- [Overview](#overview)
|
|
385
|
+
- [Prerequisites](#prerequisites)
|
|
386
|
+
- [Installation](#installation)
|
|
387
|
+
- [Module Setup](#module-setup)
|
|
388
|
+
- [Components](#components)
|
|
389
|
+
- [eqp-dynamic-module — Form Viewer/Filler](#eqp-dynamic-module--form-viewerfiller)
|
|
390
|
+
- [eqp-dynamic-module-configurator — Form Builder](#eqp-dynamic-module-configurator--form-builder)
|
|
391
|
+
- [Configuration Models](#configuration-models)
|
|
392
|
+
- [View Modes](#view-modes)
|
|
393
|
+
- [Endpoint Configuration](#endpoint-configuration)
|
|
394
|
+
- [Data Models](#data-models)
|
|
395
|
+
- [Field Types Reference](#field-types-reference)
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### Overview
|
|
400
|
+
|
|
401
|
+
`@eqproject/eqp-dynamic-module` exposes **two public components**:
|
|
402
|
+
|
|
403
|
+
| Component | Purpose |
|
|
404
|
+
|-----------|---------|
|
|
405
|
+
| `<eqp-dynamic-module>` | Runtime form viewer, filler, list, filter and graphs |
|
|
406
|
+
| `<eqp-dynamic-module-configurator>` | No-code form builder (create, edit, import, export) |
|
|
407
|
+
|
|
408
|
+
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.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
### Prerequisites
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
npm install @angular/cdk@^15.1.2 @angular/material@^15.1.2 @angular/material-luxon-adapter@^15.2.9 --legacy-peer-deps
|
|
416
|
+
npm install @angular-material-components/datetime-picker@^15.0.0 @angular-material-components/moment-adapter@^15.0.0 --legacy-peer-deps
|
|
417
|
+
npm install moment@^2.29.4 sweetalert2@^11.4.24 --legacy-peer-deps
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
> All `npm install` commands for this library require `--legacy-peer-deps`.
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
### Installation
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
npm install @eqproject/eqp-dynamic-module --legacy-peer-deps
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
### Module Setup
|
|
283
433
|
|
|
284
434
|
```typescript
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
435
|
+
import { EqpDynamicModuleModule } from '@eqproject/eqp-dynamic-module';
|
|
436
|
+
|
|
437
|
+
@NgModule({
|
|
438
|
+
imports: [EqpDynamicModuleModule]
|
|
439
|
+
})
|
|
440
|
+
export class AppModule {}
|
|
291
441
|
```
|
|
292
442
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
443
|
+
Add Angular Material theme to `angular.json` styles:
|
|
444
|
+
|
|
445
|
+
```json
|
|
446
|
+
"styles": [
|
|
447
|
+
"node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
|
|
448
|
+
"src/styles.css"
|
|
449
|
+
]
|
|
450
|
+
```
|
|
299
451
|
|
|
300
452
|
---
|
|
301
453
|
|
|
302
|
-
###
|
|
454
|
+
### Components
|
|
303
455
|
|
|
304
|
-
|
|
456
|
+
#### `eqp-dynamic-module` — Form Viewer/Filler
|
|
305
457
|
|
|
306
|
-
|
|
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. |
|
|
458
|
+
**Basic usage**
|
|
312
459
|
|
|
313
|
-
|
|
460
|
+
```typescript
|
|
461
|
+
import { DynamicModuleGeneralConfig, DynamicModuleViewModeEnum } from '@eqproject/eqp-dynamic-module';
|
|
314
462
|
|
|
315
|
-
|
|
316
|
-
|
|
463
|
+
generalConfig = new DynamicModuleGeneralConfig(
|
|
464
|
+
'https://your-api.example.com/api',
|
|
465
|
+
this.userToken,
|
|
466
|
+
this.context,
|
|
467
|
+
null
|
|
468
|
+
);
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
```html
|
|
472
|
+
<eqp-dynamic-module
|
|
473
|
+
[configurations]="generalConfig"
|
|
474
|
+
[formID]="'your-form-id'"
|
|
475
|
+
[starterViewMode]="DynamicModuleViewModeEnum.LIST"
|
|
476
|
+
[userID]="currentUser.id"
|
|
477
|
+
(saveRecord)="onSave($event)"
|
|
478
|
+
(afterSaveRecord)="onAfterSave($event)">
|
|
479
|
+
</eqp-dynamic-module>
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**Inputs**
|
|
483
|
+
|
|
484
|
+
| Input | Type | Default | Description |
|
|
485
|
+
|-------|------|---------|-------------|
|
|
486
|
+
| `configurations` | `DynamicModuleGeneralConfig` | — | **Required.** Server connection configuration. |
|
|
487
|
+
| `formID` | `string` | — | **Required.** ID of the form to display. |
|
|
488
|
+
| `starterViewMode` | `DynamicModuleViewModeEnum` | `LIST` | Initial view mode. |
|
|
489
|
+
| `userID` | `string` | `"0"` | User ID stamped on saved records. |
|
|
490
|
+
| `orgaID` | `string` | `"0"` | Organization ID. |
|
|
317
491
|
| `showTitle` | `boolean` | `true` | Show/hide the form name. |
|
|
318
|
-
| `showSaveButton` | `boolean` | `true` | Show/hide the save button. |
|
|
319
492
|
| `showBackButton` | `boolean` | `true` | Show/hide the back button. |
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
493
|
+
| `showSaveButton` | `boolean` | `true` | Show/hide the save button. |
|
|
494
|
+
| `values` | `Record[]` | `null` | Pre-loaded records for LIST mode. |
|
|
495
|
+
| `FormJSON` | `string` | `""` | Form JSON string for REPAIR mode. |
|
|
496
|
+
| `formulaObject` | `any` | `{}` | Context object for formula evaluation. |
|
|
497
|
+
| `selectedRecord` | `Record \| string` | `null` | Pre-select a record by object or ID. |
|
|
498
|
+
| `externalButtons` | `RecordButton[]` | `[]` | Extra buttons in the record action menu. |
|
|
499
|
+
| `actionButtons` | `ActionButton[]` | `[]` | Action buttons for `Bottone` field type. |
|
|
500
|
+
| `defaultListActions` | `DynamicModuleListFormRecordActionsDefault` | all `true` | Toggle default list actions. |
|
|
501
|
+
| `listViewRecordTitle` | `string[]` | `[]` | Field keys composing the accordion title. |
|
|
502
|
+
| `defaultListViewFunction` | `Function` | `null` | Custom function called on list load. |
|
|
503
|
+
| `onSaveBackToList` | `boolean` | `false` | Return to LIST after save. |
|
|
504
|
+
| `onBackTo` | `DynamicModuleViewModeEnum` | `null` | View mode for the back button. |
|
|
505
|
+
| `numberOfColumns` | `number` | `3` | Number of layout columns. |
|
|
506
|
+
| `showHiddenFields` | `boolean` | `true` | Show/hide hidden fields. |
|
|
507
|
+
| `filterResultViewMode` | `DynamicModuleFilterResultViewModeEnum` | `INTERNAL_EQPTABLE` | Filter results display mode. |
|
|
508
|
+
| `additionalParams` | `any` | `null` | Extra params for server filter calls. |
|
|
509
|
+
| `additionalInfo` | `any` | `null` | Extra data for client-side operations. |
|
|
323
510
|
| `prefilterParams` | `any` | `null` | Pre-filter parameters. |
|
|
511
|
+
| `updateInfo` | `any` | `null` | Data to update response values after load. |
|
|
512
|
+
| `contestualizationParams` | `any` | `null` | Contextualisation parameters. |
|
|
324
513
|
| `showNewSearchButton` | `boolean` | `true` | Show/hide the new search button. |
|
|
514
|
+
| `highlightFilter` | `any` | — | Row/field highlighting configuration. |
|
|
515
|
+
| `isDraggableListView` | `boolean` | `true` | Enable drag-and-drop in list view. |
|
|
516
|
+
| `Statistic` | `FilterStatistic` | `null` | Statistics and filter configuration. |
|
|
517
|
+
| `QueryEditorComponent` | `any` | — | Custom query editor component for lookups. |
|
|
518
|
+
| `debugMode` | `boolean` | `false` | Enable verbose console logging. |
|
|
325
519
|
|
|
326
|
-
|
|
520
|
+
**Outputs**
|
|
327
521
|
|
|
328
|
-
|
|
|
329
|
-
|
|
330
|
-
| `
|
|
331
|
-
| `
|
|
332
|
-
| `
|
|
333
|
-
| `
|
|
334
|
-
| `
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
522
|
+
| Output | Payload | Description |
|
|
523
|
+
|--------|---------|-------------|
|
|
524
|
+
| `(saveRecord)` | `Record` | Emitted on save when **no** save endpoint is configured. |
|
|
525
|
+
| `(afterSaveRecord)` | `Record` | Emitted after server save call completes. |
|
|
526
|
+
| `(deleteRecord)` | `Record` | Emitted on delete when **no** delete endpoint is configured. |
|
|
527
|
+
| `(afterDeleteRecord)` | `Record` | Emitted after server delete call completes. |
|
|
528
|
+
| `(SaveJSON)` | `string` | Emitted when form JSON is exported. |
|
|
529
|
+
| `(afterFilter)` | `DynRecord[]` | Emitted after filter operation with result set. |
|
|
530
|
+
| `(dragStarted)` | `Record` | Emitted when drag starts. |
|
|
531
|
+
| `(dragReleased)` | `void` | Emitted when drag ends. |
|
|
532
|
+
| `(clickDragIndicator)` | `Record` | Emitted when drag handle is clicked. |
|
|
533
|
+
| `(out)` | `eventOut` | General-purpose external output. |
|
|
534
|
+
| `(fireTrigger)` | `FireTrigger` | Emitted when a trigger fires. |
|
|
535
|
+
| `(afterOutputExternalFilters)` | `FilterStatistic` | Emitted after external filters applied. |
|
|
338
536
|
|
|
339
|
-
|
|
537
|
+
---
|
|
340
538
|
|
|
341
|
-
|
|
342
|
-
|----------|------|-------------|
|
|
343
|
-
| `FormJSON` | `string` | JSON string of the form to review/repair. |
|
|
539
|
+
#### `eqp-dynamic-module-configurator` — Form Builder
|
|
344
540
|
|
|
345
|
-
|
|
541
|
+
**Usage modes**
|
|
346
542
|
|
|
347
|
-
|
|
543
|
+
```html
|
|
544
|
+
<!-- Create new form -->
|
|
545
|
+
<eqp-dynamic-module-configurator
|
|
546
|
+
*ngIf="config"
|
|
547
|
+
[configurations]="config"
|
|
548
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
549
|
+
</eqp-dynamic-module-configurator>
|
|
348
550
|
|
|
349
|
-
|
|
551
|
+
<!-- Edit existing form -->
|
|
552
|
+
<eqp-dynamic-module-configurator
|
|
553
|
+
[configurations]="config"
|
|
554
|
+
[formID]="formID"
|
|
555
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
556
|
+
</eqp-dynamic-module-configurator>
|
|
350
557
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
558
|
+
<!-- Export form -->
|
|
559
|
+
<eqp-dynamic-module-configurator
|
|
560
|
+
[configurations]="config"
|
|
561
|
+
[formID]="formID"
|
|
562
|
+
[viewMode]="'Export'"
|
|
563
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
564
|
+
</eqp-dynamic-module-configurator>
|
|
565
|
+
|
|
566
|
+
<!-- Import from JSON -->
|
|
567
|
+
<eqp-dynamic-module-configurator
|
|
568
|
+
[configurations]="config"
|
|
569
|
+
[formID]="null"
|
|
570
|
+
[viewMode]="'Export'"
|
|
571
|
+
(saveFormEvent)="onFormSaved($event)">
|
|
572
|
+
</eqp-dynamic-module-configurator>
|
|
573
|
+
```
|
|
355
574
|
|
|
356
|
-
|
|
575
|
+
**Inputs**
|
|
357
576
|
|
|
358
|
-
|
|
|
359
|
-
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
362
|
-
| `
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
577
|
+
| Input | Type | Default | Description |
|
|
578
|
+
|-------|------|---------|-------------|
|
|
579
|
+
| `configurations` | `DynamicModuleConfiguratorConfig` | — | **Required.** Configuration container. |
|
|
580
|
+
| `formID` | `string` | `null` | Form ID to edit. `null` creates a new form. |
|
|
581
|
+
| `viewMode` | `string` | `"addOrEdit"` | `"addOrEdit"` or `"Export"`. |
|
|
582
|
+
| `fieldsExtraConfig` | `FieldExtraConfig[]` | — | Extra configuration for specific fields. |
|
|
583
|
+
| `triggers` | `any` | — | Trigger definitions for the editor. |
|
|
584
|
+
| `actionButtons` | `any` | — | Action button definitions. |
|
|
585
|
+
| `contestualization` | `Contestualization[]` | — | Contextualisation options. |
|
|
586
|
+
| `formulaObject` | `any` | — | Context for formula preview. |
|
|
587
|
+
| `QueryEditorComponent` | `DynamicLoaderDirectiveData` | — | Custom query editor component. |
|
|
588
|
+
| `debugMode` | `boolean` | `false` | Enable verbose logging. |
|
|
589
|
+
|
|
590
|
+
**Outputs**
|
|
591
|
+
|
|
592
|
+
| Output | Payload | Description |
|
|
593
|
+
|--------|---------|-------------|
|
|
594
|
+
| `(saveFormEvent)` | `Form` | Emitted on save when **no** save endpoint is configured. |
|
|
595
|
+
| `(afterSaveFormEvent)` | `Form` | Emitted after server save call completes. |
|
|
596
|
+
| `(out)` | `eventOut` | General-purpose external output. |
|
|
597
|
+
| `(fireTrigger)` | `FireTrigger` | Emitted when a trigger fires. |
|
|
365
598
|
|
|
366
599
|
---
|
|
367
600
|
|
|
368
|
-
###
|
|
601
|
+
### Configuration Models
|
|
369
602
|
|
|
370
|
-
|
|
603
|
+
#### `DynamicModuleGeneralConfig`
|
|
604
|
+
|
|
605
|
+
```typescript
|
|
606
|
+
const general = new DynamicModuleGeneralConfig(
|
|
607
|
+
baseServerUrl, // string — e.g. "https://api.example.com/api"
|
|
608
|
+
userToken, // string — auth token
|
|
609
|
+
context, // Context
|
|
610
|
+
endPointConfiguration // EndPointConfiguration | null
|
|
611
|
+
);
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
#### `DynamicModuleListFormRecordActionsDefault`
|
|
371
615
|
|
|
372
616
|
```typescript
|
|
373
617
|
const actions = new DynamicModuleListFormRecordActionsDefault();
|
|
374
|
-
actions.add = true;
|
|
375
|
-
actions.view = true;
|
|
376
|
-
actions.edit = true;
|
|
377
|
-
actions.duplicate = false;
|
|
378
|
-
actions.delete = true;
|
|
379
|
-
actions.graphs = false;
|
|
618
|
+
actions.add = true;
|
|
619
|
+
actions.view = true;
|
|
620
|
+
actions.edit = true;
|
|
621
|
+
actions.duplicate = false;
|
|
622
|
+
actions.delete = true;
|
|
623
|
+
actions.graphs = false;
|
|
380
624
|
```
|
|
381
625
|
|
|
382
626
|
---
|
|
383
627
|
|
|
384
|
-
|
|
628
|
+
### View Modes
|
|
385
629
|
|
|
386
630
|
```typescript
|
|
387
|
-
import { DynamicModuleViewModeEnum } from '@eqproject/eqp-dynamic-module';
|
|
388
|
-
|
|
389
631
|
enum DynamicModuleViewModeEnum {
|
|
390
|
-
NONE = 0,
|
|
391
|
-
VIEW = 1,
|
|
392
|
-
COMPILE = 2,
|
|
393
|
-
LIST = 3,
|
|
394
|
-
REPAIR = 4,
|
|
395
|
-
LISTWIEW = 5,
|
|
396
|
-
FILTER = 6,
|
|
397
|
-
GRAPHS = 7,
|
|
398
|
-
HLIST = 8,
|
|
399
|
-
EXTERNAL_FILTER = 9
|
|
632
|
+
NONE = 0,
|
|
633
|
+
VIEW = 1,
|
|
634
|
+
COMPILE = 2,
|
|
635
|
+
LIST = 3,
|
|
636
|
+
REPAIR = 4,
|
|
637
|
+
LISTWIEW = 5,
|
|
638
|
+
FILTER = 6,
|
|
639
|
+
GRAPHS = 7,
|
|
640
|
+
HLIST = 8,
|
|
641
|
+
EXTERNAL_FILTER = 9
|
|
400
642
|
}
|
|
401
643
|
```
|
|
402
644
|
|
|
403
645
|
---
|
|
404
646
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
By default the library builds all endpoint URLs from `baseServerUrl` using a standard convention. Pass a custom `EndPointConfiguration` to override individual routes.
|
|
647
|
+
### Endpoint Configuration
|
|
408
648
|
|
|
409
649
|
```typescript
|
|
410
|
-
import {
|
|
411
|
-
EndPointConfiguration,
|
|
412
|
-
EndPointData,
|
|
413
|
-
EndPointDataParams,
|
|
414
|
-
RequestMethodEnum,
|
|
415
|
-
ParamTypeEnum
|
|
416
|
-
} from '@eqproject/eqp-dynamic-module';
|
|
417
|
-
|
|
418
650
|
const endPoints = new EndPointConfiguration();
|
|
419
|
-
|
|
420
|
-
// Override the "save record" endpoint
|
|
421
651
|
endPoints.Records.SaveEndPoint = new EndPointData();
|
|
422
652
|
endPoints.Records.SaveEndPoint.Url = 'https://custom-api.example.com/records/save';
|
|
423
653
|
endPoints.Records.SaveEndPoint.RequestMethod = RequestMethodEnum.POST;
|
|
424
|
-
endPoints.Records.SaveEndPoint.Params = [
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
];
|
|
431
|
-
|
|
654
|
+
endPoints.Records.SaveEndPoint.Params = [{
|
|
655
|
+
ParamName: 'orgId',
|
|
656
|
+
ParamValue: this.orgaId,
|
|
657
|
+
ParamType: ParamTypeEnum['Query param']
|
|
658
|
+
}];
|
|
432
659
|
const general = new DynamicModuleGeneralConfig(baseUrl, token, context, endPoints);
|
|
433
660
|
```
|
|
434
661
|
|
|
435
|
-
|
|
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`
|
|
662
|
+
**Available Records endpoints:** `GetWithContextualizationByFormCodeEndPoint`, `GetByFormIDEndPoint`, `GetByFormCodeEndPoint`, `GetAllByEntAndUserIDEndPoint`, `GetByIDEndPoint`, `SaveEndPoint`, `DuplicateEndPoint`, `DeleteEndPoint`, `RepairEndPoint`, `ApplyFilter`, `GetAllAttachmentsEndPoint`.
|
|
476
663
|
|
|
477
|
-
|
|
478
|
-
|----------|------|-------------|
|
|
479
|
-
| `ParamName` | `string` | Parameter name. |
|
|
480
|
-
| `ParamValue` | `any` | Parameter value. |
|
|
481
|
-
| `ParamType` | `ParamTypeEnum` | `1` = query string, `2` = route segment, `3` = request body. |
|
|
664
|
+
**Available Forms endpoints:** `GetByIDEndPoint`, `GetAllFormEndPoint`, `GetByIDAndVersionEndPoint`, `SaveEndPoint`, `SaveAttachmentEndPoint`, `ExportByIDEndPoint`, `GetAttachmentWithBases64`, `SpeechToFormEditEndPoint`.
|
|
482
665
|
|
|
483
666
|
---
|
|
484
667
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
### `Record`
|
|
668
|
+
### Data Models
|
|
488
669
|
|
|
489
|
-
|
|
670
|
+
#### `Record`
|
|
490
671
|
|
|
491
672
|
| Property | Type | Description |
|
|
492
673
|
|----------|------|-------------|
|
|
493
674
|
| `ID` | `string` | Unique record identifier. |
|
|
494
|
-
| `EntID` | `string` | ID of the form
|
|
495
|
-
| `Version` | `number` | Form version at
|
|
675
|
+
| `EntID` | `string` | ID of the form this record belongs to. |
|
|
676
|
+
| `Version` | `number` | Form version at compilation time. |
|
|
496
677
|
| `userID` | `string` | ID of the user who created the record. |
|
|
497
|
-
| `AnswerDate` | `string` | ISO date string of
|
|
498
|
-
| `HTMLreadableValues` | `string` | Pre-rendered HTML
|
|
499
|
-
| `AdditionalParams` | `any` | Extra parameters
|
|
500
|
-
| `AdditionalInfo` | `any` | Extra information
|
|
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. |
|
|
678
|
+
| `AnswerDate` | `string` | ISO date string of compilation. |
|
|
679
|
+
| `HTMLreadableValues` | `string` | Pre-rendered HTML of field values. |
|
|
680
|
+
| `AdditionalParams` | `any` | Extra parameters. |
|
|
681
|
+
| `AdditionalInfo` | `any` | Extra information. |
|
|
519
682
|
|
|
520
683
|
---
|
|
521
684
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
The `FieldTypeEnum` describes every field type available in the form builder.
|
|
685
|
+
### Field Types Reference
|
|
525
686
|
|
|
526
687
|
| Value | Key | Description |
|
|
527
688
|
|-------|-----|-------------|
|
|
@@ -539,12 +700,3 @@ The `FieldTypeEnum` describes every field type available in the form builder.
|
|
|
539
700
|
| `12` | `Etichetta` | Display-only label. |
|
|
540
701
|
| `13` | `Immagine con markers` | Image with interactive annotation markers. |
|
|
541
702
|
| `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. |
|