@eqproject/eqp-dynamic-module 0.0.4 → 0.0.5

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 (85) hide show
  1. package/README.md +43 -24
  2. package/bundles/eqproject-eqp-dynamic-module.umd.js +871 -226
  3. package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -1
  4. package/bundles/eqproject-eqp-dynamic-module.umd.min.js +2 -2
  5. package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -1
  6. package/eqproject-eqp-dynamic-module.d.ts +2 -1
  7. package/eqproject-eqp-dynamic-module.metadata.json +1 -1
  8. package/esm2015/eqproject-eqp-dynamic-module.js +3 -2
  9. package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +198 -22
  10. package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +124 -9
  11. package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +64 -12
  12. package/esm2015/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
  13. package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
  14. package/esm2015/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
  15. package/esm2015/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
  16. package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
  17. package/esm2015/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +21 -24
  18. package/esm2015/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
  19. package/esm2015/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
  20. package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
  21. package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
  22. package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
  23. package/esm2015/lib/components/private/spinner/spinner.component.js +23 -0
  24. package/esm2015/lib/eqp-dynamic-module.module.js +3 -1
  25. package/esm2015/lib/models/endPointConfiguration.model.js +23 -0
  26. package/esm2015/lib/models/fields/dateField.model.js +1 -1
  27. package/esm2015/lib/models/fields/listValueField.model.js +3 -1
  28. package/esm2015/lib/models/fields/numericField.model.js +1 -1
  29. package/esm2015/lib/models/fields/textField.model.js +10 -1
  30. package/esm2015/lib/models/form.model.js +1 -1
  31. package/esm2015/lib/models/record.model.js +6 -1
  32. package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +10 -1
  33. package/esm2015/lib/services/spinner.service.js +43 -0
  34. package/esm2015/lib/services/utilityHelper.services.js +180 -13
  35. package/esm2015/public-api.js +3 -1
  36. package/esm5/eqproject-eqp-dynamic-module.js +3 -2
  37. package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +204 -22
  38. package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +126 -8
  39. package/esm5/lib/components/private/add-form-field/add-form-field.component.js +64 -12
  40. package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
  41. package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
  42. package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
  43. package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
  44. package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
  45. package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +22 -24
  46. package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
  47. package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
  48. package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
  49. package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
  50. package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
  51. package/esm5/lib/components/private/spinner/spinner.component.js +24 -0
  52. package/esm5/lib/eqp-dynamic-module.module.js +3 -1
  53. package/esm5/lib/models/endPointConfiguration.model.js +33 -0
  54. package/esm5/lib/models/fields/dateField.model.js +1 -1
  55. package/esm5/lib/models/fields/listValueField.model.js +7 -1
  56. package/esm5/lib/models/fields/numericField.model.js +1 -1
  57. package/esm5/lib/models/fields/textField.model.js +10 -1
  58. package/esm5/lib/models/form.model.js +1 -1
  59. package/esm5/lib/models/record.model.js +8 -1
  60. package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +11 -1
  61. package/esm5/lib/services/spinner.service.js +46 -0
  62. package/esm5/lib/services/utilityHelper.services.js +182 -11
  63. package/esm5/public-api.js +3 -1
  64. package/fesm2015/eqproject-eqp-dynamic-module.js +820 -212
  65. package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
  66. package/fesm5/eqproject-eqp-dynamic-module.js +864 -226
  67. package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
  68. package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +78 -4
  69. package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +51 -2
  70. package/lib/components/private/add-form-field/add-form-field.component.d.ts +29 -4
  71. package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +3 -11
  72. package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +3 -1
  73. package/lib/components/private/spinner/spinner.component.d.ts +9 -0
  74. package/lib/models/endPointConfiguration.model.d.ts +35 -0
  75. package/lib/models/fields/dateField.model.d.ts +1 -0
  76. package/lib/models/fields/listValueField.model.d.ts +17 -0
  77. package/lib/models/fields/numericField.model.d.ts +3 -1
  78. package/lib/models/fields/textField.model.d.ts +9 -1
  79. package/lib/models/form.model.d.ts +1 -0
  80. package/lib/models/record.model.d.ts +8 -0
  81. package/lib/services/eqp-dynamic-module-dialog.service.d.ts +6 -0
  82. package/lib/services/spinner.service.d.ts +15 -0
  83. package/lib/services/utilityHelper.services.d.ts +30 -1
  84. package/package.json +3 -3
  85. package/public-api.d.ts +2 -0
@@ -1,7 +1,10 @@
1
1
  import { __extends, __decorate, __awaiter, __generator } from 'tslib';
2
2
  import { CommonModule } from '@angular/common';
