@eqproject/eqp-dynamic-module 0.0.3 → 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 (90) hide show
  1. package/README.md +43 -24
  2. package/bundles/eqproject-eqp-dynamic-module.umd.js +1166 -334
  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 +107 -16
  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 +10 -21
  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 +148 -6
  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 +6 -2
  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/imageField.model.js +5 -1
  28. package/esm2015/lib/models/fields/listValueField.model.js +3 -1
  29. package/esm2015/lib/models/fields/numericField.model.js +1 -1
  30. package/esm2015/lib/models/fields/textField.model.js +10 -1
  31. package/esm2015/lib/models/form.model.js +1 -1
  32. package/esm2015/lib/models/record.model.js +6 -1
  33. package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +10 -1
  34. package/esm2015/lib/services/spinner.service.js +43 -0
  35. package/esm2015/lib/services/utilityHelper.services.js +180 -13
  36. package/esm2015/public-api.js +3 -1
  37. package/esm5/eqproject-eqp-dynamic-module.js +3 -2
  38. package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +204 -22
  39. package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +126 -8
  40. package/esm5/lib/components/private/add-form-field/add-form-field.component.js +107 -16
  41. package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
  42. package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +10 -21
  43. package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
  44. package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
  45. package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +157 -6
  46. package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +22 -24
  47. package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
  48. package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
  49. package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
  50. package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
  51. package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
  52. package/esm5/lib/components/private/spinner/spinner.component.js +24 -0
  53. package/esm5/lib/eqp-dynamic-module.module.js +6 -2
  54. package/esm5/lib/models/endPointConfiguration.model.js +33 -0
  55. package/esm5/lib/models/fields/dateField.model.js +1 -1
  56. package/esm5/lib/models/fields/imageField.model.js +9 -1
  57. package/esm5/lib/models/fields/listValueField.model.js +7 -1
  58. package/esm5/lib/models/fields/numericField.model.js +1 -1
  59. package/esm5/lib/models/fields/textField.model.js +10 -1
  60. package/esm5/lib/models/form.model.js +1 -1
  61. package/esm5/lib/models/record.model.js +8 -1
  62. package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +11 -1
  63. package/esm5/lib/services/spinner.service.js +46 -0
  64. package/esm5/lib/services/utilityHelper.services.js +182 -11
  65. package/esm5/public-api.js +3 -1
  66. package/fesm2015/eqproject-eqp-dynamic-module.js +1021 -239
  67. package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
  68. package/fesm5/eqproject-eqp-dynamic-module.js +1160 -335
  69. package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
  70. package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +78 -4
  71. package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +51 -2
  72. package/lib/components/private/add-form-field/add-form-field.component.d.ts +42 -3
  73. package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +1 -17
  74. package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +51 -2
  75. package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +3 -11
  76. package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +3 -1
  77. package/lib/components/private/spinner/spinner.component.d.ts +9 -0
  78. package/lib/models/endPointConfiguration.model.d.ts +35 -0
  79. package/lib/models/fields/dateField.model.d.ts +1 -0
  80. package/lib/models/fields/imageField.model.d.ts +10 -4
  81. package/lib/models/fields/listValueField.model.d.ts +17 -0
  82. package/lib/models/fields/numericField.model.d.ts +3 -1
  83. package/lib/models/fields/textField.model.d.ts +9 -1
  84. package/lib/models/form.model.d.ts +1 -0
  85. package/lib/models/record.model.d.ts +8 -0
  86. package/lib/services/eqp-dynamic-module-dialog.service.d.ts +6 -0
  87. package/lib/services/spinner.service.d.ts +15 -0
  88. package/lib/services/utilityHelper.services.d.ts +30 -1
  89. package/package.json +5 -3
  90. package/public-api.d.ts +2 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material/checkbox'), require('@angular/material/button'), require('@angular/material/input'), require('@angular/material/autocomplete'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/radio'), require('@angular/material/select'), require('@angular/material/slider'), require('@angular/material/slide-toggle'), require('@angular/material/menu'), require('@angular/material/sidenav'), require('@angular/material/toolbar'), require('@angular/material/list'), require('@angular/material/grid-list'), require('@angular/material/card'), require('@angular/material/stepper'), require('@angular/material/tabs'), require('@angular/material/expansion'), require('@angular/material/button-toggle'), require('@angular/material/chips'), require('@angular/material/icon'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/dialog'), require('@angular/material/tooltip'), require('@angular/material/snack-bar'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/core'), require('@eqproject/eqp-table'), require('@eqproject/eqp-attachments'), require('@eqproject/eqp-select'), require('@eqproject/eqp-datetimepicker'), require('@eqproject/eqp-filters'), require('@eqproject/eqp-numeric'), require('sweetalert2'), require('@angular/platform-browser')) :
