@eqproject/eqp-dynamic-module 0.0.1 → 0.0.4

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 (33) hide show
  1. package/bundles/eqproject-eqp-dynamic-module.umd.js +305 -75
  2. package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -1
  3. package/bundles/eqproject-eqp-dynamic-module.umd.min.js +2 -2
  4. package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -1
  5. package/eqproject-eqp-dynamic-module.metadata.json +1 -1
  6. package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +33 -12
  7. package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +45 -6
  8. package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +10 -21
  9. package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +149 -7
  10. package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +7 -3
  11. package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +40 -18
  12. package/esm2015/lib/eqp-dynamic-module.module.js +4 -2
  13. package/esm2015/lib/models/fields/imageField.model.js +5 -1
  14. package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +33 -12
  15. package/esm5/lib/components/private/add-form-field/add-form-field.component.js +45 -6
  16. package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +10 -21
  17. package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +158 -7
  18. package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +7 -3
  19. package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +40 -20
  20. package/esm5/lib/eqp-dynamic-module.module.js +4 -2
  21. package/esm5/lib/models/fields/imageField.model.js +9 -1
  22. package/fesm2015/eqproject-eqp-dynamic-module.js +291 -74
  23. package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
  24. package/fesm5/eqproject-eqp-dynamic-module.js +304 -76
  25. package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
  26. package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +7 -1
  27. package/lib/components/private/add-form-field/add-form-field.component.d.ts +14 -0
  28. package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +1 -17
  29. package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +51 -2
  30. package/lib/components/private/form-records/add-form-record/add-form-record.component.d.ts +3 -1
  31. package/lib/components/private/form-records/list-form-record/list-form-record.component.d.ts +8 -3
  32. package/lib/models/fields/imageField.model.d.ts +10 -4
  33. package/package.json +3 -1
@@ -1,6 +1,6 @@
1
- import { __extends, __decorate } from 'tslib';
1
+ import { __extends, __decorate, __awaiter, __generator } from 'tslib';
2
2
  import { CommonModule } from '@angular/common';