3
- import { ɵɵdefineInjectable, ɵɵinject, Injectable, EventEmitter, Input, Output, Component, NgModule, ViewChild, ChangeDetectorRef, ViewChildren } from '@angular/core';
3
+ import { ɵɵdefineInjectable, Injectable, ɵɵinject, EventEmitter, Input, Output, Component, NgModule, ViewChild, ChangeDetectorRef, ViewChildren } from '@angular/core';
4
4
  import { Validators, FormControl, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import Swal from 'sweetalert2';
6
+ import { HttpClient } from '@angular/common/http';
7
+ import { Subject } from 'rxjs';
5
8
  import { MatCheckboxModule } from '@angular/material/checkbox';
6
9
  import { MatButtonModule } from '@angular/material/button';
7
10
  import { MatInputModule } from '@angular/material/input';
@@ -34,13 +37,12 @@ import { MatSortModule } from '@angular/material/sort';
34
37
  import { MatPaginatorModule } from '@angular/material/paginator';
35
38
  import { MatNativeDateModule } from '@angular/material/core';
36
39
  import { TypeColumn, CellAlignmentEnum, NumberColumnPipe, EqpTableModule } from '@eqproject/eqp-table';
37
- import { EqpAttachmentsModule } from '@eqproject/eqp-attachments';
40
+ import { AttachmentType, EqpAttachmentsModule } from '@eqproject/eqp-attachments';
38
41
  import { EnumHelper, EqpSelectModule } from '@eqproject/eqp-select';
39
42
  import { PickerModeEnum, EqpDatetimepickerModule } from '@eqproject/eqp-datetimepicker';
40
43
  import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';
41
44
  import { EqpFiltersModule } from '@eqproject/eqp-filters';
42
- import { EqpNumericModule } from '@eqproject/eqp-numeric';
43
- import Swal from 'sweetalert2';
45
+ import { EqpNumericInputMode, EqpNumericModule } from '@eqproject/eqp-numeric';
44
46
  import { BrowserModule } from '@angular/platform-browser';
45
47
 
46
48
  var Context = /** @class */ (function () {
@@ -55,6 +57,36 @@ var ContextUser = /** @class */ (function () {
55
57
  return ContextUser;
56
58
  }());
57
59
 
60
+ var EndPointConfiguration = /** @class */ (function () {
61
+ function EndPointConfiguration() {
62
+ }
63
+ return EndPointConfiguration;
64
+ }());
65
+ var EndPointData = /** @class */ (function () {
66
+ function EndPointData() {
67
+ }
68
+ return EndPointData;
69
+ }());
70
+ var EndPointDataParams = /** @class */ (function () {
71
+ function EndPointDataParams() {
72
+ this.ParamValue = null;
73
+ }
74
+ return EndPointDataParams;
75
+ }());
76
+ var ParamTypeEnum;
77
+ (function (ParamTypeEnum) {
78
+ ParamTypeEnum[ParamTypeEnum["Query param"] = 1] = "Query param";
79
+ ParamTypeEnum[ParamTypeEnum["In route"] = 2] = "In route";
80
+ ParamTypeEnum[ParamTypeEnum["In Body"] = 3] = "In Body";
81
+ })(ParamTypeEnum || (ParamTypeEnum = {}));
82
+ var RequestMethodEnum;
83
+ (function (RequestMethodEnum) {
84
+ RequestMethodEnum["GET"] = "GET";
85
+ RequestMethodEnum["POST"] = "POST";
86
+ RequestMethodEnum["PUT"] = "PUT";
87
+ RequestMethodEnum["DELETE"] = "DELETE";
88
+ })(RequestMethodEnum || (RequestMethodEnum = {}));
89
+
58
90
  /**
59
91
  * Classe base che implementa la valorizzazione dell'ID (se null) con una nuova GUID
60
92
  * in creazione dell'oggetto.
@@ -101,6 +133,136 @@ var FormScalarTypeEnum;
101
133
  FormScalarTypeEnum[FormScalarTypeEnum["In accordion"] = 4] = "In accordion"; //GROUPED_BY_ACCORDION
102
134
  })(FormScalarTypeEnum || (FormScalarTypeEnum = {}));
103
135
 
136
+ var Record = /** @class */ (function () {
137
+ function Record() {
138
+ }
139
+ return Record;
140
+ }());
141
+ var DynRecord = /** @class */ (function () {
142
+ function DynRecord() {
143
+ this.Values = {};
144
+ }
145
+ return DynRecord;
146
+ }());
147
+
148
+ var EqpDynamicModuleDialogService = /** @class */ (function () {
149
+ function EqpDynamicModuleDialogService() {
150
+ }
151
+ /**
152
+ * Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
153
+ * @param message Messaggio da mostrare nello sweetalert
154
+ * @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
155
+ */
156
+ EqpDynamicModuleDialogService.Success = function (message, title) {
157
+ if (title === void 0) { title = null; }
158
+ var currentTitle = title != null ? title : 'Operazione completata con successo.';
159
+ Swal.fire(currentTitle, message, 'success');
160
+ };
161
+ /**
162
+ * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
163
+ * @param message Messaggio d'errore da mostrare nello sweetalert
164
+ * @param title Titolo dello sweetalert (di default mostra 'Errore')
165
+ */
166
+ EqpDynamicModuleDialogService.Error = function (message, title) {
167
+ if (title === void 0) { title = null; }
168
+ var currentTitle = title != null ? title : 'Errore';
169
+ if (Array.isArray(message)) {
170
+ currentTitle = title != null ? title : 'Errore';
171
+ var htmlErrors = message.join("<br>");
172
+ Swal.fire({
173
+ title: currentTitle,
174
+ html: htmlErrors,
175
+ icon: 'error'
176
+ });
177
+ }
178
+ else {
179
+ Swal.fire(currentTitle, message, 'error');
180
+ }
181
+ };
182
+ /**
183
+ * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
184
+ * CONFERMA lancia la funzione di callback passata come parametro
185
+ * @param message Messaggio da mostrare nello sweetalert
186
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
187
+ */
188
+ EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
189
+ if (isWarning === void 0) { isWarning = false; }
190
+ if (title === void 0) { title = null; }
191
+ if (customWidth === void 0) { customWidth = null; }
192
+ var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
193
+ if (Array.isArray(message)) {
194
+ var htmlErrors = message.join("<br>");
195
+ Swal.fire({
196
+ title: currentTitle,
197
+ html: htmlErrors,
198
+ width: customWidth ? customWidth : '32rem',
199
+ icon: !isWarning ? 'question' : 'warning',
200
+ showCancelButton: true,
201
+ allowOutsideClick: false,
202
+ allowEscapeKey: false
203
+ }).then(function (result) {
204
+ if (result.value && confirmCallback) {
205
+ confirmCallback();
206
+ }
207
+ });
208
+ }
209
+ else {
210
+ Swal.fire({
211
+ title: currentTitle,
212
+ text: message,
213
+ width: customWidth ? customWidth : '32rem',
214
+ icon: !isWarning ? 'question' : 'warning',
215
+ showCancelButton: true,
216
+ allowOutsideClick: false,
217
+ allowEscapeKey: false
218
+ }).then(function (result) {
219
+ if (result.value && confirmCallback) {
220
+ confirmCallback();
221
+ }
222
+ });
223
+ }
224
+ };
225
+ /**
226
+ * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
227
+ * @param message Messaggio da mostrare nello sweetalert
228
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
229
+ */
230
+ EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
231
+ if (title === void 0) { title = null; }
232
+ if (isToast === void 0) { isToast = null; }
233
+ var currentTitle = title != null ? title : "Informazione:";
234
+ Swal.fire(currentTitle, message, 'info');
235
+ };
236
+ /**
237
+ * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
238
+ * @param message Messaggio da mostrare nello sweetalert
239
+ * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
240
+ */
241
+ EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
242
+ if (title === void 0) { title = null; }
243
+ if (isToast === void 0) { isToast = null; }
244
+ var currentTitle = title != null ? title : "Attenzione!";
245
+ if (Array.isArray(message)) {
246
+ var htmlWarnings = message.join("<br>");
247
+ Swal.fire({
248
+ title: currentTitle,
249
+ html: htmlWarnings,
250
+ icon: 'warning'
251
+ });
252
+ }
253
+ else {
254
+ Swal.fire(currentTitle, message, 'warning');
255
+ }
256
+ };
257
+ EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
258
+ EqpDynamicModuleDialogService = __decorate([
259
+ Injectable({
260
+ providedIn: 'root'
261
+ })
262
+ ], EqpDynamicModuleDialogService);
263
+ return EqpDynamicModuleDialogService;
264
+ }());
265
+
104
266
  /**
105
267
  * Contiene le informazioni di base del campo, indipendentemente dal tipo.
106
268
  * Questa classe è volutamente astratta perché il tipo di campo è dettato dal tipo
@@ -141,6 +303,24 @@ var ColSpanSizesEnum;
141
303
  ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"] = 12] = "col-lg-12";
142
304
  })(ColSpanSizesEnum || (ColSpanSizesEnum = {}));
143
305
 
306
+ /**Campo di testo */
307
+ var TextField = /** @class */ (function (_super) {
308
+ __extends(TextField, _super);
309
+ function TextField() {
310
+ return _super !== null && _super.apply(this, arguments) || this;
311
+ }
312
+ return TextField;
313
+ }(BaseField));
314
+ var TextMaskEnum;
315
+ (function (TextMaskEnum) {
316
+ TextMaskEnum[TextMaskEnum["Password"] = 1] = "Password";
317
+ TextMaskEnum[TextMaskEnum["Email"] = 2] = "Email";
318
+ TextMaskEnum[TextMaskEnum["Telefono"] = 3] = "Telefono";
319
+ TextMaskEnum[TextMaskEnum["Url"] = 4] = "Url";
320
+ })(TextMaskEnum || (TextMaskEnum = {}));
321
+ var UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
322
+ var TelRegex = '([+]?[0-9]{10,14})';
323
+
144
324
  var ArrayValidators = /** @class */ (function () {
145
325
  function ArrayValidators() {
146
326
  }
@@ -163,18 +343,73 @@ var ArrayValidators = /** @class */ (function () {
163
343
  return ArrayValidators;
164
344
  }());
165
345
 
346
+ var SpinnerService = /** @class */ (function () {
347
+ function SpinnerService() {
348
+ this.isLoading = new Subject();
349
+ this.requestsCount = 0;
350
+ }
351
+ /**
352
+ * Mostra lo spinner
353
+ */
354
+ SpinnerService.prototype.show = function () {
355
+ var _this = this;
356
+ setTimeout(function () {
357
+ _this.isLoading.next(true);
358
+ }, 100);
359
+ };
360
+ /**
361
+ * Nasconde lo spinner
362
+ */
363
+ SpinnerService.prototype.hide = function () {
364
+ var _this = this;
365
+ setTimeout(function () {
366
+ _this.isLoading.next(false);
367
+ }, 100);
368
+ };
369
+ SpinnerService.prototype.addRequestCounter = function () {
370
+ this.requestsCount++;
371
+ this.show();
372
+ };
373
+ SpinnerService.prototype.removeRequestCounter = function () {
374
+ this.requestsCount--;
375
+ if (this.requestsCount == 0)
376
+ this.hide();
377
+ };
378
+ SpinnerService.ɵprov = ɵɵdefineInjectable({ factory: function SpinnerService_Factory() { return new SpinnerService(); }, token: SpinnerService, providedIn: "root" });
379
+ SpinnerService = __decorate([
380
+ Injectable({
381
+ providedIn: 'root'
382
+ })
383
+ ], SpinnerService);
384
+ return SpinnerService;
385
+ }());
386
+
166
387
  var UtilityHelperService = /** @class */ (function () {
167
- function UtilityHelperService(formBuilder) {
388
+ function UtilityHelperService(formBuilder, http, spinnerService) {
168
389
  this.formBuilder = formBuilder;
390
+ this.http = http;
391
+ this.spinnerService = spinnerService;
169
392
  }
170
393
  UtilityHelperService_1 = UtilityHelperService;
171
394
  UtilityHelperService.EvaluateFieldFormula = function (formula, rec, ctx) {
172
- var evaluatedValue = eval(formula.replace('"', '\"'));
395
+ var evaluatedValue = eval(formula);
173
396
  return (evaluatedValue ? evaluatedValue : null);
174
397
  };
175
398
  UtilityHelperService.SetContext = function (ctx) {
176
399
  this.context = ctx;
177
400
  };
401
+ UtilityHelperService.GetFieldType = function (field) {
402
+ switch (field.FieldType) {
403
+ case FieldTypeEnum["Campo di testo"]: {
404
+ var t = Object.assign(new TextField, field);
405
+ return t;
406
+ break;
407
+ }
408
+ default: {
409
+ break;
410
+ }
411
+ }
412
+ };
178
413
  /**
179
414
  * Metodo per impostare i valori da suggerire nell'autocomplete per i campi in cui l'utente deve scrivere comandi javascript.
180
415
  * In base all'ultimo carattere digitato viene impostato un elenco di oggetti o proprietà che l'utente ha a disposizione in quel momento.
@@ -222,7 +457,7 @@ var UtilityHelperService = /** @class */ (function () {
222
457
  // funzione javascript. Controllo la parola che l'utente sta digitando e se fa parte di uno degli oggetti a disposizione
223
458
  // o una proprietà di essi allora suggerisco i possibili match.
224
459
  else {
225
- var availableOptions = [];
460
+ var availableOptions_1 = [];
226
461
  // Prendo tutti i blocchi di caratteri digitati dall'utente
227
462
  var allFormulaWords = typedFormula.split(" ");
228
463
  // Prendo l'ultimo blocco di caratteri digitato dall'utente
@@ -231,7 +466,7 @@ var UtilityHelperService = /** @class */ (function () {
231
466
  // sui "." e imposto i suggerimenti in base al path della prorpietà che si sta digitando.
232
467
  if (!new RegExp("[^0-9a-zA-Z_.]").test(lastTypedString)) {
233
468
  var propertyPath = lastTypedString.split(".");
234
- var lastTypedWork = propertyPath[propertyPath.length - 1];
469
+ var lastTypedWork_1 = propertyPath[propertyPath.length - 1];
235
470
  var propertiesToCheck = [];
236
471
  if (propertyPath.length == 1) {
237
472
  propertiesToCheck = ["rec", "ctx"];
@@ -245,15 +480,15 @@ var UtilityHelperService = /** @class */ (function () {
245
480
  else if (propertyPath.length > 1 && propertyPath[propertyPath.length - 2] === "rec") {
246
481
  propertiesToCheck = availableRecProperties;
247
482
  }
248
- // Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
483
+ // Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
249
484
  // quello che sta digitando l'utente.
250
485
  propertiesToCheck.forEach(function (prop) {
251
- if (prop.startsWith(lastTypedWork)) {
252
- availableOptions.push({ label: prop, value: typedFormula + prop.substring(lastTypedWork.length, prop.length) });
486
+ if (prop.startsWith(lastTypedWork_1)) {
487
+ availableOptions_1.push({ label: prop, value: typedFormula + prop.substring(lastTypedWork_1.length, prop.length) });
253
488
  }
254
489
  });
255
490
  }
256
- autocompleteOptions = availableOptions;
491
+ autocompleteOptions = availableOptions_1;
257
492
  }
258
493
  return autocompleteOptions;
259
494
  };
@@ -343,6 +578,17 @@ var UtilityHelperService = /** @class */ (function () {
343
578
  if (field.MinLenght) {
344
579
  validators.push(Validators.minLength(field.MinLenght));
345
580
  }
581
+ switch (field.TextMask) {
582
+ case TextMaskEnum.Url:
583
+ validators.push(Validators.pattern(UrlRegex));
584
+ break;
585
+ case TextMaskEnum.Email:
586
+ validators.push(Validators.email);
587
+ break;
588
+ case TextMaskEnum.Telefono:
589
+ validators.push(Validators.pattern(TelRegex));
590
+ break;
591
+ }
346
592
  break;
347
593
  case FieldTypeEnum["Area di testo"]:
348
594
  if (field.MaxLenght) {
@@ -365,12 +611,151 @@ var UtilityHelperService = /** @class */ (function () {
365
611
  }
366
612
  return new FormControl(record[field.Name], validators);
367
613
  };
614
+ /**
615
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
616
+ * a cui si deve connettere e al token da passare per autenticarsi.
617
+ * @param baseServerUrl Stringa dell'url base del server (es: "http://localhost:5000").
618
+ * @param userToken Token dell'utente loggato da usare per autenticarsi se necessario.
619
+ * @returns Resituisce la configurazione completa degli endPoint da usare di default.
620
+ */
621
+ UtilityHelperService.prototype.ConfigureDefaultEndPoints = function (baseServerUrl, userToken) {
622
+ var endPointConfiguration = new EndPointConfiguration();
623
+ endPointConfiguration = new EndPointConfiguration();
624
+ endPointConfiguration.Records = {
625
+ GetByFormIDEndPoint: {
626
+ Url: baseServerUrl + "/api/v1/getall",
627
+ Token: userToken,
628
+ RequestMethod: RequestMethodEnum.GET,
629
+ },
630
+ GetByIDEndPoint: {
631
+ Url: baseServerUrl + "/api/v1/getByID",
632
+ Token: userToken,
633
+ RequestMethod: RequestMethodEnum.GET,
634
+ },
635
+ SaveEndPoint: {
636
+ Url: baseServerUrl + "/api/v1/save",
637
+ Token: userToken,
638
+ RequestMethod: RequestMethodEnum.POST,
639
+ },
640
+ DuplicateEndPoint: {
641
+ Url: baseServerUrl + "/api/v1/duplicate",
642
+ Token: userToken,
643
+ RequestMethod: RequestMethodEnum.POST,
644
+ },
645
+ DeleteEndPoint: {
646
+ Url: baseServerUrl + "/api/v1/delete",
647
+ Token: userToken,
648
+ RequestMethod: RequestMethodEnum.DELETE,
649
+ }
650
+ };
651
+ endPointConfiguration.Forms = {
652
+ GetByIDEndPoint: {
653
+ Url: baseServerUrl + "/api/conf/form",
654
+ Token: userToken,
655
+ RequestMethod: RequestMethodEnum.GET,
656
+ },
657
+ SaveEndPoint: {
658
+ Url: baseServerUrl + "/api/conf/form",
659
+ Token: userToken,
660
+ RequestMethod: RequestMethodEnum.POST,
661
+ }
662
+ };
663
+ return endPointConfiguration;
664
+ };
665
+ /**
666
+ * Metodo che data la configurazione di un endpoint costruisce l'url da chiamare, gli eventuali parametri
667
+ * da passare (nel body o nella rotta) ed effettua la chiamata. Al termine della chiamata esegue le eventuali
668
+ * funzioni di callback (sia in caso di successo che in caso di errore) passate in input.
669
+ * @param endPointData Cofigurazione dell'endpoint da chiamare.
670
+ * @param dynamicModuleParams Array dei parametri aggiunti dal modulo dinamico a quelli già configurati
671
+ * (ad esempio il record o la form da salvare oppure l'ID per recuperare una particolare entità).
672
+ * @param callback Metodo da eseguire in caso di successo dopo la chiamata http.
673
+ * NOTA: in input viene passata la risposta della chiamata stessa.
674
+ * @param errorCallBack Metodo da eseguire in caso di errore dopo la chiamata http.
675
+ * NOTA: in input viene passato l'errore generato della chiamata stessa.
676
+ */
677
+ UtilityHelperService.prototype.RunEndPointCall = function (endPointData, dynamicModuleParams, callback, errorCallBack) {
678
+ var _this = this;
679
+ if (dynamicModuleParams === void 0) { dynamicModuleParams = null; }
680
+ if (callback === void 0) { callback = null; }
681
+ if (errorCallBack === void 0) { errorCallBack = null; }
682
+ this.spinnerService.addRequestCounter();
683
+ var url = "" + endPointData.Url;
684
+ var queryParams = null;
685
+ var bodyParams = {
686
+ AdditionalParams: {}
687
+ };
688
+ // Se nella configurazione sono stati definiti parametri da aggiungere alla chiamata questi vengono ciclati
689
+ // e aggiunti nel punto in cui devono essere usati.
690
+ if (endPointData.Params) {
691
+ endPointData.Params.forEach(function (p) {
692
+ switch (p.ParamType) {
693
+ case ParamTypeEnum['Query param']: {
694
+ var stringParam = p.ParamName + "=" + p.ParamValue;
695
+ queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
696
+ break;
697
+ }
698
+ case ParamTypeEnum['In route']: {
699
+ url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
700
+ break;
701
+ }
702
+ case ParamTypeEnum['In Body']: {
703
+ bodyParams.AdditionalParams[p.ParamName] = p.ParamValue;
704
+ break;
705
+ }
706
+ }
707
+ });
708
+ }
709
+ // Se sono stati passati parametri da aggiungere alla chiamata definiti all'interno del modulo dinamico
710
+ // vengono ciclati e aggiunti nel punto in cui devono essere usati dopo quelli definiti nella configurazione.
711
+ if (dynamicModuleParams) {
712
+ dynamicModuleParams.forEach(function (p) {
713
+ switch (p.ParamType) {
714
+ case ParamTypeEnum['Query param']: {
715
+ var stringParam = p.ParamName + "=" + p.ParamValue;
716
+ queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
717
+ break;
718
+ }
719
+ case ParamTypeEnum['In route']: {
720
+ url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
721
+ break;
722
+ }
723
+ case ParamTypeEnum['In Body']: {
724
+ bodyParams[p.ParamName] = p.ParamValue;
725
+ break;
726
+ }
727
+ }
728
+ });
729
+ }
730
+ if (queryParams != null) {
731
+ url = (url.endsWith("/") ? url.substring(0, url.length - 1) : url) + "?" + queryParams;
732
+ }
733
+ this.http.request(endPointData.RequestMethod, url, {
734
+ headers: endPointData.Token ? { Authorization: endPointData.Token } : null,
735
+ body: ![RequestMethodEnum.DELETE, RequestMethodEnum.GET].includes(endPointData.RequestMethod) ? bodyParams : null
736
+ })
737
+ .subscribe(function (res) {
738
+ _this.spinnerService.removeRequestCounter();
739
+ if (callback) {
740
+ callback(res);
741
+ }
742
+ }, function (error) {
743
+ _this.spinnerService.removeRequestCounter();
744
+ if (errorCallBack) {
745
+ errorCallBack(error);
746
+ }
747
+ EqpDynamicModuleDialogService.Error(error.message);
748
+ throw new Error(error.message);
749
+ });
750
+ };
368
751
  var UtilityHelperService_1;
369
752
  UtilityHelperService.context = new Context();
370
753
  UtilityHelperService.ctorParameters = function () { return [
371
- { type: FormBuilder }
754
+ { type: FormBuilder },
755
+ { type: HttpClient },
756
+ { type: SpinnerService }
372
757
  ]; };
373
- UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder)); }, token: UtilityHelperService, providedIn: "root" });
758
+ UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder), ɵɵinject(HttpClient), ɵɵinject(SpinnerService)); }, token: UtilityHelperService, providedIn: "root" });
374
759
  UtilityHelperService = UtilityHelperService_1 = __decorate([
375
760
  Injectable({
376
761
  providedIn: 'root'
@@ -380,55 +765,219 @@ var UtilityHelperService = /** @class */ (function () {
380
765
  }());
381
766
 
382
767
  var EqpDynamicModuleComponent = /** @class */ (function () {
383
- function EqpDynamicModuleComponent() {
768
+ function EqpDynamicModuleComponent(utilityHelperService) {
769
+ this.utilityHelperService = utilityHelperService;
384
770
  this.context = new Context();
385
- this.form = new Form();
386
771
  this.showButtons = true;
387
772
  this.showTitle = true;
388
- this.viewMode = FormTypeEnum.LIST;
773
+ /**
774
+ * Url del server da chiamare per recuperare, salvare o eliminare i record.
775
+ * Usato per creare la configurazione di default degli endpoint da chiamare.
776
+ */
777
+ this.baseServerUrl = null;
778
+ /**
779
+ * Token da usare negli endpoint da chiamare per recuperare o salvare i record.
780
+ * Usato solo se viene popolata la proprietà "baseServerUrl".
781
+ */
782
+ this.userToken = null;
783
+ /**
784
+ * Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
785
+ * Può essere definita dall'utente oppure lasciata null, viene popolata con dei
786
+ * valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
787
+ * viene lasciata null e non viene eseguita nessuna chiamata al server.
788
+ */
789
+ this.endPointConfiguration = null;
790
+ /**
791
+ * Eventi emessi quando si salva, elimina o duplica un record
792
+ * se non è stato specificato un endpoint da chiamare.
793
+ */
389
794
  this.saveRecord = new EventEmitter();
390
795
  this.deleteRecord = new EventEmitter();
391
796
  this.duplicateRecord = new EventEmitter();
797
+ /**
798
+ * Eventi emessi DOPO aver eseguito una chiamata al server per il salvataggio,
799
+ * l'eliminazione o la duplicazione di un record all'endpoint specificato.
800
+ */
801
+ this.afterSaveRecord = new EventEmitter();
802
+ this.afterDeleteRecord = new EventEmitter();
803
+ this.afterDuplicateRecord = new EventEmitter();
804
+ this.form = new Form();
805
+ this.viewMode = FormTypeEnum.LIST;
392
806
  this.FormTypeEnum = FormTypeEnum;
393
807
  }
394
808
  EqpDynamicModuleComponent.prototype.ngOnInit = function () {
395
809
  UtilityHelperService.SetContext(this.context);
810
+ this.configureDefaultEndPoints();
811
+ this.getFormByID();
396
812
  };
813
+ EqpDynamicModuleComponent.prototype.getFormByID = function () {
814
+ var _this = this;
815
+ var dynamicModuleParams = new Array();
816
+ dynamicModuleParams.push({
817
+ ParamName: "id",
818
+ ParamValue: this.formID,
819
+ ParamType: ParamTypeEnum['Query param']
820
+ });
821
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, dynamicModuleParams, function (res) {
822
+ _this.form = res;
823
+ _this.getRecordsByFormID();
824
+ }, function (err) {
825
+ console.log(err);
826
+ });
827
+ };
828
+ /**
829
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
830
+ * a cui si deve connettere e al token da passare per autenticarsi.
831
+ * Se la proprietà "baseServerUrl" è null e non sono stati configurati i vari endpoint allora
832
+ * non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
833
+ */
834
+ EqpDynamicModuleComponent.prototype.configureDefaultEndPoints = function () {
835
+ if (!this.endPointConfiguration && this.baseServerUrl) {
836
+ this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
837
+ }
838
+ };
839
+ /**
840
+ * Metodo per recuperare tutti i record salvati per una particolare Form.
841
+ * La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
842
+ * La risposta della chiamata deve essere un array di oggetti di tipo "DynRecord"
843
+ * a partire dai quali vengono ricreati i Record usati nel client.
844
+ */
845
+ EqpDynamicModuleComponent.prototype.getRecordsByFormID = function () {
846
+ var _this = this;
847
+ if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByFormIDEndPoint) {
848
+ var dynamicModuleParams = [
849
+ { ParamName: 'EntID', ParamValue: this.form.ID, ParamType: ParamTypeEnum['Query param'] }
850
+ ];
851
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint, dynamicModuleParams, function (res) {
852
+ _this.values = new Array();
853
+ res.forEach(function (r) {
854
+ var tmpRec = new Record();
855
+ tmpRec = JSON.parse(r.SerializedValues);
856
+ tmpRec.ID = r.ID;
857
+ tmpRec.EntID = r.EntID;
858
+ _this.values.push(tmpRec);
859
+ });
860
+ });
861
+ }
862
+ };
863
+ /**
864
+ * Metodo invocato quando si vuole aggiungere, visualizzare o modificare un record.
865
+ * Se l'evento è null vuol dire che stiamo aggiungendo un nuovo record altrimenti siamo in modifica
866
+ * o visualizzazione. In questi ultimi due casi, se è stato configurato un endpoint per il recupero
867
+ * del record completo allora viene effettuata una chiamata al server, altrimenti viene usato l'oggetto selezionato.
868
+ * @param event Oggetto con due proprietà:
869
+ * "record" = oggetto da modificare/visualizzare,
870
+ * "onlyView" = booleano (se TRUE siamo in visualizzazione altrimenti in modifica)
871
+ */
397
872
  EqpDynamicModuleComponent.prototype.onAddViewEditRecord = function (event) {
873
+ var _this = this;
398
874
  if (event != null) {
399
- this.selectedRecord = JSON.parse(JSON.stringify(event.record));
400
875
  this.onlyView = event.onlyView;
876
+ if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByIDEndPoint) {
877
+ var dynamicModuleParams = [
878
+ { ParamName: "id", ParamValue: event.record.ID, ParamType: ParamTypeEnum['Query param'] }
879
+ ];
880
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint, dynamicModuleParams, function (res) {
881
+ _this.selectedRecord = JSON.parse(res.SerializedValues);
882
+ _this.selectedRecord.ID = res.ID;
883
+ _this.selectedRecord.EntID = res.EntID;
884
+ _this.viewMode = FormTypeEnum.SCALAR;
885
+ });
886
+ }
887
+ else {
888
+ this.selectedRecord = JSON.parse(JSON.stringify(event.record));
889
+ this.viewMode = FormTypeEnum.SCALAR;
890
+ }
401
891
  }
402
892
  else {
403
893
  this.selectedRecord = null;
404
894
  this.onlyView = false;
895
+ this.viewMode = FormTypeEnum.SCALAR;
896
+ }
897
+ };
898
+ /**
899
+ * Metodo per salvare il record aggiunto o modificato.
900
+ * Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
901
+ * nel body della chiamata, altrimenti scatena l'evento "saveRecord".
902
+ * @param event Oggetto di tipo Record da salvare.
903
+ */
904
+ EqpDynamicModuleComponent.prototype.onSaveRecord = function (event) {
905
+ var _this = this;
906
+ var _a;
907
+ if (event != null && this.endPointConfiguration != null && this.endPointConfiguration.Records.SaveEndPoint) {
908
+ var dynRec = new DynRecord();
909
+ dynRec.ID = (_a = event.ID, (_a !== null && _a !== void 0 ? _a : null));
910
+ dynRec.EntID = this.form.ID;
911
+ dynRec.Values = (event !== null && event !== void 0 ? event : null);
912
+ var dynamicModuleParams = [
913
+ { ParamName: "Record", ParamValue: dynRec, ParamType: ParamTypeEnum['In Body'] }
914
+ ];
915
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint, dynamicModuleParams, function (res) {
916
+ _this.getRecordsByFormID();
917
+ _this.afterSaveRecord.emit(event);
918
+ _this.viewMode = FormTypeEnum.LIST;
919
+ });
920
+ }
921
+ else {
922
+ this.saveRecord.emit(event);
923
+ this.viewMode = FormTypeEnum.LIST;
405
924
  }
406
- this.viewMode = FormTypeEnum.SCALAR;
407
- };
408
- EqpDynamicModuleComponent.prototype.onSaveForm = function (event) {
409
- //TODO: Salvare il record!
410
- // if (event != null) {
411
- // if (event.ID && this.values.find(v => v.ID == event.ID)) {
412
- // this.values[this.values.findIndex(v => v.ID == event.ID)] = event;
413
- // } else {
414
- // this.values.push(event);
415
- // }
416
- // }
417
- this.saveRecord.emit(event);
418
- this.viewMode = FormTypeEnum.LIST;
419
925
  };
926
+ /**
927
+ * Metodo per duplicare un record precedentemente salvato.
928
+ * Se è stato configurato un endPoint per la duplicazione lato server allora effettua una chiamata passando nel body
929
+ * un oggetto contenente il record da duplicare, altrimenti scatena l'evento di output "duplicateRecord".
930
+ * @param record Oggetto di tipo Record da duplicare.
931
+ */
420
932
  EqpDynamicModuleComponent.prototype.onDuplicateRecord = function (record) {
421
- this.duplicateRecord.emit(record);
933
+ var _this = this;
934
+ if (this.endPointConfiguration && this.endPointConfiguration.Records.DuplicateEndPoint) {
935
+ EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', function () {
936
+ var dynamicModuleParams = [
937
+ { ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
938
+ ];
939
+ _this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DuplicateEndPoint, dynamicModuleParams, function (res) {
940
+ _this.getRecordsByFormID();
941
+ _this.afterDuplicateRecord.emit(record);
942
+ });
943
+ }, false, 'Richiesta conferma');
944
+ }
945
+ else {
946
+ this.duplicateRecord.emit(record);
947
+ }
422
948
  };
949
+ /**
950
+ * Metodo per eliminare un record.
951
+ * Se è stato configurato un endPoint per l'eliminazione allora effettua una chiamata passando l'ID del record da eliminare
952
+ * come query param all'interno della rotta, altrimenti scatena l'evento di output "deleteRecord".
953
+ * @param record Oggetto di tipo Record da duplicare.
954
+ */
423
955
  EqpDynamicModuleComponent.prototype.onDeleteRecord = function (record) {
424
- this.deleteRecord.emit(record);
956
+ var _this = this;
957
+ if (this.endPointConfiguration && this.endPointConfiguration.Records.DeleteEndPoint) {
958
+ EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', function () {
959
+ var dynamicModuleParams = [
960
+ { ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
961
+ ];
962
+ _this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DeleteEndPoint, dynamicModuleParams, function (res) {
963
+ _this.getRecordsByFormID();
964
+ _this.afterDeleteRecord.emit(record);
965
+ });
966
+ }, false, 'Richiesta conferma');
967
+ }
968
+ else {
969
+ this.deleteRecord.emit(record);
970
+ }
425
971
  };
972
+ EqpDynamicModuleComponent.ctorParameters = function () { return [
973
+ { type: UtilityHelperService }
974
+ ]; };
426
975
  __decorate([
427
976
  Input()
428
977
  ], EqpDynamicModuleComponent.prototype, "context", void 0);
429
978
  __decorate([
430
979
  Input()
431
- ], EqpDynamicModuleComponent.prototype, "form", void 0);
980
+ ], EqpDynamicModuleComponent.prototype, "formID", void 0);
432
981
  __decorate([
433
982
  Input()
434
983
  ], EqpDynamicModuleComponent.prototype, "values", void 0);