3
- typeof define === 'function' && define.amd ? define('@eqproject/eqp-dynamic-module', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material/checkbox', '@angular/material/button', '@angular/material/input', '@angular/material/autocomplete', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/radio', '@angular/material/select', '@angular/material/slider', '@angular/material/slide-toggle', '@angular/material/menu', '@angular/material/sidenav', '@angular/material/toolbar', '@angular/material/list', '@angular/material/grid-list', '@angular/material/card', '@angular/material/stepper', '@angular/material/tabs', '@angular/material/expansion', '@angular/material/button-toggle', '@angular/material/chips', '@angular/material/icon', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/dialog', '@angular/material/tooltip', '@angular/material/snack-bar', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/core', '@eqproject/eqp-table', '@eqproject/eqp-attachments', '@eqproject/eqp-select', '@eqproject/eqp-datetimepicker', '@eqproject/eqp-filters', '@eqproject/eqp-numeric', 'sweetalert2', '@angular/platform-browser'], factory) :
4
- (global = global || self, factory((global.eqproject = global.eqproject || {}, global.eqproject['eqp-dynamic-module'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material.checkbox, global.ng.material.button, global.ng.material.input, global.ng.material.autocomplete, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.radio, global.ng.material.select, global.ng.material.slider, global.ng.material.slideToggle, global.ng.material.menu, global.ng.material.sidenav, global.ng.material.toolbar, global.ng.material.list, global.ng.material.gridList, global.ng.material.card, global.ng.material.stepper, global.ng.material.tabs, global.ng.material.expansion, global.ng.material.buttonToggle, global.ng.material.chips, global.ng.material.icon, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.dialog, global.ng.material.tooltip, global.ng.material.snackBar, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.core, global.eqpTable, global.eqpAttachments, global.eqpSelect, global.eqpDatetimepicker, global.eqpFilters, global.eqpNumeric, global.Swal, global.ng.platformBrowser));
5
- }(this, (function (exports, common, core, forms, checkbox, button, input, autocomplete, datepicker, formField, radio, select, slider, slideToggle, menu, sidenav, toolbar, list, gridList, card, stepper, tabs, expansion, buttonToggle, chips, icon, progressSpinner, progressBar, dialog, tooltip, snackBar, table, sort, paginator, core$1, eqpTable, eqpAttachments, eqpSelect, eqpDatetimepicker, eqpFilters, eqpNumeric, Swal, platformBrowser) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('sweetalert2'), require('@angular/common/http'), require('rxjs'), require('@angular/material/checkbox'), require('@angular/material/button'), require('@angular/material/input'), require('@angular/material/autocomplete'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/radio'), require('@angular/material/select'), require('@angular/material/slider'), require('@angular/material/slide-toggle'), require('@angular/material/menu'), require('@angular/material/sidenav'), require('@angular/material/toolbar'), require('@angular/material/list'), require('@angular/material/grid-list'), require('@angular/material/card'), require('@angular/material/stepper'), require('@angular/material/tabs'), require('@angular/material/expansion'), require('@angular/material/button-toggle'), require('@angular/material/chips'), require('@angular/material/icon'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/dialog'), require('@angular/material/tooltip'), require('@angular/material/snack-bar'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/core'), require('@eqproject/eqp-table'), require('@eqproject/eqp-attachments'), require('@eqproject/eqp-select'), require('@eqproject/eqp-datetimepicker'), require('@eqproject/eqp-img-drawing'), require('@eqproject/eqp-filters'), require('@eqproject/eqp-numeric'), require('@angular/platform-browser')) :
3
+ typeof define === 'function' && define.amd ? define('@eqproject/eqp-dynamic-module', ['exports', '@angular/common', '@angular/core', '@angular/forms', 'sweetalert2', '@angular/common/http', 'rxjs', '@angular/material/checkbox', '@angular/material/button', '@angular/material/input', '@angular/material/autocomplete', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/radio', '@angular/material/select', '@angular/material/slider', '@angular/material/slide-toggle', '@angular/material/menu', '@angular/material/sidenav', '@angular/material/toolbar', '@angular/material/list', '@angular/material/grid-list', '@angular/material/card', '@angular/material/stepper', '@angular/material/tabs', '@angular/material/expansion', '@angular/material/button-toggle', '@angular/material/chips', '@angular/material/icon', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/dialog', '@angular/material/tooltip', '@angular/material/snack-bar', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/core', '@eqproject/eqp-table', '@eqproject/eqp-attachments', '@eqproject/eqp-select', '@eqproject/eqp-datetimepicker', '@eqproject/eqp-img-drawing', '@eqproject/eqp-filters', '@eqproject/eqp-numeric', '@angular/platform-browser'], factory) :
4
+ (global = global || self, factory((global.eqproject = global.eqproject || {}, global.eqproject['eqp-dynamic-module'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.Swal, global.ng.common.http, global.rxjs, global.ng.material.checkbox, global.ng.material.button, global.ng.material.input, global.ng.material.autocomplete, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.radio, global.ng.material.select, global.ng.material.slider, global.ng.material.slideToggle, global.ng.material.menu, global.ng.material.sidenav, global.ng.material.toolbar, global.ng.material.list, global.ng.material.gridList, global.ng.material.card, global.ng.material.stepper, global.ng.material.tabs, global.ng.material.expansion, global.ng.material.buttonToggle, global.ng.material.chips, global.ng.material.icon, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.dialog, global.ng.material.tooltip, global.ng.material.snackBar, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.core, global.eqpTable, global.eqpAttachments, global.eqpSelect, global.eqpDatetimepicker, global.eqpImgDrawing, global.eqpFilters, global.eqpNumeric, global.ng.platformBrowser));
5
+ }(this, (function (exports, common, core, forms, Swal, http, rxjs, checkbox, button, input, autocomplete, datepicker, formField, radio, select, slider, slideToggle, menu, sidenav, toolbar, list, gridList, card, stepper, tabs, expansion, buttonToggle, chips, icon, progressSpinner, progressBar, dialog, tooltip, snackBar, table, sort, paginator, core$1, eqpTable, eqpAttachments, eqpSelect, eqpDatetimepicker, eqpImgDrawing, eqpFilters, eqpNumeric, platformBrowser) { 'use strict';
6
6
 
7
7
  Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
8
 
@@ -237,6 +237,36 @@
237
237
  return ContextUser;
238
238
  }());
239
239
 
240
+ var EndPointConfiguration = /** @class */ (function () {
241
+ function EndPointConfiguration() {
242
+ }
243
+ return EndPointConfiguration;
244
+ }());
245
+ var EndPointData = /** @class */ (function () {
246
+ function EndPointData() {
247
+ }
248
+ return EndPointData;
249
+ }());
250
+ var EndPointDataParams = /** @class */ (function () {
251
+ function EndPointDataParams() {
252
+ this.ParamValue = null;
253
+ }
254
+ return EndPointDataParams;
255
+ }());
256
+
257
+ (function (ParamTypeEnum) {
258
+ ParamTypeEnum[ParamTypeEnum["Query param"] = 1] = "Query param";
259
+ ParamTypeEnum[ParamTypeEnum["In route"] = 2] = "In route";
260
+ ParamTypeEnum[ParamTypeEnum["In Body"] = 3] = "In Body";
261
+ })(exports.ParamTypeEnum || (exports.ParamTypeEnum = {}));
262
+
263
+ (function (RequestMethodEnum) {
264
+ RequestMethodEnum["GET"] = "GET";
265
+ RequestMethodEnum["POST"] = "POST";
266
+ RequestMethodEnum["PUT"] = "PUT";
267
+ RequestMethodEnum["DELETE"] = "DELETE";
268
+ })(exports.RequestMethodEnum || (exports.RequestMethodEnum = {}));
269
+
240
270
  /**
241
271
  * Classe base che implementa la valorizzazione dell'ID (se null) con una nuova GUID
242
272
  * in creazione dell'oggetto.
@@ -283,6 +313,136 @@
283
313
  FormScalarTypeEnum[FormScalarTypeEnum["In accordion"] = 4] = "In accordion"; //GROUPED_BY_ACCORDION
284
314
  })(exports.FormScalarTypeEnum || (exports.FormScalarTypeEnum = {}));
285
315
 
316
+ var Record = /** @class */ (function () {
317
+ function Record() {
318
+ }
319
+ return Record;
320
+ }());
321
+ var DynRecord = /** @class */ (function () {
322
+ function DynRecord() {
323
+ this.Values = {};
324
+ }
325
+ return DynRecord;
326
+ }());
327
+
328
+ var EqpDynamicModuleDialogService = /** @class */ (function () {
329
+ function EqpDynamicModuleDialogService() {
330
+ }
331
+ /**
332
+ * Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
333
+ * @param message Messaggio da mostrare nello sweetalert
334
+ * @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
335
+ */
336
+ EqpDynamicModuleDialogService.Success = function (message, title) {
337
+ if (title === void 0) { title = null; }
338
+ var currentTitle = title != null ? title : 'Operazione completata con successo.';
339
+ Swal.fire(currentTitle, message, 'success');
340
+ };
341
+ /**
342
+ * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
343
+ * @param message Messaggio d'errore da mostrare nello sweetalert
344
+ * @param title Titolo dello sweetalert (di default mostra 'Errore')
345
+ */
346
+ EqpDynamicModuleDialogService.Error = function (message, title) {
347
+ if (title === void 0) { title = null; }
348
+ var currentTitle = title != null ? title : 'Errore';
349
+ if (Array.isArray(message)) {
350
+ currentTitle = title != null ? title : 'Errore';
351
+ var htmlErrors = message.join("<br>");
352
+ Swal.fire({
353
+ title: currentTitle,
354
+ html: htmlErrors,
355
+ icon: 'error'
356
+ });
357
+ }
358
+ else {
359
+ Swal.fire(currentTitle, message, 'error');
360
+ }
361
+ };
362
+ /**
363
+ * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
364
+ * CONFERMA lancia la funzione di callback passata come parametro
365
+ * @param message Messaggio da mostrare nello sweetalert
366
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
367
+ */
368
+ EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
369
+ if (isWarning === void 0) { isWarning = false; }
370
+ if (title === void 0) { title = null; }
371
+ if (customWidth === void 0) { customWidth = null; }
372
+ var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
373
+ if (Array.isArray(message)) {
374
+ var htmlErrors = message.join("<br>");
375
+ Swal.fire({
376
+ title: currentTitle,
377
+ html: htmlErrors,
378
+ width: customWidth ? customWidth : '32rem',
379
+ icon: !isWarning ? 'question' : 'warning',
380
+ showCancelButton: true,
381
+ allowOutsideClick: false,
382
+ allowEscapeKey: false
383
+ }).then(function (result) {
384
+ if (result.value && confirmCallback) {
385
+ confirmCallback();
386
+ }
387
+ });
388
+ }
389
+ else {
390
+ Swal.fire({
391
+ title: currentTitle,
392
+ text: message,
393
+ width: customWidth ? customWidth : '32rem',
394
+ icon: !isWarning ? 'question' : 'warning',
395
+ showCancelButton: true,
396
+ allowOutsideClick: false,
397
+ allowEscapeKey: false
398
+ }).then(function (result) {
399
+ if (result.value && confirmCallback) {
400
+ confirmCallback();
401
+ }
402
+ });
403
+ }
404
+ };
405
+ /**
406
+ * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
407
+ * @param message Messaggio da mostrare nello sweetalert
408
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
409
+ */
410
+ EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
411
+ if (title === void 0) { title = null; }
412
+ if (isToast === void 0) { isToast = null; }
413
+ var currentTitle = title != null ? title : "Informazione:";
414
+ Swal.fire(currentTitle, message, 'info');
415
+ };
416
+ /**
417
+ * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
418
+ * @param message Messaggio da mostrare nello sweetalert
419
+ * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
420
+ */
421
+ EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
422
+ if (title === void 0) { title = null; }
423
+ if (isToast === void 0) { isToast = null; }
424
+ var currentTitle = title != null ? title : "Attenzione!";
425
+ if (Array.isArray(message)) {
426
+ var htmlWarnings = message.join("<br>");
427
+ Swal.fire({
428
+ title: currentTitle,
429
+ html: htmlWarnings,
430
+ icon: 'warning'
431
+ });
432
+ }
433
+ else {
434
+ Swal.fire(currentTitle, message, 'warning');
435
+ }
436
+ };
437
+ EqpDynamicModuleDialogService.ɵprov = core.ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
438
+ EqpDynamicModuleDialogService = __decorate([
439
+ core.Injectable({
440
+ providedIn: 'root'
441
+ })
442
+ ], EqpDynamicModuleDialogService);
443
+ return EqpDynamicModuleDialogService;
444
+ }());
445
+
286
446
  /**
287
447
  * Contiene le informazioni di base del campo, indipendentemente dal tipo.
288
448
  * Questa classe è volutamente astratta perché il tipo di campo è dettato dal tipo
@@ -323,6 +483,24 @@
323
483
  ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"] = 12] = "col-lg-12";
324
484
  })(exports.ColSpanSizesEnum || (exports.ColSpanSizesEnum = {}));
325
485
 
486
+ /**Campo di testo */
487
+ var TextField = /** @class */ (function (_super) {
488
+ __extends(TextField, _super);
489
+ function TextField() {
490
+ return _super !== null && _super.apply(this, arguments) || this;
491
+ }
492
+ return TextField;
493
+ }(BaseField));
494
+
495
+ (function (TextMaskEnum) {
496
+ TextMaskEnum[TextMaskEnum["Password"] = 1] = "Password";
497
+ TextMaskEnum[TextMaskEnum["Email"] = 2] = "Email";
498
+ TextMaskEnum[TextMaskEnum["Telefono"] = 3] = "Telefono";
499
+ TextMaskEnum[TextMaskEnum["Url"] = 4] = "Url";
500
+ })(exports.TextMaskEnum || (exports.TextMaskEnum = {}));
501
+ var UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
502
+ var TelRegex = '([+]?[0-9]{10,14})';
503
+
326
504
  var ArrayValidators = /** @class */ (function () {
327
505
  function ArrayValidators() {
328
506
  }
@@ -345,18 +523,73 @@
345
523
  return ArrayValidators;
346
524
  }());
347
525
 
526
+ var SpinnerService = /** @class */ (function () {
527
+ function SpinnerService() {
528
+ this.isLoading = new rxjs.Subject();
529
+ this.requestsCount = 0;
530
+ }
531
+ /**
532
+ * Mostra lo spinner
533
+ */
534
+ SpinnerService.prototype.show = function () {
535
+ var _this = this;
536
+ setTimeout(function () {
537
+ _this.isLoading.next(true);
538
+ }, 100);
539
+ };
540
+ /**
541
+ * Nasconde lo spinner
542
+ */
543
+ SpinnerService.prototype.hide = function () {
544
+ var _this = this;
545
+ setTimeout(function () {
546
+ _this.isLoading.next(false);
547
+ }, 100);
548
+ };
549
+ SpinnerService.prototype.addRequestCounter = function () {
550
+ this.requestsCount++;
551
+ this.show();
552
+ };
553
+ SpinnerService.prototype.removeRequestCounter = function () {
554
+ this.requestsCount--;
555
+ if (this.requestsCount == 0)
556
+ this.hide();
557
+ };
558
+ SpinnerService.ɵprov = core.ɵɵdefineInjectable({ factory: function SpinnerService_Factory() { return new SpinnerService(); }, token: SpinnerService, providedIn: "root" });
559
+ SpinnerService = __decorate([
560
+ core.Injectable({
561
+ providedIn: 'root'
562
+ })
563
+ ], SpinnerService);
564
+ return SpinnerService;
565
+ }());
566
+
348
567
  var UtilityHelperService = /** @class */ (function () {
349
- function UtilityHelperService(formBuilder) {
568
+ function UtilityHelperService(formBuilder, http, spinnerService) {
350
569
  this.formBuilder = formBuilder;
570
+ this.http = http;
571
+ this.spinnerService = spinnerService;
351
572
  }
352
573
  UtilityHelperService_1 = UtilityHelperService;
353
574
  UtilityHelperService.EvaluateFieldFormula = function (formula, rec, ctx) {
354
- var evaluatedValue = eval(formula.replace('"', '\"'));
575
+ var evaluatedValue = eval(formula);
355
576
  return (evaluatedValue ? evaluatedValue : null);
356
577
  };
357
578
  UtilityHelperService.SetContext = function (ctx) {
358
579
  this.context = ctx;
359
580
  };
581
+ UtilityHelperService.GetFieldType = function (field) {
582
+ switch (field.FieldType) {
583
+ case exports.FieldTypeEnum["Campo di testo"]: {
584
+ var t = Object.assign(new TextField, field);
585
+ return t;
586
+ break;
587
+ }
588
+ default: {
589
+ break;
590
+ }
591
+ }
592
+ };
360
593
  /**
361
594
  * Metodo per impostare i valori da suggerire nell'autocomplete per i campi in cui l'utente deve scrivere comandi javascript.
362
595
  * In base all'ultimo carattere digitato viene impostato un elenco di oggetti o proprietà che l'utente ha a disposizione in quel momento.
@@ -404,7 +637,7 @@
404
637
  // funzione javascript. Controllo la parola che l'utente sta digitando e se fa parte di uno degli oggetti a disposizione
405
638
  // o una proprietà di essi allora suggerisco i possibili match.
406
639
  else {
407
- var availableOptions = [];
640
+ var availableOptions_1 = [];
408
641
  // Prendo tutti i blocchi di caratteri digitati dall'utente
409
642
  var allFormulaWords = typedFormula.split(" ");
410
643
  // Prendo l'ultimo blocco di caratteri digitato dall'utente
@@ -413,7 +646,7 @@
413
646
  // sui "." e imposto i suggerimenti in base al path della prorpietà che si sta digitando.
414
647
  if (!new RegExp("[^0-9a-zA-Z_.]").test(lastTypedString)) {
415
648
  var propertyPath = lastTypedString.split(".");
416
- var lastTypedWork = propertyPath[propertyPath.length - 1];
649
+ var lastTypedWork_1 = propertyPath[propertyPath.length - 1];
417
650
  var propertiesToCheck = [];
418
651
  if (propertyPath.length == 1) {
419
652
  propertiesToCheck = ["rec", "ctx"];
@@ -427,15 +660,15 @@
427
660
  else if (propertyPath.length > 1 && propertyPath[propertyPath.length - 2] === "rec") {
428
661
  propertiesToCheck = availableRecProperties;
429
662
  }
430
- // Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
663
+ // Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
431
664
  // quello che sta digitando l'utente.
432
665
  propertiesToCheck.forEach(function (prop) {
433
- if (prop.startsWith(lastTypedWork)) {
434
- availableOptions.push({ label: prop, value: typedFormula + prop.substring(lastTypedWork.length, prop.length) });
666
+ if (prop.startsWith(lastTypedWork_1)) {
667
+ availableOptions_1.push({ label: prop, value: typedFormula + prop.substring(lastTypedWork_1.length, prop.length) });
435
668
  }
436
669
  });
437
670
  }
438
- autocompleteOptions = availableOptions;
671
+ autocompleteOptions = availableOptions_1;
439
672
  }
440
673
  return autocompleteOptions;
441
674
  };
@@ -525,6 +758,17 @@
525
758
  if (field.MinLenght) {
526
759
  validators.push(forms.Validators.minLength(field.MinLenght));
527
760
  }
761
+ switch (field.TextMask) {
762
+ case exports.TextMaskEnum.Url:
763
+ validators.push(forms.Validators.pattern(UrlRegex));
764
+ break;
765
+ case exports.TextMaskEnum.Email:
766
+ validators.push(forms.Validators.email);
767
+ break;
768
+ case exports.TextMaskEnum.Telefono:
769
+ validators.push(forms.Validators.pattern(TelRegex));
770
+ break;
771
+ }
528
772
  break;
529
773
  case exports.FieldTypeEnum["Area di testo"]:
530
774
  if (field.MaxLenght) {
@@ -547,12 +791,151 @@
547
791
  }
548
792
  return new forms.FormControl(record[field.Name], validators);
549
793
  };
794
+ /**
795
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
796
+ * a cui si deve connettere e al token da passare per autenticarsi.
797
+ * @param baseServerUrl Stringa dell'url base del server (es: "http://localhost:5000").
798
+ * @param userToken Token dell'utente loggato da usare per autenticarsi se necessario.
799
+ * @returns Resituisce la configurazione completa degli endPoint da usare di default.
800
+ */
801
+ UtilityHelperService.prototype.ConfigureDefaultEndPoints = function (baseServerUrl, userToken) {
802
+ var endPointConfiguration = new EndPointConfiguration();
803
+ endPointConfiguration = new EndPointConfiguration();
804
+ endPointConfiguration.Records = {
805
+ GetByFormIDEndPoint: {
806
+ Url: baseServerUrl + "/api/v1/getall",
807
+ Token: userToken,
808
+ RequestMethod: exports.RequestMethodEnum.GET,
809
+ },
810
+ GetByIDEndPoint: {
811
+ Url: baseServerUrl + "/api/v1/getByID",
812
+ Token: userToken,
813
+ RequestMethod: exports.RequestMethodEnum.GET,
814
+ },
815
+ SaveEndPoint: {
816
+ Url: baseServerUrl + "/api/v1/save",
817
+ Token: userToken,
818
+ RequestMethod: exports.RequestMethodEnum.POST,
819
+ },
820
+ DuplicateEndPoint: {
821
+ Url: baseServerUrl + "/api/v1/duplicate",
822
+ Token: userToken,
823
+ RequestMethod: exports.RequestMethodEnum.POST,
824
+ },
825
+ DeleteEndPoint: {
826
+ Url: baseServerUrl + "/api/v1/delete",
827
+ Token: userToken,
828
+ RequestMethod: exports.RequestMethodEnum.DELETE,
829
+ }
830
+ };
831
+ endPointConfiguration.Forms = {
832
+ GetByIDEndPoint: {
833
+ Url: baseServerUrl + "/api/conf/form",
834
+ Token: userToken,
835
+ RequestMethod: exports.RequestMethodEnum.GET,
836
+ },
837
+ SaveEndPoint: {
838
+ Url: baseServerUrl + "/api/conf/form",
839
+ Token: userToken,
840
+ RequestMethod: exports.RequestMethodEnum.POST,
841
+ }
842
+ };
843
+ return endPointConfiguration;
844
+ };
845
+ /**
846
+ * Metodo che data la configurazione di un endpoint costruisce l'url da chiamare, gli eventuali parametri
847
+ * da passare (nel body o nella rotta) ed effettua la chiamata. Al termine della chiamata esegue le eventuali
848
+ * funzioni di callback (sia in caso di successo che in caso di errore) passate in input.
849
+ * @param endPointData Cofigurazione dell'endpoint da chiamare.
850
+ * @param dynamicModuleParams Array dei parametri aggiunti dal modulo dinamico a quelli già configurati
851
+ * (ad esempio il record o la form da salvare oppure l'ID per recuperare una particolare entità).
852
+ * @param callback Metodo da eseguire in caso di successo dopo la chiamata http.
853
+ * NOTA: in input viene passata la risposta della chiamata stessa.
854
+ * @param errorCallBack Metodo da eseguire in caso di errore dopo la chiamata http.
855
+ * NOTA: in input viene passato l'errore generato della chiamata stessa.
856
+ */
857
+ UtilityHelperService.prototype.RunEndPointCall = function (endPointData, dynamicModuleParams, callback, errorCallBack) {
858
+ var _this = this;
859
+ if (dynamicModuleParams === void 0) { dynamicModuleParams = null; }
860
+ if (callback === void 0) { callback = null; }
861
+ if (errorCallBack === void 0) { errorCallBack = null; }
862
+ this.spinnerService.addRequestCounter();
863
+ var url = "" + endPointData.Url;
864
+ var queryParams = null;
865
+ var bodyParams = {
866
+ AdditionalParams: {}
867
+ };
868
+ // Se nella configurazione sono stati definiti parametri da aggiungere alla chiamata questi vengono ciclati
869
+ // e aggiunti nel punto in cui devono essere usati.
870
+ if (endPointData.Params) {
871
+ endPointData.Params.forEach(function (p) {
872
+ switch (p.ParamType) {
873
+ case exports.ParamTypeEnum['Query param']: {
874
+ var stringParam = p.ParamName + "=" + p.ParamValue;
875
+ queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
876
+ break;
877
+ }
878
+ case exports.ParamTypeEnum['In route']: {
879
+ url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
880
+ break;
881
+ }
882
+ case exports.ParamTypeEnum['In Body']: {
883
+ bodyParams.AdditionalParams[p.ParamName] = p.ParamValue;
884
+ break;
885
+ }
886
+ }
887
+ });
888
+ }
889
+ // Se sono stati passati parametri da aggiungere alla chiamata definiti all'interno del modulo dinamico
890
+ // vengono ciclati e aggiunti nel punto in cui devono essere usati dopo quelli definiti nella configurazione.
891
+ if (dynamicModuleParams) {
892
+ dynamicModuleParams.forEach(function (p) {
893
+ switch (p.ParamType) {
894
+ case exports.ParamTypeEnum['Query param']: {
895
+ var stringParam = p.ParamName + "=" + p.ParamValue;
896
+ queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
897
+ break;
898
+ }
899
+ case exports.ParamTypeEnum['In route']: {
900
+ url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
901
+ break;
902
+ }
903
+ case exports.ParamTypeEnum['In Body']: {
904
+ bodyParams[p.ParamName] = p.ParamValue;
905
+ break;
906
+ }
907
+ }
908
+ });
909
+ }
910
+ if (queryParams != null) {
911
+ url = (url.endsWith("/") ? url.substring(0, url.length - 1) : url) + "?" + queryParams;
912
+ }
913
+ this.http.request(endPointData.RequestMethod, url, {
914
+ headers: endPointData.Token ? { Authorization: endPointData.Token } : null,
915
+ body: ![exports.RequestMethodEnum.DELETE, exports.RequestMethodEnum.GET].includes(endPointData.RequestMethod) ? bodyParams : null
916
+ })
917
+ .subscribe(function (res) {
918
+ _this.spinnerService.removeRequestCounter();
919
+ if (callback) {
920
+ callback(res);
921
+ }
922
+ }, function (error) {
923
+ _this.spinnerService.removeRequestCounter();
924
+ if (errorCallBack) {
925
+ errorCallBack(error);
926
+ }
927
+ EqpDynamicModuleDialogService.Error(error.message);
928
+ throw new Error(error.message);
929
+ });
930
+ };
550
931
  var UtilityHelperService_1;
551
932
  UtilityHelperService.context = new Context();
552
933
  UtilityHelperService.ctorParameters = function () { return [
553
- { type: forms.FormBuilder }
934
+ { type: forms.FormBuilder },
935
+ { type: http.HttpClient },
936
+ { type: SpinnerService }
554
937
  ]; };
555
- UtilityHelperService.ɵprov = core.ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(core.ɵɵinject(forms.FormBuilder)); }, token: UtilityHelperService, providedIn: "root" });
938
+ UtilityHelperService.ɵprov = core.ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(core.ɵɵinject(forms.FormBuilder), core.ɵɵinject(http.HttpClient), core.ɵɵinject(SpinnerService)); }, token: UtilityHelperService, providedIn: "root" });
556
939
  UtilityHelperService = UtilityHelperService_1 = __decorate([
557
940
  core.Injectable({
558
941
  providedIn: 'root'
@@ -562,55 +945,219 @@
562
945
  }());
563
946
 
564
947
  var EqpDynamicModuleComponent = /** @class */ (function () {
565
- function EqpDynamicModuleComponent() {
948
+ function EqpDynamicModuleComponent(utilityHelperService) {
949
+ this.utilityHelperService = utilityHelperService;
566
950
  this.context = new Context();
567
- this.form = new Form();
568
951
  this.showButtons = true;
569
952
  this.showTitle = true;
570
- this.viewMode = exports.FormTypeEnum.LIST;
953
+ /**
954
+ * Url del server da chiamare per recuperare, salvare o eliminare i record.
955
+ * Usato per creare la configurazione di default degli endpoint da chiamare.
956
+ */
957
+ this.baseServerUrl = null;
958
+ /**
959
+ * Token da usare negli endpoint da chiamare per recuperare o salvare i record.
960
+ * Usato solo se viene popolata la proprietà "baseServerUrl".
961
+ */
962
+ this.userToken = null;
963
+ /**
964
+ * Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
965
+ * Può essere definita dall'utente oppure lasciata null, viene popolata con dei
966
+ * valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
967
+ * viene lasciata null e non viene eseguita nessuna chiamata al server.
968
+ */
969
+ this.endPointConfiguration = null;
970
+ /**
971
+ * Eventi emessi quando si salva, elimina o duplica un record
972
+ * se non è stato specificato un endpoint da chiamare.
973
+ */
571
974
  this.saveRecord = new core.EventEmitter();
572
975
  this.deleteRecord = new core.EventEmitter();
573
976
  this.duplicateRecord = new core.EventEmitter();
977
+ /**
978
+ * Eventi emessi DOPO aver eseguito una chiamata al server per il salvataggio,
979
+ * l'eliminazione o la duplicazione di un record all'endpoint specificato.
980
+ */
981
+ this.afterSaveRecord = new core.EventEmitter();
982
+ this.afterDeleteRecord = new core.EventEmitter();
983
+ this.afterDuplicateRecord = new core.EventEmitter();
984
+ this.form = new Form();
985
+ this.viewMode = exports.FormTypeEnum.LIST;
574
986
  this.FormTypeEnum = exports.FormTypeEnum;
575
987
  }
576
988
  EqpDynamicModuleComponent.prototype.ngOnInit = function () {
577
989
  UtilityHelperService.SetContext(this.context);
990
+ this.configureDefaultEndPoints();
991
+ this.getFormByID();
992
+ };
993
+ EqpDynamicModuleComponent.prototype.getFormByID = function () {
994
+ var _this = this;
995
+ var dynamicModuleParams = new Array();
996
+ dynamicModuleParams.push({
997
+ ParamName: "id",
998
+ ParamValue: this.formID,
999
+ ParamType: exports.ParamTypeEnum['Query param']
1000
+ });
1001
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, dynamicModuleParams, function (res) {
1002
+ _this.form = res;
1003
+ _this.getRecordsByFormID();
1004
+ }, function (err) {
1005
+ console.log(err);
1006
+ });
1007
+ };
1008
+ /**
1009
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
1010
+ * a cui si deve connettere e al token da passare per autenticarsi.
1011
+ * Se la proprietà "baseServerUrl" è null e non sono stati configurati i vari endpoint allora
1012
+ * non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
1013
+ */
1014
+ EqpDynamicModuleComponent.prototype.configureDefaultEndPoints = function () {
1015
+ if (!this.endPointConfiguration && this.baseServerUrl) {
1016
+ this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
1017
+ }
578
1018
  };
1019
+ /**
1020
+ * Metodo per recuperare tutti i record salvati per una particolare Form.
1021
+ * La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
1022
+ * La risposta della chiamata deve essere un array di oggetti di tipo "DynRecord"
1023
+ * a partire dai quali vengono ricreati i Record usati nel client.
1024
+ */
1025
+ EqpDynamicModuleComponent.prototype.getRecordsByFormID = function () {
1026
+ var _this = this;
1027
+ if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByFormIDEndPoint) {
1028
+ var dynamicModuleParams = [
1029
+ { ParamName: 'EntID', ParamValue: this.form.ID, ParamType: exports.ParamTypeEnum['Query param'] }
1030
+ ];
1031
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint, dynamicModuleParams, function (res) {
1032
+ _this.values = new Array();
1033
+ res.forEach(function (r) {
1034
+ var tmpRec = new Record();
1035
+ tmpRec = JSON.parse(r.SerializedValues);
1036
+ tmpRec.ID = r.ID;
1037
+ tmpRec.EntID = r.EntID;
1038
+ _this.values.push(tmpRec);
1039
+ });
1040
+ });
1041
+ }
1042
+ };
1043
+ /**
1044
+ * Metodo invocato quando si vuole aggiungere, visualizzare o modificare un record.
1045
+ * Se l'evento è null vuol dire che stiamo aggiungendo un nuovo record altrimenti siamo in modifica
1046
+ * o visualizzazione. In questi ultimi due casi, se è stato configurato un endpoint per il recupero
1047
+ * del record completo allora viene effettuata una chiamata al server, altrimenti viene usato l'oggetto selezionato.
1048
+ * @param event Oggetto con due proprietà:
1049
+ * "record" = oggetto da modificare/visualizzare,
1050
+ * "onlyView" = booleano (se TRUE siamo in visualizzazione altrimenti in modifica)
1051
+ */
579
1052
  EqpDynamicModuleComponent.prototype.onAddViewEditRecord = function (event) {
1053
+ var _this = this;
580
1054
  if (event != null) {
581
- this.selectedRecord = JSON.parse(JSON.stringify(event.record));
582
1055
  this.onlyView = event.onlyView;
1056
+ if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByIDEndPoint) {
1057
+ var dynamicModuleParams = [
1058
+ { ParamName: "id", ParamValue: event.record.ID, ParamType: exports.ParamTypeEnum['Query param'] }
1059
+ ];
1060
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint, dynamicModuleParams, function (res) {
1061
+ _this.selectedRecord = JSON.parse(res.SerializedValues);
1062
+ _this.selectedRecord.ID = res.ID;
1063
+ _this.selectedRecord.EntID = res.EntID;
1064
+ _this.viewMode = exports.FormTypeEnum.SCALAR;
1065
+ });
1066
+ }
1067
+ else {
1068
+ this.selectedRecord = JSON.parse(JSON.stringify(event.record));
1069
+ this.viewMode = exports.FormTypeEnum.SCALAR;
1070
+ }
583
1071
  }
584
1072
  else {
585
1073
  this.selectedRecord = null;
586
1074
  this.onlyView = false;
1075
+ this.viewMode = exports.FormTypeEnum.SCALAR;
1076
+ }
1077
+ };
1078
+ /**
1079
+ * Metodo per salvare il record aggiunto o modificato.
1080
+ * Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
1081
+ * nel body della chiamata, altrimenti scatena l'evento "saveRecord".
1082
+ * @param event Oggetto di tipo Record da salvare.
1083
+ */
1084
+ EqpDynamicModuleComponent.prototype.onSaveRecord = function (event) {
1085
+ var _this = this;
1086
+ var _a;
1087
+ if (event != null && this.endPointConfiguration != null && this.endPointConfiguration.Records.SaveEndPoint) {
1088
+ var dynRec = new DynRecord();
1089
+ dynRec.ID = (_a = event.ID, (_a !== null && _a !== void 0 ? _a : null));
1090
+ dynRec.EntID = this.form.ID;
1091
+ dynRec.Values = (event !== null && event !== void 0 ? event : null);
1092
+ var dynamicModuleParams = [
1093
+ { ParamName: "Record", ParamValue: dynRec, ParamType: exports.ParamTypeEnum['In Body'] }
1094
+ ];
1095
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint, dynamicModuleParams, function (res) {
1096
+ _this.getRecordsByFormID();
1097
+ _this.afterSaveRecord.emit(event);
1098
+ _this.viewMode = exports.FormTypeEnum.LIST;
1099
+ });
1100
+ }
1101
+ else {
1102
+ this.saveRecord.emit(event);
1103
+ this.viewMode = exports.FormTypeEnum.LIST;
587
1104
  }
588
- this.viewMode = exports.FormTypeEnum.SCALAR;
589
- };
590
- EqpDynamicModuleComponent.prototype.onSaveForm = function (event) {
591
- //TODO: Salvare il record!
592
- // if (event != null) {
593
- // if (event.ID && this.values.find(v => v.ID == event.ID)) {
594
- // this.values[this.values.findIndex(v => v.ID == event.ID)] = event;
595
- // } else {
596
- // this.values.push(event);
597
- // }
598
- // }
599
- this.saveRecord.emit(event);
600
- this.viewMode = exports.FormTypeEnum.LIST;
601
1105
  };
1106
+ /**
1107
+ * Metodo per duplicare un record precedentemente salvato.
1108
+ * Se è stato configurato un endPoint per la duplicazione lato server allora effettua una chiamata passando nel body
1109
+ * un oggetto contenente il record da duplicare, altrimenti scatena l'evento di output "duplicateRecord".
1110
+ * @param record Oggetto di tipo Record da duplicare.
1111
+ */
602
1112
  EqpDynamicModuleComponent.prototype.onDuplicateRecord = function (record) {
603
- this.duplicateRecord.emit(record);
1113
+ var _this = this;
1114
+ if (this.endPointConfiguration && this.endPointConfiguration.Records.DuplicateEndPoint) {
1115
+ EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', function () {
1116
+ var dynamicModuleParams = [
1117
+ { ParamName: "id", ParamValue: record.ID, ParamType: exports.ParamTypeEnum['Query param'] }
1118
+ ];
1119
+ _this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DuplicateEndPoint, dynamicModuleParams, function (res) {
1120
+ _this.getRecordsByFormID();
1121
+ _this.afterDuplicateRecord.emit(record);
1122
+ });
1123
+ }, false, 'Richiesta conferma');
1124
+ }
1125
+ else {
1126
+ this.duplicateRecord.emit(record);
1127
+ }
604
1128
  };
