@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,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'), require('projects/eqp-dynamic-module/src/lib/services/utilityHelper.services'), require('projects/eqp-dynamic-module/src/public-api')) :
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', 'projects/eqp-dynamic-module/src/lib/services/utilityHelper.services', 'projects/eqp-dynamic-module/src/public-api'], 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, global.utilityHelper_services, global.publicApi));
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, utilityHelper_services, publicApi) { 'use strict';
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-img-drawing'), 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-img-drawing', '@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.eqpImgDrawing, 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, eqpImgDrawing, eqpFilters, eqpNumeric, Swal, platformBrowser) { 'use strict';
6
6
 
7
7
  Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
8
 
@@ -566,7 +566,11 @@
566
566
  this.context = new Context();
567
567
  this.form = new Form();
568
568
  this.showButtons = true;
569
+ this.showTitle = true;
569
570
  this.viewMode = exports.FormTypeEnum.LIST;
571
+ this.saveRecord = new core.EventEmitter();
572
+ this.deleteRecord = new core.EventEmitter();
573
+ this.duplicateRecord = new core.EventEmitter();
570
574
  this.FormTypeEnum = exports.FormTypeEnum;
571
575
  }
572
576
  EqpDynamicModuleComponent.prototype.ngOnInit = function () {
@@ -585,16 +589,21 @@
585
589
  };
586
590
  EqpDynamicModuleComponent.prototype.onSaveForm = function (event) {
587
591
  //TODO: Salvare il record!
588
- if (event != null) {
589
- if (event.ID && this.values.find(function (v) { return v.ID == event.ID; })) {
590
- this.values[this.values.findIndex(function (v) { return v.ID == event.ID; })] = event;
591
- }
592
- else {
593
- this.values.push(event);
594
- }
595
- }
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);
596
600
  this.viewMode = exports.FormTypeEnum.LIST;
597
- console.log(event);
601
+ };
602
+ EqpDynamicModuleComponent.prototype.onDuplicateRecord = function (record) {
603
+ this.duplicateRecord.emit(record);
604
+ };
605
+ EqpDynamicModuleComponent.prototype.onDeleteRecord = function (record) {
606
+ this.deleteRecord.emit(record);
598
607
  };