@@ -440,7 +989,13 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
440
989
  ], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
441
990
  __decorate([
442
991
  Input()
443
- ], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
992
+ ], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
993
+ __decorate([
994
+ Input()
995
+ ], EqpDynamicModuleComponent.prototype, "userToken", void 0);
996
+ __decorate([
997
+ Input()
998
+ ], EqpDynamicModuleComponent.prototype, "endPointConfiguration", void 0);
444
999
  __decorate([
445
1000
  Output()
446
1001
  ], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
@@ -450,10 +1005,19 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
450
1005
  __decorate([
451
1006
  Output()
452
1007
  ], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
1008
+ __decorate([
1009
+ Output()
1010
+ ], EqpDynamicModuleComponent.prototype, "afterSaveRecord", void 0);
1011
+ __decorate([
1012
+ Output()
1013
+ ], EqpDynamicModuleComponent.prototype, "afterDeleteRecord", void 0);
1014
+ __decorate([
1015
+ Output()
1016
+ ], EqpDynamicModuleComponent.prototype, "afterDuplicateRecord", void 0);
453
1017
  EqpDynamicModuleComponent = __decorate([
454
1018
  Component({
455
1019
  selector: 'eqp-dynamic-module',
456
- template: "<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"onSaveForm($event)\" [showTitle]=\"showTitle\">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf=\"viewMode == FormTypeEnum.LIST\" [form]=\"form\" [values]=\"values\"\r\n (onAddViewEditRecord)=\"onAddViewEditRecord($event)\" [showTitle]=\"showTitle\"\r\n (onDeleteRecord)=\"onDeleteRecord($event)\" (onDuplicateRecord)=\"onDuplicateRecord($event)\">\r\n</list-form-record>",
1020
+ template: "<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"onSaveRecord($event)\" [showTitle]=\"showTitle\">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf=\"viewMode == FormTypeEnum.LIST && values\" [form]=\"form\" [values]=\"values\"\r\n (onAddViewEditRecord)=\"onAddViewEditRecord($event)\" [showTitle]=\"showTitle\"\r\n (onDeleteRecord)=\"onDeleteRecord($event)\" (onDuplicateRecord)=\"onDuplicateRecord($event)\">\r\n</list-form-record>",
457
1021
  styles: ["::ng-deep mat-form-field{width:100%}"]
458
1022
  })
459
1023
  ], EqpDynamicModuleComponent);
@@ -536,134 +1100,83 @@ var MaterialModule = /** @class */ (function () {
536
1100
  return MaterialModule;
537
1101
  }());
538
1102
 
539
- var EqpDynamicModuleDialogService = /** @class */ (function () {
540
- function EqpDynamicModuleDialogService() {
541
- }
542
- /**
543
- * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
544
- * @param message Messaggio d'errore da mostrare nello sweetalert
545
- * @param title Titolo dello sweetalert (di default mostra 'Errore')
546
- */
547
- EqpDynamicModuleDialogService.Error = function (message, title) {
548
- if (title === void 0) { title = null; }
549
- var currentTitle = title != null ? title : 'Errore';
550
- if (Array.isArray(message)) {
551
- currentTitle = title != null ? title : 'Errore';
552
- var htmlErrors = message.join("<br>");
553
- Swal.fire({
554
- title: currentTitle,
555
- html: htmlErrors,
556
- icon: 'error'
557
- });
558
- }
559
- else {
560
- Swal.fire(currentTitle, message, 'error');
561
- }
562
- };
563
- /**
564
- * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
565
- * CONFERMA lancia la funzione di callback passata come parametro
566
- * @param message Messaggio da mostrare nello sweetalert
567
- * @param title Titolo dello sweetalert (di default mostra 'Info')
568
- */
569
- EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
570
- if (isWarning === void 0) { isWarning = false; }
571
- if (title === void 0) { title = null; }
572
- if (customWidth === void 0) { customWidth = null; }
573
- var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
574
- if (Array.isArray(message)) {
575
- var htmlErrors = message.join("<br>");
576
- Swal.fire({
577
- title: currentTitle,
578
- html: htmlErrors,
579
- width: customWidth ? customWidth : '32rem',
580
- icon: !isWarning ? 'question' : 'warning',
581
- showCancelButton: true,
582
- allowOutsideClick: false,
583
- allowEscapeKey: false
584
- }).then(function (result) {
585
- if (result.value && confirmCallback) {
586
- confirmCallback();
587
- }
588
- });
589
- }
590
- else {
591
- Swal.fire({
592
- title: currentTitle,
593
- text: message,
594
- width: customWidth ? customWidth : '32rem',
595
- icon: !isWarning ? 'question' : 'warning',
596
- showCancelButton: true,
597
- allowOutsideClick: false,
598
- allowEscapeKey: false
599
- }).then(function (result) {
600
- if (result.value && confirmCallback) {
601
- confirmCallback();
602
- }
603
- });
604
- }
605
- };
606
- /**
607
- * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
608
- * @param message Messaggio da mostrare nello sweetalert
609
- * @param title Titolo dello sweetalert (di default mostra 'Info')
610
- */
611
- EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
612
- if (title === void 0) { title = null; }
613
- if (isToast === void 0) { isToast = null; }
614
- var currentTitle = title != null ? title : "Informazione:";
615
- Swal.fire(currentTitle, message, 'info');
616
- };
617
- /**
618
- * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
619
- * @param message Messaggio da mostrare nello sweetalert
620
- * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
621
- */
622
- EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
623
- if (title === void 0) { title = null; }
624
- if (isToast === void 0) { isToast = null; }
625
- var currentTitle = title != null ? title : "Attenzione!";
626
- if (Array.isArray(message)) {
627
- var htmlWarnings = message.join("<br>");
628
- Swal.fire({
629
- title: currentTitle,
630
- html: htmlWarnings,
631
- icon: 'warning'
632
- });
633
- }
634
- else {
635
- Swal.fire(currentTitle, message, 'warning');
636
- }
637
- };
638
- EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
639
- EqpDynamicModuleDialogService = __decorate([
640
- Injectable({
641
- providedIn: 'root'
642
- })
643
- ], EqpDynamicModuleDialogService);
644
- return EqpDynamicModuleDialogService;
645
- }());
646
-
647
1103
  var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
648
- function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog) {
1104
+ function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog, utilityHelperService) {
649
1105
  this.formBuilder = formBuilder;
650
1106
  this.dialog = dialog;
1107
+ this.utilityHelperService = utilityHelperService;
651
1108
  this.context = new Context();
652
1109
  this.form = new Form();
1110
+ this.formID = null;
653
1111
  this.innerFormManagment = false;
1112
+ /**
1113
+ * Url del server da chiamare per recuerare, salvare o eliminare i record.
1114
+ * Usato per creare la configurazione di default degli endpoint da chiamare.
1115
+ */
1116
+ this.baseServerUrl = null;
1117
+ /**
1118
+ * Token da usare negli endpoint da chiamare per recuperare o salvare i record.
1119
+ * Usato solo se viene popolata la proprietà "baseServerUrl".
1120
+ */
1121
+ this.userToken = null;
1122
+ /**
1123
+ * Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
1124
+ * Può essere definita dall'utente oppure lasciata null, viene popolata con dei
1125
+ * valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
1126
+ * viene lasciata null e non viene eseguita nessuna chiamata al server.
1127
+ */
1128
+ this.endPointConfiguration = null;
654
1129
  this.formCompleted = false;
655
1130
  //#region Enumeratori usati nell'html
656
1131
  this.FormTypeEnum = FormTypeEnum;
657
1132
  this.FormScalarTypeEnum = FormScalarTypeEnum;
658
1133
  //#endregion
1134
+ /**
1135
+ * Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare.
1136
+ */
659
1137
  this.saveFormEvent = new EventEmitter();
1138
+ /**
1139
+ * Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato.
1140
+ */
1141
+ this.afterSaveFormEvent = new EventEmitter();
660
1142
  }
661
1143
  EqpDynamicModuleConfiguratorComponent.prototype.ngOnInit = function () {
1144
+ this.configureDefaultEndPoints();
1145
+ this.getFormByID();
662
1146
  if (this.context) {
663
1147
  UtilityHelperService.SetContext(this.context);
664
1148
  }
665
- this.configureColumns();
666
- this.createFormForm();
1149
+ };
1150
+ /**
1151
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
1152
+ * a cui si deve connettere e al token da passare per autenticarsi.
1153
+ * Se la proprietà baseServerUrl è null e non sono stati configurati i vari endpoint allora
1154
+ * non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
1155
+ */
1156
+ EqpDynamicModuleConfiguratorComponent.prototype.configureDefaultEndPoints = function () {
1157
+ if (!this.endPointConfiguration && this.baseServerUrl) {
1158
+ this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
1159
+ if (this.formID) {
1160
+ this.endPointConfiguration.Forms.GetByIDEndPoint.Params = [{ ParamName: 'id', ParamValue: this.formID, ParamType: ParamTypeEnum['Query param'] }];
1161
+ }
1162
+ }
1163
+ };
1164
+ /**
1165
+ * Metodo per recuperare tutti i record salvati per una particolare Form.
1166
+ * La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
1167
+ */
1168
+ EqpDynamicModuleConfiguratorComponent.prototype.getFormByID = function () {
1169
+ var _this = this;
1170
+ if (this.formID && this.endPointConfiguration && this.endPointConfiguration.Forms && this.endPointConfiguration.Forms.GetByIDEndPoint) {
1171
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, null, function (res) {
1172
+ _this.setFormAndConfigure(res);
1173
+ }, function (err) {
1174
+ _this.setFormAndConfigure(new Form());
1175
+ });
1176
+ }
1177
+ else {
1178
+ this.setFormAndConfigure();
1179
+ }
667
1180
  };
668
1181
  /**
669
1182
  * Metodo invocato al cambio del tipo di visualizzazione della form.
@@ -939,10 +1452,54 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
939
1452
  }
940
1453
  };
941
1454
  /**
942
- * Metodo che scatena l'evento di output per salvare la form creata alla fine del wizard
1455
+ * Metodo per salvare la form creata alla fine del wizard.
1456
+ * Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
1457
+ * nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
1458
+ * NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
1459
+ * Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
943
1460
  */