3
- import { ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, NgModule, EventEmitter, ViewChild, Output, ChangeDetectorRef, ViewChildren } from '@angular/core';
3
+ import { ɵɵdefineInjectable, ɵɵinject, Injectable, EventEmitter, Input, Output, Component, NgModule, ViewChild, ChangeDetectorRef, ViewChildren } from '@angular/core';
4
4
  import { Validators, FormControl, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { MatCheckboxModule } from '@angular/material/checkbox';
6
6
  import { MatButtonModule } from '@angular/material/button';
@@ -37,12 +37,11 @@ import { TypeColumn, CellAlignmentEnum, NumberColumnPipe, EqpTableModule } from
37
37
  import { EqpAttachmentsModule } from '@eqproject/eqp-attachments';
38
38
  import { EnumHelper, EqpSelectModule } from '@eqproject/eqp-select';
39
39
  import { PickerModeEnum, EqpDatetimepickerModule } from '@eqproject/eqp-datetimepicker';
40
+ import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';
40
41
  import { EqpFiltersModule } from '@eqproject/eqp-filters';
41
42
  import { EqpNumericModule } from '@eqproject/eqp-numeric';
42
43
  import Swal from 'sweetalert2';
43
44
  import { BrowserModule } from '@angular/platform-browser';
44
- import { UtilityHelperService as UtilityHelperService$1 } from 'projects/eqp-dynamic-module/src/lib/services/utilityHelper.services';
45
- import { UtilityHelperService as UtilityHelperService$2, EqpDynamicModuleDialogService as EqpDynamicModuleDialogService$1, FieldTypeEnum as FieldTypeEnum$1, DateTimeTypeEnum as DateTimeTypeEnum$1 } from 'projects/eqp-dynamic-module/src/public-api';
46
45
 
47
46
  var Context = /** @class */ (function () {
48
47
  function Context() {
@@ -385,7 +384,11 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
385
384
  this.context = new Context();
386
385
  this.form = new Form();
387
386
  this.showButtons = true;
387
+ this.showTitle = true;
388
388
  this.viewMode = FormTypeEnum.LIST;
389
+ this.saveRecord = new EventEmitter();
390
+ this.deleteRecord = new EventEmitter();
391
+ this.duplicateRecord = new EventEmitter();
389
392
  this.FormTypeEnum = FormTypeEnum;
390
393
  }
391
394
  EqpDynamicModuleComponent.prototype.ngOnInit = function () {
@@ -404,16 +407,21 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
404
407
  };
405
408
  EqpDynamicModuleComponent.prototype.onSaveForm = function (event) {
406
409
  //TODO: Salvare il record!
407
- if (event != null) {
408
- if (event.ID && this.values.find(function (v) { return v.ID == event.ID; })) {
409
- this.values[this.values.findIndex(function (v) { return v.ID == event.ID; })] = event;
410
- }
411
- else {
412
- this.values.push(event);
413
- }
414
- }
410
+ // if (event != null) {
411
+ // if (event.ID && this.values.find(v => v.ID == event.ID)) {
412
+ // this.values[this.values.findIndex(v => v.ID == event.ID)] = event;
413
+ // } else {
414
+ // this.values.push(event);
415
+ // }
416
+ // }
417
+ this.saveRecord.emit(event);
415
418
  this.viewMode = FormTypeEnum.LIST;
416
- console.log(event);
419
+ };
420
+ EqpDynamicModuleComponent.prototype.onDuplicateRecord = function (record) {
421
+ this.duplicateRecord.emit(record);
422
+ };
423
+ EqpDynamicModuleComponent.prototype.onDeleteRecord = function (record) {
424
+ this.deleteRecord.emit(record);
417
425
  };
418
426
  __decorate([
419
427
  Input()
@@ -427,13 +435,25 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
427
435
  __decorate([
428
436
  Input()
429
437
  ], EqpDynamicModuleComponent.prototype, "showButtons", void 0);
438
+ __decorate([
439
+ Input()
440
+ ], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
430
441
  __decorate([
431
442
  Input()
432
443
  ], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
444
+ __decorate([
445
+ Output()
446
+ ], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
447
+ __decorate([
448
+ Output()
449
+ ], EqpDynamicModuleComponent.prototype, "deleteRecord", void 0);
450
+ __decorate([
451
+ Output()
452
+ ], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
433
453
  EqpDynamicModuleComponent = __decorate([
434
454
  Component({
435
455
  selector: 'eqp-dynamic-module',
436
- template: "<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"onSaveForm($event)\">\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)\">\r\n</list-form-record>",
456
+ template: "<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"onSaveForm($event)\" [showTitle]=\"showTitle\">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf=\"viewMode == FormTypeEnum.LIST\" [form]=\"form\" [values]=\"values\"\r\n (onAddViewEditRecord)=\"onAddViewEditRecord($event)\" [showTitle]=\"showTitle\"\r\n (onDeleteRecord)=\"onDeleteRecord($event)\" (onDuplicateRecord)=\"onDuplicateRecord($event)\">\r\n</list-form-record>",
437
457
  styles: ["::ng-deep mat-form-field{width:100%}"]
438
458
  })
439
459
  ], EqpDynamicModuleComponent);
@@ -1347,11 +1367,10 @@ var AddFormFieldComponent = /** @class */ (function () {
1347
1367
  break;
1348
1368
  case FieldTypeEnum.Immagine:
1349
1369
  this.field.AttachDefinition = new AttachmentField();
1350
- this.fieldFormGroup.addControl('IsMultiAttach', new FormControl(this.field.AttachDefinition.IsMultiAttach));
1351
- // this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
1352
- this.fieldFormGroup.addControl('IsMultiPoint', new FormControl(this.field.IsMultiPoint));
1353
- this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
1370
+ this.fieldFormGroup.addControl('EnableDrawing', new FormControl(this.field.EnableDrawing));
1354
1371
  this.fieldFormGroup.addControl('ImageIsContextualAttachment', new FormControl(this.field.ImageIsContextualAttachment));
1372
+ // Imposto i FormControl variabili.
1373
+ this.onImageIsContextualAttachmentChange();
1355
1374
  this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
1356
1375
  break;
1357
1376
  case FieldTypeEnum['Elenco generico']:
@@ -1368,10 +1387,50 @@ var AddFormFieldComponent = /** @class */ (function () {
1368
1387
  if ([FieldTypeEnum.Allegato, FieldTypeEnum.Immagine, FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
1369
1388
  this.field.Formula = null;
1370
1389
  this.fieldFormGroup.controls["Formula"].disable();
1390
+ this.fieldFormGroup.controls["InListView"].disable();
1371
1391
  }
1372
1392
  else {
1373
1393
  this.fieldFormGroup.controls["Formula"].enable();
1394
+ this.fieldFormGroup.controls["InListView"].enable();
1395
+ }
1396
+ };
1397
+ /**
1398
+ * Metodo invocato al cambio del valore della proprietà ImageIsContextualAttachment nel caso
1399
+ * di campi di tipo Immagine. Se TRUE allora rimuove i FormControl per le proprietà IsMultiAttach
1400
+ * e AllowedExtensions e aggiunge i FormControl per le proprietà ImgName e ContextualAttachment,
1401
+ * altrimenti il contrario.
1402
+ */
1403
+ AddFormFieldComponent.prototype.onImageIsContextualAttachmentChange = function () {
1404
+ this.field.ImgName = null;
1405
+ this.field.AttachDefinition.AllowedExtensions = [];
1406
+ this.field.AttachDefinition.IsMultiAttach = false;
1407
+ this.field.ContextualAttachment = null;
1408
+ if (this.field.ImageIsContextualAttachment) {
1409
+ this.fieldFormGroup.removeControl("IsMultiAttach");
1410
+ this.fieldFormGroup.removeControl("AllowedExtensions");
1411
+ this.fieldFormGroup.addControl('ImgName', new FormControl(this.field.ImgName, Validators.required));
1412
+ this.fieldFormGroup.addControl('ContextualAttachment', new FormControl(this.field.ContextualAttachment, Validators.required));
1413
+ }
1414
+ else {
1415
+ this.fieldFormGroup.removeControl("ImgName");
1416
+ this.fieldFormGroup.removeControl("ContextualAttachment");
1417
+ this.fieldFormGroup.addControl('IsMultiAttach', new FormControl(this.field.AttachDefinition.IsMultiAttach));
1418
+ this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
1419
+ }
1420
+ };
1421
+ /**
1422
+ * Metodo per intercettare l'aggiunta di un allegato nei campi di tipo Immagine per aggiornare
1423
+ * il valore della proprietà ContextualAttachment e la validazione del relativo FormControl.
1424
+ * @param event Array contenente l'elenco aggiornato degli allegati caricati (nel nostro caso ne contiene al più 1).
1425
+ */
1426
+ AddFormFieldComponent.prototype.catchContextualAttachmentChange = function (event) {
1427
+ if (event && event.length > 0) {
1428
+ this.field.ContextualAttachment = event[0];
1429
+ }
1430
+ else {
1431
+ this.field.ContextualAttachment = null;
1374
1432
  }
1433
+ this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
1375
1434
  };
1376
1435
  /**
1377
1436
  * Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
@@ -1707,7 +1766,7 @@ var AddFormFieldComponent = /** @class */ (function () {
1707
1766
  AddFormFieldComponent = __decorate([
1708
1767
  Component({
1709
1768
  selector: 'eqp-dynamic-module-add-form-field',
1710
- 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>",
1769
+ template: "<div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\n <form [formGroup]=\"fieldFormGroup\">\n <div class=\"row\">\n <div class=\"header-title-standard\">{{indexField != null && indexField >= 0 ? \"Modifica\"\n : \"Aggiungi\"}} campo</div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"FieldTypeEnum\" [(ngModelInput)]=\"field.FieldType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo campo\" (ngModelInputChange)=\"onFieldTypeChange()\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldType'\"\n [enumDataToExclude]=\"fieldTypesToExclude\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Label </mat-label>\n <input formControlName=\"Label\" required matInput [(ngModel)]=\"field.Label\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Descrizione </mat-label>\n <input formControlName=\"Description\" required matInput [(ngModel)]=\"field.Description\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.Required\" formControlName=\"Required\" color=\"primary\">\n Obbligatorio\n </mat-slide-toggle>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Formula (Javascript) </mat-label>\n <input formControlName=\"Formula\" matInput [(ngModel)]=\"field.Formula\"\n [matAutocomplete]=\"formulaAutocomplete\" (keyup)=\"setFormulaAutocompleteOptions($event)\"\n (focus)=\"setFormulaAutocompleteOptions(null)\">\n <mat-autocomplete #formulaAutocomplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of formulaAutocompleteOptions\" [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"formFieldsGroups\">\n <eqp-select [arrayData]=\"formFieldsGroups\" [(ngModelInput)]=\"field.FieldGroup\"\n [arrayKeyProperty]=\"'Name'\" [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldGroup'\" [isRequired]=\"true\"\n [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"availableColSpanSizes\" [(ngModelInput)]=\"field.ColSizes\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" (ngModelInputChange)=\"onColSizeSelect()\"\n [isMultiSelect]=\"true\" placeholder=\"Larghezza campo\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'ColSizes'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.InListView\" formControlName=\"InListView\" color=\"primary\"\n [disabled]=\"fieldFormGroup.controls['InListView'].disabled\">\n Mostrare nella visualizzazione a lista\n </mat-slide-toggle>\n </div>\n\n <ng-container *ngTemplateOutlet=\"fieldTypeFormTemplate\">\n </ng-container>\n </div>\n\n\n <div class=\"row mt-2 mb-1\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveAndExitAddField(true)\"\n [disabled]=\"disableSaveField()\" type=\"button\">\n Salva\n </button>\n <button class=\"btn mat-raised-button\" (click)=\"saveAndExitAddField(false)\" type=\"button\">\n Esci\n </button>\n </div>\n </div>\n </form>\n</div>\n\n\n<!-- FORM PROPRIET\u00C0 CAMPI DI TESTO -->\n<ng-template #textFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Maschera </mat-label>\n <input formControlName=\"TextMask\" matInput [(ngModel)]=\"field.TextMask\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI AREA DI TESTO -->\n<ng-template #textareaFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Righe </mat-label>\n <input formControlName=\"Rows\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.Rows\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI BOOLEANI -->\n<ng-template #booleadFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsTristate\" formControlName=\"IsTristate\" color=\"primary\">\n A tre stati\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"BoolPresentantioEnum\" [(ngModelInput)]=\"field.PresetationType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresetationType'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI DATA -->\n<ng-template #dateFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data minima'\" [(ngModelInput)]=\"field.MinDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MinDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data massima'\" [(ngModelInput)]=\"field.MaxDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MaxDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"DateTimeTypeEnum\" [(ngModelInput)]=\"field.IsOnlyDate\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di data\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'IsOnlyDate'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI NUMERICI -->\n<ng-template #numericFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsInteger\" formControlName=\"IsInteger\" color=\"primary\">\n Valore intero\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Formato numerico </mat-label>\n <input formControlName=\"NumberFormat\" matInput [(ngModel)]=\"field.NumberFormat\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Simbolo valuta </mat-label>\n <input formControlName=\"CurrencySymbol\" matInput [(ngModel)]=\"field.CurrencySymbol\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore massimo </mat-label>\n <input formControlName=\"MinValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinValue\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore minimo </mat-label>\n <input formControlName=\"MaxValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxValue\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI ALLEGATO -->\n<ng-template #attachmentFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiAttach\" formControlName=\"IsMultiAttach\" color=\"primary\">\n Allegati multipli\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"AvailableFileExtensions.concat(AvailableImageExtensions)\"\n [(ngModelInput)]=\"field.AllowedExtensions\" [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\"\n [isMultiSelect]=\"true\" placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\" [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI IMMAGINE -->\n<ng-template #imageFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\n color=\"primary\" (ngModelChange)=\"onImageIsContextualAttachmentChange()\">\n Immagine pre-caricata nel campo\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.EnableDrawing\" formControlName=\"EnableDrawing\" color=\"primary\">\n Abilita il disegno\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\"\n *ngIf=\"!field.ImageIsContextualAttachment\">\n <mat-slide-toggle [(ngModel)]=\"field.AttachDefinition.IsMultiAttach\" formControlName=\"IsMultiAttach\"\n color=\"primary\">\n Immagini multiple\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"!field.ImageIsContextualAttachment\">\n <eqp-select [arrayData]=\"AvailableImageExtensions\" [(ngModelInput)]=\"field.AttachDefinition.AllowedExtensions\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" [isMultiSelect]=\"true\"\n placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\" required>\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-8 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\n <eqp-attachments [attachmentsList]=\"field._contextualAttachments\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"false\" [showHeader]=\"false\"\n (localEditedAttachments)=\"catchContextualAttachmentChange($event)\" #contextualAttachmentEqpAttachments>\n </eqp-attachments>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.AttachDefinition.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\"\n [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LISTA DI VALORI -->\n<ng-template #listValueFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiChoiche\" formControlName=\"IsMultiChoiche\" color=\"primary\">\n Scelta multipla\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"ListPresentationEnum\" [(ngModelInput)]=\"field.PresentationMode\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresentationMode'\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <h4 class=\"key-value-list-section-title\"> </h4>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Label opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.key\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Valore opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.value\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <span class=\"mr-3\">Opzioni inserite:</span>\n <ul class=\"value-pairs-list\">\n <li *ngFor=\"let keyValuePair of getDictionaryKeyValue()\">\n <mat-icon class=\"mr-1\" (click)=\"deleteKeyFromDictionary(keyValuePair.key)\">close\n </mat-icon>\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LOOKUP -->\n<ng-template #lookupFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.UseAsGetOrDiscard\" formControlName=\"UseAsGetOrDiscard\" color=\"primary\"\n matTooltip=\"Se true la lookup viene visualizzata in una modale per lo scegli scarta\">\n Usa per scegli o scarta\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field matTooltip=\"Nome dell'entit\u00E0 relazionata\">\n <mat-label> Nome entit\u00E0 </mat-label>\n <input formControlName=\"EntitySourceName\" required matInput [(ngModel)]=\"field.EntitySourceName\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <mat-form-field\n matTooltip=\"Elenco di campi ordinato che verr\u00E0 visualizzato nella lookup (premere invio per confermare)\">\n <mat-label>\n Nomi dei campi (invio per confermare) </mat-label>\n <input matInput (keyup)=\"onMultiSelectInputKeyup($event, 'FieldNames')\">\n </mat-form-field>\n </div>\n <div class=\"col-md-8 d-flex align-items-center\">\n <span class=\"mr-3\">Nomi selezionati:</span>\n <div class=\"extension-container\" *ngFor=\"let extension of field.FieldNames; let i = index\">\n <span>{{extension}}</span>\n <mat-icon class=\"ml-1\" (click)=\"field.FieldNames.splice(i,1)\">close\n </mat-icon>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE -->\n<ng-template #dialogMetadata>\n <eqp-dynamic-module-add-form-field [field]=\"selectedMetadata\" [availableFields]=\"availableFields\"\n [indexField]=\"indexSelectedMetadata\" (saveFieldEvent)=\"onSaveMetadata($event)\" [fieldTypesToExclude]=\"[6,7,10]\">\n </eqp-dynamic-module-add-form-field>\n</ng-template>",
1711
1770
  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}"]
1712
1771
  })
1713
1772
  ], AddFormFieldComponent);
@@ -2105,31 +2164,13 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
2105
2164
  }());
2106
2165
 
2107
2166
  var AttachmentFieldTemplateComponent = /** @class */ (function () {
2108
- //#endregion
2109
2167
  function AttachmentFieldTemplateComponent(utilityService, cdr) {
2110
2168
  this.utilityService = utilityService;
2111
2169
  this.cdr = cdr;
2112
2170
  this.onlyImages = false;
2113
2171
  this.recordChange = new EventEmitter();
2172
+ this.onAttachmentsChange = new EventEmitter();
2114
2173
  this.metadataFormGroups = new Array();
2115
- //#region Etichette per eqp-attachments
2116
- this.previewLabel = "Anteprima";
2117
- this.emptyTableMessage = "No record found";
2118
- this.downloadTooltipPosition = "below";
2119
- this.openLinkLabel = "Apri link";
2120
- this.addButtonLabel = "Aggiungi";
2121
- this.downloadLabel = "Download";
2122
- this.deleteLabel = "Elimina";
2123
- this.fileNameLabel = "Nome file";
2124
- this.uploadFileLabel = "Carica file";
2125
- this.confirmLabel = "Conferma";
2126
- this.abortLabel = "Annulla";
2127
- this.saveLabel = "Salva";
2128
- this.exitLabel = "Esci";
2129
- this.eqpTableSearchText = "Cerca...";
2130
- this.deleteDialogTitle = "Attenzione:";
2131
- this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
2132
- this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
2133
2174
  }
2134
2175
  AttachmentFieldTemplateComponent.prototype.ngOnInit = function () {
2135
2176
  // Nel caso in cui sono in modifica di un Record aggiorno il valore
@@ -2180,6 +2221,10 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
2180
2221
  this.createMetadataFormGroups();
2181
2222
  this.setFormControlValue();
2182
2223
  this.onRecordValueChange();
2224
+ // Scateno un evento di output necessario al componente ImageFieldTemplate al
2225
+ // variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
2226
+ // sull'immagine caricata in base alla configurazione del Field.
2227
+ this.onAttachmentsChange.emit();
2183
2228
  this.cdr.detectChanges();
2184
2229
  };
2185
2230
  /**
@@ -2266,6 +2311,9 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
2266
2311
  __decorate([
2267
2312
  Output()
2268
2313
  ], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
2314
+ __decorate([
2315
+ Output()
2316
+ ], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
2269
2317
  __decorate([
2270
2318
  ViewChild("eqpAttachments", { static: true })
2271
2319
  ], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
@@ -2275,16 +2323,38 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
2275
2323
  AttachmentFieldTemplateComponent = __decorate([
2276
2324
  Component({
2277
2325
  selector: 'attachment-field-template',
2278
- 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>",
2326
+ template: "<p *ngIf=\"!field.IsMultiAttach\" class=\"mb-2\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n</p>\n<div class=\"row\" *ngIf=\"!field.IsMultiAttach && record[field.Name] && record[field.Name][0]\">\n <div class=\"mt-2\" *ngFor=\"let metadata of field.MetadataFields\"\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\n <dynamic-module-field [field]=\"metadata\" [record]=\"record[field.Name][0]\"\n (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n </div>\n</div>\n\n<eqp-attachments [attachmentsList]=\"record[field.Name]\" [showMatCard]=\"true\" [allowOnlyImages]=\"onlyImages\"\n [isDisabled]=\"field.FormFormGroup.disabled\" [showInlinePreview]=\"true\" [multipleAttachment]=\"field.IsMultiAttach\"\n [disableAction]=\"field.FormFormGroup.disabled\" [acceptedFileTypes]=\"field.AllowedExtensions\" [showHeader]=\"true\"\n [headerTitle]=\"field.Label + (field.Required ? ' *' : '')\" (localEditedAttachments)=\"catchAttachmentList($event)\"\n #eqpAttachments>\n</eqp-attachments>\n\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\n<ng-template #metadataColumnTemplate let-row=\"row\" let-col=\"col\">\n <dynamic-module-field [field]=\"getFieldFromMetadata(col, row)\" [record]=\"row\"\n (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n</ng-template>",
2279
2327
  styles: [""]
2280
2328
  })
2281
2329
  ], AttachmentFieldTemplateComponent);
2282
2330
  return AttachmentFieldTemplateComponent;
2283
2331
  }());
2284
2332
 
2333
+ /**
2334
+ * Metodo per recuperare, a partire da un Blob, la stringa contenente il base64 del file.
2335
+ * Usato per prendere il base64 dell'immagine dopo che l'utente ci ha disegnato sopra.
2336
+ * @param file Blob che rappresenta l'immagine.
2337
+ */
2338
+ var toBase64 = function (file) { return new Promise(function (resolve, reject) {
2339
+ var reader = new FileReader();
2340
+ reader.readAsDataURL(file);
2341
+ reader.onload = function () { return resolve(reader.result.toString()); };
2342
+ reader.onerror = function (error) { return reject(error); };
2343
+ }); };
2344
+ var ɵ0 = toBase64;
2285
2345
  var ImageFieldTemplateComponent = /** @class */ (function () {
2286
- function ImageFieldTemplateComponent() {
2346
+ //#endregion
2347
+ function ImageFieldTemplateComponent(dialog, utilityService) {
2348
+ this.dialog = dialog;
2349
+ this.utilityService = utilityService;
2287
2350
  this.recordChange = new EventEmitter();
2351
+ //#region Proprietà per configurare il componente ngx-image-drawing e aprire il relativo dialog.
2352
+ this.width = null;
2353
+ this.height = null;
2354
+ this.i18n = {
2355
+ saveBtn: 'Salva modifiche',
2356
+ cancelBtn: 'Ricarica originale'
2357
+ };
2288
2358
  }
2289
2359
  ImageFieldTemplateComponent.prototype.ngOnInit = function () {
2290
2360
  this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
@@ -2297,6 +2367,19 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
2297
2367
  this.field.AttachDefinition.Required = this.field.Required;
2298
2368
  this.field.AttachDefinition.Formula = this.field.Formula;
2299
2369
  this.field.AttachDefinition.FieldValue = this.field.FieldValue;
2370
+ // Se il campo prevede un'immagine pre-caricata (ImageIsContextualAttachment == true) sulla quale
2371
+ // l'utente può disegnare (EnableDrawing == true) e non sono in modifica di un record (ovvero nel record
2372
+ // non ho un'immagine già salvata) allora imposta l'immagine pre caricata come valore iniziale
2373
+ // nel record corrente e ne recupera le dimensioni per visualizzare correttamente l'area in cui
2374
+ // l'utente può disegnare. Se non effettua modifiche o non salva i disegni fatti viene salvata
2375
+ // l'immagine originale.
2376
+ if (this.field.ImageIsContextualAttachment && this.field.ContextualAttachment) {
2377
+ if (!this.record[this.field.Name] || !Array.isArray(this.record[this.field.Name]) || !(this.record[this.field.Name].length > 0)) {
2378
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
2379
+ }
2380
+ this.preLoadedImageMetadataFormGroup = this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields, this.record[this.field.Name][0]);
2381
+ this.getImageDimensions();
2382
+ }
2300
2383
  };
2301
2384
  ImageFieldTemplateComponent.prototype.ngOnChanges = function (changes) {
2302
2385
  // Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
@@ -2305,14 +2388,125 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
2305
2388
  this.updateField();
2306
2389
  }
2307
2390
  };
2391
+ ImageFieldTemplateComponent.prototype.updateMetadataValidity = function () {
2392
+ if (this.preLoadedImageMetadataFormGroup.invalid) {
2393
+ this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
2394
+ }
2395
+ else {
2396
+ this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
2397
+ }
2398
+ this.onRecordValueChange();
2399
+ };
2308
2400
  /**
2309
2401
  * Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
2310
2402
  */
2311
2403
  ImageFieldTemplateComponent.prototype.updateField = function () {
2312
2404
  if (this.field.Formula) {
2313
- this.record[this.field.Name] = UtilityHelperService$1.EvaluateFieldFormula(this.field.Formula, this.record, null);
2405
+ this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2406
+ }
2407
+ };
2408
+ ImageFieldTemplateComponent.prototype.resetPreLoadedImage = function () {
2409
+ this.width = null;
2410
+ this.height = null;
2411
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
2412
+ this.getImageDimensions();
2413
+ };
2414
+ /**
2415
+ * Metodo invocato quando vengono aggiunti o eliminati gli allegati nel componente AttachmentFieldTemplate.
2416
+ * Se l'ImageField è abilitato al disegno (EnableDrawing == true), non permette allegati multipli (IsMulitAttach == false)
2417
+ * e nel Record corrente è presente l'immagine caricata dall'utente allora recupera le dimensioni dell'immagine e
2418
+ * apre il dialog con il componente image-drawing per permettere il disegno sull'immagine appena caricata.
2419
+ */
2420
+ ImageFieldTemplateComponent.prototype.onAttachmentsChange = function () {
2421
+ if (!this.field.AttachDefinition.IsMultiAttach && this.field.EnableDrawing && this.record[this.field.Name] && this.record[this.field.Name][0]) {
2422
+ this.getImageDimensions();
2423
+ this.dialogImageDrowingRef = this.dialog.open(this.dialogImageDrowing, {
2424
+ disableClose: true,
2425
+ hasBackdrop: true,
2426
+ width: '75%'
2427
+ });
2314
2428
  }
2315
2429
  };
2430
+ /**
2431
+ * Metodo invocato al salvataggio dell'immagine dal componente image-drawing.
2432
+ * Trasforma il Blob ricevuto in un base64, aggiorna il FileContetType e il FileDataBase64
2433
+ * dell'allegato caricato e chiude il dialog in cui disegnare.
2434
+ * @param drawnPicture Blob dell'immagine disegnata.
2435
+ */
2436
+ ImageFieldTemplateComponent.prototype.saveDrowning = function (drawnPicture) {
2437
+ return __awaiter(this, void 0, void 0, function () {
2438
+ var base64File;
2439
+ return __generator(this, function (_a) {
2440
+ switch (_a.label) {
2441
+ case 0: return [4 /*yield*/, toBase64(drawnPicture)];
2442
+ case 1:
2443
+ base64File = _a.sent();
2444
+ if (base64File) {
2445
+ this.record[this.field.Name][0].FileContentType = base64File.split(",")[0].split(":")[1].split(";")[0];
2446
+ this.record[this.field.Name][0].FileDataBase64 = base64File.split(",")[1];
2447
+ }
2448
+ if (this.dialogImageDrowingRef) {
2449
+ this.closeImageDrowingDialog();
2450
+ }
2451
+ return [2 /*return*/];
2452
+ }
2453
+ });
2454
+ });
2455
+ };
2456
+ /**
2457
+ * Metodo per chiudere il dialog in cui disegnare sull'immagine cariata e svuotare le dimensioni.
2458
+ */
2459
+ ImageFieldTemplateComponent.prototype.closeImageDrowingDialog = function () {
2460
+ this.dialogImageDrowingRef.close();
2461
+ this.width = null;
2462
+ this.height = null;
2463
+ };
2464
+ /**
2465
+ * Metodo per recuperare le dimensioni dell'immagine caricata per mostrare correttamente
2466
+ * il componente image-drawing. Se non viene eseguito questo passaggio l'area in cui disegnare
2467
+ * è più grande dell'immagine stessa e al salvataggio i tratti disegnati vengono spostati.
2468
+ */
2469
+ ImageFieldTemplateComponent.prototype.getImageDimensions = function () {
2470
+ var _this = this;
2471
+ var blob = this.getBlobFromBase64();
2472
+ var reader = new FileReader();
2473
+ reader.onload = function (e) {
2474
+ var image = new Image();
2475
+ image.src = e.target.result;
2476
+ image.onload = function (rs) {
2477
+ _this.height = rs.currentTarget['height'];
2478
+ _this.width = rs.currentTarget['width'];
2479
+ };
2480
+ };
2481
+ reader.readAsDataURL(blob);
2482
+ };
2483
+ /**
2484
+ * Metodo per convertire il base64 di un'immagine in un Blob.
2485
+ * Necessario per il recupero delle dimensioni dell'immagine caricata a partire dal suo base64.
2486
+ * Viene eseguito solo nel caso in cui l'ImageField non ammette allegati multipli.
2487
+ * @returns Restituisce il Blob dell'immagine caricata.
2488
+ */
2489
+ ImageFieldTemplateComponent.prototype.getBlobFromBase64 = function () {
2490
+ var byteCharacters = atob(this.record[this.field.Name][0].FileDataBase64);
2491
+ var byteNumbers = new Array(byteCharacters.length);
2492
+ for (var i = 0; i < byteCharacters.length; i++) {
2493
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
2494
+ }
2495
+ var byteArray = new Uint8Array(byteNumbers);
2496
+ return new Blob([byteArray], { type: this.record[this.field.Name][0].FileContentType });
2497
+ };
2498
+ /**
2499
+ * Metodo per emettere l'evento che il valore del record è cambiato.
2500
+ */
2501
+ ImageFieldTemplateComponent.prototype.onRecordValueChange = function () {
2502
+ if (!this.field.Formula) {
2503
+ this.recordChange.emit(this.record);
2504
+ }
2505
+ };
2506
+ ImageFieldTemplateComponent.ctorParameters = function () { return [
2507
+ { type: MatDialog },
2508
+ { type: UtilityHelperService }
2509
+ ]; };
2316
2510
  __decorate([
2317
2511
  Input()
2318
2512
  ], ImageFieldTemplateComponent.prototype, "record", void 0);
@@ -2322,11 +2516,14 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
2322
2516
  __decorate([
2323
2517
  Output()
2324
2518
  ], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
2519
+ __decorate([
2520
+ ViewChild("dialogImageDrowing", { static: true })
2521
+ ], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
2325
2522
  ImageFieldTemplateComponent = __decorate([
2326
2523
  Component({
2327
2524
  selector: 'image-field-template',
2328
- template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"\n [onlyImages]=\"true\">\n</attachment-field-template>",
2329
- styles: [""]
2525
+ template: "<!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA' DI DISEGNO -->\n<div class=\"row\" *ngIf=\"field.ImageIsContextualAttachment && field.ContextualAttachment\">\n <div class=\"col-sm-12 col-md-6 col-lg-4\">\n <p class=\"mb-2\">\n {{ field.Label + (field.Required ? \" *\" : \"\")}}\n <br>\n Nome immagine: {{ field.ImgName}}\n </p>\n <eqp-img-drawing\n *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\n [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\" [width]=\"width\"\n [height]=\"height\" [i18n]=\"i18n\" [showCancelButton]=\"true\" (save)=\"saveDrowning($event)\"\n (cancel)=\"resetPreLoadedImage()\">\n </eqp-img-drawing>\n\n <img *ngIf=\"!field.EnableDrawing\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType+ ';base64,'+ record[field.Name][0].FileDataBase64\">\n </div>\n\n <div class=\"col-sm-12 col-md-6 col-lg-8\">\n <div class=\"row\"\n *ngIf=\"field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup\">\n <div class=\"mt-2\" *ngFor=\"let metadata of field.AttachDefinition.MetadataFields\"\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\n <dynamic-module-field #fieldTemplate [field]=\"metadata\" [form]=\"preLoadedImageMetadataFormGroup\"\n [record]=\"record[field.Name][0]\" (recordChange)=\"updateMetadataValidity()\">\n </dynamic-module-field>\n </div>\n </div>\n </div>\n</div>\n\n<!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI -->\n<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\" [onlyImages]=\"true\"\n (onAttachmentsChange)=\"onAttachmentsChange()\" *ngIf=\"!field.ImageIsContextualAttachment\">\n</attachment-field-template>\n\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\n<ng-template #dialogImageDrowing>\n <div *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\n class=\"row\">\n <div class=\"col-sm-12 col-md-12\">\n <eqp-img-drawing [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\"\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\n [i18n]=\"i18n\" [showCancelButton]=\"false\" (save)=\"saveDrowning($event)\">\n </eqp-img-drawing>\n </div>\n </div>\n <div class=\"row mt-2 mb-1\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"btn mat-raised-button\" (click)=\"closeImageDrowingDialog()\" type=\"button\">\n Annulla disegno\n </button>\n </div>\n </div>\n</ng-template>",
2526
+ styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
2330
2527
  })
2331
2528
  ], ImageFieldTemplateComponent);
2332
2529
  return ImageFieldTemplateComponent;
@@ -2334,12 +2531,22 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
2334
2531
 
2335
2532
  var ListFormRecordComponent = /** @class */ (function () {
2336
2533
  function ListFormRecordComponent() {
2534
+ this.showTitle = true;
2337
2535
  this.columns = new Array();
2338
2536
  this.onAddViewEditRecord = new EventEmitter();
2537
+ this.onDeleteRecord = new EventEmitter();
2538
+ this.onDuplicateRecord = new EventEmitter();
2339
2539
  }
2340
2540
  ListFormRecordComponent.prototype.ngOnInit = function () {
2341
2541
  this.configureColumns();
2342
2542
  };
2543
+ ListFormRecordComponent.prototype.ngOnChanges = function (changes) {
2544
+ // Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
2545
+ if (changes['values'] != undefined && changes['values'].firstChange == false) {
2546
+ this.values = changes['values'].currentValue;
2547
+ this.reloadTables();
2548
+ }
2549
+ };
2343
2550
  /**
2344
2551
  * Metodo per configurare le colonne della eqp-table.
2345
2552
  */
@@ -2375,7 +2582,7 @@ var ListFormRecordComponent = /** @class */ (function () {
2375
2582
  .push({
2376
2583
  name: action.Name, icon: action.Icon, fn: function (element, index, col) {
2377
2584
  var rec = element;
2378
- var ctx = UtilityHelperService$2.context;
2585
+ var ctx = UtilityHelperService.context;
2379
2586
  eval(action.Action);
2380
2587
  // TODO: salvare le modifiche
2381
2588
  }
@@ -2397,18 +2604,17 @@ var ListFormRecordComponent = /** @class */ (function () {
2397
2604
  * @param record Record da duplicare.
2398
2605
  */
2399
2606
  ListFormRecordComponent.prototype.duplicateRecord = function (record) {
2400
- var _this = this;
2401
- EqpDynamicModuleDialogService$1.Confirm('Duplicare il record selezionato?', function () {
2402
- var copiedRecord = JSON.parse(JSON.stringify(record));
2403
- if (!isNaN(parseInt(copiedRecord.ID))) {
2404
- copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2405
- }
2406
- else {
2407
- copiedRecord.ID = "xxxxxxxxx".replace("x", function (c) { return (Math.random() + 16 | 0).toString(16); });
2408
- }
2409
- _this.values.push(copiedRecord);
2410
- _this.reloadTables();
2411
- }, false, 'Richiesta conferma');
2607
+ // EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
2608
+ // var copiedRecord: Record = JSON.parse(JSON.stringify(record));
2609
+ // if (!isNaN(parseInt(copiedRecord.ID))) {
2610
+ // copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2611
+ // } else {
2612
+ // copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
2613
+ // }
2614
+ // this.values.push(copiedRecord);
2615
+ // this.reloadTables();
2616
+ // }, false, 'Richiesta conferma');
2617
+ this.onDuplicateRecord.emit(record);
2412
2618
  //TODO
2413
2619
  };
2414
2620
  /**
@@ -2416,11 +2622,11 @@ var ListFormRecordComponent = /** @class */ (function () {
2416
2622
  * @param record Record da eliminare selezionato sulla eqp-table.
2417
2623
  */
2418
2624
  ListFormRecordComponent.prototype.deleteRecord = function (record) {
2419
- var _this = this;
2420
- EqpDynamicModuleDialogService$1.Confirm('Eliminare il record selezionato?', function () {
2421
- _this.values.splice(_this.values.indexOf(record), 1);
2422
- _this.reloadTables();
2423
- }, false, 'Richiesta conferma');
2625
+ // EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
2626
+ // this.values.splice(this.values.indexOf(record), 1);
2627
+ // this.reloadTables();
2628
+ // }, false, 'Richiesta conferma');
2629
+ this.onDeleteRecord.emit(record);
2424
2630
  // TODO
2425
2631
  };
2426
2632
  /**
@@ -2452,23 +2658,23 @@ var ListFormRecordComponent = /** @class */ (function () {
2452
2658
  ListFormRecordComponent.prototype.createFieldColumn = function (field) {
2453
2659
  var column = { key: field.Name, display: field.Label };
2454
2660
  switch (field.FieldType) {
2455
- case FieldTypeEnum$1['Booleano']:
2661
+ case FieldTypeEnum['Booleano']:
2456
2662
  column.type = TypeColumn.Boolean;
2457
2663
  column.booleanValues = { false: '<i class="fa fa-times error-color"></i>', true: '<i class="fa fa-check success-color"></i>' };
2458
2664
  column.styles = { flex: "0 0 7%", cellAlignment: CellAlignmentEnum.CENTER };
2459
2665
  break;
2460
- case FieldTypeEnum$1['Data e/o ora']:
2461
- if (field.IsOnlyDate != DateTimeTypeEnum$1['Solo orario']) {
2666
+ case FieldTypeEnum['Data e/o ora']:
2667
+ if (field.IsOnlyDate != DateTimeTypeEnum['Solo orario']) {
2462
2668
  column.type = TypeColumn.Date;
2463
- if (field.IsOnlyDate == DateTimeTypeEnum$1['Data e ora']) {
2669
+ if (field.IsOnlyDate == DateTimeTypeEnum['Data e ora']) {
2464
2670
  column.format = "dd/MM/yyyy HH:mm";
2465
2671
  }
2466
- else if (field.IsOnlyDate == DateTimeTypeEnum$1['Solo data']) {
2672
+ else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
2467
2673
  column.format = "dd/MM/yyyy";
2468
2674
  }
2469
2675
  }
2470
2676
  break;
2471
- case FieldTypeEnum$1['Campo numerico']:
2677
+ case FieldTypeEnum['Campo numerico']:
2472
2678
  if (field.CurrencySymbol) {
2473
2679
  column.numberPipe = NumberColumnPipe.CURRENCY;
2474
2680
  column.currencyPipeCode = field.CurrencySymbol;
@@ -2477,8 +2683,8 @@ var ListFormRecordComponent = /** @class */ (function () {
2477
2683
  column.numberPipe = NumberColumnPipe.DECIMAL;
2478
2684
  }
2479
2685
  break;
2480
- case FieldTypeEnum$1['Allegato']:
2481
- case FieldTypeEnum$1['Immagine']:
2686
+ case FieldTypeEnum['Allegato']:
2687
+ case FieldTypeEnum['Immagine']:
2482
2688
  column.value = function (element) {
2483
2689
  if (field.IsMultiAttach || (field.AttachDefinition && field.AttachDefinition.IsMultiAttach)) {
2484
2690
  return element[field.Name] != null && element[field.Name].length > 0 ? element[field.Name].map(function (a) { return a.FileName; }).join(", ") : null;
@@ -2490,7 +2696,7 @@ var ListFormRecordComponent = /** @class */ (function () {
2490
2696
  column.isSortable = false;
2491
2697
  column.isSearchable = false;
2492
2698
  break;
2493
- case FieldTypeEnum$1['Elenco generico']:
2699
+ case FieldTypeEnum['Elenco generico']:
2494
2700
  column.value = function (element) {
2495
2701
  if (field.IsMultiChoiche) {
2496
2702
  if (!element[field.Name] || element[field.Name].length == 0) {
@@ -2507,7 +2713,7 @@ var ListFormRecordComponent = /** @class */ (function () {
2507
2713
  column.isSortable = false;
2508
2714
  column.isSearchable = false;
2509
2715
  break;
2510
- case FieldTypeEnum$1['Lookup']:
2716
+ case FieldTypeEnum['Lookup']:
2511
2717
  // TODO
2512
2718
  break;
2513
2719
  }
@@ -2521,6 +2727,9 @@ var ListFormRecordComponent = /** @class */ (function () {
2521
2727
  this.tableRecords.reloadDatatable();
2522
2728
  }
2523
2729
  };
2730
+ __decorate([
2731
+ Input()
2732
+ ], ListFormRecordComponent.prototype, "showTitle", void 0);
2524
2733
  __decorate([
2525
2734
  Input()
2526
2735
  ], ListFormRecordComponent.prototype, "form", void 0);
@@ -2533,10 +2742,16 @@ var ListFormRecordComponent = /** @class */ (function () {
2533
2742
  __decorate([
2534
2743
  Output()
2535
2744
  ], ListFormRecordComponent.prototype, "onAddViewEditRecord", void 0);
2745
+ __decorate([
2746
+ Output()
2747
+ ], ListFormRecordComponent.prototype, "onDeleteRecord", void 0);
2748
+ __decorate([
2749
+ Output()
2750
+ ], ListFormRecordComponent.prototype, "onDuplicateRecord", void 0);
2536
2751
  ListFormRecordComponent = __decorate([
2537
2752
  Component({
2538
2753
  selector: 'list-form-record',
2539
- template: "<div class=\"row eqp-dynamic-module-title\">\r\n <div class=\"col-md-6\">\r\n <h4><b>Elenco {{form.Name}}</b></h4>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"onAddViewEditRecord.emit(null)\">\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\r\n\r\n<eqp-table #tableRecords [data]=\"values\" [columns]=\"columns\"></eqp-table>",
2754
+ template: "<div class=\"row eqp-dynamic-module-title\">\r\n <div class=\"col-md-6\">\r\n <h4 *ngIf=\"showTitle\"><b>Elenco {{form.Name}}</b></h4>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"onAddViewEditRecord.emit(null)\">\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\r\n\r\n<eqp-table #tableRecords [data]=\"values\" [columns]=\"columns\"></eqp-table>",
2540
2755
  styles: ["::ng-deep .error-color{color:var(--danger)}::ng-deep .success-color{color:var(--success)}"]
2541
2756
  })
2542
2757
  ], ListFormRecordComponent);
@@ -2553,6 +2768,7 @@ var AddFormRecordComponent = /** @class */ (function () {
2553
2768
  function AddFormRecordComponent(cdr, utilityService) {
2554
2769
  this.cdr = cdr;
2555
2770
  this.utilityService = utilityService;
2771
+ this.showTitle = true;
2556
2772
  this.showButtons = true;
2557
2773
  this.form = new Form();
2558
2774
  this.fieldGroups = {};
@@ -2641,8 +2857,11 @@ var AddFormRecordComponent = /** @class */ (function () {
2641
2857
  };
2642
2858
  AddFormRecordComponent.ctorParameters = function () { return [
2643
2859
  { type: ChangeDetectorRef },
2644
- { type: UtilityHelperService$2 }
2860
+ { type: UtilityHelperService }
2645
2861
  ]; };
2862
+ __decorate([
2863
+ Input()
2864
+ ], AddFormRecordComponent.prototype, "showTitle", void 0);
2646
2865
  __decorate([
2647
2866
  Input()
2648
2867
  ], AddFormRecordComponent.prototype, "showButtons", void 0);
@@ -2664,7 +2883,7 @@ var AddFormRecordComponent = /** @class */ (function () {
2664
2883
  AddFormRecordComponent = __decorate([
2665
2884
  Component({
2666
2885
  selector: 'add-form-record',
2667
- template: "<div class=\"row eqp-dynamic-module-title\">\n <div class=\"col-md-12 text-center\">\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\" (recordChange)=\"onRecordChange()\"></dynamic-module-field>\n </div>\n </div>\n</ng-template>",
2886
+ template: "<div class=\"row eqp-dynamic-module-title\" *ngIf=\"showTitle\">\n <div class=\"col-md-12\">\n <h4><b>{{form.Name}}</b></h4>\n </div>\n</div>\n\n<form [formGroup]=\"formForm\">\n\n <!-- VISUALIZZAZIONE SEMPLICE -->\n <ng-container *ngIf=\"form.FormScalarType == FormScalarTypeEnum.Semplice\" [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: form.Fields }\">\n </ng-container>\n\n <!-- VISUALIZZAZIONE A STEPPER -->\n <mat-horizontal-stepper linear *ngIf=\"form.FormScalarType == FormScalarTypeEnum['A step']\">\n <mat-step *ngFor=\"let group of form.FormFieldsGroups\">\n <ng-template matStepLabel>\n {{group.Name}}\n </ng-template>\n\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </mat-step>\n </mat-horizontal-stepper>\n\n <!-- VISUALIZZAZIONE A TAB -->\n <mat-tab-group *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In tab']\">\n <mat-tab *ngFor=\"let group of form.FormFieldsGroups\" [label]=\"group.Name\">\n <div class=\"mt-3\">\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <!-- VISUALIZZAZIONE AD ACCORDION -->\n <mat-accordion multi *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In accordion']\">\n <mat-expansion-panel *ngFor=\"let group of form.FormFieldsGroups\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n {{group.Name}}\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\n </ng-container>\n </mat-expansion-panel>\n </mat-accordion>\n</form>\n\n<div class=\"row mt-2\" *ngIf=\"showButtons\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"mr-2\" mat-raised-button (click)=\"saveOrExitForm(true)\" type=\"button\">\n Annulla\n </button>\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveOrExitForm(false)\"\n [disabled]=\"formForm.invalid || formForm.disabled\" type=\"button\">\n Salva\n </button>\n </div>\n</div>\n\n<!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM -->\n<ng-template #fieldTemplates let-fields='fields'>\n <div class=\"row\">\n <div class=\"mt-2\" *ngFor=\"let field of fields\" [ngClass]=\"utilityService.getFieldSyleClass(field)\">\n <dynamic-module-field #fieldTemplate [field]=\"field\" [form]=\"form\" [record]=\"record\"\n (recordChange)=\"onRecordChange()\"></dynamic-module-field>\n </div>\n </div>\n</ng-template>",
2668
2887
  styles: [""]
2669
2888
  })
2670
2889
  ], AddFormRecordComponent);
@@ -2825,7 +3044,8 @@ var EqpDynamicModuleModule = /** @class */ (function () {
2825
3044
  EqpSelectModule,
2826
3045
  EqpDatetimepickerModule,
2827
3046
  EqpFiltersModule,
2828
- EqpNumericModule
3047
+ EqpNumericModule,
3048
+ EqpImgDrawingModule
2829
3049
  ],
2830
3050
  exports: [
2831
3051
  EqpDynamicModuleComponent,
@@ -2852,6 +3072,14 @@ var ImageField = /** @class */ (function (_super) {
2852
3072
  function ImageField() {
2853
3073
  return _super !== null && _super.apply(this, arguments) || this;
2854
3074
  }
3075
+ Object.defineProperty(ImageField.prototype, "_contextualAttachments", {
3076
+ /**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
3077
+ get: function () {
3078
+ return this.ContextualAttachment ? [this.ContextualAttachment] : [];
3079
+ },
3080
+ enumerable: true,
3081
+ configurable: true
3082
+ });
2855
3083
  return ImageField;
2856
3084
  }(BaseField));
2857
3085
 
@@ -2898,5 +3126,5 @@ var TextField = /** @class */ (function (_super) {
2898
3126
  * Generated bundle index. Do not edit.
2899
3127
  */
2900
3128
 
2901
- export { ActionOnRecord, AddFormFieldComponent, AddFormRecordComponent, ArrayValidators, AttachmentField, AttachmentFieldTemplateComponent, AvailableFileExtensions, AvailableImageExtensions, BaseField, BaseObj, BoolPresentantioEnum, BooleanField, BooleanFieldTemplateComponent, ColSpanSizesEnum, Context, ContextUser, DateField, DateFieldTemplateComponent, DateTimeTypeEnum, DynamicModuleFieldComponent, Entity, EqpDynamicModuleComponent, EqpDynamicModuleConfiguratorComponent, EqpDynamicModuleDialogService, EqpDynamicModuleModule, FieldTypeEnum, Form, FormFieldGroup, FormScalarTypeEnum, FormTypeEnum, ImageField, ImageFieldTemplateComponent, ListFormRecordComponent, ListPresentationEnum, ListValueField, ListValueFieldTemplateComponent, LookupField, NumericField, NumericFieldTemplateComponent, Record, TextField, TextFieldTemplateComponent, TextareaField, TextareaFieldTemplateComponent, UtilityHelperService, MaterialModule as ɵa };
3129
+ export { ActionOnRecord, AddFormFieldComponent, AddFormRecordComponent, ArrayValidators, AttachmentField, AttachmentFieldTemplateComponent, AvailableFileExtensions, AvailableImageExtensions, BaseField, BaseObj, BoolPresentantioEnum, BooleanField, BooleanFieldTemplateComponent, ColSpanSizesEnum, Context, ContextUser, DateField, DateFieldTemplateComponent, DateTimeTypeEnum, DynamicModuleFieldComponent, Entity, EqpDynamicModuleComponent, EqpDynamicModuleConfiguratorComponent, EqpDynamicModuleDialogService, EqpDynamicModuleModule, FieldTypeEnum, Form, FormFieldGroup, FormScalarTypeEnum, FormTypeEnum, ImageField, ImageFieldTemplateComponent, ListFormRecordComponent, ListPresentationEnum, ListValueField, ListValueFieldTemplateComponent, LookupField, NumericField, NumericFieldTemplateComponent, Record, TextField, TextFieldTemplateComponent, TextareaField, TextareaFieldTemplateComponent, UtilityHelperService, ɵ0, MaterialModule as ɵa };
2902
3130
  //# sourceMappingURL=eqproject-eqp-dynamic-module.js.map