@eqproject/eqp-dynamic-module 0.0.3 → 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.
- package/bundles/eqproject-eqp-dynamic-module.umd.js +220 -33
- package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -1
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js +2 -2
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -1
- package/eqproject-eqp-dynamic-module.metadata.json +1 -1
- package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +45 -6
- package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +10 -21
- package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +148 -6
- package/esm2015/lib/eqp-dynamic-module.module.js +4 -2
- package/esm2015/lib/models/fields/imageField.model.js +5 -1
- package/esm5/lib/components/private/add-form-field/add-form-field.component.js +45 -6
- package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +10 -21
- package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +157 -6
- package/esm5/lib/eqp-dynamic-module.module.js +4 -2
- package/esm5/lib/models/fields/imageField.model.js +9 -1
- package/fesm2015/eqproject-eqp-dynamic-module.js +205 -31
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +218 -31
- package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
- package/lib/components/private/add-form-field/add-form-field.component.d.ts +14 -0
- package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +1 -17
- package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +51 -2
- package/lib/models/fields/imageField.model.d.ts +10 -4
- package/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
1
|
+
import { __decorate, __awaiter } from 'tslib';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
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';
|
|
@@ -37,6 +37,7 @@ 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';
|
|
@@ -1288,11 +1289,10 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1288
1289
|
break;
|
|
1289
1290
|
case FieldTypeEnum.Immagine:
|
|
1290
1291
|
this.field.AttachDefinition = new AttachmentField();
|
|
1291
|
-
this.fieldFormGroup.addControl('
|
|
1292
|
-
// this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
|
|
1293
|
-
this.fieldFormGroup.addControl('IsMultiPoint', new FormControl(this.field.IsMultiPoint));
|
|
1294
|
-
this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
|
|
1292
|
+
this.fieldFormGroup.addControl('EnableDrawing', new FormControl(this.field.EnableDrawing));
|
|
1295
1293
|
this.fieldFormGroup.addControl('ImageIsContextualAttachment', new FormControl(this.field.ImageIsContextualAttachment));
|
|
1294
|
+
// Imposto i FormControl variabili.
|
|
1295
|
+
this.onImageIsContextualAttachmentChange();
|
|
1296
1296
|
this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
|
|
1297
1297
|
break;
|
|
1298
1298
|
case FieldTypeEnum['Elenco generico']:
|
|
@@ -1309,11 +1309,51 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1309
1309
|
if ([FieldTypeEnum.Allegato, FieldTypeEnum.Immagine, FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
|
|
1310
1310
|
this.field.Formula = null;
|
|
1311
1311
|
this.fieldFormGroup.controls["Formula"].disable();
|
|
1312
|
+
this.fieldFormGroup.controls["InListView"].disable();
|
|
1312
1313
|
}
|
|
1313
1314
|
else {
|
|
1314
1315
|
this.fieldFormGroup.controls["Formula"].enable();
|
|
1316
|
+
this.fieldFormGroup.controls["InListView"].enable();
|
|
1315
1317
|
}
|
|
1316
1318
|
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Metodo invocato al cambio del valore della proprietà ImageIsContextualAttachment nel caso
|
|
1321
|
+
* di campi di tipo Immagine. Se TRUE allora rimuove i FormControl per le proprietà IsMultiAttach
|
|
1322
|
+
* e AllowedExtensions e aggiunge i FormControl per le proprietà ImgName e ContextualAttachment,
|
|
1323
|
+
* altrimenti il contrario.
|
|
1324
|
+
*/
|
|
1325
|
+
onImageIsContextualAttachmentChange() {
|
|
1326
|
+
this.field.ImgName = null;
|
|
1327
|
+
this.field.AttachDefinition.AllowedExtensions = [];
|
|
1328
|
+
this.field.AttachDefinition.IsMultiAttach = false;
|
|
1329
|
+
this.field.ContextualAttachment = null;
|
|
1330
|
+
if (this.field.ImageIsContextualAttachment) {
|
|
1331
|
+
this.fieldFormGroup.removeControl("IsMultiAttach");
|
|
1332
|
+
this.fieldFormGroup.removeControl("AllowedExtensions");
|
|
1333
|
+
this.fieldFormGroup.addControl('ImgName', new FormControl(this.field.ImgName, Validators.required));
|
|
1334
|
+
this.fieldFormGroup.addControl('ContextualAttachment', new FormControl(this.field.ContextualAttachment, Validators.required));
|
|
1335
|
+
}
|
|
1336
|
+
else {
|
|
1337
|
+
this.fieldFormGroup.removeControl("ImgName");
|
|
1338
|
+
this.fieldFormGroup.removeControl("ContextualAttachment");
|
|
1339
|
+
this.fieldFormGroup.addControl('IsMultiAttach', new FormControl(this.field.AttachDefinition.IsMultiAttach));
|
|
1340
|
+
this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Metodo per intercettare l'aggiunta di un allegato nei campi di tipo Immagine per aggiornare
|
|
1345
|
+
* il valore della proprietà ContextualAttachment e la validazione del relativo FormControl.
|
|
1346
|
+
* @param event Array contenente l'elenco aggiornato degli allegati caricati (nel nostro caso ne contiene al più 1).
|
|
1347
|
+
*/
|
|
1348
|
+
catchContextualAttachmentChange(event) {
|
|
1349
|
+
if (event && event.length > 0) {
|
|
1350
|
+
this.field.ContextualAttachment = event[0];
|
|
1351
|
+
}
|
|
1352
|
+
else {
|
|
1353
|
+
this.field.ContextualAttachment = null;
|
|
1354
|
+
}
|
|
1355
|
+
this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
|
|
1356
|
+
}
|
|
1317
1357
|
/**
|
|
1318
1358
|
* Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
|
|
1319
1359
|
* da usare nella visualizzazione del campo. Questa funzione manipola la sorgente dati per
|
|
@@ -1641,7 +1681,7 @@ __decorate([
|
|
|
1641
1681
|
AddFormFieldComponent = __decorate([
|
|
1642
1682
|
Component({
|
|
1643
1683
|
selector: 'eqp-dynamic-module-add-form-field',
|
|
1644
|
-
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>",
|
|
1684
|
+
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>",
|
|
1645
1685
|
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}"]
|
|
1646
1686
|
})
|
|
1647
1687
|
], AddFormFieldComponent);
|
|
@@ -2029,31 +2069,13 @@ ListValueFieldTemplateComponent = __decorate([
|
|
|
2029
2069
|
], ListValueFieldTemplateComponent);
|
|
2030
2070
|
|
|
2031
2071
|
let AttachmentFieldTemplateComponent = class AttachmentFieldTemplateComponent {
|
|
2032
|
-
//#endregion
|
|
2033
2072
|
constructor(utilityService, cdr) {
|
|
2034
2073
|
this.utilityService = utilityService;
|
|
2035
2074
|
this.cdr = cdr;
|
|
2036
2075
|
this.onlyImages = false;
|
|
2037
2076
|
this.recordChange = new EventEmitter();
|
|
2077
|
+
this.onAttachmentsChange = new EventEmitter();
|
|
2038
2078
|
this.metadataFormGroups = new Array();
|
|
2039
|
-
//#region Etichette per eqp-attachments
|
|
2040
|
-
this.previewLabel = "Anteprima";
|
|
2041
|
-
this.emptyTableMessage = "No record found";
|
|
2042
|
-
this.downloadTooltipPosition = "below";
|
|
2043
|
-
this.openLinkLabel = "Apri link";
|
|
2044
|
-
this.addButtonLabel = "Aggiungi";
|
|
2045
|
-
this.downloadLabel = "Download";
|
|
2046
|
-
this.deleteLabel = "Elimina";
|
|
2047
|
-
this.fileNameLabel = "Nome file";
|
|
2048
|
-
this.uploadFileLabel = "Carica file";
|
|
2049
|
-
this.confirmLabel = "Conferma";
|
|
2050
|
-
this.abortLabel = "Annulla";
|
|
2051
|
-
this.saveLabel = "Salva";
|
|
2052
|
-
this.exitLabel = "Esci";
|
|
2053
|
-
this.eqpTableSearchText = "Cerca...";
|
|
2054
|
-
this.deleteDialogTitle = "Attenzione:";
|
|
2055
|
-
this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
|
|
2056
|
-
this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
|
|
2057
2079
|
}
|
|
2058
2080
|
ngOnInit() {
|
|
2059
2081
|
// Nel caso in cui sono in modifica di un Record aggiorno il valore
|
|
@@ -2104,6 +2126,10 @@ let AttachmentFieldTemplateComponent = class AttachmentFieldTemplateComponent {
|
|
|
2104
2126
|
this.createMetadataFormGroups();
|
|
2105
2127
|
this.setFormControlValue();
|
|
2106
2128
|
this.onRecordValueChange();
|
|
2129
|
+
// Scateno un evento di output necessario al componente ImageFieldTemplate al
|
|
2130
|
+
// variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
|
|
2131
|
+
// sull'immagine caricata in base alla configurazione del Field.
|
|
2132
|
+
this.onAttachmentsChange.emit();
|
|
2107
2133
|
this.cdr.detectChanges();
|
|
2108
2134
|
}
|
|
2109
2135
|
/**
|
|
@@ -2189,6 +2215,9 @@ __decorate([
|
|
|
2189
2215
|
__decorate([
|
|
2190
2216
|
Output()
|
|
2191
2217
|
], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
2218
|
+
__decorate([
|
|
2219
|
+
Output()
|
|
2220
|
+
], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
|
|
2192
2221
|
__decorate([
|
|
2193
2222
|
ViewChild("eqpAttachments", { static: true })
|
|
2194
2223
|
], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
|
|
@@ -2198,14 +2227,36 @@ __decorate([
|
|
|
2198
2227
|
AttachmentFieldTemplateComponent = __decorate([
|
|
2199
2228
|
Component({
|
|
2200
2229
|
selector: 'attachment-field-template',
|
|
2201
|
-
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\"
|
|
2230
|
+
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>",
|
|
2202
2231
|
styles: [""]
|
|
2203
2232
|
})
|
|
2204
2233
|
], AttachmentFieldTemplateComponent);
|
|
2205
2234
|
|
|
2235
|
+
/**
|
|
2236
|
+
* Metodo per recuperare, a partire da un Blob, la stringa contenente il base64 del file.
|
|
2237
|
+
* Usato per prendere il base64 dell'immagine dopo che l'utente ci ha disegnato sopra.
|
|
2238
|
+
* @param file Blob che rappresenta l'immagine.
|
|
2239
|
+
*/
|
|
2240
|
+
const toBase64 = file => new Promise((resolve, reject) => {
|
|
2241
|
+
const reader = new FileReader();
|
|
2242
|
+
reader.readAsDataURL(file);
|
|
2243
|
+
reader.onload = () => resolve(reader.result.toString());
|
|
2244
|
+
reader.onerror = error => reject(error);
|
|
2245
|
+
});
|
|
2246
|
+
const ɵ0 = toBase64;
|
|
2206
2247
|
let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
2207
|
-
|
|
2248
|
+
//#endregion
|
|
2249
|
+
constructor(dialog, utilityService) {
|
|
2250
|
+
this.dialog = dialog;
|
|
2251
|
+
this.utilityService = utilityService;
|
|
2208
2252
|
this.recordChange = new EventEmitter();
|
|
2253
|
+
//#region Proprietà per configurare il componente ngx-image-drawing e aprire il relativo dialog.
|
|
2254
|
+
this.width = null;
|
|
2255
|
+
this.height = null;
|
|
2256
|
+
this.i18n = {
|
|
2257
|
+
saveBtn: 'Salva modifiche',
|
|
2258
|
+
cancelBtn: 'Ricarica originale'
|
|
2259
|
+
};
|
|
2209
2260
|
}
|
|
2210
2261
|
ngOnInit() {
|
|
2211
2262
|
this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
|
|
@@ -2218,6 +2269,19 @@ let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
|
2218
2269
|
this.field.AttachDefinition.Required = this.field.Required;
|
|
2219
2270
|
this.field.AttachDefinition.Formula = this.field.Formula;
|
|
2220
2271
|
this.field.AttachDefinition.FieldValue = this.field.FieldValue;
|
|
2272
|
+
// Se il campo prevede un'immagine pre-caricata (ImageIsContextualAttachment == true) sulla quale
|
|
2273
|
+
// l'utente può disegnare (EnableDrawing == true) e non sono in modifica di un record (ovvero nel record
|
|
2274
|
+
// non ho un'immagine già salvata) allora imposta l'immagine pre caricata come valore iniziale
|
|
2275
|
+
// nel record corrente e ne recupera le dimensioni per visualizzare correttamente l'area in cui
|
|
2276
|
+
// l'utente può disegnare. Se non effettua modifiche o non salva i disegni fatti viene salvata
|
|
2277
|
+
// l'immagine originale.
|
|
2278
|
+
if (this.field.ImageIsContextualAttachment && this.field.ContextualAttachment) {
|
|
2279
|
+
if (!this.record[this.field.Name] || !Array.isArray(this.record[this.field.Name]) || !(this.record[this.field.Name].length > 0)) {
|
|
2280
|
+
this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
|
|
2281
|
+
}
|
|
2282
|
+
this.preLoadedImageMetadataFormGroup = this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields, this.record[this.field.Name][0]);
|
|
2283
|
+
this.getImageDimensions();
|
|
2284
|
+
}
|
|
2221
2285
|
}
|
|
2222
2286
|
ngOnChanges(changes) {
|
|
2223
2287
|
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
@@ -2226,6 +2290,15 @@ let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
|
2226
2290
|
this.updateField();
|
|
2227
2291
|
}
|
|
2228
2292
|
}
|
|
2293
|
+
updateMetadataValidity() {
|
|
2294
|
+
if (this.preLoadedImageMetadataFormGroup.invalid) {
|
|
2295
|
+
this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
|
|
2296
|
+
}
|
|
2297
|
+
else {
|
|
2298
|
+
this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
|
|
2299
|
+
}
|
|
2300
|
+
this.onRecordValueChange();
|
|
2301
|
+
}
|
|
2229
2302
|
/**
|
|
2230
2303
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
2231
2304
|
*/
|
|
@@ -2234,7 +2307,100 @@ let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
|
2234
2307
|
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
2235
2308
|
}
|
|
2236
2309
|
}
|
|
2310
|
+
resetPreLoadedImage() {
|
|
2311
|
+
this.width = null;
|
|
2312
|
+
this.height = null;
|
|
2313
|
+
this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
|
|
2314
|
+
this.getImageDimensions();
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Metodo invocato quando vengono aggiunti o eliminati gli allegati nel componente AttachmentFieldTemplate.
|
|
2318
|
+
* Se l'ImageField è abilitato al disegno (EnableDrawing == true), non permette allegati multipli (IsMulitAttach == false)
|
|
2319
|
+
* e nel Record corrente è presente l'immagine caricata dall'utente allora recupera le dimensioni dell'immagine e
|
|
2320
|
+
* apre il dialog con il componente image-drawing per permettere il disegno sull'immagine appena caricata.
|
|
2321
|
+
*/
|
|
2322
|
+
onAttachmentsChange() {
|
|
2323
|
+
if (!this.field.AttachDefinition.IsMultiAttach && this.field.EnableDrawing && this.record[this.field.Name] && this.record[this.field.Name][0]) {
|
|
2324
|
+
this.getImageDimensions();
|
|
2325
|
+
this.dialogImageDrowingRef = this.dialog.open(this.dialogImageDrowing, {
|
|
2326
|
+
disableClose: true,
|
|
2327
|
+
hasBackdrop: true,
|
|
2328
|
+
width: '75%'
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Metodo invocato al salvataggio dell'immagine dal componente image-drawing.
|
|
2334
|
+
* Trasforma il Blob ricevuto in un base64, aggiorna il FileContetType e il FileDataBase64
|
|
2335
|
+
* dell'allegato caricato e chiude il dialog in cui disegnare.
|
|
2336
|
+
* @param drawnPicture Blob dell'immagine disegnata.
|
|
2337
|
+
*/
|
|
2338
|
+
saveDrowning(drawnPicture) {
|
|
2339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2340
|
+
let base64File = yield toBase64(drawnPicture);
|
|
2341
|
+
if (base64File) {
|
|
2342
|
+
this.record[this.field.Name][0].FileContentType = base64File.split(",")[0].split(":")[1].split(";")[0];
|
|
2343
|
+
this.record[this.field.Name][0].FileDataBase64 = base64File.split(",")[1];
|
|
2344
|
+
}
|
|
2345
|
+
if (this.dialogImageDrowingRef) {
|
|
2346
|
+
this.closeImageDrowingDialog();
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Metodo per chiudere il dialog in cui disegnare sull'immagine cariata e svuotare le dimensioni.
|
|
2352
|
+
*/
|
|
2353
|
+
closeImageDrowingDialog() {
|
|
2354
|
+
this.dialogImageDrowingRef.close();
|
|
2355
|
+
this.width = null;
|
|
2356
|
+
this.height = null;
|
|
2357
|
+
}
|
|
2358
|
+
/**
|
|
2359
|
+
* Metodo per recuperare le dimensioni dell'immagine caricata per mostrare correttamente
|
|
2360
|
+
* il componente image-drawing. Se non viene eseguito questo passaggio l'area in cui disegnare
|
|
2361
|
+
* è più grande dell'immagine stessa e al salvataggio i tratti disegnati vengono spostati.
|
|
2362
|
+
*/
|
|
2363
|
+
getImageDimensions() {
|
|
2364
|
+
var blob = this.getBlobFromBase64();
|
|
2365
|
+
const reader = new FileReader();
|
|
2366
|
+
reader.onload = (e) => {
|
|
2367
|
+
const image = new Image();
|
|
2368
|
+
image.src = e.target.result;
|
|
2369
|
+
image.onload = rs => {
|
|
2370
|
+
this.height = rs.currentTarget['height'];
|
|
2371
|
+
this.width = rs.currentTarget['width'];
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
2374
|
+
reader.readAsDataURL(blob);
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Metodo per convertire il base64 di un'immagine in un Blob.
|
|
2378
|
+
* Necessario per il recupero delle dimensioni dell'immagine caricata a partire dal suo base64.
|
|
2379
|
+
* Viene eseguito solo nel caso in cui l'ImageField non ammette allegati multipli.
|
|
2380
|
+
* @returns Restituisce il Blob dell'immagine caricata.
|
|
2381
|
+
*/
|
|
2382
|
+
getBlobFromBase64() {
|
|
2383
|
+
const byteCharacters = atob(this.record[this.field.Name][0].FileDataBase64);
|
|
2384
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
2385
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
2386
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
2387
|
+
}
|
|
2388
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
2389
|
+
return new Blob([byteArray], { type: this.record[this.field.Name][0].FileContentType });
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
2393
|
+
*/
|
|
2394
|
+
onRecordValueChange() {
|
|
2395
|
+
if (!this.field.Formula) {
|
|
2396
|
+
this.recordChange.emit(this.record);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2237
2399
|
};
|
|
2400
|
+
ImageFieldTemplateComponent.ctorParameters = () => [
|
|
2401
|
+
{ type: MatDialog },
|
|
2402
|
+
{ type: UtilityHelperService }
|
|
2403
|
+
];
|
|
2238
2404
|
__decorate([
|
|
2239
2405
|
Input()
|
|
2240
2406
|
], ImageFieldTemplateComponent.prototype, "record", void 0);
|
|
@@ -2244,11 +2410,14 @@ __decorate([
|
|
|
2244
2410
|
__decorate([
|
|
2245
2411
|
Output()
|
|
2246
2412
|
], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
2413
|
+
__decorate([
|
|
2414
|
+
ViewChild("dialogImageDrowing", { static: true })
|
|
2415
|
+
], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
|
|
2247
2416
|
ImageFieldTemplateComponent = __decorate([
|
|
2248
2417
|
Component({
|
|
2249
2418
|
selector: 'image-field-template',
|
|
2250
|
-
template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"
|
|
2251
|
-
styles: [""]
|
|
2419
|
+
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>",
|
|
2420
|
+
styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
|
|
2252
2421
|
})
|
|
2253
2422
|
], ImageFieldTemplateComponent);
|
|
2254
2423
|
|
|
@@ -2755,7 +2924,8 @@ EqpDynamicModuleModule = __decorate([
|
|
|
2755
2924
|
EqpSelectModule,
|
|
2756
2925
|
EqpDatetimepickerModule,
|
|
2757
2926
|
EqpFiltersModule,
|
|
2758
|
-
EqpNumericModule
|
|
2927
|
+
EqpNumericModule,
|
|
2928
|
+
EqpImgDrawingModule
|
|
2759
2929
|
],
|
|
2760
2930
|
exports: [
|
|
2761
2931
|
EqpDynamicModuleComponent,
|
|
@@ -2771,6 +2941,10 @@ class Entity extends BaseObj {
|
|
|
2771
2941
|
}
|
|
2772
2942
|
|
|
2773
2943
|
class ImageField extends BaseField {
|
|
2944
|
+
/**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
|
|
2945
|
+
get _contextualAttachments() {
|
|
2946
|
+
return this.ContextualAttachment ? [this.ContextualAttachment] : [];
|
|
2947
|
+
}
|
|
2774
2948
|
}
|
|
2775
2949
|
|
|
2776
2950
|
/**Questo tipo di campo rappresenta una lookup ad altri valori */
|
|
@@ -2796,5 +2970,5 @@ class TextField extends BaseField {
|
|
|
2796
2970
|
* Generated bundle index. Do not edit.
|
|
2797
2971
|
*/
|
|
2798
2972
|
|
|
2799
|
-
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 };
|
|
2973
|
+
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 };
|
|
2800
2974
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.js.map
|