944
1461
  EqpDynamicModuleConfiguratorComponent.prototype.saveForm = function () {
945
- this.saveFormEvent.emit(this.form);
1462
+ var _this = this;
1463
+ if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
1464
+ // Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
1465
+ // Necessario per far funzionare correttamente il FieldConverter del server.
1466
+ var formToSave_1 = JSON.parse(JSON.stringify(this.form));
1467
+ /*formToSave.Fields = [];
1468
+ this.form.Fields.forEach(field => {
1469
+ formToSave.Fields.push({
1470
+ FieldType: field.FieldType,
1471
+ Value: JSON.parse(JSON.stringify(field))
1472
+ });
1473
+ });*/
1474
+ formToSave_1.Fields = [];
1475
+ this.form.Fields.forEach(function (field) {
1476
+ var fld = UtilityHelperService.GetFieldType(field);
1477
+ formToSave_1.Fields.push(fld);
1478
+ });
1479
+ var dynamicModuleParams = [
1480
+ { ParamName: "Form", ParamValue: formToSave_1, ParamType: ParamTypeEnum['In Body'] }
1481
+ ];
1482
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, function (res) {
1483
+ EqpDynamicModuleDialogService.Success("Form salvata con successo!");
1484
+ _this.afterSaveFormEvent.emit(_this.form);
1485
+ });
1486
+ }
1487
+ else {
1488
+ this.saveFormEvent.emit(this.form);
1489
+ }
1490
+ };
1491
+ //#region FUNZIONI PRIVATE
1492
+ /**
1493
+ * Metodo per impostare la form e configurare colonne/FormGourp.
1494
+ * @param form Form da utilizzare.
1495
+ */
1496
+ EqpDynamicModuleConfiguratorComponent.prototype.setFormAndConfigure = function (form) {
1497
+ if (form === void 0) { form = null; }
1498
+ if (form != null) {
1499
+ this.form = form;
1500
+ }
1501
+ this.configureColumns();
1502
+ this.createFormForm();
946
1503
  };
947
1504
  /**
948
1505
  * Configura le colonne per le tabelle necessarie alla creazione della form:
@@ -1136,7 +1693,8 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1136
1693
  };
1137
1694
  EqpDynamicModuleConfiguratorComponent.ctorParameters = function () { return [
1138
1695
  { type: FormBuilder },
1139
- { type: MatDialog }
1696
+ { type: MatDialog },
1697
+ { type: UtilityHelperService }
1140
1698
  ]; };
1141
1699
  __decorate([
1142
1700
  Input()
@@ -1144,9 +1702,21 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1144
1702
  __decorate([
1145
1703
  Input()
1146
1704
  ], EqpDynamicModuleConfiguratorComponent.prototype, "form", void 0);
1705
+ __decorate([
1706
+ Input()
1707
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "formID", void 0);
1147
1708
  __decorate([
1148
1709
  Input()
1149
1710
  ], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
1711
+ __decorate([
1712
+ Input()
1713
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);
1714
+ __decorate([
1715
+ Input()
1716
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "userToken", void 0);
1717
+ __decorate([
1718
+ Input()
1719
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "endPointConfiguration", void 0);
1150
1720
  __decorate([
1151
1721
  ViewChild('fieldsTable', { static: false })
1152
1722
  ], EqpDynamicModuleConfiguratorComponent.prototype, "fieldsTable", void 0);
@@ -1168,10 +1738,13 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1168
1738
  __decorate([
1169
1739
  Output()
1170
1740
  ], EqpDynamicModuleConfiguratorComponent.prototype, "saveFormEvent", void 0);
1741
+ __decorate([
1742
+ Output()
1743
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "afterSaveFormEvent", void 0);
1171
1744
  EqpDynamicModuleConfiguratorComponent = __decorate([
1172
1745
  Component({
1173
1746
  selector: 'eqp-dynamic-module-configurator',
1174
- template: "<mat-horizontal-stepper linear #stepper>\r\n <!-- DATI GENERALI DELLA FORM -->\r\n <mat-step [stepControl]=\"formFormGroup\">\r\n <form [formGroup]=\"formFormGroup\" (keydown.enter)=\"false\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName=\"Name\" [(ngModel)]=\"form.Name\" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-md-4\">\r\n <eqp-select [enumData]=\"FormScalarTypeEnum\" [(ngModelInput)]=\"form.FormScalarType\"\r\n [isRequired]=\"true\" [showCancelButton]=\"false\" placeholder=\"Tipo di visualizzazione\"\r\n [formGroupInput]=\"formFormGroup\" [formControlNameInput]=\"'FormScalarType'\"\r\n (ngModelInputChange)=\"onChangeFormScalarType()\">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice\">\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]=\"formFieldGroupName\" [ngModelOptions]=\"{standalone: true}\"\r\n (keyup)=\"onFormFieldGroupNameKeyUp($event)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Sezioni inserite:</span>\r\n <ul class=\"section-list\">\r\n <li *ngFor=\"let groupName of form.FormFieldsGroups, let i=index\">\r\n <mat-icon class=\"mr-1\" (click)=\"onDeleteFormFieldGroupName(groupName.Name)\">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button mat-raised-button color=\"primary\" matStepperNext\r\n [disabled]=\"formFormGroup.invalid\">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DEI CAMPI DELLA FORM -->\r\n <mat-step [completed]=\"isFieldStepCompleted()\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"openFieldDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class=\"btn btn-primary ml-2\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openInnerFormDialog()\" *ngIf=\"!innerFormManagment\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]=\"false\" [columns]=\"fieldsColumns\" [data]=\"form.Fields\"\r\n [emptyTableMessage]=\"'Nessun campo inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext [disabled]=\"!isFieldStepCompleted()\"\r\n (click)=\"setFormStatus(false)\">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openActionOnRecordDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]=\"false\" [columns]=\"actionsOnRecordColumns\"\r\n [data]=\"form.ActionsOnRecord\" [emptyTableMessage]=\"'Nessuna action inserita'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext (click)=\"setFormStatus(true)\">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- VISUALIZZAZIONE FORM CREATA -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\"\r\n (click)=\"setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)\"></div>\r\n Riepilogo\r\n </ng-template>\r\n\r\n <eqp-dynamic-module [form]=\"previewForm\" *ngIf=\"previewForm && formCompleted\" [showButtons]=\"false\"\r\n [viewMode]=\"FormTypeEnum.SCALAR\"></eqp-dynamic-module>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious (click)=\"setFormStatus(false)\">Precedente</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveForm()\">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class=\"row\" *ngIf=\"innerFormManagment\">\r\n <div class=\"col-md-12 text-right\">\r\n <button mat-raised-button (click)=\"saveFormEvent.emit(null)\">Esci</button>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG AGGIUNTA/MODIFICA CAMPO -->\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedField\" [indexField]=\"indexSelectedField\"\r\n (saveFieldEvent)=\"onSaveField($event)\" [availableFields]=\"form.Fields\"\r\n [formFieldsGroups]=\"form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #fieldSectionColumnTemplate let-row=\"row\">\r\n <eqp-select [arrayData]=\"form.FormFieldsGroups\" [(ngModelInput)]=\"row.FieldGroup\" [arrayKeyProperty]=\"'Name'\"\r\n [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\" [isRequired]=\"true\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM -->\r\n<ng-template #dialogActionOnRecord>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"actionOnRecordFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n \"Modifica\"\r\n : \"Aggiungi\"}} azione sul record</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName=\"Name\" required matInput [(ngModel)]=\"selectedAction.Name\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName=\"Icon\" required matInput [(ngModel)]=\"selectedAction.Icon\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12 mt-2\">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"'Azione (Javascript)'\" [rows]=\"3\" formControlName=\"Action\"\r\n required [(ngModel)]=\"selectedAction.Action\" [matAutocomplete]=\"actionAutocomplete\"\r\n (keyup)=\"setActionAutocompleteOptions($event)\"\r\n (focus)=\"setActionAutocompleteOptions(null)\"></textarea>\r\n <mat-autocomplete #actionAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of actionAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveActionOnRecord()\"\r\n [disabled]=\"actionOnRecordFormGroup.invalid\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"closeDialogActionOnRecord()\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]=\"selectedInnerForm\" [innerFormManagment]=\"true\"\r\n (saveFormEvent)=\"onSaveOrExitInnerForm($event)\"></eqp-dynamic-module-configurator>\r\n</ng-template>",
1747
+ template: "<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<mat-horizontal-stepper linear #stepper>\r\n <!-- DATI GENERALI DELLA FORM -->\r\n <mat-step [stepControl]=\"formFormGroup\">\r\n <form [formGroup]=\"formFormGroup\" (keydown.enter)=\"false\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName=\"Name\" [(ngModel)]=\"form.Name\" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-md-4\">\r\n <eqp-select [enumData]=\"FormScalarTypeEnum\" [(ngModelInput)]=\"form.FormScalarType\"\r\n [isRequired]=\"true\" [showCancelButton]=\"false\" placeholder=\"Tipo di visualizzazione\"\r\n [formGroupInput]=\"formFormGroup\" [formControlNameInput]=\"'FormScalarType'\"\r\n (ngModelInputChange)=\"onChangeFormScalarType()\">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice\">\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]=\"formFieldGroupName\" [ngModelOptions]=\"{standalone: true}\"\r\n (keyup)=\"onFormFieldGroupNameKeyUp($event)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Sezioni inserite:</span>\r\n <ul class=\"section-list\">\r\n <li *ngFor=\"let groupName of form.FormFieldsGroups, let i=index\">\r\n <mat-icon class=\"mr-1\" (click)=\"onDeleteFormFieldGroupName(groupName.Name)\">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button mat-raised-button color=\"primary\" matStepperNext\r\n [disabled]=\"formFormGroup.invalid\">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DEI CAMPI DELLA FORM -->\r\n <mat-step [completed]=\"isFieldStepCompleted()\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"openFieldDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class=\"btn btn-primary ml-2\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openInnerFormDialog()\" *ngIf=\"!innerFormManagment\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]=\"false\" [columns]=\"fieldsColumns\" [data]=\"form.Fields\"\r\n [emptyTableMessage]=\"'Nessun campo inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext [disabled]=\"!isFieldStepCompleted()\"\r\n (click)=\"setFormStatus(false)\">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openActionOnRecordDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]=\"false\" [columns]=\"actionsOnRecordColumns\"\r\n [data]=\"form.ActionsOnRecord\" [emptyTableMessage]=\"'Nessuna action inserita'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext (click)=\"setFormStatus(true)\">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- VISUALIZZAZIONE FORM CREATA -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\"\r\n (click)=\"setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)\"></div>\r\n Anteprima\r\n </ng-template>\r\n\r\n <add-form-record *ngIf=\"previewForm && formCompleted\" [form]=\"previewForm\" [showButtons]=\"false\">\r\n </add-form-record>\r\n\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious (click)=\"setFormStatus(false)\">Precedente</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveForm()\">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class=\"row\" *ngIf=\"innerFormManagment\">\r\n <div class=\"col-md-12 text-right\">\r\n <button mat-raised-button (click)=\"saveFormEvent.emit(null)\">Esci</button>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG AGGIUNTA/MODIFICA CAMPO -->\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedField\" [indexField]=\"indexSelectedField\"\r\n (saveFieldEvent)=\"onSaveField($event)\" [availableFields]=\"form.Fields\"\r\n [formFieldsGroups]=\"form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #fieldSectionColumnTemplate let-row=\"row\">\r\n <eqp-select [arrayData]=\"form.FormFieldsGroups\" [(ngModelInput)]=\"row.FieldGroup\" [arrayKeyProperty]=\"'Name'\"\r\n [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\" [isRequired]=\"true\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM -->\r\n<ng-template #dialogActionOnRecord>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"actionOnRecordFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n \"Modifica\"\r\n : \"Aggiungi\"}} azione sul record</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName=\"Name\" required matInput [(ngModel)]=\"selectedAction.Name\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName=\"Icon\" required matInput [(ngModel)]=\"selectedAction.Icon\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12 mt-2\">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"'Azione (Javascript)'\" [rows]=\"3\" formControlName=\"Action\"\r\n required [(ngModel)]=\"selectedAction.Action\" [matAutocomplete]=\"actionAutocomplete\"\r\n (keyup)=\"setActionAutocompleteOptions($event)\"\r\n (focus)=\"setActionAutocompleteOptions(null)\"></textarea>\r\n <mat-autocomplete #actionAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of actionAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveActionOnRecord()\"\r\n [disabled]=\"actionOnRecordFormGroup.invalid\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"closeDialogActionOnRecord()\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER CONFIGURARE LE FORM DI DETTAGLIO -->\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]=\"selectedInnerForm\" [innerFormManagment]=\"true\"\r\n (saveFormEvent)=\"onSaveOrExitInnerForm($event)\"></eqp-dynamic-module-configurator>\r\n</ng-template>",
1175
1748
  styles: ["::ng-deep mat-form-field{width:100%}.stepper-header-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.section-list{list-style:none;padding:0}.section-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.danger-color{color:var(--danger)}"]
1176
1749
  })
1177
1750
  ], EqpDynamicModuleConfiguratorComponent);
@@ -1243,6 +1816,11 @@ var ListValueField = /** @class */ (function (_super) {
1243
1816
  }
1244
1817
  return ListValueField;
1245
1818
  }(BaseField));
1819
+ var ButtonImage = /** @class */ (function () {
1820
+ function ButtonImage() {
1821
+ }
1822
+ return ButtonImage;
1823
+ }());
1246
1824
  var ListPresentationEnum;