1129
+ /**
1130
+ * Metodo per eliminare un record.
1131
+ * Se è stato configurato un endPoint per l'eliminazione allora effettua una chiamata passando l'ID del record da eliminare
1132
+ * come query param all'interno della rotta, altrimenti scatena l'evento di output "deleteRecord".
1133
+ * @param record Oggetto di tipo Record da duplicare.
1134
+ */
605
1135
  EqpDynamicModuleComponent.prototype.onDeleteRecord = function (record) {
606
- this.deleteRecord.emit(record);
1136
+ var _this = this;
1137
+ if (this.endPointConfiguration && this.endPointConfiguration.Records.DeleteEndPoint) {
1138
+ EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', function () {
1139
+ var dynamicModuleParams = [
1140
+ { ParamName: "id", ParamValue: record.ID, ParamType: exports.ParamTypeEnum['Query param'] }
1141
+ ];
1142
+ _this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DeleteEndPoint, dynamicModuleParams, function (res) {
1143
+ _this.getRecordsByFormID();
1144
+ _this.afterDeleteRecord.emit(record);
1145
+ });
1146
+ }, false, 'Richiesta conferma');
1147
+ }
1148
+ else {
1149
+ this.deleteRecord.emit(record);
1150
+ }
607
1151
  };
1152
+ EqpDynamicModuleComponent.ctorParameters = function () { return [
1153
+ { type: UtilityHelperService }
1154
+ ]; };
608
1155
  __decorate([
609
1156
  core.Input()
610
1157
  ], EqpDynamicModuleComponent.prototype, "context", void 0);
