@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.
- package/bundles/eqproject-eqp-dynamic-module.umd.js +305 -75
- 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/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +33 -12
- 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 +149 -7
- package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +7 -3
- package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +40 -18
- package/esm2015/lib/eqp-dynamic-module.module.js +4 -2
- package/esm2015/lib/models/fields/imageField.model.js +5 -1
- package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +33 -12
- 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 +158 -7
- package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +7 -3
- package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +40 -20
- 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 +291 -74
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +304 -76
- package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +7 -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/components/private/form-records/add-form-record/add-form-record.component.d.ts +3 -1
- package/lib/components/private/form-records/list-form-record/list-form-record.component.d.ts +8 -3
- package/lib/models/fields/imageField.model.d.ts +10 -4
- package/package.json +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
1
|
+
import { __decorate, __awaiter } from 'tslib';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, NgModule,
|
|
3
|
+
import { ɵɵdefineInjectable, ɵɵinject, Injectable, EventEmitter, Input, Output, Component, NgModule, ViewChild, ChangeDetectorRef, ViewChildren } from '@angular/core';
|
|
4
4
|
import { Validators, FormControl, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
6
6
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -37,12 +37,11 @@ import { TypeColumn, CellAlignmentEnum, NumberColumnPipe, EqpTableModule } from
|
|
|
37
37
|
import { EqpAttachmentsModule } from '@eqproject/eqp-attachments';
|
|
38
38
|
import { EnumHelper, EqpSelectModule } from '@eqproject/eqp-select';
|
|
39
39
|
import { PickerModeEnum, EqpDatetimepickerModule } from '@eqproject/eqp-datetimepicker';
|
|
40
|
+
import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';
|
|
40
41
|
import { EqpFiltersModule } from '@eqproject/eqp-filters';
|
|
41
42
|
import { EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
42
43
|
import Swal from 'sweetalert2';
|
|
43
44
|
import { BrowserModule } from '@angular/platform-browser';
|
|
44
|
-
import { UtilityHelperService as UtilityHelperService$1 } from 'projects/eqp-dynamic-module/src/lib/services/utilityHelper.services';
|
|
45
|
-
import { UtilityHelperService as UtilityHelperService$2, EqpDynamicModuleDialogService as EqpDynamicModuleDialogService$1, FieldTypeEnum as FieldTypeEnum$1, DateTimeTypeEnum as DateTimeTypeEnum$1 } from 'projects/eqp-dynamic-module/src/public-api';
|
|
46
45
|
|
|
47
46
|
class Context {
|
|
48
47
|
constructor() {
|
|
@@ -354,7 +353,11 @@ let EqpDynamicModuleComponent = class EqpDynamicModuleComponent {
|
|
|
354
353
|
this.context = new Context();
|
|
355
354
|
this.form = new Form();
|
|
356
355
|
this.showButtons = true;
|
|
356
|
+
this.showTitle = true;
|
|
357
357
|
this.viewMode = FormTypeEnum.LIST;
|
|
358
|
+
this.saveRecord = new EventEmitter();
|
|
359
|
+
this.deleteRecord = new EventEmitter();
|
|
360
|
+
this.duplicateRecord = new EventEmitter();
|
|
358
361
|
this.FormTypeEnum = FormTypeEnum;
|
|
359
362
|
}
|
|
360
363
|
ngOnInit() {
|
|
@@ -373,16 +376,21 @@ let EqpDynamicModuleComponent = class EqpDynamicModuleComponent {
|
|
|
373
376
|
}
|
|
374
377
|
onSaveForm(event) {
|
|
375
378
|
//TODO: Salvare il record!
|
|
376
|
-
if (event != null) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
379
|
+
// if (event != null) {
|
|
380
|
+
// if (event.ID && this.values.find(v => v.ID == event.ID)) {
|
|
381
|
+
// this.values[this.values.findIndex(v => v.ID == event.ID)] = event;
|
|
382
|
+
// } else {
|
|
383
|
+
// this.values.push(event);
|
|
384
|
+
// }
|
|
385
|
+
// }
|
|
386
|
+
this.saveRecord.emit(event);
|
|
384
387
|
this.viewMode = FormTypeEnum.LIST;
|
|
385
|
-
|
|
388
|
+
}
|
|
389
|
+
onDuplicateRecord(record) {
|
|
390
|
+
this.duplicateRecord.emit(record);
|
|
391
|
+
}
|
|
392
|
+
onDeleteRecord(record) {
|
|
393
|
+
this.deleteRecord.emit(record);
|
|
386
394
|
}
|
|
387
395
|
};
|
|
388
396
|
__decorate([
|
|
@@ -397,13 +405,25 @@ __decorate([
|
|
|
397
405
|
__decorate([
|
|
398
406
|
Input()
|
|
399
407
|
], EqpDynamicModuleComponent.prototype, "showButtons", void 0);
|
|
408
|
+
__decorate([
|
|
409
|
+
Input()
|
|
410
|
+
], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
|
|
400
411
|
__decorate([
|
|
401
412
|
Input()
|
|
402
413
|
], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
|
|
414
|
+
__decorate([
|
|
415
|
+
Output()
|
|
416
|
+
], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
Output()
|
|
419
|
+
], EqpDynamicModuleComponent.prototype, "deleteRecord", void 0);
|
|
420
|
+
__decorate([
|
|
421
|
+
Output()
|
|
422
|
+
], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
|
|
403
423
|
EqpDynamicModuleComponent = __decorate([
|
|
404
424
|
Component({
|
|
405
425
|
selector: 'eqp-dynamic-module',
|
|
406
|
-
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>",
|
|
426
|
+
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>",
|
|
407
427
|
styles: ["::ng-deep mat-form-field{width:100%}"]
|
|
408
428
|
})
|
|
409
429
|
], EqpDynamicModuleComponent);
|
|
@@ -1269,11 +1289,10 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1269
1289
|
break;
|
|
1270
1290
|
case FieldTypeEnum.Immagine:
|
|
1271
1291
|
this.field.AttachDefinition = new AttachmentField();
|
|
1272
|
-
this.fieldFormGroup.addControl('
|
|
1273
|
-
// this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
|
|
1274
|
-
this.fieldFormGroup.addControl('IsMultiPoint', new FormControl(this.field.IsMultiPoint));
|
|
1275
|
-
this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
|
|
1292
|
+
this.fieldFormGroup.addControl('EnableDrawing', new FormControl(this.field.EnableDrawing));
|
|
1276
1293
|
this.fieldFormGroup.addControl('ImageIsContextualAttachment', new FormControl(this.field.ImageIsContextualAttachment));
|
|
1294
|
+
// Imposto i FormControl variabili.
|
|
1295
|
+
this.onImageIsContextualAttachmentChange();
|
|
1277
1296
|
this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
|
|
1278
1297
|
break;
|
|
1279
1298
|
case FieldTypeEnum['Elenco generico']:
|
|
@@ -1290,10 +1309,50 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1290
1309
|
if ([FieldTypeEnum.Allegato, FieldTypeEnum.Immagine, FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
|
|
1291
1310
|
this.field.Formula = null;
|
|
1292
1311
|
this.fieldFormGroup.controls["Formula"].disable();
|
|
1312
|
+
this.fieldFormGroup.controls["InListView"].disable();
|
|
1293
1313
|
}
|
|
1294
1314
|
else {
|
|
1295
1315
|
this.fieldFormGroup.controls["Formula"].enable();
|
|
1316
|
+
this.fieldFormGroup.controls["InListView"].enable();
|
|
1317
|
+
}
|
|
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;
|
|
1296
1354
|
}
|
|
1355
|
+
this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
|
|
1297
1356
|
}
|
|
1298
1357
|
/**
|
|
1299
1358
|
* Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
|
|
@@ -1622,7 +1681,7 @@ __decorate([
|
|
|
1622
1681
|
AddFormFieldComponent = __decorate([
|
|
1623
1682
|
Component({
|
|
1624
1683
|
selector: 'eqp-dynamic-module-add-form-field',
|
|
1625
|
-
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>",
|
|
1626
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}"]
|
|
1627
1686
|
})
|
|
1628
1687
|
], AddFormFieldComponent);
|
|
@@ -2010,31 +2069,13 @@ ListValueFieldTemplateComponent = __decorate([
|
|
|
2010
2069
|
], ListValueFieldTemplateComponent);
|
|
2011
2070
|
|
|
2012
2071
|
let AttachmentFieldTemplateComponent = class AttachmentFieldTemplateComponent {
|
|
2013
|
-
//#endregion
|
|
2014
2072
|
constructor(utilityService, cdr) {
|
|
2015
2073
|
this.utilityService = utilityService;
|
|
2016
2074
|
this.cdr = cdr;
|
|
2017
2075
|
this.onlyImages = false;
|
|
2018
2076
|
this.recordChange = new EventEmitter();
|
|
2077
|
+
this.onAttachmentsChange = new EventEmitter();
|
|
2019
2078
|
this.metadataFormGroups = new Array();
|
|
2020
|
-
//#region Etichette per eqp-attachments
|
|
2021
|
-
this.previewLabel = "Anteprima";
|
|
2022
|
-
this.emptyTableMessage = "No record found";
|
|
2023
|
-
this.downloadTooltipPosition = "below";
|
|
2024
|
-
this.openLinkLabel = "Apri link";
|
|
2025
|
-
this.addButtonLabel = "Aggiungi";
|
|
2026
|
-
this.downloadLabel = "Download";
|
|
2027
|
-
this.deleteLabel = "Elimina";
|
|
2028
|
-
this.fileNameLabel = "Nome file";
|
|
2029
|
-
this.uploadFileLabel = "Carica file";
|
|
2030
|
-
this.confirmLabel = "Conferma";
|
|
2031
|
-
this.abortLabel = "Annulla";
|
|
2032
|
-
this.saveLabel = "Salva";
|
|
2033
|
-
this.exitLabel = "Esci";
|
|
2034
|
-
this.eqpTableSearchText = "Cerca...";
|
|
2035
|
-
this.deleteDialogTitle = "Attenzione:";
|
|
2036
|
-
this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
|
|
2037
|
-
this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
|
|
2038
2079
|
}
|
|
2039
2080
|
ngOnInit() {
|
|
2040
2081
|
// Nel caso in cui sono in modifica di un Record aggiorno il valore
|
|
@@ -2085,6 +2126,10 @@ let AttachmentFieldTemplateComponent = class AttachmentFieldTemplateComponent {
|
|
|
2085
2126
|
this.createMetadataFormGroups();
|
|
2086
2127
|
this.setFormControlValue();
|
|
2087
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();
|
|
2088
2133
|
this.cdr.detectChanges();
|
|
2089
2134
|
}
|
|
2090
2135
|
/**
|
|
@@ -2170,6 +2215,9 @@ __decorate([
|
|
|
2170
2215
|
__decorate([
|
|
2171
2216
|
Output()
|
|
2172
2217
|
], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
2218
|
+
__decorate([
|
|
2219
|
+
Output()
|
|
2220
|
+
], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
|
|
2173
2221
|
__decorate([
|
|
2174
2222
|
ViewChild("eqpAttachments", { static: true })
|
|
2175
2223
|
], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
|
|
@@ -2179,14 +2227,36 @@ __decorate([
|
|
|
2179
2227
|
AttachmentFieldTemplateComponent = __decorate([
|
|
2180
2228
|
Component({
|
|
2181
2229
|
selector: 'attachment-field-template',
|
|
2182
|
-
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>",
|
|
2183
2231
|
styles: [""]
|
|
2184
2232
|
})
|
|
2185
2233
|
], AttachmentFieldTemplateComponent);
|
|
2186
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;
|
|
2187
2247
|
let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
2188
|
-
|
|
2248
|
+
//#endregion
|
|
2249
|
+
constructor(dialog, utilityService) {
|
|
2250
|
+
this.dialog = dialog;
|
|
2251
|
+
this.utilityService = utilityService;
|
|
2189
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
|
+
};
|
|
2190
2260
|
}
|
|
2191
2261
|
ngOnInit() {
|
|
2192
2262
|
this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
|
|
@@ -2199,6 +2269,19 @@ let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
|
2199
2269
|
this.field.AttachDefinition.Required = this.field.Required;
|
|
2200
2270
|
this.field.AttachDefinition.Formula = this.field.Formula;
|
|
2201
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
|
+
}
|
|
2202
2285
|
}
|
|
2203
2286
|
ngOnChanges(changes) {
|
|
2204
2287
|
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
@@ -2207,15 +2290,117 @@ let ImageFieldTemplateComponent = class ImageFieldTemplateComponent {
|
|
|
2207
2290
|
this.updateField();
|
|
2208
2291
|
}
|
|
2209
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
|
+
}
|
|
2210
2302
|
/**
|
|
2211
2303
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
2212
2304
|
*/
|
|
2213
2305
|
updateField() {
|
|
2214
2306
|
if (this.field.Formula) {
|
|
2215
|
-
this.record[this.field.Name] = UtilityHelperService
|
|
2307
|
+
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
2308
|
+
}
|
|
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);
|
|
2216
2397
|
}
|
|
2217
2398
|
}
|
|
2218
2399
|
};
|
|
2400
|
+
ImageFieldTemplateComponent.ctorParameters = () => [
|
|
2401
|
+
{ type: MatDialog },
|
|
2402
|
+
{ type: UtilityHelperService }
|
|
2403
|
+
];
|
|
2219
2404
|
__decorate([
|
|
2220
2405
|
Input()
|
|
2221
2406
|
], ImageFieldTemplateComponent.prototype, "record", void 0);
|
|
@@ -2225,22 +2410,35 @@ __decorate([
|
|
|
2225
2410
|
__decorate([
|
|
2226
2411
|
Output()
|
|
2227
2412
|
], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
2413
|
+
__decorate([
|
|
2414
|
+
ViewChild("dialogImageDrowing", { static: true })
|
|
2415
|
+
], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
|
|
2228
2416
|
ImageFieldTemplateComponent = __decorate([
|
|
2229
2417
|
Component({
|
|
2230
2418
|
selector: 'image-field-template',
|
|
2231
|
-
template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"
|
|
2232
|
-
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}"]
|
|
2233
2421
|
})
|
|
2234
2422
|
], ImageFieldTemplateComponent);
|
|
2235
2423
|
|
|
2236
2424
|
let ListFormRecordComponent = class ListFormRecordComponent {
|
|
2237
2425
|
constructor() {
|
|
2426
|
+
this.showTitle = true;
|
|
2238
2427
|
this.columns = new Array();
|
|
2239
2428
|
this.onAddViewEditRecord = new EventEmitter();
|
|
2429
|
+
this.onDeleteRecord = new EventEmitter();
|
|
2430
|
+
this.onDuplicateRecord = new EventEmitter();
|
|
2240
2431
|
}
|
|
2241
2432
|
ngOnInit() {
|
|
2242
2433
|
this.configureColumns();
|
|
2243
2434
|
}
|
|
2435
|
+
ngOnChanges(changes) {
|
|
2436
|
+
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
2437
|
+
if (changes['values'] != undefined && changes['values'].firstChange == false) {
|
|
2438
|
+
this.values = changes['values'].currentValue;
|
|
2439
|
+
this.reloadTables();
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2244
2442
|
/**
|
|
2245
2443
|
* Metodo per configurare le colonne della eqp-table.
|
|
2246
2444
|
*/
|
|
@@ -2274,7 +2472,7 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2274
2472
|
.push({
|
|
2275
2473
|
name: action.Name, icon: action.Icon, fn: (element, index, col) => {
|
|
2276
2474
|
const rec = element;
|
|
2277
|
-
const ctx = UtilityHelperService
|
|
2475
|
+
const ctx = UtilityHelperService.context;
|
|
2278
2476
|
eval(action.Action);
|
|
2279
2477
|
// TODO: salvare le modifiche
|
|
2280
2478
|
}
|
|
@@ -2296,17 +2494,17 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2296
2494
|
* @param record Record da duplicare.
|
|
2297
2495
|
*/
|
|
2298
2496
|
duplicateRecord(record) {
|
|
2299
|
-
EqpDynamicModuleDialogService
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2497
|
+
// EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
|
|
2498
|
+
// var copiedRecord: Record = JSON.parse(JSON.stringify(record));
|
|
2499
|
+
// if (!isNaN(parseInt(copiedRecord.ID))) {
|
|
2500
|
+
// copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
|
|
2501
|
+
// } else {
|
|
2502
|
+
// copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
|
|
2503
|
+
// }
|
|
2504
|
+
// this.values.push(copiedRecord);
|
|
2505
|
+
// this.reloadTables();
|
|
2506
|
+
// }, false, 'Richiesta conferma');
|
|
2507
|
+
this.onDuplicateRecord.emit(record);
|
|
2310
2508
|
//TODO
|
|
2311
2509
|
}
|
|
2312
2510
|
/**
|
|
@@ -2314,10 +2512,11 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2314
2512
|
* @param record Record da eliminare selezionato sulla eqp-table.
|
|
2315
2513
|
*/
|
|
2316
2514
|
deleteRecord(record) {
|
|
2317
|
-
EqpDynamicModuleDialogService
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
}, false, 'Richiesta conferma');
|
|
2515
|
+
// EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
|
|
2516
|
+
// this.values.splice(this.values.indexOf(record), 1);
|
|
2517
|
+
// this.reloadTables();
|
|
2518
|
+
// }, false, 'Richiesta conferma');
|
|
2519
|
+
this.onDeleteRecord.emit(record);
|
|
2321
2520
|
// TODO
|
|
2322
2521
|
}
|
|
2323
2522
|
/**
|
|
@@ -2348,23 +2547,23 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2348
2547
|
createFieldColumn(field) {
|
|
2349
2548
|
var column = { key: field.Name, display: field.Label };
|
|
2350
2549
|
switch (field.FieldType) {
|
|
2351
|
-
case FieldTypeEnum
|
|
2550
|
+
case FieldTypeEnum['Booleano']:
|
|
2352
2551
|
column.type = TypeColumn.Boolean;
|
|
2353
2552
|
column.booleanValues = { false: '<i class="fa fa-times error-color"></i>', true: '<i class="fa fa-check success-color"></i>' };
|
|
2354
2553
|
column.styles = { flex: "0 0 7%", cellAlignment: CellAlignmentEnum.CENTER };
|
|
2355
2554
|
break;
|
|
2356
|
-
case FieldTypeEnum
|
|
2357
|
-
if (field.IsOnlyDate != DateTimeTypeEnum
|
|
2555
|
+
case FieldTypeEnum['Data e/o ora']:
|
|
2556
|
+
if (field.IsOnlyDate != DateTimeTypeEnum['Solo orario']) {
|
|
2358
2557
|
column.type = TypeColumn.Date;
|
|
2359
|
-
if (field.IsOnlyDate == DateTimeTypeEnum
|
|
2558
|
+
if (field.IsOnlyDate == DateTimeTypeEnum['Data e ora']) {
|
|
2360
2559
|
column.format = "dd/MM/yyyy HH:mm";
|
|
2361
2560
|
}
|
|
2362
|
-
else if (field.IsOnlyDate == DateTimeTypeEnum
|
|
2561
|
+
else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
|
|
2363
2562
|
column.format = "dd/MM/yyyy";
|
|
2364
2563
|
}
|
|
2365
2564
|
}
|
|
2366
2565
|
break;
|
|
2367
|
-
case FieldTypeEnum
|
|
2566
|
+
case FieldTypeEnum['Campo numerico']:
|
|
2368
2567
|
if (field.CurrencySymbol) {
|
|
2369
2568
|
column.numberPipe = NumberColumnPipe.CURRENCY;
|
|
2370
2569
|
column.currencyPipeCode = field.CurrencySymbol;
|
|
@@ -2373,8 +2572,8 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2373
2572
|
column.numberPipe = NumberColumnPipe.DECIMAL;
|
|
2374
2573
|
}
|
|
2375
2574
|
break;
|
|
2376
|
-
case FieldTypeEnum
|
|
2377
|
-
case FieldTypeEnum
|
|
2575
|
+
case FieldTypeEnum['Allegato']:
|
|
2576
|
+
case FieldTypeEnum['Immagine']:
|
|
2378
2577
|
column.value = (element) => {
|
|
2379
2578
|
if (field.IsMultiAttach || (field.AttachDefinition && field.AttachDefinition.IsMultiAttach)) {
|
|
2380
2579
|
return element[field.Name] != null && element[field.Name].length > 0 ? element[field.Name].map(a => a.FileName).join(", ") : null;
|
|
@@ -2386,7 +2585,7 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2386
2585
|
column.isSortable = false;
|
|
2387
2586
|
column.isSearchable = false;
|
|
2388
2587
|
break;
|
|
2389
|
-
case FieldTypeEnum
|
|
2588
|
+
case FieldTypeEnum['Elenco generico']:
|
|
2390
2589
|
column.value = (element) => {
|
|
2391
2590
|
if (field.IsMultiChoiche) {
|
|
2392
2591
|
if (!element[field.Name] || element[field.Name].length == 0) {
|
|
@@ -2403,7 +2602,7 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2403
2602
|
column.isSortable = false;
|
|
2404
2603
|
column.isSearchable = false;
|
|
2405
2604
|
break;
|
|
2406
|
-
case FieldTypeEnum
|
|
2605
|
+
case FieldTypeEnum['Lookup']:
|
|
2407
2606
|
// TODO
|
|
2408
2607
|
break;
|
|
2409
2608
|
}
|
|
@@ -2418,6 +2617,9 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2418
2617
|
}
|
|
2419
2618
|
}
|
|
2420
2619
|
};
|
|
2620
|
+
__decorate([
|
|
2621
|
+
Input()
|
|
2622
|
+
], ListFormRecordComponent.prototype, "showTitle", void 0);
|
|
2421
2623
|
__decorate([
|
|
2422
2624
|
Input()
|
|
2423
2625
|
], ListFormRecordComponent.prototype, "form", void 0);
|
|
@@ -2430,10 +2632,16 @@ __decorate([
|
|
|
2430
2632
|
__decorate([
|
|
2431
2633
|
Output()
|
|
2432
2634
|
], ListFormRecordComponent.prototype, "onAddViewEditRecord", void 0);
|
|
2635
|
+
__decorate([
|
|
2636
|
+
Output()
|
|
2637
|
+
], ListFormRecordComponent.prototype, "onDeleteRecord", void 0);
|
|
2638
|
+
__decorate([
|
|
2639
|
+
Output()
|
|
2640
|
+
], ListFormRecordComponent.prototype, "onDuplicateRecord", void 0);
|
|
2433
2641
|
ListFormRecordComponent = __decorate([
|
|
2434
2642
|
Component({
|
|
2435
2643
|
selector: 'list-form-record',
|
|
2436
|
-
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>",
|
|
2644
|
+
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>",
|
|
2437
2645
|
styles: ["::ng-deep .error-color{color:var(--danger)}::ng-deep .success-color{color:var(--success)}"]
|
|
2438
2646
|
})
|
|
2439
2647
|
], ListFormRecordComponent);
|
|
@@ -2445,6 +2653,7 @@ let AddFormRecordComponent = class AddFormRecordComponent {
|
|
|
2445
2653
|
constructor(cdr, utilityService) {
|
|
2446
2654
|
this.cdr = cdr;
|
|
2447
2655
|
this.utilityService = utilityService;
|
|
2656
|
+
this.showTitle = true;
|
|
2448
2657
|
this.showButtons = true;
|
|
2449
2658
|
this.form = new Form();
|
|
2450
2659
|
this.fieldGroups = {};
|
|
@@ -2532,8 +2741,11 @@ let AddFormRecordComponent = class AddFormRecordComponent {
|
|
|
2532
2741
|
};
|
|
2533
2742
|
AddFormRecordComponent.ctorParameters = () => [
|
|
2534
2743
|
{ type: ChangeDetectorRef },
|
|
2535
|
-
{ type: UtilityHelperService
|
|
2744
|
+
{ type: UtilityHelperService }
|
|
2536
2745
|
];
|
|
2746
|
+
__decorate([
|
|
2747
|
+
Input()
|
|
2748
|
+
], AddFormRecordComponent.prototype, "showTitle", void 0);
|
|
2537
2749
|
__decorate([
|
|
2538
2750
|
Input()
|
|
2539
2751
|
], AddFormRecordComponent.prototype, "showButtons", void 0);
|
|
@@ -2555,7 +2767,7 @@ __decorate([
|
|
|
2555
2767
|
AddFormRecordComponent = __decorate([
|
|
2556
2768
|
Component({
|
|
2557
2769
|
selector: 'add-form-record',
|
|
2558
|
-
template: "<div class=\"row eqp-dynamic-module-title\">\n <div class=\"col-md-12
|
|
2770
|
+
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>",
|
|
2559
2771
|
styles: [""]
|
|
2560
2772
|
})
|
|
2561
2773
|
], AddFormRecordComponent);
|
|
@@ -2712,7 +2924,8 @@ EqpDynamicModuleModule = __decorate([
|
|
|
2712
2924
|
EqpSelectModule,
|
|
2713
2925
|
EqpDatetimepickerModule,
|
|
2714
2926
|
EqpFiltersModule,
|
|
2715
|
-
EqpNumericModule
|
|
2927
|
+
EqpNumericModule,
|
|
2928
|
+
EqpImgDrawingModule
|
|
2716
2929
|
],
|
|
2717
2930
|
exports: [
|
|
2718
2931
|
EqpDynamicModuleComponent,
|
|
@@ -2728,6 +2941,10 @@ class Entity extends BaseObj {
|
|
|
2728
2941
|
}
|
|
2729
2942
|
|
|
2730
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
|
+
}
|
|
2731
2948
|
}
|
|
2732
2949
|
|
|
2733
2950
|
/**Questo tipo di campo rappresenta una lookup ad altri valori */
|
|
@@ -2753,5 +2970,5 @@ class TextField extends BaseField {
|
|
|
2753
2970
|
* Generated bundle index. Do not edit.
|
|
2754
2971
|
*/
|
|
2755
2972
|
|
|
2756
|
-
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 };
|
|
2757
2974
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.js.map
|