1247
1825
  (function (ListPresentationEnum) {
1248
1826
  ListPresentationEnum[ListPresentationEnum["Combo box"] = 1] = "Combo box";
@@ -1253,10 +1831,11 @@ var ListPresentationEnum;
1253
1831
 
1254
1832
  var AddFormFieldComponent = /** @class */ (function () {
1255
1833
  //#endregion
1256
- function AddFormFieldComponent(formBuilder, enumHelper, dialog) {
1834
+ function AddFormFieldComponent(formBuilder, enumHelper, dialog, cdr) {
1257
1835
  this.formBuilder = formBuilder;
1258
1836
  this.enumHelper = enumHelper;
1259
1837
  this.dialog = dialog;
1838
+ this.cdr = cdr;
1260
1839
  this.fieldTypesToExclude = [FieldTypeEnum['Form di dettaglio']];
1261
1840
  this.keyValueObject = { key: '', value: '' };
1262
1841
  this.availableColSpanSizes = [];
@@ -1269,6 +1848,8 @@ var AddFormFieldComponent = /** @class */ (function () {
1269
1848
  this.BoolPresentantioEnum = BoolPresentantioEnum;
1270
1849
  this.DateTimeTypeEnum = DateTimeTypeEnum;
1271
1850
  this.ListPresentationEnum = ListPresentationEnum;
1851
+ this.TextMaskEnum = TextMaskEnum;
1852
+ this.AttachmentType = AttachmentType;
1272
1853
  }
1273
1854
  AddFormFieldComponent.prototype.ngOnInit = function () {
1274
1855
  var _this = this;
@@ -1307,7 +1888,7 @@ var AddFormFieldComponent = /** @class */ (function () {
1307
1888
  Required: [this.field.Required],
1308
1889
  FieldType: [this.field.FieldType, Validators.required],
1309
1890
  Formula: [this.field.Formula],
1310
- ColSizes: [this.field.ColSizes],
1891
+ ColSpanSizes: [this.field.ColSpanSizes],
1311
1892
  InListView: [this.field.InListView],
1312
1893
  });
1313
1894
  if (this.formFieldsGroups) {
@@ -1326,7 +1907,7 @@ var AddFormFieldComponent = /** @class */ (function () {
1326
1907
  if (restoreField)
1327
1908
  this.restoreBaseFieldProperties();
1328
1909
  this.createFieldForm();
1329
- this.onColSizeSelect();
1910
+ this.onColSpanSizeSelect();
1330
1911
  this.fieldTypeFormTemplate = null;
1331
1912
  switch (this.field.FieldType) {
1332
1913
  case FieldTypeEnum['Campo di testo']:
@@ -1350,13 +1931,16 @@ var AddFormFieldComponent = /** @class */ (function () {
1350
1931
  this.fieldFormGroup.addControl('IsOnlyDate', new FormControl(this.field.IsOnlyDate, Validators.required));
1351
1932
  this.fieldFormGroup.addControl('MinDate', new FormControl(this.field.MinDate));
1352
1933
  this.fieldFormGroup.addControl('MaxDate', new FormControl(this.field.MaxDate));
1934
+ this.fieldFormGroup.addControl('DateFormat', new FormControl(this.field.DateFormat));
1353
1935
  this.fieldTypeFormTemplate = this.dateFieldFormTemplate;
1354
1936
  break;
1355
1937
  case FieldTypeEnum['Campo numerico']:
1356
1938
  this.fieldFormGroup.addControl('IsInteger', new FormControl(this.field.IsInteger));
1357
1939
  this.fieldFormGroup.addControl('MinValue', new FormControl(this.field.MinValue));
1358
1940
  this.fieldFormGroup.addControl('MaxValue', new FormControl(this.field.MaxValue));
1359
- this.fieldFormGroup.addControl('NumberFormat', new FormControl(this.field.NumberFormat));
1941
+ this.fieldFormGroup.addControl('DecimalSeparator', new FormControl(this.field.DecimalSeparator));
1942
+ this.fieldFormGroup.addControl('DecimalPrecision', new FormControl(this.field.DecimalPrecision));
1943
+ this.fieldFormGroup.addControl('ThousandsSeparator', new FormControl(this.field.ThousandsSeparator));
1360
1944
  this.fieldFormGroup.addControl('CurrencySymbol', new FormControl(this.field.CurrencySymbol));
1361
1945
  this.fieldTypeFormTemplate = this.numericFieldFormTemplate;
1362
1946
  break;
@@ -1440,17 +2024,50 @@ var AddFormFieldComponent = /** @class */ (function () {
1440
2024
  * seleziona la classe "col-sm-6", al change del valore questo metodo rimuove dalla select
1441
2025
  * tutti gli altri valori per la grandezza di schermo selezionata.
1442
2026
  */
1443
- AddFormFieldComponent.prototype.onColSizeSelect = function () {
2027
+ AddFormFieldComponent.prototype.onColSpanSizeSelect = function () {
1444
2028
  // Recupero l'array degli oggetti chiave-valore che rappreseta l'enumeratore
1445
2029
  var colSizeClassEnumArray = this.enumHelper.getEnumArray(ColSpanSizesEnum, false, null);
1446
2030
  // Costruisco l'array delle classi selezionate dall'utente in formato stringa
1447
- var selectedDimensions = this.field.ColSizes ? this.field.ColSizes.map(function (col) { return ColSpanSizesEnum[col]; }) : [];
2031
+ var selectedDimensions = this.field.ColSpanSizes ? this.field.ColSpanSizes.map(function (col) { return ColSpanSizesEnum[col]; }) : [];
1448
2032
  // Filtro i valori ottenuti dall'enumeratore per escludere tutti i valori per le
1449
2033
  // grandezze di schermo già selezionatead esclusione dei valori selezionati.
1450
2034
  this.availableColSpanSizes = colSizeClassEnumArray.filter(function (value) {
1451
2035
  return !selectedDimensions.find(function (col) { return value.value.includes(col.substring(4, 6)) && value.value != col; });
1452
2036
  });
1453
2037
  };
2038
+ /**
2039
+ * Metodo invocato al cambio del tipo di visualizzazione scelta per i campi di tipo elenco generico.
2040
+ * Se viene scelta la visualizzazione ad immagini svuota la lista delle coppie chiave-valore inserite
2041
+ * in precedenza, altrimenti svuota la lista delle immagini caricate.
2042
+ */
2043
+ AddFormFieldComponent.prototype.onPresentationModeChange = function () {
2044
+ if (this.field.PresentationMode === ListPresentationEnum.Immagini) {
2045
+ this.field.ValuePairs = null;
2046
+ }
2047
+ else {
2048
+ this.field.ButtonImageList = null;
2049
+ }
2050
+ };
2051
+ /**
2052
+ * Metodo invocato quando viene caricato il componente eqp-attachments per caricare le immagini da usare
2053
+ * nella visualizzazione ad immagini dei campi di tipo "Elenco generico". Aggiunge due colonne a quelle
2054
+ * configurate nel componente in cui l'utente può indicare chiave e valore della scelta.
2055
+ * @param component Istanza del componente eqp-attachments in cui effettuare la modifica.
2056
+ */
2057
+ AddFormFieldComponent.prototype.configureButtonImagesColumns = function (component) {
2058
+ component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonKey", display: "Label", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
2059
+ component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonValue", display: "Valore", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
2060
+ this.cdr.detectChanges();
2061
+ };
2062
+ /**
2063
+ * Metodo invocato al salvataggio degli allegati quando viene configurato un campo di tipo "Elenco generico"
2064
+ * con il tipo di visualizzazione ad immagini. Intercetta l'elenco aggiornato delle immagini caricate e lo
2065
+ * memorizza nell'oggetto field corrente.
2066
+ * @param attachments Array aggiornato degli allegati caricati.
2067
+ */
2068
+ AddFormFieldComponent.prototype.catchButtonImagesChange = function (attachments) {
2069
+ this.field.ButtonImageList = attachments;
2070
+ };
1454
2071
  /**
1455
2072
  * Metodo chiamato al keyup degli input testuali che prevedono l'aggiunta del valore inserito in un array.
1456
2073
  * Se l'utente preme il tasto invio, in base al tipo di campo che sta inserendo/modificando, questo metodo
@@ -1598,7 +2215,14 @@ var AddFormFieldComponent = /** @class */ (function () {
1598
2215
  }
1599
2216
  switch (this.field.FieldType) {
1600
2217
  case FieldTypeEnum['Elenco generico']:
1601
- return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
2218
+ if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
2219
+ return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
2220
+ }
2221
+ else {
2222
+ return (!this.field.ButtonImageList
2223
+ || this.field.ButtonImageList.length === 0
2224
+ || !!this.field.ButtonImageList.find(function (i) { return !i.ButtonKey || !i.ButtonValue; }));
2225
+ }
1602
2226
  case FieldTypeEnum.Lookup:
1603
2227
  return !this.field.FieldNames || this.field.FieldNames.length === 0;
1604
2228
  default:
@@ -1632,7 +2256,7 @@ var AddFormFieldComponent = /** @class */ (function () {
1632
2256
  this.field.Required = tmpBaseField.Required;
1633
2257
  this.field.FieldType = tmpBaseField.FieldType;
1634
2258
  this.field.Formula = tmpBaseField.Formula;
1635
- this.field.ColSizes = tmpBaseField.ColSizes;
2259
+ this.field.ColSpanSizes = tmpBaseField.ColSpanSizes;
1636
2260
  this.field.FieldGroup = tmpBaseField.FieldGroup;
1637
2261
  }
1638
2262
  };
@@ -1710,7 +2334,8 @@ var AddFormFieldComponent = /** @class */ (function () {
1710
2334
  AddFormFieldComponent.ctorParameters = function () { return [
1711
2335
  { type: FormBuilder },
1712
2336
  { type: EnumHelper },
1713
- { type: MatDialog }
2337
+ { type: MatDialog },
2338
+ { type: ChangeDetectorRef }
1714
2339
  ]; };
1715
2340
  __decorate([
1716
2341
  Input()
@@ -1763,10 +2388,13 @@ var AddFormFieldComponent = /** @class */ (function () {
1763
2388
  __decorate([
1764
2389
  ViewChild('dialogMetadata', { static: true })
1765
2390
  ], AddFormFieldComponent.prototype, "dialogMetadata", void 0);
2391
+ __decorate([
2392
+ ViewChild('buttonImagesKeyValueInputColumn', { static: true })
2393
+ ], AddFormFieldComponent.prototype, "buttonImagesKeyValueInputColumn", void 0);
1766
2394
  AddFormFieldComponent = __decorate([
1767
2395
  Component({
1768
2396
  selector: 'eqp-dynamic-module-add-form-field',
1769
- template: "<div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\n <form [formGroup]=\"fieldFormGroup\">\n <div class=\"row\">\n <div class=\"header-title-standard\">{{indexField != null && indexField >= 0 ? \"Modifica\"\n : \"Aggiungi\"}} campo</div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"FieldTypeEnum\" [(ngModelInput)]=\"field.FieldType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo campo\" (ngModelInputChange)=\"onFieldTypeChange()\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldType'\"\n [enumDataToExclude]=\"fieldTypesToExclude\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Label </mat-label>\n <input formControlName=\"Label\" required matInput [(ngModel)]=\"field.Label\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Descrizione </mat-label>\n <input formControlName=\"Description\" required matInput [(ngModel)]=\"field.Description\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.Required\" formControlName=\"Required\" color=\"primary\">\n Obbligatorio\n </mat-slide-toggle>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Formula (Javascript) </mat-label>\n <input formControlName=\"Formula\" matInput [(ngModel)]=\"field.Formula\"\n [matAutocomplete]=\"formulaAutocomplete\" (keyup)=\"setFormulaAutocompleteOptions($event)\"\n (focus)=\"setFormulaAutocompleteOptions(null)\">\n <mat-autocomplete #formulaAutocomplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of formulaAutocompleteOptions\" [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"formFieldsGroups\">\n <eqp-select [arrayData]=\"formFieldsGroups\" [(ngModelInput)]=\"field.FieldGroup\"\n [arrayKeyProperty]=\"'Name'\" [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldGroup'\" [isRequired]=\"true\"\n [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"availableColSpanSizes\" [(ngModelInput)]=\"field.ColSizes\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" (ngModelInputChange)=\"onColSizeSelect()\"\n [isMultiSelect]=\"true\" placeholder=\"Larghezza campo\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'ColSizes'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.InListView\" formControlName=\"InListView\" color=\"primary\"\n [disabled]=\"fieldFormGroup.controls['InListView'].disabled\">\n Mostrare nella visualizzazione a lista\n </mat-slide-toggle>\n </div>\n\n <ng-container *ngTemplateOutlet=\"fieldTypeFormTemplate\">\n </ng-container>\n </div>\n\n\n <div class=\"row mt-2 mb-1\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveAndExitAddField(true)\"\n [disabled]=\"disableSaveField()\" type=\"button\">\n Salva\n </button>\n <button class=\"btn mat-raised-button\" (click)=\"saveAndExitAddField(false)\" type=\"button\">\n Esci\n </button>\n </div>\n </div>\n </form>\n</div>\n\n\n<!-- FORM PROPRIET\u00C0 CAMPI DI TESTO -->\n<ng-template #textFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Maschera </mat-label>\n <input formControlName=\"TextMask\" matInput [(ngModel)]=\"field.TextMask\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI AREA DI TESTO -->\n<ng-template #textareaFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Righe </mat-label>\n <input formControlName=\"Rows\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.Rows\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI BOOLEANI -->\n<ng-template #booleadFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsTristate\" formControlName=\"IsTristate\" color=\"primary\">\n A tre stati\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"BoolPresentantioEnum\" [(ngModelInput)]=\"field.PresetationType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresetationType'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI DATA -->\n<ng-template #dateFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data minima'\" [(ngModelInput)]=\"field.MinDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MinDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data massima'\" [(ngModelInput)]=\"field.MaxDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MaxDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"DateTimeTypeEnum\" [(ngModelInput)]=\"field.IsOnlyDate\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di data\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'IsOnlyDate'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI NUMERICI -->\n<ng-template #numericFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsInteger\" formControlName=\"IsInteger\" color=\"primary\">\n Valore intero\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Formato numerico </mat-label>\n <input formControlName=\"NumberFormat\" matInput [(ngModel)]=\"field.NumberFormat\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Simbolo valuta </mat-label>\n <input formControlName=\"CurrencySymbol\" matInput [(ngModel)]=\"field.CurrencySymbol\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore massimo </mat-label>\n <input formControlName=\"MinValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinValue\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore minimo </mat-label>\n <input formControlName=\"MaxValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxValue\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI ALLEGATO -->\n<ng-template #attachmentFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiAttach\" formControlName=\"IsMultiAttach\" color=\"primary\">\n Allegati multipli\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"AvailableFileExtensions.concat(AvailableImageExtensions)\"\n [(ngModelInput)]=\"field.AllowedExtensions\" [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\"\n [isMultiSelect]=\"true\" placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\" [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI IMMAGINE -->\n<ng-template #imageFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\n color=\"primary\" (ngModelChange)=\"onImageIsContextualAttachmentChange()\">\n Immagine pre-caricata nel campo\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.EnableDrawing\" formControlName=\"EnableDrawing\" color=\"primary\">\n Abilita il disegno\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\"\n *ngIf=\"!field.ImageIsContextualAttachment\">\n <mat-slide-toggle [(ngModel)]=\"field.AttachDefinition.IsMultiAttach\" formControlName=\"IsMultiAttach\"\n color=\"primary\">\n Immagini multiple\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"!field.ImageIsContextualAttachment\">\n <eqp-select [arrayData]=\"AvailableImageExtensions\" [(ngModelInput)]=\"field.AttachDefinition.AllowedExtensions\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" [isMultiSelect]=\"true\"\n placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\" required>\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-8 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\n <eqp-attachments [attachmentsList]=\"field._contextualAttachments\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"false\" [showHeader]=\"false\"\n (localEditedAttachments)=\"catchContextualAttachmentChange($event)\" #contextualAttachmentEqpAttachments>\n </eqp-attachments>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.AttachDefinition.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\"\n [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LISTA DI VALORI -->\n<ng-template #listValueFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiChoiche\" formControlName=\"IsMultiChoiche\" color=\"primary\">\n Scelta multipla\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"ListPresentationEnum\" [(ngModelInput)]=\"field.PresentationMode\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresentationMode'\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <h4 class=\"key-value-list-section-title\"> </h4>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Label opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.key\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Valore opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.value\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <span class=\"mr-3\">Opzioni inserite:</span>\n <ul class=\"value-pairs-list\">\n <li *ngFor=\"let keyValuePair of getDictionaryKeyValue()\">\n <mat-icon class=\"mr-1\" (click)=\"deleteKeyFromDictionary(keyValuePair.key)\">close\n </mat-icon>\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LOOKUP -->\n<ng-template #lookupFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.UseAsGetOrDiscard\" formControlName=\"UseAsGetOrDiscard\" color=\"primary\"\n matTooltip=\"Se true la lookup viene visualizzata in una modale per lo scegli scarta\">\n Usa per scegli o scarta\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field matTooltip=\"Nome dell'entit\u00E0 relazionata\">\n <mat-label> Nome entit\u00E0 </mat-label>\n <input formControlName=\"EntitySourceName\" required matInput [(ngModel)]=\"field.EntitySourceName\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <mat-form-field\n matTooltip=\"Elenco di campi ordinato che verr\u00E0 visualizzato nella lookup (premere invio per confermare)\">\n <mat-label>\n Nomi dei campi (invio per confermare) </mat-label>\n <input matInput (keyup)=\"onMultiSelectInputKeyup($event, 'FieldNames')\">\n </mat-form-field>\n </div>\n <div class=\"col-md-8 d-flex align-items-center\">\n <span class=\"mr-3\">Nomi selezionati:</span>\n <div class=\"extension-container\" *ngFor=\"let extension of field.FieldNames; let i = index\">\n <span>{{extension}}</span>\n <mat-icon class=\"ml-1\" (click)=\"field.FieldNames.splice(i,1)\">close\n </mat-icon>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE -->\n<ng-template #dialogMetadata>\n <eqp-dynamic-module-add-form-field [field]=\"selectedMetadata\" [availableFields]=\"availableFields\"\n [indexField]=\"indexSelectedMetadata\" (saveFieldEvent)=\"onSaveMetadata($event)\" [fieldTypesToExclude]=\"[6,7,10]\">\n </eqp-dynamic-module-add-form-field>\n</ng-template>",
2397
+ template: "<div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"fieldFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexField != null && indexField >= 0 ? \"Modifica\"\r\n : \"Aggiungi\"}} campo</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"FieldTypeEnum\" [(ngModelInput)]=\"field.FieldType\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo campo\" (ngModelInputChange)=\"onFieldTypeChange()\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldType'\"\r\n [enumDataToExclude]=\"fieldTypesToExclude\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Label </mat-label>\r\n <input formControlName=\"Label\" required matInput [(ngModel)]=\"field.Label\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Descrizione </mat-label>\r\n <input formControlName=\"Description\" required matInput [(ngModel)]=\"field.Description\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\r\n <mat-slide-toggle [(ngModel)]=\"field.Required\" formControlName=\"Required\" color=\"primary\">\r\n Obbligatorio\r\n </mat-slide-toggle>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Formula (Javascript) </mat-label>\r\n <input formControlName=\"Formula\" matInput [(ngModel)]=\"field.Formula\"\r\n [matAutocomplete]=\"formulaAutocomplete\" (keyup)=\"setFormulaAutocompleteOptions($event)\"\r\n (focus)=\"setFormulaAutocompleteOptions(null)\">\r\n <mat-autocomplete #formulaAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of formulaAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"formFieldsGroups\">\r\n <eqp-select [arrayData]=\"formFieldsGroups\" [(ngModelInput)]=\"field.FieldGroup\"\r\n [arrayKeyProperty]=\"'Name'\" [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldGroup'\" [isRequired]=\"true\"\r\n [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [arrayData]=\"availableColSpanSizes\" [(ngModelInput)]=\"field.ColSpanSizes\"\r\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" (ngModelInputChange)=\"onColSpanSizeSelect()\"\r\n [isMultiSelect]=\"true\" placeholder=\"Larghezza campo\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'ColSpanSizes'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\r\n <mat-slide-toggle [(ngModel)]=\"field.InListView\" formControlName=\"InListView\" color=\"primary\"\r\n [disabled]=\"fieldFormGroup.controls['InListView'].disabled\">\r\n Mostrare nella visualizzazione a lista\r\n </mat-slide-toggle>\r\n </div>\r\n\r\n <ng-container *ngTemplateOutlet=\"fieldTypeFormTemplate\">\r\n </ng-container>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveAndExitAddField(true)\"\r\n [disabled]=\"disableSaveField()\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"saveAndExitAddField(false)\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI DI TESTO -->\r\n<ng-template #textFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4\">\r\n <eqp-select [enumData]=\"TextMaskEnum\" [(ngModelInput)]=\"field.TextMask\" placeholder=\"Maschera\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'TextMask'\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI AREA DI TESTO -->\r\n<ng-template #textareaFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Righe </mat-label>\r\n <input formControlName=\"Rows\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.Rows\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI BOOLEANI -->\r\n<ng-template #booleadFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsTristate\" formControlName=\"IsTristate\" color=\"primary\">\r\n A tre stati\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"BoolPresentantioEnum\" [(ngModelInput)]=\"field.PresetationType\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'PresetationType'\">\r\n </eqp-select>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI DATA -->\r\n<ng-template #dateFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-datetimepicker [placeholder]=\"'Data minima'\" [(ngModelInput)]=\"field.MinDate\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MinDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-datetimepicker [placeholder]=\"'Data massima'\" [(ngModelInput)]=\"field.MaxDate\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MaxDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"DateTimeTypeEnum\" [(ngModelInput)]=\"field.IsOnlyDate\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di data\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'IsOnlyDate'\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Formato </mat-label>\r\n <input formControlName=\"DateFormat\" matInput [(ngModel)]=\"field.DateFormat\"\r\n [matTooltip]=\"'Indicare il formato senguendo la guida del pacchetto momentjs.'\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI NUMERICI -->\r\n<ng-template #numericFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsInteger\" formControlName=\"IsInteger\" color=\"primary\">\r\n Valore intero\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Separatore decimali </mat-label>\r\n <input formControlName=\"DecimalSeparator\" matInput [(ngModel)]=\"field.DecimalSeparator\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Precisione decimali </mat-label>\r\n <input formControlName=\"DecimalPrecision\" type=\"number\" [min]=\"0\" matInput\r\n [(ngModel)]=\"field.DecimalPrecision\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Separatore migliaia </mat-label>\r\n <input formControlName=\"ThousandsSeparator\" matInput [(ngModel)]=\"field.ThousandsSeparator\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Simbolo valuta </mat-label>\r\n <input formControlName=\"CurrencySymbol\" matInput [(ngModel)]=\"field.CurrencySymbol\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Valore massimo </mat-label>\r\n <input formControlName=\"MinValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinValue\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Valore minimo </mat-label>\r\n <input formControlName=\"MaxValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxValue\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI ALLEGATO -->\r\n<ng-template #attachmentFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiAttach\" formControlName=\"IsMultiAttach\" color=\"primary\">\r\n Allegati multipli\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [arrayData]=\"AvailableFileExtensions.concat(AvailableImageExtensions)\"\r\n [(ngModelInput)]=\"field.AllowedExtensions\" [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\"\r\n [isMultiSelect]=\"true\" placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 col-md-6\">\r\n <div class=\"header-title-standard\">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openMetadataDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi</span>\r\n </button>\r\n </div>\r\n </div>\r\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\r\n [data]=\"field.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI IMMAGINE -->\r\n<ng-template #imageFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\r\n color=\"primary\" (ngModelChange)=\"onImageIsContextualAttachmentChange()\">\r\n Immagine pre-caricata nel campo\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.EnableDrawing\" formControlName=\"EnableDrawing\" color=\"primary\">\r\n Abilita il disegno\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\"\r\n *ngIf=\"!field.ImageIsContextualAttachment\">\r\n <mat-slide-toggle [(ngModel)]=\"field.AttachDefinition.IsMultiAttach\" formControlName=\"IsMultiAttach\"\r\n color=\"primary\">\r\n Immagini multiple\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"!field.ImageIsContextualAttachment\">\r\n <eqp-select [arrayData]=\"AvailableImageExtensions\" [(ngModelInput)]=\"field.AttachDefinition.AllowedExtensions\"\r\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" [isMultiSelect]=\"true\"\r\n placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\r\n <mat-form-field>\r\n <mat-label> Nome immagine </mat-label>\r\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\" required>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-8 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\r\n <eqp-attachments [attachmentsList]=\"field._contextualAttachments\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\r\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"false\" [showHeader]=\"false\"\r\n (localEditedAttachments)=\"catchContextualAttachmentChange($event)\" #contextualAttachmentEqpAttachments>\r\n </eqp-attachments>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 col-md-6\">\r\n <div class=\"header-title-standard\">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openMetadataDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi</span>\r\n </button>\r\n </div>\r\n </div>\r\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\r\n [data]=\"field.AttachDefinition.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\"\r\n [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI LISTA DI VALORI -->\r\n<ng-template #listValueFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiChoiche\" formControlName=\"IsMultiChoiche\" color=\"primary\">\r\n Scelta multipla\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"ListPresentationEnum\" [(ngModelInput)]=\"field.PresentationMode\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'PresentationMode'\" (ngModelInputChange)=\"onPresentationModeChange()\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\" *ngIf=\"field.PresentationMode != ListPresentationEnum.Immagini\">\r\n <div class=\"row\">\r\n <h4 class=\"key-value-list-section-title\"> </h4>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Label opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]=\"keyValueObject.key\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Valore opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]=\"keyValueObject.value\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Opzioni inserite:</span>\r\n <ul class=\"value-pairs-list\">\r\n <li *ngFor=\"let keyValuePair of getDictionaryKeyValue()\">\r\n <mat-icon class=\"mr-1\" (click)=\"deleteKeyFromDictionary(keyValuePair.key)\">close\r\n </mat-icon>\r\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-12 mt-2\" *ngIf=\"field.PresentationMode == ListPresentationEnum.Immagini\">\r\n <eqp-attachments [attachmentsList]=\"field.ButtonImageList\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\r\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"true\" [showHeader]=\"false\"\r\n [allowedTypes]=\"[AttachmentType.FILE]\" (localEditedAttachments)=\"catchButtonImagesChange($event)\"\r\n (onComponentLoaded)=\"configureButtonImagesColumns($event)\">\r\n </eqp-attachments>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI LOOKUP -->\r\n<ng-template #lookupFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.UseAsGetOrDiscard\" formControlName=\"UseAsGetOrDiscard\" color=\"primary\"\r\n matTooltip=\"Se true la lookup viene visualizzata in una modale per lo scegli scarta\">\r\n Usa per scegli o scarta\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field matTooltip=\"Nome dell'entit\u00E0 relazionata\">\r\n <mat-label> Nome entit\u00E0 </mat-label>\r\n <input formControlName=\"EntitySourceName\" required matInput [(ngModel)]=\"field.EntitySourceName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field\r\n matTooltip=\"Elenco di campi ordinato che verr\u00E0 visualizzato nella lookup (premere invio per confermare)\">\r\n <mat-label>\r\n Nomi dei campi (invio per confermare) </mat-label>\r\n <input matInput (keyup)=\"onMultiSelectInputKeyup($event, 'FieldNames')\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-8 d-flex align-items-center\">\r\n <span class=\"mr-3\">Nomi selezionati:</span>\r\n <div class=\"extension-container\" *ngFor=\"let extension of field.FieldNames; let i = index\">\r\n <span>{{extension}}</span>\r\n <mat-icon class=\"ml-1\" (click)=\"field.FieldNames.splice(i,1)\">close\r\n </mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE -->\r\n<ng-template #dialogMetadata>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedMetadata\" [availableFields]=\"availableFields\"\r\n [indexField]=\"indexSelectedMetadata\" (saveFieldEvent)=\"onSaveMetadata($event)\" [fieldTypesToExclude]=\"[6,7,10]\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<ng-template #buttonImagesKeyValueInputColumn let-row=\"row\" let-col=\"col\">\r\n <mat-form-field>\r\n <mat-label> {{col.display}} </mat-label>\r\n <input matInput [(ngModel)]=\"row[col.key]\" required>\r\n </mat-form-field>\r\n</ng-template>",
1770
2398
  styles: [".extension-container{display:inline-block;font-size:15px;border:1px solid var(--primary);border-radius:15px;margin-right:10px}.extension-container mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.extension-container span{margin-left:10px}.key-value-list-section-title{background:linear-gradient(to right,var(--gray) 0,#fff 100%) left bottom #fff no-repeat;background-size:100% 1px}.value-pairs-list{list-style:none;padding:0}.value-pairs-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}"]
1771
2399
  })
1772
2400
  ], AddFormFieldComponent);
@@ -1776,6 +2404,7 @@ var AddFormFieldComponent = /** @class */ (function () {
1776
2404
  var TextFieldTemplateComponent = /** @class */ (function () {
1777
2405
  function TextFieldTemplateComponent() {
1778
2406
  this.recordChange = new EventEmitter();
2407
+ this.InputMaskEnum = TextMaskEnum;
1779
2408
  }
1780
2409
  TextFieldTemplateComponent.prototype.ngOnInit = function () {
1781
2410
  };
@@ -1786,6 +2415,20 @@ var TextFieldTemplateComponent = /** @class */ (function () {
1786
2415
  this.updateField();
1787
2416
  }
1788
2417
  };
2418
+ TextFieldTemplateComponent.prototype.getInputType = function () {
2419
+ switch (this.field.TextMask) {
2420
+ case TextMaskEnum.Email:
2421
+ return 'email';
2422
+ case TextMaskEnum.Password:
2423
+ return 'password';
2424
+ case TextMaskEnum.Telefono:
2425
+ return 'tel';
2426
+ case TextMaskEnum.Url:
2427
+ return 'url';
2428
+ default:
2429
+ return 'text';
2430
+ }
2431
+ };
1789
2432
  /**
1790
2433
  * Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
1791
2434
  */
@@ -1814,7 +2457,7 @@ var TextFieldTemplateComponent = /** @class */ (function () {
1814
2457
  TextFieldTemplateComponent = __decorate([
1815
2458
  Component({
1816
2459
  selector: 'text-field-template',
1817
- template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput type=\"text\" [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n</mat-form-field>",
2460
+ template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput [type]=\"getInputType()\" [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n</mat-form-field>",
1818
2461
  styles: [""]
1819
2462
  })
1820
2463
  ], TextFieldTemplateComponent);
@@ -1866,7 +2509,7 @@ var BooleanFieldTemplateComponent = /** @class */ (function () {
1866
2509
  BooleanFieldTemplateComponent = __decorate([
1867
2510
  Component({
1868
2511
  selector: 'boolean-field-template',
1869
- template: "<div [formGroup]=\"field.FormFormGroup\">\n\n <!-- VISUALIZZAZIONE A TOGGLE -->\n <mat-slide-toggle color=\"primary\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Toggle\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-slide-toggle>\n\n\n <!-- VISUALIZZAZIONE A RADIOBUTTON -->\n <mat-label class=\"mr-3\" *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-label>\n <mat-radio-group *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n <mat-radio-button class=\"mr-2\" [value]=\"true\" color=\"primary\"> Si </mat-radio-button>\n <mat-radio-button class=\"mr-2\" [value]=\"false\" color=\"primary\"> No </mat-radio-button>\n <mat-radio-button class=\"mr-2\" [value]=\"null\" color=\"primary\" *ngIf=\"field.IsTristate\"> ND\n </mat-radio-button>\n </mat-radio-group>\n\n <!-- VISUALIZZAZIONE A CHECKBOX -->\n <mat-checkbox class=\"mr-2\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Checkbox\"\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [formControlName]=\"field.Name\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-checkbox>\n\n <!-- TODO: Visualizzazione \"Stringa true o false\" e \"Numerico 0 o 1\" ?? -->\n</div>",
2512
+ template: "<div [formGroup]=\"field.FormFormGroup\">\r\n\r\n <!-- VISUALIZZAZIONE A TOGGLE -->\r\n <mat-slide-toggle color=\"primary\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Toggle\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-slide-toggle>\r\n\r\n\r\n <!-- VISUALIZZAZIONE A RADIOBUTTON -->\r\n <mat-label class=\"mr-3\" *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-label>\r\n <mat-radio-group *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n <mat-radio-button class=\"mr-2\" [value]=\"true\" color=\"primary\"> Si </mat-radio-button>\r\n <mat-radio-button class=\"mr-2\" [value]=\"false\" color=\"primary\"> No </mat-radio-button>\r\n <mat-radio-button class=\"mr-2\" [value]=\"null\" color=\"primary\" *ngIf=\"field.IsTristate\"> ND\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n <!-- VISUALIZZAZIONE A CHECKBOX -->\r\n <mat-checkbox class=\"mr-2\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Checkbox\"\r\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [formControlName]=\"field.Name\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-checkbox>\r\n\r\n <!-- TODO: Visualizzazione \"Stringa true o false\" e \"Numerico 0 o 1\" ?? -->\r\n</div>",
1870
2513
  styles: [""]
1871
2514
  })
1872
2515
  ], BooleanFieldTemplateComponent);
@@ -1932,7 +2575,7 @@ var DateFieldTemplateComponent = /** @class */ (function () {
1932
2575
  DateFieldTemplateComponent = __decorate([
1933
2576
  Component({
1934
2577
  selector: 'date-field-template',
1935
- template: "<eqp-datetimepicker [placeholder]=\"field.Label\" [UTCDate]=\"true\" [pickerMode]=\"pickerMode\"\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\"\n [minDate]=\"field.MinDate ? field.MinDate : null\" [maxDate]=\"field.MaxDate ? field.MaxDate : null\"\n [isRequired]=\"field.Required\" [disabled]=\"field.FormFormGroup.disabled\" [(ngModelInput)]=\"record[field.Name]\"\n (ngModelInputChange)=\"onRecordValueChange()\">\n</eqp-datetimepicker>",
2578
+ template: "<eqp-datetimepicker [placeholder]=\"field.Label\" [UTCDate]=\"true\" [pickerMode]=\"pickerMode\"\r\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\"\r\n [minDate]=\"field.MinDate ? field.MinDate : null\" [maxDate]=\"field.MaxDate ? field.MaxDate : null\"\r\n [isRequired]=\"field.Required\" [disabled]=\"field.FormFormGroup.disabled\" [(ngModelInput)]=\"record[field.Name]\"\r\n (ngModelInputChange)=\"onRecordValueChange()\" [customDateFormat]=\"field.DateFormat ? field.DateFormat : null\">\r\n</eqp-datetimepicker>",
1936
2579
  styles: [""]
1937
2580
  })
1938
2581
  ], DateFieldTemplateComponent);
@@ -1980,7 +2623,7 @@ var TextareaFieldTemplateComponent = /** @class */ (function () {
1980
2623
  TextareaFieldTemplateComponent = __decorate([
1981
2624
  Component({
1982
2625
  selector: 'textarea-field-template',
1983
- template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\n <textarea matInput [placeholder]=\"field.Label\" [rows]=\"field.Rows\" [formControlName]=\"field.Name\"\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\"\n (ngModelChange)=\"onRecordValueChange()\"></textarea>\n</mat-form-field>",
2626
+ template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <textarea matInput [placeholder]=\"field.Label\" [rows]=\"field.Rows\" [formControlName]=\"field.Name\"\r\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\"\r\n (ngModelChange)=\"onRecordValueChange()\"></textarea>\r\n</mat-form-field>",
1984
2627
  styles: [""]
1985
2628
  })
1986
2629
  ], TextareaFieldTemplateComponent);
@@ -2023,10 +2666,17 @@ var NumericFieldTemplateComponent = /** @class */ (function () {
2023
2666
  */
2024
2667
  NumericFieldTemplateComponent.prototype.configureEqpNumericOptions = function () {
2025
2668
  this.eqpNumericOptions.prefix = this.field.CurrencySymbol ? this.field.CurrencySymbol : "";
2669
+ this.eqpNumericOptions.inputMode = this.field.CurrencySymbol ? EqpNumericInputMode.FINANCIAL : EqpNumericInputMode.NATURAL;
2026
2670
  if (this.field.MinValue != null && this.field.MinValue != undefined)
2027
2671
  this.eqpNumericOptions.min = this.field.MinValue;
2028
2672
  if (this.field.MaxValue != null && this.field.MaxValue != undefined)
2029
2673
  this.eqpNumericOptions.max = this.field.MaxValue;
2674
+ if (this.field.DecimalSeparator != null && this.field.DecimalSeparator != undefined)
2675
+ this.eqpNumericOptions.decimal = this.field.DecimalSeparator;
2676
+ if (this.field.ThousandsSeparator != null && this.field.ThousandsSeparator != undefined)
2677
+ this.eqpNumericOptions.thousands = this.field.ThousandsSeparator;
2678
+ if (this.field.DecimalPrecision != null && this.field.DecimalPrecision != undefined)
2679
+ this.eqpNumericOptions.precision = this.field.DecimalPrecision;
2030
2680
  };
2031
2681
  __decorate([
2032
2682
  Input()
@@ -2040,7 +2690,7 @@ var NumericFieldTemplateComponent = /** @class */ (function () {
2040
2690
  NumericFieldTemplateComponent = __decorate([
2041
2691
  Component({
2042
2692
  selector: 'numeric-field-template',
2043
- template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\n <mat-label> {{field.Label}} </mat-label>\n <input matInput eqpNumericMask [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" [options]=\"eqpNumericOptions\"\n [step]=\"field.IsInteger ? 1 : null\" (ngModelChange)=\"onRecordValueChange()\" />\n</mat-form-field>",
2693
+ template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput eqpNumericMask [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" [options]=\"eqpNumericOptions\"\r\n [step]=\"field.IsInteger ? 1 : null\" (ngModelChange)=\"onRecordValueChange()\" />\r\n</mat-form-field>",
2044
2694
  styles: [""]
2045
2695
  })
2046
2696
  ], NumericFieldTemplateComponent);
@@ -2078,26 +2728,17 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
2078
2728
  this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2079
2729
  }
2080
2730
  };
2081
- /**
2082
- * Metodo per recuperare la classe da applicare al button (nella relativa visualizzazione).
2083
- * Se il pulsante è stato selezionato imposta la classe "selected-button".
2084
- * @param data Oggetto bindato al pulsante
2085
- * @returns Restituisce la classe da applicare tramite [ngClass]
2086
- */
2087
- ListValueFieldTemplateComponent.prototype.getSelectButtonClass = function (data) {
2088
- var selectedButtonClass = "selected-button";
2089
- return data.Selected ? selectedButtonClass : null;
2090
- };
2091
2731
  /**
2092
2732
  * Metodo invocato quando viene selezionata un'opzione nella visualizzazione a button
2093
2733
  * @param data Rappresenta l'oggetto selezionato
2094
2734
  */
2095
2735
  ListValueFieldTemplateComponent.prototype.buttonSelectClick = function (data) {
2736
+ data.Selected = !data.Selected;
2096
2737
  if (this.field.IsMultiChoiche) {
2097
- data.Selected = !data.Selected;
2098
2738
  this.updateSelected(false);
2099
2739
  }
2100
2740
  else {
2741
+ this.arrayData.filter(function (d) { return d.Key != data.Key && d.Value != data.Value; }).forEach(function (d) { return d.Selected = false; });
2101
2742
  this.record[this.field.Name] = data.Value;
2102
2743
  }
2103
2744
  this.onRecordValueChange();
@@ -2127,16 +2768,23 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
2127
2768
  */
2128
2769
  ListValueFieldTemplateComponent.prototype.setArrayData = function () {
2129
2770
  var _this = this;
2130
- Object.keys(this.field.ValuePairs).forEach(function (k) {
2131
- var isOptionSelected;
2132
- if (_this.field.IsMultiChoiche && _this.record[_this.field.Name] && _this.record[_this.field.Name].length > 0) {
2133
- isOptionSelected = !!_this.record[_this.field.Name].find(function (v) { return v == _this.field.ValuePairs[k]; });
2134
- }
2135
- else {
2136
- isOptionSelected = _this.record[_this.field.Name] === _this.field.ValuePairs[k];
2137
- }
2138
- _this.arrayData.push({ Key: k, Value: _this.field.ValuePairs[k], Selected: isOptionSelected });
2139
- });
2771
+ if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
2772
+ Object.keys(this.field.ValuePairs).forEach(function (k) { _this.createArrayDataElement(k, _this.field.ValuePairs[k]); });
2773
+ }
2774
+ else {
2775
+ this.field.ButtonImageList.forEach(function (i) { _this.createArrayDataElement(i.ButtonKey, i.ButtonValue, 'data:' + i.FileContentType + ';base64,' + i.FileDataBase64); });
2776
+ }
2777
+ };
2778
+ ListValueFieldTemplateComponent.prototype.createArrayDataElement = function (key, value, imgUrl) {
2779
+ if (imgUrl === void 0) { imgUrl = null; }
2780
+ var isOptionSelected;
2781
+ if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
2782
+ isOptionSelected = !!this.record[this.field.Name].find(function (v) { return v == value; });
2783
+ }
2784
+ else {
2785
+ isOptionSelected = this.record[this.field.Name] === value;
2786
+ }
2787
+ this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
2140
2788
  };
2141
2789
  /**
2142
2790
  * Metodo per aggiornare il valore e il validator del FormControl associato al campo.
@@ -2156,8 +2804,8 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
2156
2804
  ListValueFieldTemplateComponent = __decorate([
2157
2805
  Component({
2158
2806
  selector: 'list-value-field-template',
2159
- template: "<eqp-select *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\" [placeholder]=\"field.Label\"\n [includeFullObject]=\"false\" [isRequired]=\"field.Required\" [isDisabled]=\"field.FormFormGroup.disabled\"\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\"\n (ngModelInputChange)=\"onRecordValueChange()\">\n</eqp-select>\n\n<div *ngIf=\"field.PresentationMode != ListPresentationEnum['Combo box']\" [formGroup]=\"field.FormFormGroup\">\n\n <mat-label class=\"mr-3\"> {{field.Label + (field.Required ? \" *\" : \"\")}} </mat-label>\n\n <!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) -->\n <mat-radio-group *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && !field.IsMultiChoiche\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n <mat-radio-button class=\"mr-2\" *ngFor=\"let data of arrayData\" [value]=\"data.Value\" color=\"primary\">\n {{data.Key}}\n </mat-radio-button>\n </mat-radio-group>\n\n <!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) -->\n <div class=\"d-inline-block\"\n *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && field.IsMultiChoiche\">\n <mat-checkbox class=\"mr-2\" *ngFor=\"let data of arrayData\" [disabled]=\"field.FormFormGroup.disabled\"\n [formControlName]=\"field.Name\" [(ngModel)]=\"data.Selected\" (ngModelChange)=\"updateSelected()\">\n {{data.Key}}\n </mat-checkbox>\n </div>\n\n <!-- VISUALIZZAZIONE A PULSANTI (CON TESTO) -->\n <div class=\"d-inline-block\" *ngIf=\"field.PresentationMode == ListPresentationEnum['Pulsante con testo']\">\n <button mat-raised-button color=\"primary\" class=\"btn btn-primary mr-2\" *ngFor=\"let data of arrayData\"\n (click)=\"buttonSelectClick(data)\" [ngClass]=\"getSelectButtonClass(data)\"\n [disabled]=\"field.FormFormGroup.disabled\">\n {{data.Key}}\n </button>\n </div>\n\n <!-- TODO: VISUALIZZAZIONE A PULSANTI (CON IMMAGINI) ?? -->\n</div>",
2160
- styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]
2807
+ template: "<eqp-select *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\r\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\" [placeholder]=\"field.Label\"\r\n [includeFullObject]=\"false\" [isRequired]=\"field.Required\" [isDisabled]=\"field.FormFormGroup.disabled\"\r\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\"\r\n (ngModelInputChange)=\"onRecordValueChange()\">\r\n</eqp-select>\r\n\r\n<div *ngIf=\"field.PresentationMode != ListPresentationEnum['Combo box']\" [formGroup]=\"field.FormFormGroup\">\r\n\r\n <mat-label class=\"mr-3\"> {{field.Label + (field.Required ? \" *\" : \"\")}} </mat-label>\r\n\r\n <!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) -->\r\n <mat-radio-group *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && !field.IsMultiChoiche\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n <mat-radio-button class=\"mr-2\" *ngFor=\"let data of arrayData\" [value]=\"data.Value\" color=\"primary\">\r\n {{data.Key}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n <!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) -->\r\n <div class=\"d-inline-block\"\r\n *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && field.IsMultiChoiche\">\r\n <mat-checkbox class=\"mr-2\" *ngFor=\"let data of arrayData\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [formControlName]=\"field.Name\" [(ngModel)]=\"data.Selected\" (ngModelChange)=\"updateSelected()\">\r\n {{data.Key}}\r\n </mat-checkbox>\r\n </div>\r\n\r\n <!-- VISUALIZZAZIONE A PULSANTI (CON TESTO O IMMAGINI) -->\r\n <div class=\"d-inline-block\"\r\n *ngIf=\"[ListPresentationEnum['Pulsante con testo'], ListPresentationEnum.Immagini].includes(field.PresentationMode)\">\r\n <button mat-raised-button color=\"primary\" class=\"btn btn-primary m-1 data-button\" *ngFor=\"let data of arrayData\"\r\n [ngClass]=\"{'selected-button': data.Selected == true, 'p-0': field.PresentationMode == ListPresentationEnum.Immagini}\"\r\n (click)=\"buttonSelectClick(data)\" [disabled]=\"field.FormFormGroup.disabled\">\r\n\r\n <!-- TESTO DEL PULSANTE -->\r\n <span *ngIf=\"field.PresentationMode == ListPresentationEnum['Pulsante con testo']\"> {{data.Key}}</span>\r\n\r\n <!-- IMMAGINE DEL PULSANTE -->\r\n <img *ngIf=\"field.PresentationMode == ListPresentationEnum.Immagini\" [src]=\"data.ImgUrl\">\r\n </button>\r\n </div>\r\n\r\n</div>",
2808
+ styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}.data-button img{max-height:300px;max-width:300px}"]
2161
2809
  })
2162
2810
  ], ListValueFieldTemplateComponent);
2163
2811
  return ListValueFieldTemplateComponent;
@@ -2323,7 +2971,7 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
2323
2971
  AttachmentFieldTemplateComponent = __decorate([
2324
2972
  Component({
2325
2973
  selector: 'attachment-field-template',
2326
- template: "<p *ngIf=\"!field.IsMultiAttach\" class=\"mb-2\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n</p>\n<div class=\"row\" *ngIf=\"!field.IsMultiAttach && record[field.Name] && record[field.Name][0]\">\n <div class=\"mt-2\" *ngFor=\"let metadata of field.MetadataFields\"\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\n <dynamic-module-field [field]=\"metadata\" [record]=\"record[field.Name][0]\"\n (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n </div>\n</div>\n\n<eqp-attachments [attachmentsList]=\"record[field.Name]\" [showMatCard]=\"true\" [allowOnlyImages]=\"onlyImages\"\n [isDisabled]=\"field.FormFormGroup.disabled\" [showInlinePreview]=\"true\" [multipleAttachment]=\"field.IsMultiAttach\"\n [disableAction]=\"field.FormFormGroup.disabled\" [acceptedFileTypes]=\"field.AllowedExtensions\" [showHeader]=\"true\"\n [headerTitle]=\"field.Label + (field.Required ? ' *' : '')\" (localEditedAttachments)=\"catchAttachmentList($event)\"\n #eqpAttachments>\n</eqp-attachments>\n\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\n<ng-template #metadataColumnTemplate let-row=\"row\" let-col=\"col\">\n <dynamic-module-field [field]=\"getFieldFromMetadata(col, row)\" [record]=\"row\"\n (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n</ng-template>",
2974
+ template: "<p *ngIf=\"!field.IsMultiAttach\" class=\"mb-2\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n</p>\r\n<div class=\"row\" *ngIf=\"!field.IsMultiAttach && record[field.Name] && record[field.Name][0]\">\r\n <div class=\"mt-2\" *ngFor=\"let metadata of field.MetadataFields\"\r\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\r\n <dynamic-module-field [field]=\"metadata\" [record]=\"record[field.Name][0]\"\r\n (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n </div>\r\n</div>\r\n\r\n<eqp-attachments [attachmentsList]=\"record[field.Name]\" [showMatCard]=\"true\" [allowOnlyImages]=\"onlyImages\"\r\n [isDisabled]=\"field.FormFormGroup.disabled\" [showInlinePreview]=\"true\" [multipleAttachment]=\"field.IsMultiAttach\"\r\n [disableAction]=\"field.FormFormGroup.disabled\" [acceptedFileTypes]=\"field.AllowedExtensions\" [showHeader]=\"true\"\r\n [headerTitle]=\"field.Label + (field.Required ? ' *' : '')\" (localEditedAttachments)=\"catchAttachmentList($event)\"\r\n #eqpAttachments>\r\n</eqp-attachments>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #metadataColumnTemplate let-row=\"row\" let-col=\"col\">\r\n <dynamic-module-field [field]=\"getFieldFromMetadata(col, row)\" [record]=\"row\"\r\n (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n</ng-template>",
2327
2975
  styles: [""]
2328
2976
  })
2329
2977
  ], AttachmentFieldTemplateComponent);
@@ -2522,7 +3170,7 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
2522
3170
  ImageFieldTemplateComponent = __decorate([
2523
3171
  Component({
2524
3172
  selector: 'image-field-template',
2525
- template: "<!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA' DI DISEGNO -->\n<div class=\"row\" *ngIf=\"field.ImageIsContextualAttachment && field.ContextualAttachment\">\n <div class=\"col-sm-12 col-md-6 col-lg-4\">\n <p class=\"mb-2\">\n {{ field.Label + (field.Required ? \" *\" : \"\")}}\n <br>\n Nome immagine: {{ field.ImgName}}\n </p>\n <eqp-img-drawing\n *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\n [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\" [width]=\"width\"\n [height]=\"height\" [i18n]=\"i18n\" [showCancelButton]=\"true\" (save)=\"saveDrowning($event)\"\n (cancel)=\"resetPreLoadedImage()\">\n </eqp-img-drawing>\n\n <img *ngIf=\"!field.EnableDrawing\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType+ ';base64,'+ record[field.Name][0].FileDataBase64\">\n </div>\n\n <div class=\"col-sm-12 col-md-6 col-lg-8\">\n <div class=\"row\"\n *ngIf=\"field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup\">\n <div class=\"mt-2\" *ngFor=\"let metadata of field.AttachDefinition.MetadataFields\"\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\n <dynamic-module-field #fieldTemplate [field]=\"metadata\" [form]=\"preLoadedImageMetadataFormGroup\"\n [record]=\"record[field.Name][0]\" (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n </div>\n </div>\n </div>\n</div>\n\n<!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI -->\n<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\" [onlyImages]=\"true\"\n (onAttachmentsChange)=\"onAttachmentsChange()\" *ngIf=\"!field.ImageIsContextualAttachment\">\n</attachment-field-template>\n\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\n<ng-template #dialogImageDrowing>\n <div *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\n class=\"row\">\n <div class=\"col-sm-12 col-md-12\">\n <eqp-img-drawing [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\n [i18n]=\"i18n\" [showCancelButton]=\"false\" (save)=\"saveDrowning($event)\">\n </eqp-img-drawing>\n </div>\n </div>\n <div class=\"row mt-2 mb-1\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"btn mat-raised-button\" (click)=\"closeImageDrowingDialog()\" type=\"button\">\n Annulla disegno\n </button>\n </div>\n </div>\n</ng-template>",
3173
+ template: "<!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA' DI DISEGNO -->\r\n<div class=\"row\" *ngIf=\"field.ImageIsContextualAttachment && field.ContextualAttachment\">\r\n <div class=\"col-sm-12 col-md-6 col-lg-4\">\r\n <p class=\"mb-2\">\r\n {{ field.Label + (field.Required ? \" *\" : \"\")}}\r\n <br>\r\n Nome immagine: {{ field.ImgName}}\r\n </p>\r\n <eqp-img-drawing\r\n *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\r\n [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\" [width]=\"width\"\r\n [height]=\"height\" [i18n]=\"i18n\" [showCancelButton]=\"true\" (save)=\"saveDrowning($event)\"\r\n (cancel)=\"resetPreLoadedImage()\">\r\n </eqp-img-drawing>\r\n\r\n <img *ngIf=\"!field.EnableDrawing\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType+ ';base64,'+ record[field.Name][0].FileDataBase64\">\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-6 col-lg-8\">\r\n <div class=\"row\"\r\n *ngIf=\"field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup\">\r\n <div class=\"mt-2\" *ngFor=\"let metadata of field.AttachDefinition.MetadataFields\"\r\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\r\n <dynamic-module-field #fieldTemplate [field]=\"metadata\" [form]=\"preLoadedImageMetadataFormGroup\"\r\n [record]=\"record[field.Name][0]\" (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI -->\r\n<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\" [onlyImages]=\"true\"\r\n (onAttachmentsChange)=\"onAttachmentsChange()\" *ngIf=\"!field.ImageIsContextualAttachment\">\r\n</attachment-field-template>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrowing>\r\n <div *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\r\n class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <eqp-img-drawing [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\r\n [i18n]=\"i18n\" [showCancelButton]=\"false\" (save)=\"saveDrowning($event)\">\r\n </eqp-img-drawing>\r\n </div>\r\n </div>\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn mat-raised-button\" (click)=\"closeImageDrowingDialog()\" type=\"button\">\r\n Annulla disegno\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>",
2526
3174
  styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
2527
3175
  })
2528
3176
  ], ImageFieldTemplateComponent);
@@ -2604,30 +3252,14 @@ var ListFormRecordComponent = /** @class */ (function () {
2604
3252
  * @param record Record da duplicare.
2605
3253
  */
2606
3254
  ListFormRecordComponent.prototype.duplicateRecord = function (record) {
2607
- // EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
2608
- // var copiedRecord: Record = JSON.parse(JSON.stringify(record));
2609
- // if (!isNaN(parseInt(copiedRecord.ID))) {
2610
- // copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2611
- // } else {
2612
- // copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
2613
- // }
2614
- // this.values.push(copiedRecord);
2615
- // this.reloadTables();
2616
- // }, false, 'Richiesta conferma');
2617
3255
  this.onDuplicateRecord.emit(record);
2618
- //TODO
2619
3256
  };
2620
3257
  /**
2621
3258
  * Metodo per eliminare un record dalla lista.
2622
3259
  * @param record Record da eliminare selezionato sulla eqp-table.
2623
3260
  */
2624
3261
  ListFormRecordComponent.prototype.deleteRecord = function (record) {
2625
- // EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
2626
- // this.values.splice(this.values.indexOf(record), 1);
2627
- // this.reloadTables();
2628
- // }, false, 'Richiesta conferma');
2629
3262
  this.onDeleteRecord.emit(record);
2630
- // TODO
2631
3263
  };
2632
3264
  /**
2633
3265
  * Metodo per creare la configurazione delle colonne per la eqp-table.
@@ -2670,7 +3302,7 @@ var ListFormRecordComponent = /** @class */ (function () {
2670
3302
  column.format = "dd/MM/yyyy HH:mm";
2671
3303
  }
2672
3304
  else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
2673
- column.format = "dd/MM/yyyy";
3305
+ column.format = field.DateFormat ? field.DateFormat.replace("DD", "dd") : "dd/MM/yyyy";
2674
3306
  }
2675
3307
  }
2676
3308
  break;
@@ -2758,12 +3390,6 @@ var ListFormRecordComponent = /** @class */ (function () {
2758
3390
  return ListFormRecordComponent;
2759
3391
  }());
2760
3392
 
2761
- var Record = /** @class */ (function () {
2762
- function Record() {
2763
- }
2764
- return Record;
2765
- }());
2766
-
2767
3393
  var AddFormRecordComponent = /** @class */ (function () {
2768
3394
  function AddFormRecordComponent(cdr, utilityService) {
2769
3395
  this.cdr = cdr;
@@ -2883,7 +3509,7 @@ var AddFormRecordComponent = /** @class */ (function () {
2883
3509
  AddFormRecordComponent = __decorate([
2884
3510
  Component({
2885
3511
  selector: 'add-form-record',
2886
- template: "<div class=\"row eqp-dynamic-module-title\" *ngIf=\"showTitle\">\n <div class=\"col-md-12\">\n <h4><b>{{form.Name}}</b></h4>\n </div>\n</div>\n\n<form [formGroup]=\"formForm\">\n\n <!-- VISUALIZZAZIONE SEMPLICE -->\n <ng-container *ngIf=\"form.FormScalarType == FormScalarTypeEnum.Semplice\" [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: form.Fields }\">\n </ng-container>\n\n <!-- VISUALIZZAZIONE A STEPPER -->\n <mat-horizontal-stepper linear *ngIf=\"form.FormScalarType == FormScalarTypeEnum['A step']\">\n <mat-step *ngFor=\"let group of form.FormFieldsGroups\">\n <ng-template matStepLabel>\n {{group.Name}}\n </ng-template>\n\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </mat-step>\n </mat-horizontal-stepper>\n\n <!-- VISUALIZZAZIONE A TAB -->\n <mat-tab-group *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In tab']\">\n <mat-tab *ngFor=\"let group of form.FormFieldsGroups\" [label]=\"group.Name\">\n <div class=\"mt-3\">\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <!-- VISUALIZZAZIONE AD ACCORDION -->\n <mat-accordion multi *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In accordion']\">\n <mat-expansion-panel *ngFor=\"let group of form.FormFieldsGroups\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n {{group.Name}}\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </mat-expansion-panel>\n </mat-accordion>\n</form>\n\n<div class=\"row mt-2\" *ngIf=\"showButtons\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"mr-2\" mat-raised-button (click)=\"saveOrExitForm(true)\" type=\"button\">\n Annulla\n </button>\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveOrExitForm(false)\"\n [disabled]=\"formForm.invalid || formForm.disabled\" type=\"button\">\n Salva\n </button>\n </div>\n</div>\n\n<!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM -->\n<ng-template #fieldTemplates let-fields='fields'>\n <div class=\"row\">\n <div class=\"mt-2\" *ngFor=\"let field of fields\" [ngClass]=\"utilityService.getFieldSyleClass(field)\">\n <dynamic-module-field #fieldTemplate [field]=\"field\" [form]=\"form\" [record]=\"record\"\n (recordChange)=\"onRecordChange()\"></dynamic-module-field>\n </div>\n </div>\n</ng-template>",
3512
+ template: "<div class=\"row eqp-dynamic-module-title\" *ngIf=\"showTitle\">\r\n <div class=\"col-md-12\">\r\n <h4><b>{{form.Name}}</b></h4>\r\n </div>\r\n</div>\r\n\r\n<form [formGroup]=\"formForm\">\r\n\r\n <!-- VISUALIZZAZIONE SEMPLICE -->\r\n <ng-container *ngIf=\"form.FormScalarType == FormScalarTypeEnum.Semplice\" [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: form.Fields }\">\r\n </ng-container>\r\n\r\n <!-- VISUALIZZAZIONE A STEPPER -->\r\n <mat-horizontal-stepper linear *ngIf=\"form.FormScalarType == FormScalarTypeEnum['A step']\">\r\n <mat-step *ngFor=\"let group of form.FormFieldsGroups\">\r\n <ng-template matStepLabel>\r\n {{group.Name}}\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </mat-step>\r\n </mat-horizontal-stepper>\r\n\r\n <!-- VISUALIZZAZIONE A TAB -->\r\n <mat-tab-group *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In tab']\">\r\n <mat-tab *ngFor=\"let group of form.FormFieldsGroups\" [label]=\"group.Name\">\r\n <div class=\"mt-3\">\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </div>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n <!-- VISUALIZZAZIONE AD ACCORDION -->\r\n <mat-accordion multi *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In accordion']\">\r\n <mat-expansion-panel *ngFor=\"let group of form.FormFieldsGroups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{group.Name}}\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n</form>\r\n\r\n<div class=\"row mt-2\" *ngIf=\"showButtons\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button (click)=\"saveOrExitForm(true)\" type=\"button\">\r\n Annulla\r\n </button>\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveOrExitForm(false)\"\r\n [disabled]=\"formForm.invalid || formForm.disabled\" type=\"button\">\r\n Salva\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM -->\r\n<ng-template #fieldTemplates let-fields='fields'>\r\n <div class=\"row\">\r\n <div class=\"mt-2\" *ngFor=\"let field of fields\" [ngClass]=\"utilityService.getFieldSyleClass(field)\">\r\n <dynamic-module-field #fieldTemplate [field]=\"field\" [form]=\"form\" [record]=\"record\"\r\n (recordChange)=\"onRecordChange()\"></dynamic-module-field>\r\n </div>\r\n </div>\r\n</ng-template>",
2887
3513
  styles: [""]
2888
3514
  })
2889
3515
  ], AddFormRecordComponent);
@@ -3005,13 +3631,33 @@ var DynamicModuleFieldComponent = /** @class */ (function () {
3005
3631
  DynamicModuleFieldComponent = __decorate([
3006
3632
  Component({
3007
3633
  selector: 'dynamic-module-field',
3008
- template: "<text-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo di testo']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</text-field-template>\n\n<textarea-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Area di testo']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</textarea-field-template>\n\n<boolean-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Booleano']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</boolean-field-template>\n\n<date-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Data e/o ora']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</date-field-template>\n\n<numeric-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo numerico']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</numeric-field-template>\n\n<list-value-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Elenco generico']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</list-value-field-template>\n\n<attachment-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Allegato']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</attachment-field-template>\n\n<image-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Immagine']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</image-field-template>\n\n<list-form-record #listInnerFormRecords *ngIf=\"field.FieldType == FieldTypeEnum['Form di dettaglio']\"\n [form]=\"getInnerFormFromField(field)\" [values]=\"record[field.Name]\"\n (onAddViewEditRecord)=\"onAddViewEditInnerFormRecord($event, field)\">\n</list-form-record>\n\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO -->\n<ng-template #dialogInnerFormRecord>\n <add-form-record [form]=\"selectedInnerForm\" [record]=\"selectedInnerFormRecord\" [onlyView]=\"onlyViewInnerFormRecord\"\n (saveRecordEvent)=\"onSaveInnerFormRecord($event)\"></add-form-record>\n</ng-template>",
3634
+ template: "<text-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</text-field-template>\r\n\r\n<textarea-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</textarea-field-template>\r\n\r\n<boolean-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Booleano']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</boolean-field-template>\r\n\r\n<date-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</date-field-template>\r\n\r\n<numeric-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</numeric-field-template>\r\n\r\n<list-value-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Elenco generico']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</list-value-field-template>\r\n\r\n<attachment-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Allegato']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</attachment-field-template>\r\n\r\n<image-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Immagine']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</image-field-template>\r\n\r\n<list-form-record #listInnerFormRecords *ngIf=\"field.FieldType == FieldTypeEnum['Form di dettaglio']\"\r\n [form]=\"getInnerFormFromField(field)\" [values]=\"record[field.Name]\"\r\n (onAddViewEditRecord)=\"onAddViewEditInnerFormRecord($event, field)\">\r\n</list-form-record>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO -->\r\n<ng-template #dialogInnerFormRecord>\r\n <add-form-record [form]=\"selectedInnerForm\" [record]=\"selectedInnerFormRecord\" [onlyView]=\"onlyViewInnerFormRecord\"\r\n (saveRecordEvent)=\"onSaveInnerFormRecord($event)\"></add-form-record>\r\n</ng-template>",
3009
3635
  styles: [""]
3010
3636
  })
3011
3637
  ], DynamicModuleFieldComponent);
3012
3638
  return DynamicModuleFieldComponent;
3013
3639
  }());
3014
3640
 
3641
+ var SpinnerComponent = /** @class */ (function () {
3642
+ function SpinnerComponent(spinnerService) {
3643
+ this.spinnerService = spinnerService;
3644
+ this.isLoading = this.spinnerService.isLoading;
3645
+ }
3646
+ SpinnerComponent.prototype.ngOnInit = function () {
3647
+ };
3648
+ SpinnerComponent.ctorParameters = function () { return [
3649
+ { type: SpinnerService }
3650
+ ]; };
3651
+ SpinnerComponent = __decorate([
3652
+ Component({
3653
+ selector: 'eqp-dynamic-module-spinner',
3654
+ template: "<div class=\"eqp-splash-screen\" *ngIf=\"isLoading | async\">\r\n <div id=\"loader\"></div>\r\n</div>",
3655
+ styles: [":host #loader{display:block;position:relative;width:150px;height:150px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:2s linear infinite spin;animation:2s linear infinite spin}:host #loader:before{content:\"\";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:3s linear infinite spin;animation:3s linear infinite spin}:host #loader:after{content:\"\";position:absolute;top:15px;left:15px;right:15px;bottom:15px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:1.5s linear infinite spin;animation:1.5s linear infinite spin}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}:host .eqp-splash-screen{background-color:#343a4040;position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;z-index:9999}:host .eqp-splash-screen img{margin-left:calc(100vw - 100%);width:90px;margin-bottom:30px}:host .eqp-splash-screen span{margin-left:calc(100vw - 100%);margin-bottom:30px}:host .eqp-splash-screen ::ng-deep .mat-progress-spinner circle,:host .eqp-splash-screen ::ng-deep .mat-spinner circle{stroke:#5d78ff}"]
3656
+ })
3657
+ ], SpinnerComponent);
3658
+ return SpinnerComponent;
3659
+ }());
3660
+
3015
3661
  var EqpDynamicModuleModule = /** @class */ (function () {
3016
3662
  function EqpDynamicModuleModule() {
3017
3663
  }
@@ -3032,6 +3678,7 @@ var EqpDynamicModuleModule = /** @class */ (function () {
3032
3678
  ListFormRecordComponent,
3033
3679
  AddFormRecordComponent,
3034
3680
  DynamicModuleFieldComponent,
3681
+ SpinnerComponent,
3035
3682
  ],
3036
3683
  imports: [
3037
3684
  BrowserModule,
@@ -3109,15 +3756,6 @@ var TextareaField = /** @class */ (function (_super) {
3109
3756
  return TextareaField;
3110
3757
  }(BaseField));
3111
3758
 
3112
- /**Campo di testo */
3113
- var TextField = /** @class */ (function (_super) {
3114
- __extends(TextField, _super);
3115
- function TextField() {
3116
- return _super !== null && _super.apply(this, arguments) || this;
3117
- }
3118
- return TextField;
3119
- }(BaseField));
3120
-
3121
3759
  /*
3122
3760
  * Public API Surface of eqp-dynamic-module
3123
3761
  */
@@ -3126,5 +3764,5 @@ var TextField = /** @class */ (function (_super) {
3126
3764
  * Generated bundle index. Do not edit.
3127
3765
  */
3128
3766
 
3129
- export { ActionOnRecord, AddFormFieldComponent, AddFormRecordComponent, ArrayValidators, AttachmentField, AttachmentFieldTemplateComponent, AvailableFileExtensions, AvailableImageExtensions, BaseField, BaseObj, BoolPresentantioEnum, BooleanField, BooleanFieldTemplateComponent, ColSpanSizesEnum, Context, ContextUser, DateField, DateFieldTemplateComponent, DateTimeTypeEnum, DynamicModuleFieldComponent, Entity, EqpDynamicModuleComponent, EqpDynamicModuleConfiguratorComponent, EqpDynamicModuleDialogService, EqpDynamicModuleModule, FieldTypeEnum, Form, FormFieldGroup, FormScalarTypeEnum, FormTypeEnum, ImageField, ImageFieldTemplateComponent, ListFormRecordComponent, ListPresentationEnum, ListValueField, ListValueFieldTemplateComponent, LookupField, NumericField, NumericFieldTemplateComponent, Record, TextField, TextFieldTemplateComponent, TextareaField, TextareaFieldTemplateComponent, UtilityHelperService, ɵ0, MaterialModule as ɵa };
3767
+ export { ActionOnRecord, AddFormFieldComponent, AddFormRecordComponent, ArrayValidators, AttachmentField, AttachmentFieldTemplateComponent, AvailableFileExtensions, AvailableImageExtensions, BaseField, BaseObj, BoolPresentantioEnum, BooleanField, BooleanFieldTemplateComponent, ButtonImage, ColSpanSizesEnum, Context, ContextUser, DateField, DateFieldTemplateComponent, DateTimeTypeEnum, DynRecord, DynamicModuleFieldComponent, EndPointConfiguration, EndPointData, EndPointDataParams, Entity, EqpDynamicModuleComponent, EqpDynamicModuleConfiguratorComponent, EqpDynamicModuleDialogService, EqpDynamicModuleModule, FieldTypeEnum, Form, FormFieldGroup, FormScalarTypeEnum, FormTypeEnum, ImageField, ImageFieldTemplateComponent, ListFormRecordComponent, ListPresentationEnum, ListValueField, ListValueFieldTemplateComponent, LookupField, NumericField, NumericFieldTemplateComponent, ParamTypeEnum, Record, RequestMethodEnum, SpinnerService, TelRegex, TextField, TextFieldTemplateComponent, TextMaskEnum, TextareaField, TextareaFieldTemplateComponent, UrlRegex, UtilityHelperService, ɵ0, SpinnerComponent as ɵa, MaterialModule as ɵb };
3130
3768
  //# sourceMappingURL=eqproject-eqp-dynamic-module.js.map