611
1158
  __decorate([
612
1159
  core.Input()
613
- ], EqpDynamicModuleComponent.prototype, "form", void 0);
1160
+ ], EqpDynamicModuleComponent.prototype, "formID", void 0);
614
1161
  __decorate([
615
1162
  core.Input()
616
1163
  ], EqpDynamicModuleComponent.prototype, "values", void 0);
@@ -622,7 +1169,13 @@
622
1169
  ], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
623
1170
  __decorate([
624
1171
  core.Input()
625
- ], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
1172
+ ], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
1173
+ __decorate([
1174
+ core.Input()
1175
+ ], EqpDynamicModuleComponent.prototype, "userToken", void 0);
1176
+ __decorate([
1177
+ core.Input()
1178
+ ], EqpDynamicModuleComponent.prototype, "endPointConfiguration", void 0);
626
1179
  __decorate([
627
1180
  core.Output()
628
1181
  ], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
@@ -632,220 +1185,178 @@
632
1185
  __decorate([
633
1186
  core.Output()
634
1187
  ], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
635
- EqpDynamicModuleComponent = __decorate([
636
- core.Component({
637
- selector: 'eqp-dynamic-module',
638
- 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>",
639
- styles: ["::ng-deep mat-form-field{width:100%}"]
640
- })
641
- ], EqpDynamicModuleComponent);
642
- return EqpDynamicModuleComponent;
643
- }());
644
-
645
- var MaterialModule = /** @class */ (function () {
646
- function MaterialModule() {
647
- }
648
- MaterialModule = __decorate([
649
- core.NgModule({
650
- imports: [
651
- checkbox.MatCheckboxModule,
652
- button.MatButtonModule,
653
- input.MatInputModule,
654
- autocomplete.MatAutocompleteModule,
655
- datepicker.MatDatepickerModule,
656
- formField.MatFormFieldModule,
657
- radio.MatRadioModule,
658
- select.MatSelectModule,
659
- slider.MatSliderModule,
660
- slideToggle.MatSlideToggleModule,
661
- menu.MatMenuModule,
662
- sidenav.MatSidenavModule,
663
- toolbar.MatToolbarModule,
664
- list.MatListModule,
665
- gridList.MatGridListModule,
666
- card.MatCardModule,
667
- stepper.MatStepperModule,
668
- tabs.MatTabsModule,
669
- expansion.MatExpansionModule,
670
- buttonToggle.MatButtonToggleModule,
671
- chips.MatChipsModule,
672
- icon.MatIconModule,
673
- progressSpinner.MatProgressSpinnerModule,
674
- progressBar.MatProgressBarModule,
675
- dialog.MatDialogModule,
676
- tooltip.MatTooltipModule,
677
- snackBar.MatSnackBarModule,
678
- table.MatTableModule,
679
- sort.MatSortModule,
680
- paginator.MatPaginatorModule,
681
- datepicker.MatDatepickerModule,
682
- core$1.MatNativeDateModule
683
- ],
684
- exports: [
685
- checkbox.MatCheckboxModule,
686
- button.MatButtonModule,
687
- input.MatInputModule,
688
- autocomplete.MatAutocompleteModule,
689
- datepicker.MatDatepickerModule,
690
- formField.MatFormFieldModule,
691
- radio.MatRadioModule,
692
- select.MatSelectModule,
693
- slider.MatSliderModule,
694
- slideToggle.MatSlideToggleModule,
695
- menu.MatMenuModule,
696
- sidenav.MatSidenavModule,
697
- toolbar.MatToolbarModule,
698
- list.MatListModule,
699
- gridList.MatGridListModule,
700
- card.MatCardModule,
701
- stepper.MatStepperModule,
702
- tabs.MatTabsModule,
703
- expansion.MatExpansionModule,
704
- buttonToggle.MatButtonToggleModule,
705
- chips.MatChipsModule,
706
- icon.MatIconModule,
707
- progressSpinner.MatProgressSpinnerModule,
708
- progressBar.MatProgressBarModule,
709
- dialog.MatDialogModule,
710
- tooltip.MatTooltipModule,
711
- snackBar.MatSnackBarModule,
712
- table.MatTableModule,
713
- sort.MatSortModule,
714
- paginator.MatPaginatorModule
715
- ],
716
- })
717
- ], MaterialModule);
718
- return MaterialModule;
719
- }());
720
-
721
- var EqpDynamicModuleDialogService = /** @class */ (function () {
722
- function EqpDynamicModuleDialogService() {
723
- }
724
- /**
725
- * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
726
- * @param message Messaggio d'errore da mostrare nello sweetalert
727
- * @param title Titolo dello sweetalert (di default mostra 'Errore')
728
- */
729
- EqpDynamicModuleDialogService.Error = function (message, title) {
730
- if (title === void 0) { title = null; }
731
- var currentTitle = title != null ? title : 'Errore';
732
- if (Array.isArray(message)) {
733
- currentTitle = title != null ? title : 'Errore';
734
- var htmlErrors = message.join("<br>");
735
- Swal.fire({
736
- title: currentTitle,
737
- html: htmlErrors,
738
- icon: 'error'
739
- });
740
- }
741
- else {
742
- Swal.fire(currentTitle, message, 'error');
743
- }
744
- };
745
- /**
746
- * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
747
- * CONFERMA lancia la funzione di callback passata come parametro
748
- * @param message Messaggio da mostrare nello sweetalert
749
- * @param title Titolo dello sweetalert (di default mostra 'Info')
750
- */
751
- EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
752
- if (isWarning === void 0) { isWarning = false; }
753
- if (title === void 0) { title = null; }
754
- if (customWidth === void 0) { customWidth = null; }
755
- var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
756
- if (Array.isArray(message)) {
757
- var htmlErrors = message.join("<br>");
758
- Swal.fire({
759
- title: currentTitle,
760
- html: htmlErrors,
761
- width: customWidth ? customWidth : '32rem',
762
- icon: !isWarning ? 'question' : 'warning',
763
- showCancelButton: true,
764
- allowOutsideClick: false,
765
- allowEscapeKey: false
766
- }).then(function (result) {
767
- if (result.value && confirmCallback) {
768
- confirmCallback();
769
- }
770
- });
771
- }
772
- else {
773
- Swal.fire({
774
- title: currentTitle,
775
- text: message,
776
- width: customWidth ? customWidth : '32rem',
777
- icon: !isWarning ? 'question' : 'warning',
778
- showCancelButton: true,
779
- allowOutsideClick: false,
780
- allowEscapeKey: false
781
- }).then(function (result) {
782
- if (result.value && confirmCallback) {
783
- confirmCallback();
784
- }
785
- });
786
- }
787
- };
788
- /**
789
- * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
790
- * @param message Messaggio da mostrare nello sweetalert
791
- * @param title Titolo dello sweetalert (di default mostra 'Info')
792
- */
793
- EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
794
- if (title === void 0) { title = null; }
795
- if (isToast === void 0) { isToast = null; }
796
- var currentTitle = title != null ? title : "Informazione:";
797
- Swal.fire(currentTitle, message, 'info');
798
- };
799
- /**
800
- * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
801
- * @param message Messaggio da mostrare nello sweetalert
802
- * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
803
- */
804
- EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
805
- if (title === void 0) { title = null; }
806
- if (isToast === void 0) { isToast = null; }
807
- var currentTitle = title != null ? title : "Attenzione!";
808
- if (Array.isArray(message)) {
809
- var htmlWarnings = message.join("<br>");
810
- Swal.fire({
811
- title: currentTitle,
812
- html: htmlWarnings,
813
- icon: 'warning'
814
- });
815
- }
816
- else {
817
- Swal.fire(currentTitle, message, 'warning');
818
- }
819
- };
820
- EqpDynamicModuleDialogService.ɵprov = core.ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
821
- EqpDynamicModuleDialogService = __decorate([
822
- core.Injectable({
823
- providedIn: 'root'
1188
+ __decorate([
1189
+ core.Output()
1190
+ ], EqpDynamicModuleComponent.prototype, "afterSaveRecord", void 0);
1191
+ __decorate([
1192
+ core.Output()
1193
+ ], EqpDynamicModuleComponent.prototype, "afterDeleteRecord", void 0);
1194
+ __decorate([
1195
+ core.Output()
1196
+ ], EqpDynamicModuleComponent.prototype, "afterDuplicateRecord", void 0);
1197
+ EqpDynamicModuleComponent = __decorate([
1198
+ core.Component({
1199
+ selector: 'eqp-dynamic-module',
1200
+ 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>",
1201
+ styles: ["::ng-deep mat-form-field{width:100%}"]
824
1202
  })
825
- ], EqpDynamicModuleDialogService);
826
- return EqpDynamicModuleDialogService;
1203
+ ], EqpDynamicModuleComponent);
1204
+ return EqpDynamicModuleComponent;
1205
+ }());
1206
+
1207
+ var MaterialModule = /** @class */ (function () {
1208
+ function MaterialModule() {
1209
+ }
1210
+ MaterialModule = __decorate([
1211
+ core.NgModule({
1212
+ imports: [
1213
+ checkbox.MatCheckboxModule,
1214
+ button.MatButtonModule,
1215
+ input.MatInputModule,
1216
+ autocomplete.MatAutocompleteModule,
1217
+ datepicker.MatDatepickerModule,
1218
+ formField.MatFormFieldModule,
1219
+ radio.MatRadioModule,
1220
+ select.MatSelectModule,
1221
+ slider.MatSliderModule,
1222
+ slideToggle.MatSlideToggleModule,
1223
+ menu.MatMenuModule,
1224
+ sidenav.MatSidenavModule,
1225
+ toolbar.MatToolbarModule,
1226
+ list.MatListModule,
1227
+ gridList.MatGridListModule,
1228
+ card.MatCardModule,
1229
+ stepper.MatStepperModule,
1230
+ tabs.MatTabsModule,
1231
+ expansion.MatExpansionModule,
1232
+ buttonToggle.MatButtonToggleModule,
1233
+ chips.MatChipsModule,
1234
+ icon.MatIconModule,
1235
+ progressSpinner.MatProgressSpinnerModule,
1236
+ progressBar.MatProgressBarModule,
1237
+ dialog.MatDialogModule,
1238
+ tooltip.MatTooltipModule,
1239
+ snackBar.MatSnackBarModule,
1240
+ table.MatTableModule,
1241
+ sort.MatSortModule,
1242
+ paginator.MatPaginatorModule,
1243
+ datepicker.MatDatepickerModule,
1244
+ core$1.MatNativeDateModule
1245
+ ],
1246
+ exports: [
1247
+ checkbox.MatCheckboxModule,
1248
+ button.MatButtonModule,
1249
+ input.MatInputModule,
1250
+ autocomplete.MatAutocompleteModule,
1251
+ datepicker.MatDatepickerModule,
1252
+ formField.MatFormFieldModule,
1253
+ radio.MatRadioModule,
1254
+ select.MatSelectModule,
1255
+ slider.MatSliderModule,
1256
+ slideToggle.MatSlideToggleModule,
1257
+ menu.MatMenuModule,
1258
+ sidenav.MatSidenavModule,
1259
+ toolbar.MatToolbarModule,
1260
+ list.MatListModule,
1261
+ gridList.MatGridListModule,
1262
+ card.MatCardModule,
1263
+ stepper.MatStepperModule,
1264
+ tabs.MatTabsModule,
1265
+ expansion.MatExpansionModule,
1266
+ buttonToggle.MatButtonToggleModule,
1267
+ chips.MatChipsModule,
1268
+ icon.MatIconModule,
1269
+ progressSpinner.MatProgressSpinnerModule,
1270
+ progressBar.MatProgressBarModule,
1271
+ dialog.MatDialogModule,
1272
+ tooltip.MatTooltipModule,
1273
+ snackBar.MatSnackBarModule,
1274
+ table.MatTableModule,
1275
+ sort.MatSortModule,
1276
+ paginator.MatPaginatorModule
1277
+ ],
1278
+ })
1279
+ ], MaterialModule);
1280
+ return MaterialModule;
827
1281
  }());