599
608
  __decorate([
600
609
  core.Input()
@@ -608,13 +617,25 @@
608
617
  __decorate([
609
618
  core.Input()
610
619
  ], EqpDynamicModuleComponent.prototype, "showButtons", void 0);
620
+ __decorate([
621
+ core.Input()
622
+ ], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
611
623
  __decorate([
612
624
  core.Input()
613
625
  ], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
626
+ __decorate([
627
+ core.Output()
628
+ ], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
629
+ __decorate([
630
+ core.Output()
631
+ ], EqpDynamicModuleComponent.prototype, "deleteRecord", void 0);
632
+ __decorate([
633
+ core.Output()
634
+ ], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
614
635
  EqpDynamicModuleComponent = __decorate([
615
636
  core.Component({
616
637
  selector: 'eqp-dynamic-module',
617
- 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>",
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>",
618
639
  styles: ["::ng-deep mat-form-field{width:100%}"]
619
640
  })
620
641
  ], EqpDynamicModuleComponent);
@@ -1528,11 +1549,10 @@
1528
1549
  break;
1529
1550
  case exports.FieldTypeEnum.Immagine:
1530
1551
  this.field.AttachDefinition = new AttachmentField();
1531
- this.fieldFormGroup.addControl('IsMultiAttach', new forms.FormControl(this.field.AttachDefinition.IsMultiAttach));
1532
- // this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
1533
- this.fieldFormGroup.addControl('IsMultiPoint', new forms.FormControl(this.field.IsMultiPoint));
1534
- this.fieldFormGroup.addControl("AllowedExtensions", new forms.FormControl(this.field.AttachDefinition.AllowedExtensions));
1552
+ this.fieldFormGroup.addControl('EnableDrawing', new forms.FormControl(this.field.EnableDrawing));
1535
1553
  this.fieldFormGroup.addControl('ImageIsContextualAttachment', new forms.FormControl(this.field.ImageIsContextualAttachment));
1554
+ // Imposto i FormControl variabili.
1555
+ this.onImageIsContextualAttachmentChange();
1536
1556
  this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
1537
1557
  break;
1538
1558
  case exports.FieldTypeEnum['Elenco generico']:
@@ -1549,10 +1569,50 @@
1549
1569
  if ([exports.FieldTypeEnum.Allegato, exports.FieldTypeEnum.Immagine, exports.FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
1550
1570
  this.field.Formula = null;
1551
1571
  this.fieldFormGroup.controls["Formula"].disable();
1572
+ this.fieldFormGroup.controls["InListView"].disable();
1552
1573
  }
1553
1574
  else {
1554
1575
  this.fieldFormGroup.controls["Formula"].enable();
1576
+ this.fieldFormGroup.controls["InListView"].enable();
1577
+ }
1578
+ };
1579
+ /**
1580
+ * Metodo invocato al cambio del valore della proprietà ImageIsContextualAttachment nel caso
1581
+ * di campi di tipo Immagine. Se TRUE allora rimuove i FormControl per le proprietà IsMultiAttach
1582
+ * e AllowedExtensions e aggiunge i FormControl per le proprietà ImgName e ContextualAttachment,
1583
+ * altrimenti il contrario.
1584
+ */
1585
+ AddFormFieldComponent.prototype.onImageIsContextualAttachmentChange = function () {
1586
+ this.field.ImgName = null;
1587
+ this.field.AttachDefinition.AllowedExtensions = [];
1588
+ this.field.AttachDefinition.IsMultiAttach = false;
1589
+ this.field.ContextualAttachment = null;
1590
+ if (this.field.ImageIsContextualAttachment) {
1591
+ this.fieldFormGroup.removeControl("IsMultiAttach");
1592
+ this.fieldFormGroup.removeControl("AllowedExtensions");
1593
+ this.fieldFormGroup.addControl('ImgName', new forms.FormControl(this.field.ImgName, forms.Validators.required));
1594
+ this.fieldFormGroup.addControl('ContextualAttachment', new forms.FormControl(this.field.ContextualAttachment, forms.Validators.required));
1595
+ }
1596
+ else {
1597
+ this.fieldFormGroup.removeControl("ImgName");
1598
+ this.fieldFormGroup.removeControl("ContextualAttachment");
1599
+ this.fieldFormGroup.addControl('IsMultiAttach', new forms.FormControl(this.field.AttachDefinition.IsMultiAttach));
1600
+ this.fieldFormGroup.addControl("AllowedExtensions", new forms.FormControl(this.field.AttachDefinition.AllowedExtensions));
1601
+ }
1602
+ };
1603
+ /**
1604
+ * Metodo per intercettare l'aggiunta di un allegato nei campi di tipo Immagine per aggiornare
1605
+ * il valore della proprietà ContextualAttachment e la validazione del relativo FormControl.
1606
+ * @param event Array contenente l'elenco aggiornato degli allegati caricati (nel nostro caso ne contiene al più 1).
1607
+ */
1608
+ AddFormFieldComponent.prototype.catchContextualAttachmentChange = function (event) {
1609
+ if (event && event.length > 0) {
1610
+ this.field.ContextualAttachment = event[0];
1611
+ }
1612
+ else {
1613
+ this.field.ContextualAttachment = null;
1555
1614
  }
1615
+ this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
1556
1616
  };
1557
1617
  /**
1558
1618
  * Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
@@ -1888,7 +1948,7 @@
1888
1948
  AddFormFieldComponent = __decorate([
1889
1949
  core.Component({
1890
1950
  selector: 'eqp-dynamic-module-add-form-field',
1891
- 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>",
1951
+ 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>",
1892
1952
  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}"]
1893
1953
  })
1894
1954
  ], AddFormFieldComponent);
@@ -2286,31 +2346,13 @@
2286
2346
  }());
2287
2347
 
2288
2348
  var AttachmentFieldTemplateComponent = /** @class */ (function () {
2289
- //#endregion
2290
2349
  function AttachmentFieldTemplateComponent(utilityService, cdr) {
2291
2350
  this.utilityService = utilityService;
2292
2351
  this.cdr = cdr;
2293
2352
  this.onlyImages = false;
2294
2353
  this.recordChange = new core.EventEmitter();
2354
+ this.onAttachmentsChange = new core.EventEmitter();
2295
2355
  this.metadataFormGroups = new Array();
2296
- //#region Etichette per eqp-attachments
2297
- this.previewLabel = "Anteprima";
2298
- this.emptyTableMessage = "No record found";
2299
- this.downloadTooltipPosition = "below";
2300
- this.openLinkLabel = "Apri link";
2301
- this.addButtonLabel = "Aggiungi";
2302
- this.downloadLabel = "Download";
2303
- this.deleteLabel = "Elimina";
2304
- this.fileNameLabel = "Nome file";
2305
- this.uploadFileLabel = "Carica file";
2306
- this.confirmLabel = "Conferma";
2307
- this.abortLabel = "Annulla";
2308
- this.saveLabel = "Salva";
2309
- this.exitLabel = "Esci";
2310
- this.eqpTableSearchText = "Cerca...";
2311
- this.deleteDialogTitle = "Attenzione:";
2312
- this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
2313
- this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
2314
2356
  }
2315
2357
  AttachmentFieldTemplateComponent.prototype.ngOnInit = function () {
2316
2358
  // Nel caso in cui sono in modifica di un Record aggiorno il valore
@@ -2361,6 +2403,10 @@
2361
2403
  this.createMetadataFormGroups();
2362
2404
  this.setFormControlValue();
2363
2405
  this.onRecordValueChange();
2406
+ // Scateno un evento di output necessario al componente ImageFieldTemplate al
2407
+ // variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
2408
+ // sull'immagine caricata in base alla configurazione del Field.
2409
+ this.onAttachmentsChange.emit();
2364
2410
  this.cdr.detectChanges();
2365
2411
  };
2366
2412
  /**
@@ -2447,6 +2493,9 @@
2447
2493
  __decorate([
2448
2494
  core.Output()
2449
2495
  ], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
2496
+ __decorate([
2497
+ core.Output()
2498
+ ], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
2450
2499
  __decorate([
2451
2500
  core.ViewChild("eqpAttachments", { static: true })
2452
2501
  ], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
@@ -2456,16 +2505,38 @@
2456
2505
  AttachmentFieldTemplateComponent = __decorate([
2457
2506
  core.Component({
2458
2507
  selector: 'attachment-field-template',
2459
- 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>",
2508
+ 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>",
2460
2509
  styles: [""]
2461
2510
  })
2462
2511
  ], AttachmentFieldTemplateComponent);
2463
2512
  return AttachmentFieldTemplateComponent;
2464
2513
  }());
2465
2514
 
2515
+ /**
2516
+ * Metodo per recuperare, a partire da un Blob, la stringa contenente il base64 del file.
2517
+ * Usato per prendere il base64 dell'immagine dopo che l'utente ci ha disegnato sopra.
2518
+ * @param file Blob che rappresenta l'immagine.
2519
+ */
2520
+ var toBase64 = function (file) { return new Promise(function (resolve, reject) {
2521
+ var reader = new FileReader();
2522
+ reader.readAsDataURL(file);
2523
+ reader.onload = function () { return resolve(reader.result.toString()); };
2524
+ reader.onerror = function (error) { return reject(error); };
2525
+ }); };
2526
+ var ɵ0 = toBase64;
2466
2527
  var ImageFieldTemplateComponent = /** @class */ (function () {
2467
- function ImageFieldTemplateComponent() {
2528
+ //#endregion
2529
+ function ImageFieldTemplateComponent(dialog, utilityService) {
2530
+ this.dialog = dialog;
2531
+ this.utilityService = utilityService;
2468
2532
  this.recordChange = new core.EventEmitter();
2533
+ //#region Proprietà per configurare il componente ngx-image-drawing e aprire il relativo dialog.
2534
+ this.width = null;
2535
+ this.height = null;
2536
+ this.i18n = {
2537
+ saveBtn: 'Salva modifiche',
2538
+ cancelBtn: 'Ricarica originale'
2539
+ };
2469
2540
  }
2470
2541
  ImageFieldTemplateComponent.prototype.ngOnInit = function () {
2471
2542
  this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
@@ -2478,6 +2549,19 @@
2478
2549
  this.field.AttachDefinition.Required = this.field.Required;
2479
2550
  this.field.AttachDefinition.Formula = this.field.Formula;
2480
2551
  this.field.AttachDefinition.FieldValue = this.field.FieldValue;
2552
+ // Se il campo prevede un'immagine pre-caricata (ImageIsContextualAttachment == true) sulla quale
2553
+ // l'utente può disegnare (EnableDrawing == true) e non sono in modifica di un record (ovvero nel record
2554
+ // non ho un'immagine già salvata) allora imposta l'immagine pre caricata come valore iniziale
2555
+ // nel record corrente e ne recupera le dimensioni per visualizzare correttamente l'area in cui
2556
+ // l'utente può disegnare. Se non effettua modifiche o non salva i disegni fatti viene salvata
2557
+ // l'immagine originale.
2558
+ if (this.field.ImageIsContextualAttachment && this.field.ContextualAttachment) {
2559
+ if (!this.record[this.field.Name] || !Array.isArray(this.record[this.field.Name]) || !(this.record[this.field.Name].length > 0)) {
2560
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
2561
+ }
2562
+ this.preLoadedImageMetadataFormGroup = this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields, this.record[this.field.Name][0]);
2563
+ this.getImageDimensions();
2564
+ }
2481
2565
  };
2482
2566
  ImageFieldTemplateComponent.prototype.ngOnChanges = function (changes) {
2483
2567
  // Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
@@ -2486,14 +2570,125 @@
2486
2570
  this.updateField();
2487
2571
  }
2488
2572
  };
2573
+ ImageFieldTemplateComponent.prototype.updateMetadataValidity = function () {
2574
+ if (this.preLoadedImageMetadataFormGroup.invalid) {
2575
+ this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
2576
+ }
2577
+ else {
2578
+ this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
2579
+ }
2580
+ this.onRecordValueChange();
2581
+ };
2489
2582
  /**
2490
2583
  * Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
2491
2584
  */
2492
2585
  ImageFieldTemplateComponent.prototype.updateField = function () {
2493
2586
  if (this.field.Formula) {
2494
- this.record[this.field.Name] = utilityHelper_services.UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2587
+ this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
2588
+ }
2589
+ };
2590
+ ImageFieldTemplateComponent.prototype.resetPreLoadedImage = function () {
2591
+ this.width = null;
2592
+ this.height = null;
2593
+ this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
2594
+ this.getImageDimensions();
2595
+ };
2596
+ /**
2597
+ * Metodo invocato quando vengono aggiunti o eliminati gli allegati nel componente AttachmentFieldTemplate.
2598
+ * Se l'ImageField è abilitato al disegno (EnableDrawing == true), non permette allegati multipli (IsMulitAttach == false)
2599
+ * e nel Record corrente è presente l'immagine caricata dall'utente allora recupera le dimensioni dell'immagine e
2600
+ * apre il dialog con il componente image-drawing per permettere il disegno sull'immagine appena caricata.
2601
+ */
2602
+ ImageFieldTemplateComponent.prototype.onAttachmentsChange = function () {
2603
+ if (!this.field.AttachDefinition.IsMultiAttach && this.field.EnableDrawing && this.record[this.field.Name] && this.record[this.field.Name][0]) {
2604
+ this.getImageDimensions();
2605
+ this.dialogImageDrowingRef = this.dialog.open(this.dialogImageDrowing, {
2606
+ disableClose: true,
2607
+ hasBackdrop: true,
2608
+ width: '75%'
2609
+ });
2495
2610
  }
2496
2611
  };
2612
+ /**
2613
+ * Metodo invocato al salvataggio dell'immagine dal componente image-drawing.
2614
+ * Trasforma il Blob ricevuto in un base64, aggiorna il FileContetType e il FileDataBase64
2615
+ * dell'allegato caricato e chiude il dialog in cui disegnare.
2616
+ * @param drawnPicture Blob dell'immagine disegnata.
2617
+ */
2618
+ ImageFieldTemplateComponent.prototype.saveDrowning = function (drawnPicture) {
2619
+ return __awaiter(this, void 0, void 0, function () {
2620
+ var base64File;
2621
+ return __generator(this, function (_a) {
2622
+ switch (_a.label) {
2623
+ case 0: return [4 /*yield*/, toBase64(drawnPicture)];
2624
+ case 1:
2625
+ base64File = _a.sent();
2626
+ if (base64File) {
2627
+ this.record[this.field.Name][0].FileContentType = base64File.split(",")[0].split(":")[1].split(";")[0];
2628
+ this.record[this.field.Name][0].FileDataBase64 = base64File.split(",")[1];
2629
+ }
2630
+ if (this.dialogImageDrowingRef) {
2631
+ this.closeImageDrowingDialog();
2632
+ }
2633
+ return [2 /*return*/];
2634
+ }
2635
+ });
2636
+ });
2637
+ };
2638
+ /**
2639
+ * Metodo per chiudere il dialog in cui disegnare sull'immagine cariata e svuotare le dimensioni.
2640
+ */
2641
+ ImageFieldTemplateComponent.prototype.closeImageDrowingDialog = function () {
2642
+ this.dialogImageDrowingRef.close();
2643
+ this.width = null;
2644
+ this.height = null;
2645
+ };
2646
+ /**
2647
+ * Metodo per recuperare le dimensioni dell'immagine caricata per mostrare correttamente
2648
+ * il componente image-drawing. Se non viene eseguito questo passaggio l'area in cui disegnare
2649
+ * è più grande dell'immagine stessa e al salvataggio i tratti disegnati vengono spostati.
2650
+ */
2651
+ ImageFieldTemplateComponent.prototype.getImageDimensions = function () {
2652
+ var _this = this;
2653
+ var blob = this.getBlobFromBase64();
2654
+ var reader = new FileReader();
2655
+ reader.onload = function (e) {
2656
+ var image = new Image();
2657
+ image.src = e.target.result;
2658
+ image.onload = function (rs) {
2659
+ _this.height = rs.currentTarget['height'];
2660
+ _this.width = rs.currentTarget['width'];
2661
+ };
2662
+ };
2663
+ reader.readAsDataURL(blob);
2664
+ };
2665
+ /**
2666
+ * Metodo per convertire il base64 di un'immagine in un Blob.
2667
+ * Necessario per il recupero delle dimensioni dell'immagine caricata a partire dal suo base64.
2668
+ * Viene eseguito solo nel caso in cui l'ImageField non ammette allegati multipli.
2669
+ * @returns Restituisce il Blob dell'immagine caricata.
2670
+ */
2671
+ ImageFieldTemplateComponent.prototype.getBlobFromBase64 = function () {
2672
+ var byteCharacters = atob(this.record[this.field.Name][0].FileDataBase64);
2673
+ var byteNumbers = new Array(byteCharacters.length);
2674
+ for (var i = 0; i < byteCharacters.length; i++) {
2675
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
2676
+ }
2677
+ var byteArray = new Uint8Array(byteNumbers);
2678
+ return new Blob([byteArray], { type: this.record[this.field.Name][0].FileContentType });
2679
+ };
2680
+ /**
2681
+ * Metodo per emettere l'evento che il valore del record è cambiato.
2682
+ */
2683
+ ImageFieldTemplateComponent.prototype.onRecordValueChange = function () {
2684
+ if (!this.field.Formula) {
2685
+ this.recordChange.emit(this.record);
2686
+ }
2687
+ };
2688
+ ImageFieldTemplateComponent.ctorParameters = function () { return [
2689
+ { type: dialog.MatDialog },
2690
+ { type: UtilityHelperService }
2691
+ ]; };
2497
2692
  __decorate([
2498
2693
  core.Input()
2499
2694
  ], ImageFieldTemplateComponent.prototype, "record", void 0);
@@ -2503,11 +2698,14 @@
2503
2698
  __decorate([
2504
2699
  core.Output()
2505
2700
  ], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
2701
+ __decorate([
2702
+ core.ViewChild("dialogImageDrowing", { static: true })
2703
+ ], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
2506
2704
  ImageFieldTemplateComponent = __decorate([
2507
2705
  core.Component({
2508
2706
  selector: 'image-field-template',
2509
- template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"\n [onlyImages]=\"true\">\n</attachment-field-template>",
2510
- styles: [""]
2707
+ 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>",
2708
+ styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
2511
2709
  })
2512
2710
  ], ImageFieldTemplateComponent);
2513
2711
  return ImageFieldTemplateComponent;
@@ -2515,12 +2713,22 @@
2515
2713
 
2516
2714
  var ListFormRecordComponent = /** @class */ (function () {
2517
2715
  function ListFormRecordComponent() {
2716
+ this.showTitle = true;
2518
2717
  this.columns = new Array();
2519
2718
  this.onAddViewEditRecord = new core.EventEmitter();
2719
+ this.onDeleteRecord = new core.EventEmitter();
2720
+ this.onDuplicateRecord = new core.EventEmitter();
2520
2721
  }
2521
2722
  ListFormRecordComponent.prototype.ngOnInit = function () {
2522
2723
  this.configureColumns();
2523
2724
  };
2725
+ ListFormRecordComponent.prototype.ngOnChanges = function (changes) {
2726
+ // Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
2727
+ if (changes['values'] != undefined && changes['values'].firstChange == false) {
2728
+ this.values = changes['values'].currentValue;
2729
+ this.reloadTables();
2730
+ }
2731
+ };
2524
2732
  /**
2525
2733
  * Metodo per configurare le colonne della eqp-table.
2526
2734
  */
@@ -2556,7 +2764,7 @@
2556
2764
  .push({
2557
2765
  name: action.Name, icon: action.Icon, fn: function (element, index, col) {
2558
2766
  var rec = element;
2559
- var ctx = publicApi.UtilityHelperService.context;
2767
+ var ctx = UtilityHelperService.context;
2560
2768
  eval(action.Action);
2561
2769
  // TODO: salvare le modifiche
2562
2770
  }
@@ -2578,18 +2786,17 @@
2578
2786
  * @param record Record da duplicare.
2579
2787
  */
2580
2788
  ListFormRecordComponent.prototype.duplicateRecord = function (record) {
2581
- var _this = this;
2582
- publicApi.EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', function () {
2583
- var copiedRecord = JSON.parse(JSON.stringify(record));
2584
- if (!isNaN(parseInt(copiedRecord.ID))) {
2585
- copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2586
- }
2587
- else {
2588
- copiedRecord.ID = "xxxxxxxxx".replace("x", function (c) { return (Math.random() + 16 | 0).toString(16); });
2589
- }
2590
- _this.values.push(copiedRecord);
2591
- _this.reloadTables();
2592
- }, false, 'Richiesta conferma');
2789
+ // EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
2790
+ // var copiedRecord: Record = JSON.parse(JSON.stringify(record));
2791
+ // if (!isNaN(parseInt(copiedRecord.ID))) {
2792
+ // copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
2793
+ // } else {
2794
+ // copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
2795
+ // }
2796
+ // this.values.push(copiedRecord);
2797
+ // this.reloadTables();
2798
+ // }, false, 'Richiesta conferma');
2799
+ this.onDuplicateRecord.emit(record);
2593
2800
  //TODO
2594
2801
  };
2595
2802
  /**
@@ -2597,11 +2804,11 @@
2597
2804
  * @param record Record da eliminare selezionato sulla eqp-table.
2598
2805
  */
2599
2806
  ListFormRecordComponent.prototype.deleteRecord = function (record) {
2600
- var _this = this;
2601
- publicApi.EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', function () {
2602
- _this.values.splice(_this.values.indexOf(record), 1);
2603
- _this.reloadTables();
2604
- }, false, 'Richiesta conferma');
2807
+ // EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
2808
+ // this.values.splice(this.values.indexOf(record), 1);
2809
+ // this.reloadTables();
2810
+ // }, false, 'Richiesta conferma');
2811
+ this.onDeleteRecord.emit(record);
2605
2812
  // TODO
2606
2813
  };
2607
2814
  /**
@@ -2633,23 +2840,23 @@
2633
2840
  ListFormRecordComponent.prototype.createFieldColumn = function (field) {
2634
2841
  var column = { key: field.Name, display: field.Label };
2635
2842
  switch (field.FieldType) {
2636
- case publicApi.FieldTypeEnum['Booleano']:
2843
+ case exports.FieldTypeEnum['Booleano']:
2637
2844
  column.type = eqpTable.TypeColumn.Boolean;
2638
2845
  column.booleanValues = { false: '<i class="fa fa-times error-color"></i>', true: '<i class="fa fa-check success-color"></i>' };
2639
2846
  column.styles = { flex: "0 0 7%", cellAlignment: eqpTable.CellAlignmentEnum.CENTER };
2640
2847
  break;
2641
- case publicApi.FieldTypeEnum['Data e/o ora']:
2642
- if (field.IsOnlyDate != publicApi.DateTimeTypeEnum['Solo orario']) {
2848
+ case exports.FieldTypeEnum['Data e/o ora']:
2849
+ if (field.IsOnlyDate != exports.DateTimeTypeEnum['Solo orario']) {
2643
2850
  column.type = eqpTable.TypeColumn.Date;
2644
- if (field.IsOnlyDate == publicApi.DateTimeTypeEnum['Data e ora']) {
2851
+ if (field.IsOnlyDate == exports.DateTimeTypeEnum['Data e ora']) {
2645
2852
  column.format = "dd/MM/yyyy HH:mm";
2646
2853
  }
2647
- else if (field.IsOnlyDate == publicApi.DateTimeTypeEnum['Solo data']) {
2854
+ else if (field.IsOnlyDate == exports.DateTimeTypeEnum['Solo data']) {
2648
2855
  column.format = "dd/MM/yyyy";
2649
2856
  }
2650
2857
  }
2651
2858
  break;
2652
- case publicApi.FieldTypeEnum['Campo numerico']:
2859
+ case exports.FieldTypeEnum['Campo numerico']:
2653
2860
  if (field.CurrencySymbol) {
2654
2861
  column.numberPipe = eqpTable.NumberColumnPipe.CURRENCY;
2655
2862
  column.currencyPipeCode = field.CurrencySymbol;
@@ -2658,8 +2865,8 @@
2658
2865
  column.numberPipe = eqpTable.NumberColumnPipe.DECIMAL;
2659
2866
  }
2660
2867
  break;
2661
- case publicApi.FieldTypeEnum['Allegato']:
2662
- case publicApi.FieldTypeEnum['Immagine']:
2868
+ case exports.FieldTypeEnum['Allegato']:
2869
+ case exports.FieldTypeEnum['Immagine']:
2663
2870
  column.value = function (element) {
2664
2871
  if (field.IsMultiAttach || (field.AttachDefinition && field.AttachDefinition.IsMultiAttach)) {
2665
2872
  return element[field.Name] != null && element[field.Name].length > 0 ? element[field.Name].map(function (a) { return a.FileName; }).join(", ") : null;
@@ -2671,7 +2878,7 @@
2671
2878
  column.isSortable = false;
2672
2879
  column.isSearchable = false;
2673
2880
  break;
2674
- case publicApi.FieldTypeEnum['Elenco generico']:
2881
+ case exports.FieldTypeEnum['Elenco generico']:
2675
2882
  column.value = function (element) {
2676
2883
  if (field.IsMultiChoiche) {
2677
2884
  if (!element[field.Name] || element[field.Name].length == 0) {
@@ -2688,7 +2895,7 @@
2688
2895
  column.isSortable = false;
2689
2896
  column.isSearchable = false;
2690
2897
  break;
2691
- case publicApi.FieldTypeEnum['Lookup']:
2898
+ case exports.FieldTypeEnum['Lookup']:
2692
2899
  // TODO
2693
2900
  break;
2694
2901
  }
@@ -2702,6 +2909,9 @@
2702
2909
  this.tableRecords.reloadDatatable();
2703
2910
  }
2704
2911
  };
2912
+ __decorate([
2913
+ core.Input()
2914
+ ], ListFormRecordComponent.prototype, "showTitle", void 0);
2705
2915
  __decorate([
2706
2916
  core.Input()
2707
2917
  ], ListFormRecordComponent.prototype, "form", void 0);
@@ -2714,10 +2924,16 @@
2714
2924
  __decorate([
2715
2925
  core.Output()
2716
2926
  ], ListFormRecordComponent.prototype, "onAddViewEditRecord", void 0);
2927
+ __decorate([
2928
+ core.Output()
2929
+ ], ListFormRecordComponent.prototype, "onDeleteRecord", void 0);
2930
+ __decorate([
2931
+ core.Output()
2932
+ ], ListFormRecordComponent.prototype, "onDuplicateRecord", void 0);
2717
2933
  ListFormRecordComponent = __decorate([
2718
2934
  core.Component({
2719
2935
  selector: 'list-form-record',
2720
- 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>",
2936
+ 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>",
2721
2937
  styles: ["::ng-deep .error-color{color:var(--danger)}::ng-deep .success-color{color:var(--success)}"]
2722
2938
  })
2723
2939
  ], ListFormRecordComponent);
@@ -2734,6 +2950,7 @@
2734
2950
  function AddFormRecordComponent(cdr, utilityService) {
2735
2951
  this.cdr = cdr;
2736
2952
  this.utilityService = utilityService;
2953
+ this.showTitle = true;
2737
2954
  this.showButtons = true;
2738
2955
  this.form = new Form();
2739
2956
  this.fieldGroups = {};
@@ -2822,8 +3039,11 @@
2822
3039
  };
2823
3040
  AddFormRecordComponent.ctorParameters = function () { return [
2824
3041
  { type: core.ChangeDetectorRef },
2825
- { type: publicApi.UtilityHelperService }
3042
+ { type: UtilityHelperService }
2826
3043
  ]; };
3044
+ __decorate([
3045
+ core.Input()
3046
+ ], AddFormRecordComponent.prototype, "showTitle", void 0);
2827
3047
  __decorate([
2828
3048
  core.Input()
2829
3049
  ], AddFormRecordComponent.prototype, "showButtons", void 0);
@@ -2845,7 +3065,7 @@
2845
3065
  AddFormRecordComponent = __decorate([
2846
3066
  core.Component({
2847
3067
  selector: 'add-form-record',
2848
- 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>",
3068
+ 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>",
2849
3069
  styles: [""]
2850
3070
  })
2851
3071
  ], AddFormRecordComponent);
@@ -3006,7 +3226,8 @@
3006
3226
  eqpSelect.EqpSelectModule,
3007
3227
  eqpDatetimepicker.EqpDatetimepickerModule,
3008
3228
  eqpFilters.EqpFiltersModule,
3009
- eqpNumeric.EqpNumericModule
3229
+ eqpNumeric.EqpNumericModule,
3230
+ eqpImgDrawing.EqpImgDrawingModule
3010
3231
  ],
3011
3232
  exports: [
3012
3233
  EqpDynamicModuleComponent,
@@ -3033,6 +3254,14 @@
3033
3254
  function ImageField() {
3034
3255
  return _super !== null && _super.apply(this, arguments) || this;
3035
3256
  }
3257
+ Object.defineProperty(ImageField.prototype, "_contextualAttachments", {
3258
+ /**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
3259
+ get: function () {
3260
+ return this.ContextualAttachment ? [this.ContextualAttachment] : [];
3261
+ },
3262
+ enumerable: true,
3263
+ configurable: true
3264
+ });
3036
3265
  return ImageField;
3037
3266
  }(BaseField));
3038
3267
 
@@ -3109,6 +3338,7 @@
3109
3338
  exports.TextareaField = TextareaField;
3110
3339
  exports.TextareaFieldTemplateComponent = TextareaFieldTemplateComponent;
3111
3340
  exports.UtilityHelperService = UtilityHelperService;
3341
+ exports.ɵ0 = ɵ0;
3112
3342
  exports.ɵa = MaterialModule;
3113
3343
 
3114
3344
  Object.defineProperty(exports, '__esModule', { value: true });