828
1282
 
829
1283
  var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
830
- function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog) {
1284
+ function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog, utilityHelperService) {
831
1285
  this.formBuilder = formBuilder;
832
1286
  this.dialog = dialog;
1287
+ this.utilityHelperService = utilityHelperService;
833
1288
  this.context = new Context();
834
1289
  this.form = new Form();
1290
+ this.formID = null;
835
1291
  this.innerFormManagment = false;
1292
+ /**
1293
+ * Url del server da chiamare per recuerare, salvare o eliminare i record.
1294
+ * Usato per creare la configurazione di default degli endpoint da chiamare.
1295
+ */
1296
+ this.baseServerUrl = null;
1297
+ /**
1298
+ * Token da usare negli endpoint da chiamare per recuperare o salvare i record.
1299
+ * Usato solo se viene popolata la proprietà "baseServerUrl".
1300
+ */
1301
+ this.userToken = null;
1302
+ /**
1303
+ * Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
1304
+ * Può essere definita dall'utente oppure lasciata null, viene popolata con dei
1305
+ * valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
1306
+ * viene lasciata null e non viene eseguita nessuna chiamata al server.
1307
+ */
1308
+ this.endPointConfiguration = null;
836
1309
  this.formCompleted = false;
837
1310
  //#region Enumeratori usati nell'html
838
1311
  this.FormTypeEnum = exports.FormTypeEnum;
839
1312
  this.FormScalarTypeEnum = exports.FormScalarTypeEnum;
840
1313
  //#endregion
1314
+ /**
1315
+ * Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare.
1316
+ */
841
1317
  this.saveFormEvent = new core.EventEmitter();
1318
+ /**
1319
+ * Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato.
1320
+ */
1321
+ this.afterSaveFormEvent = new core.EventEmitter();
842
1322
  }
843
1323
  EqpDynamicModuleConfiguratorComponent.prototype.ngOnInit = function () {
1324
+ this.configureDefaultEndPoints();
1325
+ this.getFormByID();
844
1326
  if (this.context) {
845
1327
  UtilityHelperService.SetContext(this.context);
846
1328
  }
847
- this.configureColumns();
848
- this.createFormForm();
1329
+ };
1330
+ /**
1331
+ * Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
1332
+ * a cui si deve connettere e al token da passare per autenticarsi.
1333
+ * Se la proprietà baseServerUrl è null e non sono stati configurati i vari endpoint allora
1334
+ * non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
1335
+ */
1336
+ EqpDynamicModuleConfiguratorComponent.prototype.configureDefaultEndPoints = function () {
1337
+ if (!this.endPointConfiguration && this.baseServerUrl) {
1338
+ this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
1339
+ if (this.formID) {
1340
+ this.endPointConfiguration.Forms.GetByIDEndPoint.Params = [{ ParamName: 'id', ParamValue: this.formID, ParamType: exports.ParamTypeEnum['Query param'] }];
1341
+ }
1342
+ }
1343
+ };
1344
+ /**
1345
+ * Metodo per recuperare tutti i record salvati per una particolare Form.
1346
+ * La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
1347
+ */
1348
+ EqpDynamicModuleConfiguratorComponent.prototype.getFormByID = function () {
1349
+ var _this = this;
1350
+ if (this.formID && this.endPointConfiguration && this.endPointConfiguration.Forms && this.endPointConfiguration.Forms.GetByIDEndPoint) {
1351
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, null, function (res) {
1352
+ _this.setFormAndConfigure(res);
1353
+ }, function (err) {
1354
+ _this.setFormAndConfigure(new Form());
1355
+ });
1356
+ }
1357
+ else {
1358
+ this.setFormAndConfigure();
1359
+ }
849
1360
  };
850
1361
  /**
851
1362
  * Metodo invocato al cambio del tipo di visualizzazione della form.
@@ -1121,10 +1632,54 @@
1121
1632
  }
1122
1633
  };
1123
1634
  /**
1124
- * Metodo che scatena l'evento di output per salvare la form creata alla fine del wizard
1635
+ * Metodo per salvare la form creata alla fine del wizard.
1636
+ * Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
1637
+ * nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
1638
+ * NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
1639
+ * Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
1125
1640
  */
1126
1641
  EqpDynamicModuleConfiguratorComponent.prototype.saveForm = function () {
1127
- this.saveFormEvent.emit(this.form);
1642
+ var _this = this;
1643
+ if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
1644
+ // Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
1645
+ // Necessario per far funzionare correttamente il FieldConverter del server.
1646
+ var formToSave_1 = JSON.parse(JSON.stringify(this.form));
1647
+ /*formToSave.Fields = [];
1648
+ this.form.Fields.forEach(field => {
1649
+ formToSave.Fields.push({
1650
+ FieldType: field.FieldType,
1651
+ Value: JSON.parse(JSON.stringify(field))
1652
+ });
1653
+ });*/
1654
+ formToSave_1.Fields = [];
1655
+ this.form.Fields.forEach(function (field) {
1656
+ var fld = UtilityHelperService.GetFieldType(field);
1657
+ formToSave_1.Fields.push(fld);
1658
+ });
1659
+ var dynamicModuleParams = [
1660
+ { ParamName: "Form", ParamValue: formToSave_1, ParamType: exports.ParamTypeEnum['In Body'] }
1661
+ ];
1662
+ this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, function (res) {
1663
+ EqpDynamicModuleDialogService.Success("Form salvata con successo!");
1664
+ _this.afterSaveFormEvent.emit(_this.form);
1665
+ });
1666
+ }
1667
+ else {
1668
+ this.saveFormEvent.emit(this.form);
1669
+ }
1670
+ };
1671
+ //#region FUNZIONI PRIVATE
1672
+ /**
1673
+ * Metodo per impostare la form e configurare colonne/FormGourp.
1674
+ * @param form Form da utilizzare.
1675
+ */
1676
+ EqpDynamicModuleConfiguratorComponent.prototype.setFormAndConfigure = function (form) {
1677
+ if (form === void 0) { form = null; }
1678
+ if (form != null) {
1679
+ this.form = form;
1680
+ }
1681
+ this.configureColumns();
1682
+ this.createFormForm();
1128
1683
  };
1129
1684
  /**
1130
1685
  * Configura le colonne per le tabelle necessarie alla creazione della form:
@@ -1318,7 +1873,8 @@
1318
1873
  };
1319
1874
  EqpDynamicModuleConfiguratorComponent.ctorParameters = function () { return [
1320
1875
  { type: forms.FormBuilder },
1321
- { type: dialog.MatDialog }
1876
+ { type: dialog.MatDialog },
1877
+ { type: UtilityHelperService }
1322
1878
  ]; };
1323
1879
  __decorate([
1324
1880
  core.Input()
@@ -1326,9 +1882,21 @@
1326
1882
  __decorate([
1327
1883
  core.Input()
1328
1884
  ], EqpDynamicModuleConfiguratorComponent.prototype, "form", void 0);
1885
+ __decorate([
1886
+ core.Input()
1887
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "formID", void 0);
1329
1888
  __decorate([
1330
1889
  core.Input()
1331
1890
  ], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
1891
+ __decorate([
1892
+ core.Input()
1893
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);
1894
+ __decorate([
1895
+ core.Input()
1896
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "userToken", void 0);
1897
+ __decorate([
1898
+ core.Input()
1899
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "endPointConfiguration", void 0);
1332
1900
  __decorate([
1333
1901
  core.ViewChild('fieldsTable', { static: false })
1334
1902
  ], EqpDynamicModuleConfiguratorComponent.prototype, "fieldsTable", void 0);
@@ -1350,10 +1918,13 @@
1350
1918
  __decorate([
1351
1919
  core.Output()
1352
1920
  ], EqpDynamicModuleConfiguratorComponent.prototype, "saveFormEvent", void 0);
1921
+ __decorate([
1922
+ core.Output()
1923
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "afterSaveFormEvent", void 0);
1353
1924
  EqpDynamicModuleConfiguratorComponent = __decorate([
1354
1925
  core.Component({
1355
1926
  selector: 'eqp-dynamic-module-configurator',
1356
- 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>",
1927
+ 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>",
1357
1928
  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)}"]
1358
1929
  })
1359
1930
  ], EqpDynamicModuleConfiguratorComponent);
@@ -1425,6 +1996,11 @@
1425
1996
  }
1426
1997
  return ListValueField;
1427
1998
  }(BaseField));
1999
+ var ButtonImage = /** @class */ (function () {
2000
+ function ButtonImage() {
2001
+ }
2002
+ return ButtonImage;
2003
+ }());
1428
2004
 
1429
2005
  (function (ListPresentationEnum) {
1430
2006
  ListPresentationEnum[ListPresentationEnum["Combo box"] = 1] = "Combo box";
@@ -1435,10 +2011,11 @@
1435
2011
 
1436
2012
  var AddFormFieldComponent = /** @class */ (function () {
1437
2013
  //#endregion
1438
- function AddFormFieldComponent(formBuilder, enumHelper, dialog) {
2014
+ function AddFormFieldComponent(formBuilder, enumHelper, dialog, cdr) {
1439
2015
  this.formBuilder = formBuilder;
1440
2016
  this.enumHelper = enumHelper;
1441
2017
  this.dialog = dialog;
2018
+ this.cdr = cdr;
1442
2019
  this.fieldTypesToExclude = [exports.FieldTypeEnum['Form di dettaglio']];
1443
2020
  this.keyValueObject = { key: '', value: '' };
1444
2021
  this.availableColSpanSizes = [];
@@ -1451,6 +2028,8 @@
1451
2028
  this.BoolPresentantioEnum = exports.BoolPresentantioEnum;
1452
2029
  this.DateTimeTypeEnum = exports.DateTimeTypeEnum;
1453
2030
  this.ListPresentationEnum = exports.ListPresentationEnum;
2031
+ this.TextMaskEnum = exports.TextMaskEnum;
2032
+ this.AttachmentType = eqpAttachments.AttachmentType;
1454
2033
  }
1455
2034
  AddFormFieldComponent.prototype.ngOnInit = function () {
1456
2035
  var _this = this;
@@ -1489,7 +2068,7 @@
1489
2068
  Required: [this.field.Required],
1490
2069
  FieldType: [this.field.FieldType, forms.Validators.required],
1491
2070
  Formula: [this.field.Formula],
1492
- ColSizes: [this.field.ColSizes],
2071
+ ColSpanSizes: [this.field.ColSpanSizes],
1493
2072
  InListView: [this.field.InListView],
1494
2073
  });
1495
2074
  if (this.formFieldsGroups) {
@@ -1508,7 +2087,7 @@
1508
2087
  if (restoreField)
1509
2088
  this.restoreBaseFieldProperties();
1510
2089
  this.createFieldForm();
1511
- this.onColSizeSelect();
2090
+ this.onColSpanSizeSelect();
1512
2091
  this.fieldTypeFormTemplate = null;
1513
2092
  switch (this.field.FieldType) {
1514
2093
  case exports.FieldTypeEnum['Campo di testo']:
@@ -1532,13 +2111,16 @@
1532
2111
  this.fieldFormGroup.addControl('IsOnlyDate', new forms.FormControl(this.field.IsOnlyDate, forms.Validators.required));
1533
2112
  this.fieldFormGroup.addControl('MinDate', new forms.FormControl(this.field.MinDate));
1534
2113
  this.fieldFormGroup.addControl('MaxDate', new forms.FormControl(this.field.MaxDate));
2114
+ this.fieldFormGroup.addControl('DateFormat', new forms.FormControl(this.field.DateFormat));
1535
2115
  this.fieldTypeFormTemplate = this.dateFieldFormTemplate;
1536
2116
  break;
1537
2117
  case exports.FieldTypeEnum['Campo numerico']:
1538
2118
  this.fieldFormGroup.addControl('IsInteger', new forms.FormControl(this.field.IsInteger));
1539
2119
  this.fieldFormGroup.addControl('MinValue', new forms.FormControl(this.field.MinValue));
1540
2120
  this.fieldFormGroup.addControl('MaxValue', new forms.FormControl(this.field.MaxValue));
1541
- this.fieldFormGroup.addControl('NumberFormat', new forms.FormControl(this.field.NumberFormat));
2121
+ this.fieldFormGroup.addControl('DecimalSeparator', new forms.FormControl(this.field.DecimalSeparator));
2122
+ this.fieldFormGroup.addControl('DecimalPrecision', new forms.FormControl(this.field.DecimalPrecision));
2123
+ this.fieldFormGroup.addControl('ThousandsSeparator', new forms.FormControl(this.field.ThousandsSeparator));
1542
2124
  this.fieldFormGroup.addControl('CurrencySymbol', new forms.FormControl(this.field.CurrencySymbol));
1543
2125
  this.fieldTypeFormTemplate = this.numericFieldFormTemplate;
1544
2126
  break;
@@ -1549,11 +2131,10 @@
1549
2131
  break;
1550
2132
  case exports.FieldTypeEnum.Immagine:
1551
2133
  this.field.AttachDefinition = new AttachmentField();
1552
- this.fieldFormGroup.addControl('IsMultiAttach', new forms.FormControl(this.field.AttachDefinition.IsMultiAttach));
1553
- // this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
1554
- this.fieldFormGroup.addControl('IsMultiPoint', new forms.FormControl(this.field.IsMultiPoint));
1555
- this.fieldFormGroup.addControl("AllowedExtensions", new forms.FormControl(this.field.AttachDefinition.AllowedExtensions));
2134
+ this.fieldFormGroup.addControl('EnableDrawing', new forms.FormControl(this.field.EnableDrawing));
1556
2135
  this.fieldFormGroup.addControl('ImageIsContextualAttachment', new forms.FormControl(this.field.ImageIsContextualAttachment));
2136
+ // Imposto i FormControl variabili.
2137
+ this.onImageIsContextualAttachmentChange();
1557
2138
  this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
1558
2139
  break;
1559
2140
  case exports.FieldTypeEnum['Elenco generico']:
@@ -1570,11 +2151,51 @@
1570
2151
  if ([exports.FieldTypeEnum.Allegato, exports.FieldTypeEnum.Immagine, exports.FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
1571
2152
  this.field.Formula = null;
1572
2153
  this.fieldFormGroup.controls["Formula"].disable();
2154
+ this.fieldFormGroup.controls["InListView"].disable();
1573
2155
  }
1574
2156
  else {
1575
2157
  this.fieldFormGroup.controls["Formula"].enable();
2158
+ this.fieldFormGroup.controls["InListView"].enable();
2159
+ }
2160
+ };
2161
+ /**
2162
+ * Metodo invocato al cambio del valore della proprietà ImageIsContextualAttachment nel caso
2163
+ * di campi di tipo Immagine. Se TRUE allora rimuove i FormControl per le proprietà IsMultiAttach
2164
+ * e AllowedExtensions e aggiunge i FormControl per le proprietà ImgName e ContextualAttachment,
2165
+ * altrimenti il contrario.
2166
+ */
2167
+ AddFormFieldComponent.prototype.onImageIsContextualAttachmentChange = function () {
2168
+ this.field.ImgName = null;
2169
+ this.field.AttachDefinition.AllowedExtensions = [];
2170
+ this.field.AttachDefinition.IsMultiAttach = false;
2171
+ this.field.ContextualAttachment = null;
2172
+ if (this.field.ImageIsContextualAttachment) {
2173
+ this.fieldFormGroup.removeControl("IsMultiAttach");
2174
+ this.fieldFormGroup.removeControl("AllowedExtensions");
2175
+ this.fieldFormGroup.addControl('ImgName', new forms.FormControl(this.field.ImgName, forms.Validators.required));
2176
+ this.fieldFormGroup.addControl('ContextualAttachment', new forms.FormControl(this.field.ContextualAttachment, forms.Validators.required));
2177
+ }
2178
+ else {
2179
+ this.fieldFormGroup.removeControl("ImgName");
2180
+ this.fieldFormGroup.removeControl("ContextualAttachment");
2181
+ this.fieldFormGroup.addControl('IsMultiAttach', new forms.FormControl(this.field.AttachDefinition.IsMultiAttach));
2182
+ this.fieldFormGroup.addControl("AllowedExtensions", new forms.FormControl(this.field.AttachDefinition.AllowedExtensions));
1576
2183
  }
1577
2184
  };
2185
+ /**
2186
+ * Metodo per intercettare l'aggiunta di un allegato nei campi di tipo Immagine per aggiornare
2187
+ * il valore della proprietà ContextualAttachment e la validazione del relativo FormControl.
2188
+ * @param event Array contenente l'elenco aggiornato degli allegati caricati (nel nostro caso ne contiene al più 1).
2189
+ */
2190
+ AddFormFieldComponent.prototype.catchContextualAttachmentChange = function (event) {
2191
+ if (event && event.length > 0) {
2192
+ this.field.ContextualAttachment = event[0];
2193
+ }
2194
+ else {
2195
+ this.field.ContextualAttachment = null;
2196
+ }
2197
+ this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
2198
+ };
1578
2199
  /**
1579
2200
  * Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
1580
2201
  * da usare nella visualizzazione del campo. Questa funzione manipola la sorgente dati per
@@ -1583,17 +2204,50 @@
1583
2204
  * seleziona la classe "col-sm-6", al change del valore questo metodo rimuove dalla select
1584
2205
  * tutti gli altri valori per la grandezza di schermo selezionata.
1585
2206
  */
1586
- AddFormFieldComponent.prototype.onColSizeSelect = function () {
2207
+ AddFormFieldComponent.prototype.onColSpanSizeSelect = function () {
1587
2208
  // Recupero l'array degli oggetti chiave-valore che rappreseta l'enumeratore
1588
2209
  var colSizeClassEnumArray = this.enumHelper.getEnumArray(exports.ColSpanSizesEnum, false, null);
1589
2210
  // Costruisco l'array delle classi selezionate dall'utente in formato stringa
1590
- var selectedDimensions = this.field.ColSizes ? this.field.ColSizes.map(function (col) { return exports.ColSpanSizesEnum[col]; }) : [];
2211
+ var selectedDimensions = this.field.ColSpanSizes ? this.field.ColSpanSizes.map(function (col) { return exports.ColSpanSizesEnum[col]; }) : [];
1591
2212
  // Filtro i valori ottenuti dall'enumeratore per escludere tutti i valori per le
1592
2213
  // grandezze di schermo già selezionatead esclusione dei valori selezionati.
1593
2214
  this.availableColSpanSizes = colSizeClassEnumArray.filter(function (value) {
1594
2215
  return !selectedDimensions.find(function (col) { return value.value.includes(col.substring(4, 6)) && value.value != col; });
1595
2216
  });
1596
2217
  };
2218
+ /**
2219
+ * Metodo invocato al cambio del tipo di visualizzazione scelta per i campi di tipo elenco generico.
2220
+ * Se viene scelta la visualizzazione ad immagini svuota la lista delle coppie chiave-valore inserite
2221
+ * in precedenza, altrimenti svuota la lista delle immagini caricate.
2222
+ */
2223
+ AddFormFieldComponent.prototype.onPresentationModeChange = function () {
2224
+ if (this.field.PresentationMode === exports.ListPresentationEnum.Immagini) {
2225
+ this.field.ValuePairs = null;
2226
+ }
2227
+ else {
2228
+ this.field.ButtonImageList = null;
2229
+ }
2230
+ };
2231
+ /**
2232
+ * Metodo invocato quando viene caricato il componente eqp-attachments per caricare le immagini da usare
2233
+ * nella visualizzazione ad immagini dei campi di tipo "Elenco generico". Aggiunge due colonne a quelle
2234
+ * configurate nel componente in cui l'utente può indicare chiave e valore della scelta.
2235
+ * @param component Istanza del componente eqp-attachments in cui effettuare la modifica.
2236
+ */
2237
+ AddFormFieldComponent.prototype.configureButtonImagesColumns = function (component) {
2238
+ component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonKey", display: "Label", type: eqpTable.TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
2239
+ component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonValue", display: "Valore", type: eqpTable.TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
2240
+ this.cdr.detectChanges();
2241
+ };
2242
+ /**
2243
+ * Metodo invocato al salvataggio degli allegati quando viene configurato un campo di tipo "Elenco generico"
2244
+ * con il tipo di visualizzazione ad immagini. Intercetta l'elenco aggiornato delle immagini caricate e lo
2245
+ * memorizza nell'oggetto field corrente.
2246
+ * @param attachments Array aggiornato degli allegati caricati.
2247
+ */
2248
+ AddFormFieldComponent.prototype.catchButtonImagesChange = function (attachments) {
2249
+ this.field.ButtonImageList = attachments;
2250
+ };
1597
2251
  /**
1598
2252
  * Metodo chiamato al keyup degli input testuali che prevedono l'aggiunta del valore inserito in un array.
1599
2253
  * Se l'utente preme il tasto invio, in base al tipo di campo che sta inserendo/modificando, questo metodo
@@ -1741,7 +2395,14 @@
1741
2395
  }
1742
2396
  switch (this.field.FieldType) {
1743
2397
  case exports.FieldTypeEnum['Elenco generico']:
1744
- return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
2398
+ if (this.field.PresentationMode != exports.ListPresentationEnum.Immagini) {
2399
+ return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
2400
+ }
2401
+ else {
2402
+ return (!this.field.ButtonImageList
2403
+ || this.field.ButtonImageList.length === 0
2404
+ || !!this.field.ButtonImageList.find(function (i) { return !i.ButtonKey || !i.ButtonValue; }));
2405
+ }
1745
2406
  case exports.FieldTypeEnum.Lookup:
1746
2407
  return !this.field.FieldNames || this.field.FieldNames.length === 0;
1747
2408
  default:
@@ -1775,7 +2436,7 @@
1775
2436
  this.field.Required = tmpBaseField.Required;
1776
2437
  this.field.FieldType = tmpBaseField.FieldType;
1777
2438
  this.field.Formula = tmpBaseField.Formula;
1778
- this.field.ColSizes = tmpBaseField.ColSizes;
2439
+ this.field.ColSpanSizes = tmpBaseField.ColSpanSizes;
1779
2440
  this.field.FieldGroup = tmpBaseField.FieldGroup;
1780
2441
  }
1781
2442
  };
@@ -1853,7 +2514,8 @@
1853
2514
  AddFormFieldComponent.ctorParameters = function () { return [
1854
2515
  { type: forms.FormBuilder },
1855
2516
  { type: eqpSelect.EnumHelper },
1856
- { type: dialog.MatDialog }
2517
+ { type: dialog.MatDialog },
2518
+ { type: core.ChangeDetectorRef }
1857
2519
  ]; };
1858
2520
  __decorate([
1859
2521
  core.Input()
@@ -1906,10 +2568,13 @@
1906
2568
  __decorate([
1907
2569
  core.ViewChild('dialogMetadata', { static: true })
1908
2570
  ], AddFormFieldComponent.prototype, "dialogMetadata", void 0);
2571
+ __decorate([
2572
+ core.ViewChild('buttonImagesKeyValueInputColumn', { static: true })
2573
+ ], AddFormFieldComponent.prototype, "buttonImagesKeyValueInputColumn", void 0);
1909
2574
  AddFormFieldComponent = __decorate([
1910
2575
  core.Component({
1911
2576
  selector: 'eqp-dynamic-module-add-form-field',
1912
- 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 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\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\">\n </mat-form-field>\n </div> -->\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiPoint\" formControlName=\"IsMultiPoint\" color=\"primary\">\n Immagine multi-point\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 <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\n color=\"primary\">\n Carica immagine come allegato\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 <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\">\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 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>",
2577
+ 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>",
1913
2578
  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}"]
1914
2579
  })
1915
2580
  ], AddFormFieldComponent);
@@ -1919,6 +2584,7 @@
1919
2584
  var TextFieldTemplateComponent = /** @class */ (function () {
1920
2585
  function TextFieldTemplateComponent() {
1921
2586
  this.recordChange = new core.EventEmitter();
2587
+ this.InputMaskEnum = exports.TextMaskEnum;
1922
2588
  }
1923
2589
  TextFieldTemplateComponent.prototype.ngOnInit = function () {
1924
2590
  };
@@ -1929,6 +2595,20 @@
1929
2595
  this.updateField();
1930
2596
  }
1931
2597
  };
2598
+ TextFieldTemplateComponent.prototype.getInputType = function () {
2599
+ switch (this.field.TextMask) {
2600
+ case exports.TextMaskEnum.Email:
2601
+ return 'email';
2602
+ case exports.TextMaskEnum.Password:
2603
+ return 'password';
2604
+ case exports.TextMaskEnum.Telefono:
2605
+ return 'tel';
2606
+ case exports.TextMaskEnum.Url:
2607
+ return 'url';
2608
+ default:
2609
+ return 'text';
2610
+ }
2611
+ };
1932
2612
  /**
1933
2613
  * Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
1934
2614
  */
@@ -1957,7 +2637,7 @@
1957
2637
  TextFieldTemplateComponent = __decorate([
1958
2638
  core.Component({
1959
2639
  selector: 'text-field-template',
1960
- 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>",
2640
+ 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>",
1961
2641
  styles: [""]
1962
2642
  })
1963
2643
  ], TextFieldTemplateComponent);
@@ -2009,7 +2689,7 @@
2009
2689
  BooleanFieldTemplateComponent = __decorate([
2010
2690
  core.Component({
2011
2691
  selector: 'boolean-field-template',
2012
- 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>",
2692
+ 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>",
2013
2693
  styles: [""]
2014
2694
  })
2015
2695
  ], BooleanFieldTemplateComponent);
@@ -2075,7 +2755,7 @@
2075
2755
  DateFieldTemplateComponent = __decorate([
2076
2756
  core.Component({
2077
2757
  selector: 'date-field-template',
2078
- 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>",
2758
+ 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>",
2079
2759
  styles: [""]
2080
2760
  })
2081
2761
  ], DateFieldTemplateComponent);
@@ -2123,7 +2803,7 @@
2123
2803
  TextareaFieldTemplateComponent = __decorate([
2124
2804
  core.Component({
2125
2805
  selector: 'textarea-field-template',
2126
- 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>",
2806
+ 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>",
2127
2807
  styles: [""]
2128
2808
  })
2129
2809
  ], TextareaFieldTemplateComponent);
@@ -2166,10 +2846,17 @@
2166
2846
  */
2167
2847
  NumericFieldTemplateComponent.prototype.configureEqpNumericOptions = function () {
2168
2848
  this.eqpNumericOptions.prefix = this.field.CurrencySymbol ? this.field.CurrencySymbol : "";
2849
+ this.eqpNumericOptions.inputMode = this.field.CurrencySymbol ? eqpNumeric.EqpNumericInputMode.FINANCIAL : eqpNumeric.EqpNumericInputMode.NATURAL;
2169
2850
  if (this.field.MinValue != null && this.field.MinValue != undefined)
2170
2851
  this.eqpNumericOptions.min = this.field.MinValue;
2171
2852
  if (this.field.MaxValue != null && this.field.MaxValue != undefined)
2172
2853
  this.eqpNumericOptions.max = this.field.MaxValue;
2854
+ if (this.field.DecimalSeparator != null && this.field.DecimalSeparator != undefined)
2855
+ this.eqpNumericOptions.decimal = this.field.DecimalSeparator;
2856
+ if (this.field.ThousandsSeparator != null && this.field.ThousandsSeparator != undefined)
2857
+ this.eqpNumericOptions.thousands = this.field.ThousandsSeparator;
2858
+ if (this.field.DecimalPrecision != null && this.field.DecimalPrecision != undefined)
2859
+ this.eqpNumericOptions.precision = this.field.DecimalPrecision;
2173
2860
  };
2174
2861
  __decorate([
2175
2862
  core.Input()
@@ -2183,7 +2870,7 @@
2183
2870
  NumericFieldTemplateComponent = __decorate([
2184
2871
  core.Component({
2185
2872
  selector: 'numeric-field-template',
2186
- 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>",
2873
+ 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>",
2187
2874
  styles: [""]
2188
2875
  })
2189
2876
  ], NumericFieldTemplateComponent);
@@ -2221,26 +2908,17 @@
2221
2908
  this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2222
2909
  }
2223
2910
  };
2224
- /**
2225
- * Metodo per recuperare la classe da applicare al button (nella relativa visualizzazione).
2226
- * Se il pulsante è stato selezionato imposta la classe "selected-button".
2227
- * @param data Oggetto bindato al pulsante
2228
- * @returns Restituisce la classe da applicare tramite [ngClass]
2229
- */
2230
- ListValueFieldTemplateComponent.prototype.getSelectButtonClass = function (data) {
2231
- var selectedButtonClass = "selected-button";
2232
- return data.Selected ? selectedButtonClass : null;
2233
- };
2234
2911
  /**
2235
2912
  * Metodo invocato quando viene selezionata un'opzione nella visualizzazione a button
2236
2913
  * @param data Rappresenta l'oggetto selezionato
2237
2914
  */
2238
2915
  ListValueFieldTemplateComponent.prototype.buttonSelectClick = function (data) {
2916
+ data.Selected = !data.Selected;
2239
2917
  if (this.field.IsMultiChoiche) {
2240
- data.Selected = !data.Selected;
2241
2918
  this.updateSelected(false);
2242
2919
  }
2243
2920
  else {
2921
+ this.arrayData.filter(function (d) { return d.Key != data.Key && d.Value != data.Value; }).forEach(function (d) { return d.Selected = false; });
2244
2922
  this.record[this.field.Name] = data.Value;
2245
2923
  }
2246
2924
  this.onRecordValueChange();
@@ -2270,16 +2948,23 @@
2270
2948
  */
2271
2949
  ListValueFieldTemplateComponent.prototype.setArrayData = function () {
2272
2950
  var _this = this;
2273
- Object.keys(this.field.ValuePairs).forEach(function (k) {
2274
- var isOptionSelected;
2275
- if (_this.field.IsMultiChoiche && _this.record[_this.field.Name] && _this.record[_this.field.Name].length > 0) {
2276
- isOptionSelected = !!_this.record[_this.field.Name].find(function (v) { return v == _this.field.ValuePairs[k]; });
2277
- }
2278
- else {
2279
- isOptionSelected = _this.record[_this.field.Name] === _this.field.ValuePairs[k];
2280
- }
2281
- _this.arrayData.push({ Key: k, Value: _this.field.ValuePairs[k], Selected: isOptionSelected });
2282
- });
2951
+ if (this.field.PresentationMode != exports.ListPresentationEnum.Immagini) {
2952
+ Object.keys(this.field.ValuePairs).forEach(function (k) { _this.createArrayDataElement(k, _this.field.ValuePairs[k]); });
2953
+ }
2954
+ else {
2955
+ this.field.ButtonImageList.forEach(function (i) { _this.createArrayDataElement(i.ButtonKey, i.ButtonValue, 'data:' + i.FileContentType + ';base64,' + i.FileDataBase64); });
2956
+ }
2957
+ };
2958
+ ListValueFieldTemplateComponent.prototype.createArrayDataElement = function (key, value, imgUrl) {
2959
+ if (imgUrl === void 0) { imgUrl = null; }
2960
+ var isOptionSelected;
2961
+ if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
2962
+ isOptionSelected = !!this.record[this.field.Name].find(function (v) { return v == value; });
2963
+ }
2964
+ else {
2965
+ isOptionSelected = this.record[this.field.Name] === value;
2966
+ }
2967
+ this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
2283
2968
  };
2284
2969
  /**
2285
2970
  * Metodo per aggiornare il valore e il validator del FormControl associato al campo.
@@ -2299,39 +2984,21 @@
2299
2984
  ListValueFieldTemplateComponent = __decorate([
2300
2985
  core.Component({
2301
2986
  selector: 'list-value-field-template',
2302
- 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>",
2303
- styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]
2987
+ 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>",
2988
+ 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}"]
2304
2989
  })
2305
2990
  ], ListValueFieldTemplateComponent);
2306
2991
  return ListValueFieldTemplateComponent;
2307
2992
  }());
2308
2993
 
2309
2994
  var AttachmentFieldTemplateComponent = /** @class */ (function () {
2310
- //#endregion
2311
2995
  function AttachmentFieldTemplateComponent(utilityService, cdr) {
2312
2996
  this.utilityService = utilityService;
2313
2997
  this.cdr = cdr;
2314
2998
  this.onlyImages = false;
2315
2999
  this.recordChange = new core.EventEmitter();
3000
+ this.onAttachmentsChange = new core.EventEmitter();
2316
3001
  this.metadataFormGroups = new Array();
2317
- //#region Etichette per eqp-attachments
2318
- this.previewLabel = "Anteprima";
2319
- this.emptyTableMessage = "No record found";
2320
- this.downloadTooltipPosition = "below";
2321
- this.openLinkLabel = "Apri link";
2322
- this.addButtonLabel = "Aggiungi";
2323
- this.downloadLabel = "Download";
2324
- this.deleteLabel = "Elimina";
2325
- this.fileNameLabel = "Nome file";
2326
- this.uploadFileLabel = "Carica file";
2327
- this.confirmLabel = "Conferma";
2328
- this.abortLabel = "Annulla";
2329
- this.saveLabel = "Salva";
2330
- this.exitLabel = "Esci";
2331
- this.eqpTableSearchText = "Cerca...";
2332
- this.deleteDialogTitle = "Attenzione:";
2333
- this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
2334
- this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
2335
3002
  }
2336
3003
  AttachmentFieldTemplateComponent.prototype.ngOnInit = function () {
2337
3004
  // Nel caso in cui sono in modifica di un Record aggiorno il valore
@@ -2382,6 +3049,10 @@
2382
3049
  this.createMetadataFormGroups();
2383
3050
  this.setFormControlValue();
2384
3051
  this.onRecordValueChange();
3052
+ // Scateno un evento di output necessario al componente ImageFieldTemplate al
3053
+ // variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
3054
+ // sull'immagine caricata in base alla configurazione del Field.
3055
+ this.onAttachmentsChange.emit();
2385
3056
  this.cdr.detectChanges();
2386
3057
  };
2387
3058
  /**
@@ -2468,6 +3139,9 @@
2468
3139
  __decorate([
2469
3140
  core.Output()
2470
3141
  ], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
3142
+ __decorate([
3143
+ core.Output()
3144
+ ], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
2471
3145
  __decorate([
2472
3146
  core.ViewChild("eqpAttachments", { static: true })
2473
3147
  ], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
@@ -2477,16 +3151,38 @@
2477
3151
  AttachmentFieldTemplateComponent = __decorate([
2478
3152
  core.Component({
2479
3153
  selector: 'attachment-field-template',
2480
- 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\" [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\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 ? ' *' : '')\" [previewLabel]=\"previewLabel\"\n [emptyTableMessage]=\"emptyTableMessage\" [downloadTooltipPosition]=\"downloadTooltipPosition\"\n [openLinkLabel]=\"openLinkLabel\" [addButtonLabel]=\"addButtonLabel\" [downloadLabel]=\"downloadLabel\"\n [deleteLabel]=\"deleteLabel\" [fileNameLabel]=\"fileNameLabel\" [uploadFileLabel]=\"uploadFileLabel\"\n [confirmLabel]=\"confirmLabel\" [abortLabel]=\"abortLabel\" [saveLabel]=\"saveLabel\" [exitLabel]=\"exitLabel\"\n [eqpTableSearchText]=\"eqpTableSearchText\" [deleteDialogTitle]=\"deleteDialogTitle\"\n [deleteDialogMessage]=\"deleteDialogMessage\" [noImageSelectedErrorMessage]=\"noImageSelectedErrorMessage\"\n (localEditedAttachments)=\"catchAttachmentList($event)\" #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>",
3154
+ 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>",
2481
3155
  styles: [""]
2482
3156
  })
2483
3157
  ], AttachmentFieldTemplateComponent);
2484
3158
  return AttachmentFieldTemplateComponent;
2485
3159
  }());
2486
3160
 
3161
+ /**
3162
+ * Metodo per recuperare, a partire da un Blob, la stringa contenente il base64 del file.
3163
+ * Usato per prendere il base64 dell'immagine dopo che l'utente ci ha disegnato sopra.
3164
+ * @param file Blob che rappresenta l'immagine.
3165
+ */
3166
+ var toBase64 = function (file) { return new Promise(function (resolve, reject) {
3167
+ var reader = new FileReader();
3168
+ reader.readAsDataURL(file);
3169
+ reader.onload = function () { return resolve(reader.result.toString()); };
3170
+ reader.onerror = function (error) { return reject(error); };
3171
+ }); };
3172
+ var ɵ0 = toBase64;
2487
3173
  var ImageFieldTemplateComponent = /** @class */ (function () {
2488
- function ImageFieldTemplateComponent() {
3174
+ //#endregion
3175
+ function ImageFieldTemplateComponent(dialog, utilityService) {
3176
+ this.dialog = dialog;
3177
+ this.utilityService = utilityService;
2489
3178
  this.recordChange = new core.EventEmitter();
3179
+ //#region Proprietà per configurare il componente ngx-image-drawing e aprire il relativo dialog.
3180
+ this.width = null;
3181
+ this.height = null;
3182
+ this.i18n = {
3183
+ saveBtn: 'Salva modifiche',
3184
+ cancelBtn: 'Ricarica originale'
3185
+ };
2490
3186
  }
2491
3187
  ImageFieldTemplateComponent.prototype.ngOnInit = function () {
2492
3188
  this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
@@ -2499,6 +3195,19 @@
2499
3195
  this.field.AttachDefinition.Required = this.field.Required;
2500
3196
  this.field.AttachDefinition.Formula = this.field.Formula;
2501
3197
  this.field.AttachDefinition.FieldValue = this.field.FieldValue;
3198
+ // Se il campo prevede un'immagine pre-caricata (ImageIsContextualAttachment == true) sulla quale
3199
+ // l'utente può disegnare (EnableDrawing == true) e non sono in modifica di un record (ovvero nel record
3200
+ // non ho un'immagine già salvata) allora imposta l'immagine pre caricata come valore iniziale
3201
+ // nel record corrente e ne recupera le dimensioni per visualizzare correttamente l'area in cui
3202
+ // l'utente può disegnare. Se non effettua modifiche o non salva i disegni fatti viene salvata
3203
+ // l'immagine originale.
3204
+ if (this.field.ImageIsContextualAttachment && this.field.ContextualAttachment) {
3205
+ if (!this.record[this.field.Name] || !Array.isArray(this.record[this.field.Name]) || !(this.record[this.field.Name].length > 0)) {
3206
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
3207
+ }
3208
+ this.preLoadedImageMetadataFormGroup = this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields, this.record[this.field.Name][0]);
3209
+ this.getImageDimensions();
3210
+ }
2502
3211
  };
2503
3212
  ImageFieldTemplateComponent.prototype.ngOnChanges = function (changes) {
2504
3213
  // Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
@@ -2507,6 +3216,15 @@
2507
3216
  this.updateField();
2508
3217
  }
2509
3218
  };
3219
+ ImageFieldTemplateComponent.prototype.updateMetadataValidity = function () {
3220
+ if (this.preLoadedImageMetadataFormGroup.invalid) {
3221
+ this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
3222
+ }
3223
+ else {
3224
+ this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
3225
+ }
3226
+ this.onRecordValueChange();
3227
+ };
2510
3228
  /**
2511
3229
  * Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
2512
3230
  */
@@ -2515,6 +3233,108 @@
2515
3233
  this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2516
3234
  }
2517
3235
  };
3236
+ ImageFieldTemplateComponent.prototype.resetPreLoadedImage = function () {
3237
+ this.width = null;
3238
+ this.height = null;
3239
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
3240
+ this.getImageDimensions();
3241
+ };
3242
+ /**
3243
+ * Metodo invocato quando vengono aggiunti o eliminati gli allegati nel componente AttachmentFieldTemplate.
3244
+ * Se l'ImageField è abilitato al disegno (EnableDrawing == true), non permette allegati multipli (IsMulitAttach == false)
3245
+ * e nel Record corrente è presente l'immagine caricata dall'utente allora recupera le dimensioni dell'immagine e
3246
+ * apre il dialog con il componente image-drawing per permettere il disegno sull'immagine appena caricata.
3247
+ */
3248
+ ImageFieldTemplateComponent.prototype.onAttachmentsChange = function () {
3249
+ if (!this.field.AttachDefinition.IsMultiAttach && this.field.EnableDrawing && this.record[this.field.Name] && this.record[this.field.Name][0]) {
3250
+ this.getImageDimensions();
3251
+ this.dialogImageDrowingRef = this.dialog.open(this.dialogImageDrowing, {
3252
+ disableClose: true,
3253
+ hasBackdrop: true,
3254
+ width: '75%'
3255
+ });
3256
+ }
3257
+ };
3258
+ /**
3259
+ * Metodo invocato al salvataggio dell'immagine dal componente image-drawing.
3260
+ * Trasforma il Blob ricevuto in un base64, aggiorna il FileContetType e il FileDataBase64
3261
+ * dell'allegato caricato e chiude il dialog in cui disegnare.
3262
+ * @param drawnPicture Blob dell'immagine disegnata.
3263
+ */
3264
+ ImageFieldTemplateComponent.prototype.saveDrowning = function (drawnPicture) {
3265
+ return __awaiter(this, void 0, void 0, function () {
3266
+ var base64File;
3267
+ return __generator(this, function (_a) {
3268
+ switch (_a.label) {
3269
+ case 0: return [4 /*yield*/, toBase64(drawnPicture)];
3270
+ case 1:
3271
+ base64File = _a.sent();
3272
+ if (base64File) {
3273
+ this.record[this.field.Name][0].FileContentType = base64File.split(",")[0].split(":")[1].split(";")[0];
3274
+ this.record[this.field.Name][0].FileDataBase64 = base64File.split(",")[1];
3275
+ }
3276
+ if (this.dialogImageDrowingRef) {
3277
+ this.closeImageDrowingDialog();
3278
+ }
3279
+ return [2 /*return*/];
3280
+ }
3281
+ });
3282
+ });
3283
+ };
3284
+ /**
3285
+ * Metodo per chiudere il dialog in cui disegnare sull'immagine cariata e svuotare le dimensioni.
3286
+ */
3287
+ ImageFieldTemplateComponent.prototype.closeImageDrowingDialog = function () {
3288
+ this.dialogImageDrowingRef.close();
3289
+ this.width = null;
3290
+ this.height = null;
3291
+ };
3292
+ /**
3293
+ * Metodo per recuperare le dimensioni dell'immagine caricata per mostrare correttamente
3294
+ * il componente image-drawing. Se non viene eseguito questo passaggio l'area in cui disegnare
3295
+ * è più grande dell'immagine stessa e al salvataggio i tratti disegnati vengono spostati.
3296
+ */
3297
+ ImageFieldTemplateComponent.prototype.getImageDimensions = function () {
3298
+ var _this = this;
3299
+ var blob = this.getBlobFromBase64();
3300
+ var reader = new FileReader();
3301
+ reader.onload = function (e) {
3302
+ var image = new Image();
3303
+ image.src = e.target.result;
3304
+ image.onload = function (rs) {
3305
+ _this.height = rs.currentTarget['height'];
3306
+ _this.width = rs.currentTarget['width'];
3307
+ };
3308
+ };
3309
+ reader.readAsDataURL(blob);
3310
+ };
3311
+ /**
3312
+ * Metodo per convertire il base64 di un'immagine in un Blob.
3313
+ * Necessario per il recupero delle dimensioni dell'immagine caricata a partire dal suo base64.
3314
+ * Viene eseguito solo nel caso in cui l'ImageField non ammette allegati multipli.
3315
+ * @returns Restituisce il Blob dell'immagine caricata.
3316
+ */
3317
+ ImageFieldTemplateComponent.prototype.getBlobFromBase64 = function () {
3318
+ var byteCharacters = atob(this.record[this.field.Name][0].FileDataBase64);
3319
+ var byteNumbers = new Array(byteCharacters.length);
3320
+ for (var i = 0; i < byteCharacters.length; i++) {
3321
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
3322
+ }
3323
+ var byteArray = new Uint8Array(byteNumbers);
3324
+ return new Blob([byteArray], { type: this.record[this.field.Name][0].FileContentType });
3325
+ };
3326
+ /**
3327
+ * Metodo per emettere l'evento che il valore del record è cambiato.
3328
+ */
3329
+ ImageFieldTemplateComponent.prototype.onRecordValueChange = function () {
3330
+ if (!this.field.Formula) {
3331
+ this.recordChange.emit(this.record);
3332
+ }
3333
+ };
3334
+ ImageFieldTemplateComponent.ctorParameters = function () { return [
3335
+ { type: dialog.MatDialog },
3336
+ { type: UtilityHelperService }
3337
+ ]; };
2518
3338
  __decorate([
2519
3339
  core.Input()
2520
3340
  ], ImageFieldTemplateComponent.prototype, "record", void 0);
@@ -2524,11 +3344,14 @@
2524
3344
  __decorate([
2525
3345
  core.Output()
2526
3346
  ], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
3347
+ __decorate([
3348
+ core.ViewChild("dialogImageDrowing", { static: true })
3349
+ ], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
2527
3350
  ImageFieldTemplateComponent = __decorate([
2528
3351
  core.Component({
2529
3352
  selector: 'image-field-template',
2530
- template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"\n [onlyImages]=\"true\">\n</attachment-field-template>",
2531
- styles: [""]
3353
+ 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>",
3354
+ styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
2532
3355
  })
2533
3356
  ], ImageFieldTemplateComponent);
2534
3357
  return ImageFieldTemplateComponent;
@@ -2609,30 +3432,14 @@
2609
3432
  * @param record Record da duplicare.
2610
3433
  */
2611
3434
  ListFormRecordComponent.prototype.duplicateRecord = function (record) {
2612
- // EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
2613
- // var copiedRecord: Record = JSON.parse(JSON.stringify(record));
2614
- // if (!isNaN(parseInt(copiedRecord.ID))) {
2615
- // copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2616
- // } else {
2617
- // copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
2618
- // }
2619
- // this.values.push(copiedRecord);
2620
- // this.reloadTables();
2621
- // }, false, 'Richiesta conferma');
2622
3435
  this.onDuplicateRecord.emit(record);
2623
- //TODO
2624
3436
  };
2625
3437
  /**
2626
3438
  * Metodo per eliminare un record dalla lista.
2627
3439
  * @param record Record da eliminare selezionato sulla eqp-table.
2628
3440
  */
2629
3441
  ListFormRecordComponent.prototype.deleteRecord = function (record) {
2630
- // EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
2631
- // this.values.splice(this.values.indexOf(record), 1);
2632
- // this.reloadTables();
2633
- // }, false, 'Richiesta conferma');
2634
3442
  this.onDeleteRecord.emit(record);
2635
- // TODO
2636
3443
  };
2637
3444
  /**
2638
3445
  * Metodo per creare la configurazione delle colonne per la eqp-table.
@@ -2675,7 +3482,7 @@
2675
3482
  column.format = "dd/MM/yyyy HH:mm";
2676
3483
  }
2677
3484
  else if (field.IsOnlyDate == exports.DateTimeTypeEnum['Solo data']) {
2678
- column.format = "dd/MM/yyyy";
3485
+ column.format = field.DateFormat ? field.DateFormat.replace("DD", "dd") : "dd/MM/yyyy";
2679
3486
  }
2680
3487
  }
2681
3488
  break;
@@ -2763,12 +3570,6 @@
2763
3570
  return ListFormRecordComponent;
2764
3571
  }());
2765
3572
 
2766
- var Record = /** @class */ (function () {
2767
- function Record() {
2768
- }
2769
- return Record;
2770
- }());
2771
-
2772
3573
  var AddFormRecordComponent = /** @class */ (function () {
2773
3574
  function AddFormRecordComponent(cdr, utilityService) {
2774
3575
  this.cdr = cdr;
@@ -2888,7 +3689,7 @@
2888
3689
  AddFormRecordComponent = __decorate([
2889
3690
  core.Component({
2890
3691
  selector: 'add-form-record',
2891
- 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>",
3692
+ 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>",
2892
3693
  styles: [""]
2893
3694
  })
2894
3695
  ], AddFormRecordComponent);
@@ -3010,13 +3811,33 @@
3010
3811
  DynamicModuleFieldComponent = __decorate([
3011
3812
  core.Component({
3012
3813
  selector: 'dynamic-module-field',
3013
- 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>",
3814
+ 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>",
3014
3815
  styles: [""]
3015
3816
  })
3016
3817
  ], DynamicModuleFieldComponent);
3017
3818
  return DynamicModuleFieldComponent;
3018
3819
  }());
3019
3820
 
3821
+ var SpinnerComponent = /** @class */ (function () {
3822
+ function SpinnerComponent(spinnerService) {
3823
+ this.spinnerService = spinnerService;
3824
+ this.isLoading = this.spinnerService.isLoading;
3825
+ }
3826
+ SpinnerComponent.prototype.ngOnInit = function () {
3827
+ };
3828
+ SpinnerComponent.ctorParameters = function () { return [
3829
+ { type: SpinnerService }
3830
+ ]; };
3831
+ SpinnerComponent = __decorate([
3832
+ core.Component({
3833
+ selector: 'eqp-dynamic-module-spinner',
3834
+ template: "<div class=\"eqp-splash-screen\" *ngIf=\"isLoading | async\">\r\n <div id=\"loader\"></div>\r\n</div>",
3835
+ 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}"]
3836
+ })
3837
+ ], SpinnerComponent);
3838
+ return SpinnerComponent;
3839
+ }());
3840
+
3020
3841
  var EqpDynamicModuleModule = /** @class */ (function () {
3021
3842
  function EqpDynamicModuleModule() {
3022
3843
  }
@@ -3037,6 +3858,7 @@
3037
3858
  ListFormRecordComponent,
3038
3859
  AddFormRecordComponent,
3039
3860
  DynamicModuleFieldComponent,
3861
+ SpinnerComponent,
3040
3862
  ],
3041
3863
  imports: [
3042
3864
  platformBrowser.BrowserModule,
@@ -3049,7 +3871,8 @@
3049
3871
  eqpSelect.EqpSelectModule,
3050
3872
  eqpDatetimepicker.EqpDatetimepickerModule,
3051
3873
  eqpFilters.EqpFiltersModule,
3052
- eqpNumeric.EqpNumericModule
3874
+ eqpNumeric.EqpNumericModule,
3875
+ eqpImgDrawing.EqpImgDrawingModule
3053
3876
  ],
3054
3877
  exports: [
3055
3878
  EqpDynamicModuleComponent,
@@ -3076,6 +3899,14 @@
3076
3899
  function ImageField() {
3077
3900
  return _super !== null && _super.apply(this, arguments) || this;
3078
3901
  }
3902
+ Object.defineProperty(ImageField.prototype, "_contextualAttachments", {
3903
+ /**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
3904
+ get: function () {
3905
+ return this.ContextualAttachment ? [this.ContextualAttachment] : [];
3906
+ },
3907
+ enumerable: true,
3908
+ configurable: true
3909
+ });
3079
3910
  return ImageField;
3080
3911
  }(BaseField));
3081
3912
 
@@ -3105,15 +3936,6 @@
3105
3936
  return TextareaField;
3106
3937
  }(BaseField));
3107
3938
 
3108
- /**Campo di testo */
3109
- var TextField = /** @class */ (function (_super) {
3110
- __extends(TextField, _super);
3111
- function TextField() {
3112
- return _super !== null && _super.apply(this, arguments) || this;
3113
- }
3114
- return TextField;
3115
- }(BaseField));
3116
-
3117
3939
  exports.ActionOnRecord = ActionOnRecord;
3118
3940
  exports.AddFormFieldComponent = AddFormFieldComponent;
3119
3941
  exports.AddFormRecordComponent = AddFormRecordComponent;
@@ -3126,11 +3948,16 @@
3126
3948
  exports.BaseObj = BaseObj;
3127
3949
  exports.BooleanField = BooleanField;
3128
3950
  exports.BooleanFieldTemplateComponent = BooleanFieldTemplateComponent;
3951
+ exports.ButtonImage = ButtonImage;
3129
3952
  exports.Context = Context;
3130
3953
  exports.ContextUser = ContextUser;
3131
3954
  exports.DateField = DateField;
3132
3955
  exports.DateFieldTemplateComponent = DateFieldTemplateComponent;
3956
+ exports.DynRecord = DynRecord;
3133
3957
  exports.DynamicModuleFieldComponent = DynamicModuleFieldComponent;
3958
+ exports.EndPointConfiguration = EndPointConfiguration;
3959
+ exports.EndPointData = EndPointData;
3960
+ exports.EndPointDataParams = EndPointDataParams;
3134
3961
  exports.Entity = Entity;
3135
3962
  exports.EqpDynamicModuleComponent = EqpDynamicModuleComponent;
3136
3963
  exports.EqpDynamicModuleConfiguratorComponent = EqpDynamicModuleConfiguratorComponent;
@@ -3147,12 +3974,17 @@
3147
3974
  exports.NumericField = NumericField;
3148
3975
  exports.NumericFieldTemplateComponent = NumericFieldTemplateComponent;
3149
3976
  exports.Record = Record;
3977
+ exports.SpinnerService = SpinnerService;
3978
+ exports.TelRegex = TelRegex;
3150
3979
  exports.TextField = TextField;
3151
3980
  exports.TextFieldTemplateComponent = TextFieldTemplateComponent;
3152
3981
  exports.TextareaField = TextareaField;
3153
3982
  exports.TextareaFieldTemplateComponent = TextareaFieldTemplateComponent;
3983
+ exports.UrlRegex = UrlRegex;
3154
3984
  exports.UtilityHelperService = UtilityHelperService;
3155
- exports.ɵa = MaterialModule;
3985
+ exports.ɵ0 = ɵ0;
3986
+ exports.ɵa = SpinnerComponent;
3987
+ exports.ɵb = MaterialModule;
3156
3988
 
3157
3989
  Object.defineProperty(exports, '__esModule', { value: true });
3158
3990