@eqproject/eqp-dynamic-module 0.0.7 → 0.0.8
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 +3991 -0
- package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -0
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js +17 -0
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -0
- package/eqproject-eqp-dynamic-module.d.ts +6 -0
- package/eqproject-eqp-dynamic-module.metadata.json +1 -0
- package/esm2015/eqproject-eqp-dynamic-module.js +7 -0
- package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +262 -0
- package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +649 -0
- package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +577 -0
- package/esm2015/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +127 -0
- package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +170 -0
- package/esm2015/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +56 -0
- package/esm2015/lib/components/private/field-templates/date-field-template/date-field-template.component.js +71 -0
- package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +196 -0
- package/esm2015/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +115 -0
- package/esm2015/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +71 -0
- package/esm2015/lib/components/private/field-templates/text-field-template/text-field-template.component.js +67 -0
- package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +51 -0
- package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +130 -0
- package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +216 -0
- package/esm2015/lib/components/private/spinner/spinner.component.js +23 -0
- package/esm2015/lib/eqp-dynamic-module.module.js +69 -0
- package/esm2015/lib/interfaces/iBaseFieldComponent.interface.js +1 -0
- package/esm2015/lib/interfaces/iRootObject.interface.js +1 -0
- package/esm2015/lib/models/baseField.model.js +36 -0
- package/esm2015/lib/models/baseObj.model.js +9 -0
- package/esm2015/lib/models/context.model.js +8 -0
- package/esm2015/lib/models/endPointConfiguration.model.js +23 -0
- package/esm2015/lib/models/entity.model.js +7 -0
- package/esm2015/lib/models/fields/attachmentField.model.js +22 -0
- package/esm2015/lib/models/fields/booleanField.model.js +12 -0
- package/esm2015/lib/models/fields/dateField.model.js +11 -0
- package/esm2015/lib/models/fields/imageField.model.js +8 -0
- package/esm2015/lib/models/fields/listValueField.model.js +14 -0
- package/esm2015/lib/models/fields/lookupField.model.js +5 -0
- package/esm2015/lib/models/fields/numericField.model.js +5 -0
- package/esm2015/lib/models/fields/testareaField.model.js +4 -0
- package/esm2015/lib/models/fields/textField.model.js +14 -0
- package/esm2015/lib/models/form.model.js +24 -0
- package/esm2015/lib/models/record.model.js +8 -0
- package/esm2015/lib/modules/material.module.js +108 -0
- package/esm2015/lib/services/custom-form-validators.service.js +19 -0
- package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +113 -0
- package/esm2015/lib/services/spinner.service.js +43 -0
- package/esm2015/lib/services/utilityHelper.services.js +387 -0
- package/esm2015/public-api.js +39 -0
- package/esm5/eqproject-eqp-dynamic-module.js +7 -0
- package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +269 -0
- package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +664 -0
- package/esm5/lib/components/private/add-form-field/add-form-field.component.js +588 -0
- package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +128 -0
- package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +173 -0
- package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +57 -0
- package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +72 -0
- package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +206 -0
- package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +119 -0
- package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +72 -0
- package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +68 -0
- package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +52 -0
- package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +133 -0
- package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +220 -0
- package/esm5/lib/components/private/spinner/spinner.component.js +24 -0
- package/esm5/lib/eqp-dynamic-module.module.js +72 -0
- package/esm5/lib/interfaces/iBaseFieldComponent.interface.js +1 -0
- package/esm5/lib/interfaces/iRootObject.interface.js +1 -0
- package/esm5/lib/models/baseField.model.js +43 -0
- package/esm5/lib/models/baseObj.model.js +13 -0
- package/esm5/lib/models/context.model.js +14 -0
- package/esm5/lib/models/endPointConfiguration.model.js +33 -0
- package/esm5/lib/models/entity.model.js +14 -0
- package/esm5/lib/models/fields/attachmentField.model.js +29 -0
- package/esm5/lib/models/fields/booleanField.model.js +19 -0
- package/esm5/lib/models/fields/dateField.model.js +18 -0
- package/esm5/lib/models/fields/imageField.model.js +19 -0
- package/esm5/lib/models/fields/listValueField.model.js +25 -0
- package/esm5/lib/models/fields/lookupField.model.js +12 -0
- package/esm5/lib/models/fields/numericField.model.js +12 -0
- package/esm5/lib/models/fields/testareaField.model.js +11 -0
- package/esm5/lib/models/fields/textField.model.js +21 -0
- package/esm5/lib/models/form.model.js +39 -0
- package/esm5/lib/models/record.model.js +14 -0
- package/esm5/lib/modules/material.module.js +111 -0
- package/esm5/lib/services/custom-form-validators.service.js +23 -0
- package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +123 -0
- package/esm5/lib/services/spinner.service.js +46 -0
- package/esm5/lib/services/utilityHelper.services.js +396 -0
- package/esm5/public-api.js +39 -0
- package/fesm2015/eqproject-eqp-dynamic-module.js +3580 -0
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -0
- package/fesm5/eqproject-eqp-dynamic-module.js +3766 -0
- package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -0
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +101 -0
- package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +235 -0
- package/lib/components/private/add-form-field/add-form-field.component.d.ts +199 -0
- package/lib/components/private/dynamic-module-field/dynamic-module-field.component.d.ts +55 -0
- package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +68 -0
- package/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.d.ts +21 -0
- package/lib/components/private/field-templates/date-field-template/date-field-template.component.d.ts +27 -0
- package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +65 -0
- package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +51 -0
- package/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.d.ts +26 -0
- package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +22 -0
- package/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.d.ts +20 -0
- package/lib/components/private/form-records/add-form-record/add-form-record.component.d.ts +52 -0
- package/lib/components/private/form-records/list-form-record/list-form-record.component.d.ts +64 -0
- package/lib/components/private/spinner/spinner.component.d.ts +9 -0
- package/lib/eqp-dynamic-module.module.d.ts +2 -0
- package/{src/lib/interfaces/iBaseFieldComponent.interface.ts → lib/interfaces/iBaseFieldComponent.interface.d.ts} +1 -1
- package/{src/lib/interfaces/iRootObject.interface.ts → lib/interfaces/iRootObject.interface.d.ts} +1 -1
- package/{src/lib/models/baseField.model.ts → lib/models/baseField.model.d.ts} +5 -14
- package/{src/lib/models/baseObj.model.ts → lib/models/baseObj.model.d.ts} +3 -3
- package/lib/models/context.model.d.ts +9 -0
- package/{src/lib/models/endPointConfiguration.model.ts → lib/models/endPointConfiguration.model.d.ts} +12 -16
- package/{src/lib/models/entity.model.ts → lib/models/entity.model.d.ts} +1 -2
- package/lib/models/fields/attachmentField.model.d.ts +17 -0
- package/{src/lib/models/fields/booleanField.model.ts → lib/models/fields/booleanField.model.d.ts} +4 -8
- package/{src/lib/models/fields/dateField.model.ts → lib/models/fields/dateField.model.d.ts} +3 -5
- package/{src/lib/models/fields/imageField.model.ts → lib/models/fields/imageField.model.d.ts} +3 -8
- package/{src/lib/models/fields/listValueField.model.ts → lib/models/fields/listValueField.model.d.ts} +8 -13
- package/{src/lib/models/fields/lookupField.model.ts → lib/models/fields/lookupField.model.d.ts} +2 -5
- package/{src/lib/models/fields/numericField.model.ts → lib/models/fields/numericField.model.d.ts} +2 -3
- package/{src/lib/models/fields/testareaField.model.ts → lib/models/fields/testareaField.model.d.ts} +2 -3
- package/lib/models/fields/textField.model.d.ts +15 -0
- package/{src/lib/models/form.model.ts → lib/models/form.model.d.ts} +12 -25
- package/{src/lib/models/record.model.ts → lib/models/record.model.d.ts} +5 -4
- package/lib/modules/material.module.d.ts +2 -0
- package/lib/services/custom-form-validators.service.d.ts +5 -0
- package/lib/services/eqp-dynamic-module-dialog.service.d.ts +34 -0
- package/lib/services/spinner.service.d.ts +15 -0
- package/lib/services/utilityHelper.services.d.ts +77 -0
- package/package.json +41 -31
- package/{src/public-api.ts → public-api.d.ts} +0 -3
- package/karma.conf.js +0 -32
- package/ng-package.json +0 -18
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.html +0 -10
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.scss +0 -3
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.ts +0 -228
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.html +0 -212
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.scss +0 -30
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.ts +0 -692
- package/src/lib/components/private/add-form-field/add-form-field.component.html +0 -417
- package/src/lib/components/private/add-form-field/add-form-field.component.scss +0 -38
- package/src/lib/components/private/add-form-field/add-form-field.component.ts +0 -599
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.html +0 -42
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.scss +0 -0
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.ts +0 -125
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.html +0 -25
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.ts +0 -172
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.html +0 -32
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.ts +0 -53
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.html +0 -6
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.ts +0 -70
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.html +0 -57
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.scss +0 -4
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.ts +0 -203
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.html +0 -46
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.scss +0 -13
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.ts +0 -114
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.html +0 -6
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.ts +0 -70
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.html +0 -5
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.ts +0 -65
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.html +0 -5
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.ts +0 -48
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.html +0 -74
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.scss +0 -0
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.ts +0 -117
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.html +0 -14
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.scss +0 -7
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.ts +0 -213
- package/src/lib/components/private/spinner/spinner.component.html +0 -3
- package/src/lib/components/private/spinner/spinner.component.scss +0 -100
- package/src/lib/components/private/spinner/spinner.component.ts +0 -19
- package/src/lib/eqp-dynamic-module.module.ts +0 -65
- package/src/lib/models/context.model.ts +0 -10
- package/src/lib/models/fields/attachmentField.model.ts +0 -32
- package/src/lib/models/fields/textField.model.ts +0 -18
- package/src/lib/modules/material.module.ts +0 -104
- package/src/lib/services/custom-form-validators.service.ts +0 -21
- package/src/lib/services/eqp-dynamic-module-dialog.service.ts +0 -114
- package/src/lib/services/spinner.service.ts +0 -40
- package/src/lib/services/utilityHelper.services.ts +0 -413
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -23
- package/tsconfig.lib.prod.json +0 -6
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -17
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnInit, Output, QueryList, TemplateRef, ViewChild, ViewChildren } from '@angular/core';
|
|
2
|
-
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { IBaseFieldComponent } from '../../../interfaces/iBaseFieldComponent.interface';
|
|
4
|
-
import { BaseField, FieldTypeEnum } from '../../../models/baseField.model';
|
|
5
|
-
import { Form } from '../../../models/form.model';
|
|
6
|
-
import { Record } from '../../../models/record.model';
|
|
7
|
-
import { ListFormRecordComponent } from '../form-records/list-form-record/list-form-record.component';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'dynamic-module-field',
|
|
11
|
-
templateUrl: './dynamic-module-field.component.html',
|
|
12
|
-
styleUrls: ['./dynamic-module-field.component.scss']
|
|
13
|
-
})
|
|
14
|
-
export class DynamicModuleFieldComponent implements OnInit, IBaseFieldComponent {
|
|
15
|
-
|
|
16
|
-
@Input() field: BaseField;
|
|
17
|
-
@Input() form: Form;
|
|
18
|
-
@Input() record: Record;
|
|
19
|
-
@Output() recordChange: EventEmitter<Record> = new EventEmitter<Record>();
|
|
20
|
-
|
|
21
|
-
FieldTypeEnum = FieldTypeEnum;
|
|
22
|
-
|
|
23
|
-
//#region Proprietà per aggiungere/modificare i record di una form di dettaglio
|
|
24
|
-
selectedInnerForm: Form;
|
|
25
|
-
selectedInnerFormRecord: Record;
|
|
26
|
-
indexInnerFormRecord: number;
|
|
27
|
-
onlyViewInnerFormRecord: boolean = false;
|
|
28
|
-
dialogInnerFormRecordRef: MatDialogRef<TemplateRef<any>>;
|
|
29
|
-
@ViewChild('dialogInnerFormRecord', { static: true }) dialogInnerFormRecord: TemplateRef<any>;
|
|
30
|
-
//#endregion
|
|
31
|
-
|
|
32
|
-
@ViewChildren("fieldTemplate") fieldTemplate: QueryList<DynamicModuleFieldComponent>;
|
|
33
|
-
@ViewChildren('listInnerFormRecords') listInnerFormRecords: QueryList<ListFormRecordComponent>;
|
|
34
|
-
|
|
35
|
-
constructor(
|
|
36
|
-
private dialog: MatDialog
|
|
37
|
-
) { }
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
updateField(): void {
|
|
41
|
-
if (this.fieldTemplate && this.fieldTemplate.length > 0) {
|
|
42
|
-
this.fieldTemplate.forEach(f => f.updateField());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
ngOnInit(): void {
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Metodo invocato al cambio del valore di ogni proprietà dell'oggetto record.
|
|
51
|
-
* Serve ad aggiornare il valore di tutti i campi che hanno una formula.
|
|
52
|
-
*/
|
|
53
|
-
onRecordChange() {
|
|
54
|
-
this.recordChange.emit(this.record);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Metodo per recuperare una InnerForm a partire dal Field che la rappresenta.
|
|
59
|
-
* @param field Campo a partire dal quale si vuole recuperare la InnerForm.
|
|
60
|
-
* @returns Restituisce un oggetto di tipo Form.
|
|
61
|
-
*/
|
|
62
|
-
getInnerFormFromField(field: BaseField): Form {
|
|
63
|
-
if (this.form.InnerForms && this.form.InnerForms.find(f => f.Name == field.Label)) {
|
|
64
|
-
return this.form.InnerForms.find(f => f.Name == field.Label);
|
|
65
|
-
} else {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Metodo per aprire un dialog in cui aggiungere/modificare/visualizzare un record appartenente
|
|
72
|
-
* a una form di dettaglio.
|
|
73
|
-
* @param record Evento di output del componente list-form-record, contiene il record selezionato e un booleno che indica
|
|
74
|
-
* se l'utente vuole modificare o visualizzare l'elemento selezionato.
|
|
75
|
-
* @param innerForm Contiene la Form di dettaglio dalla quale è stato richiesto il record.
|
|
76
|
-
*/
|
|
77
|
-
onAddViewEditInnerFormRecord(record: { record: Record, onlyView: boolean }, field: BaseField) {
|
|
78
|
-
this.selectedInnerForm = this.getInnerFormFromField(field);
|
|
79
|
-
if (record == null) {
|
|
80
|
-
this.selectedInnerFormRecord = new Record();
|
|
81
|
-
this.indexInnerFormRecord = null;
|
|
82
|
-
this.onlyViewInnerFormRecord = false;
|
|
83
|
-
} else {
|
|
84
|
-
this.selectedInnerFormRecord = JSON.parse(JSON.stringify(record.record));
|
|
85
|
-
this.indexInnerFormRecord = this.record[field.Name].indexOf(record);
|
|
86
|
-
this.onlyViewInnerFormRecord = record.onlyView;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
this.dialogInnerFormRecordRef = this.dialog.open(this.dialogInnerFormRecord, {
|
|
90
|
-
disableClose: true,
|
|
91
|
-
hasBackdrop: true,
|
|
92
|
-
width: '75%'
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Metodo invocato al salvataggio o alla chiusura del dialog di aggiunta/modifica/visualizzazione
|
|
98
|
-
* di un record di una form di dettaglio.
|
|
99
|
-
* @param record Oggetto restituito dal componente add-form-field (questo qui) contenente il Record
|
|
100
|
-
* aggiornato dall'utente. Se null allora l'utente non ha modificato nulla e ha chiuso il dialog.
|
|
101
|
-
*/
|
|
102
|
-
onSaveInnerFormRecord(record: Record) {
|
|
103
|
-
if (record != null) {
|
|
104
|
-
const arrayName: string = this.selectedInnerForm.Name.split(' ').join('_');
|
|
105
|
-
if (this.indexInnerFormRecord != null && this.indexInnerFormRecord >= 0) {
|
|
106
|
-
this.record[arrayName][this.indexInnerFormRecord] = record;
|
|
107
|
-
} else {
|
|
108
|
-
if (!this.record[arrayName]) {
|
|
109
|
-
this.record[arrayName] = [];
|
|
110
|
-
}
|
|
111
|
-
this.record[arrayName].push(record);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
this.dialogInnerFormRecordRef.close();
|
|
115
|
-
|
|
116
|
-
// Ricarico la tabella dei record per visualizzare le modifiche fatte dall'utente.
|
|
117
|
-
if (this.listInnerFormRecords && this.listInnerFormRecords.length > 0) {
|
|
118
|
-
this.listInnerFormRecords.forEach(list => {
|
|
119
|
-
if (list && list.tableRecords) {
|
|
120
|
-
list.tableRecords.reloadDatatable();
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<p *ngIf="!field.IsMultiAttach" class="mb-2">
|
|
2
|
-
{{field.Label + (field.Required ? " *" : "")}}
|
|
3
|
-
</p>
|
|
4
|
-
<div class="row" *ngIf="!field.IsMultiAttach && record[field.Name] && record[field.Name][0]">
|
|
5
|
-
<div class="mt-2" *ngFor="let metadata of field.MetadataFields"
|
|
6
|
-
[ngClass]="utilityService.getFieldSyleClass(metadata)">
|
|
7
|
-
<dynamic-module-field [field]="metadata" [record]="record[field.Name][0]"
|
|
8
|
-
(recordChange)="updateMetadataValidity()">
|
|
9
|
-
</dynamic-module-field>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<eqp-attachments [attachmentsList]="record[field.Name]" [showMatCard]="true" [allowOnlyImages]="onlyImages"
|
|
14
|
-
[isDisabled]="field.FormFormGroup.disabled" [showInlinePreview]="true" [multipleAttachment]="field.IsMultiAttach"
|
|
15
|
-
[disableAction]="field.FormFormGroup.disabled" [acceptedFileTypes]="field.AllowedExtensions" [showHeader]="true"
|
|
16
|
-
[headerTitle]="field.Label + (field.Required ? ' *' : '')" (localEditedAttachments)="catchAttachmentList($event)"
|
|
17
|
-
#eqpAttachments>
|
|
18
|
-
</eqp-attachments>
|
|
19
|
-
|
|
20
|
-
<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->
|
|
21
|
-
<ng-template #metadataColumnTemplate let-row="row" let-col="col">
|
|
22
|
-
<dynamic-module-field [field]="getFieldFromMetadata(col, row)" [record]="row"
|
|
23
|
-
(recordChange)="updateMetadataValidity()">
|
|
24
|
-
</dynamic-module-field>
|
|
25
|
-
</ng-template>
|
|
File without changes
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
-
import { Record } from '../../../../models/record.model';
|
|
3
|
-
import { AttachmentField, AvailableFileExtensions, AvailableImageExtensions } from '../../../../models/fields/attachmentField.model';
|
|
4
|
-
import { IBaseFieldComponent } from '../../../../interfaces/iBaseFieldComponent.interface';
|
|
5
|
-
import { UtilityHelperService } from '../../../../services/utilityHelper.services';
|
|
6
|
-
import { EqpAttachmentsComponent } from '@eqproject/eqp-attachments';
|
|
7
|
-
import { FormGroup } from '@angular/forms';
|
|
8
|
-
import { ConfigColumn, TypeColumn } from '@eqproject/eqp-table';
|
|
9
|
-
|
|
10
|
-
@Component({
|
|
11
|
-
selector: 'attachment-field-template',
|
|
12
|
-
templateUrl: './attachment-field-template.component.html',
|
|
13
|
-
styleUrls: ['./attachment-field-template.component.scss']
|
|
14
|
-
})
|
|
15
|
-
export class AttachmentFieldTemplateComponent implements OnInit, OnChanges, IBaseFieldComponent, AfterViewInit {
|
|
16
|
-
|
|
17
|
-
@Input() onlyImages: boolean = false;
|
|
18
|
-
@Input() field: AttachmentField;
|
|
19
|
-
@Input() record: Record;
|
|
20
|
-
@Output() recordChange: EventEmitter<Record> = new EventEmitter<Record>();
|
|
21
|
-
@Output() onAttachmentsChange: EventEmitter<void> = new EventEmitter<void>();
|
|
22
|
-
|
|
23
|
-
@ViewChild("eqpAttachments", { static: true }) eqpAttachments: EqpAttachmentsComponent;
|
|
24
|
-
@ViewChild('metadataColumnTemplate', { static: true }) metadataColumnTemplate: TemplateRef<any>;
|
|
25
|
-
|
|
26
|
-
metadataFormGroups: Array<FormGroup> = new Array<FormGroup>();
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
public utilityService: UtilityHelperService,
|
|
30
|
-
private cdr: ChangeDetectorRef
|
|
31
|
-
) { }
|
|
32
|
-
|
|
33
|
-
ngOnInit(): void {
|
|
34
|
-
// Nel caso in cui sono in modifica di un Record aggiorno il valore
|
|
35
|
-
// e il validator del FormControl. Se non viene eseguita questa riga
|
|
36
|
-
// l'utente deve modificare la selezione fatta per aggiornare la form.
|
|
37
|
-
this.setFormControlValue();
|
|
38
|
-
|
|
39
|
-
// Sempre nel caso in cui sono in modifica creo i FormGroup che rappresentano
|
|
40
|
-
// gli eventuali metadata degli allegati recuperati.
|
|
41
|
-
this.createMetadataFormGroups();
|
|
42
|
-
if (this.field.MetadataFields) {
|
|
43
|
-
this.field.MetadataFields.sort((a, b) => (a.OrdinalPosition > b.OrdinalPosition) ? 1 : ((b.OrdinalPosition > a.OrdinalPosition) ? -1 : 0));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!this.field.AllowedExtensions) {
|
|
47
|
-
this.field.AllowedExtensions = AvailableFileExtensions.concat(AvailableImageExtensions).map(ext => ext.key);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
ngAfterViewInit(): void {
|
|
52
|
-
// Dopo aver renderizzato il DOM, se il campo ammette molteplici allegati
|
|
53
|
-
// configuro le colonne della eqp-table in eqp-attachments.
|
|
54
|
-
if (this.field.IsMultiAttach) {
|
|
55
|
-
this.configureMultiAttachmentColumns();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
60
|
-
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
61
|
-
if (changes['record'] != undefined && changes['record'].firstChange == false && JSON.stringify(changes['record'].currentValue) != JSON.stringify(changes['record'].previousValue)) {
|
|
62
|
-
this.record = changes['record'].currentValue;
|
|
63
|
-
this.updateField();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
69
|
-
*/
|
|
70
|
-
updateField() {
|
|
71
|
-
if (this.field.Formula) {
|
|
72
|
-
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Metodo per intercettare le modifiche agli allegati caricati.
|
|
78
|
-
* Se il campo prevede dei metadata allora per ogni allegato caricato crea un FormGroup
|
|
79
|
-
* per gestire la validazione degli input che l'utente può/deve riempire. I FormGroup
|
|
80
|
-
* seguono lo stesso ordine degli allegati caricati.
|
|
81
|
-
* @param event Contiene la lista aggiornata degli Attachment caricati dall'utente.
|
|
82
|
-
*/
|
|
83
|
-
catchAttachmentList(event) {
|
|
84
|
-
this.record[this.field.Name] = event;
|
|
85
|
-
|
|
86
|
-
this.createMetadataFormGroups();
|
|
87
|
-
|
|
88
|
-
this.setFormControlValue();
|
|
89
|
-
this.onRecordValueChange();
|
|
90
|
-
|
|
91
|
-
// Scateno un evento di output necessario al componente ImageFieldTemplate al
|
|
92
|
-
// variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
|
|
93
|
-
// sull'immagine caricata in base alla configurazione del Field.
|
|
94
|
-
this.onAttachmentsChange.emit();
|
|
95
|
-
this.cdr.detectChanges();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Metodo per aggiornare lo stato di validazione del FormControl che rappresenta
|
|
100
|
-
* il campo Allegato (non i metadata al suo interno). Se tra le form dei metadata
|
|
101
|
-
* ne trova una invalida allora marca il controllo come invalido.
|
|
102
|
-
*/
|
|
103
|
-
updateMetadataValidity() {
|
|
104
|
-
if (this.metadataFormGroups.find(form => form.invalid)) {
|
|
105
|
-
this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
|
|
106
|
-
} else {
|
|
107
|
-
this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
|
|
108
|
-
}
|
|
109
|
-
this.onRecordValueChange();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Metodo per recuperare il BaseField che rappresenta il metadata nella riga della eqp-table
|
|
114
|
-
* in base alla colonna e alla riga. Una volta trovato il BaseField gli viene associato il
|
|
115
|
-
* FormGroup di cui fa parte.
|
|
116
|
-
* @param col Colonna della eqp-table.
|
|
117
|
-
* @param row Riga della eqp-table (in questo caso eredita da IAttachment).
|
|
118
|
-
* @returns Restituisce un BaseField per renderizzare il campo nella eqp-table degli allegati multipli.
|
|
119
|
-
*/
|
|
120
|
-
getFieldFromMetadata(col: ConfigColumn, row: any) {
|
|
121
|
-
var baseField = JSON.parse(JSON.stringify(this.field.MetadataFields.find(metadata => metadata.Name === col.key)));
|
|
122
|
-
baseField.FormFormGroup = this.metadataFormGroups[this.record[this.field.Name].indexOf(row)];
|
|
123
|
-
return baseField;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Metodo per aggiornare il valore e il validator del FormControl associato al campo.
|
|
128
|
-
*/
|
|
129
|
-
private setFormControlValue() {
|
|
130
|
-
this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name]);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
135
|
-
*/
|
|
136
|
-
private onRecordValueChange() {
|
|
137
|
-
if (!this.field.Formula) {
|
|
138
|
-
this.recordChange.emit(this.record);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Metodo per aggiungere alle colonne di eqp-attachments le colonne per modificare i metadata
|
|
144
|
-
* configurati per il campo Allegato o Immagine.
|
|
145
|
-
*/
|
|
146
|
-
private configureMultiAttachmentColumns() {
|
|
147
|
-
if (this.eqpAttachments && this.eqpAttachments.attachmentsColumns && this.field.MetadataFields && this.field.MetadataFields.length > 0) {
|
|
148
|
-
this.field.MetadataFields.forEach(metadata => {
|
|
149
|
-
this.eqpAttachments.attachmentsColumns.splice(
|
|
150
|
-
this.eqpAttachments.attachmentsColumns.length - 1, 0,
|
|
151
|
-
{ key: metadata.Name, display: metadata.Label, type: TypeColumn.ExternalTemplate, externalTemplate: this.metadataColumnTemplate }
|
|
152
|
-
);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Metodo per creare i FormGroup che rappresentano i metadata degli allegati caricati.
|
|
159
|
-
*/
|
|
160
|
-
private createMetadataFormGroups() {
|
|
161
|
-
if (this.field.MetadataFields && this.field.MetadataFields.length > 0) {
|
|
162
|
-
this.metadataFormGroups = [];
|
|
163
|
-
if (this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
164
|
-
this.record[this.field.Name].forEach(attachment => {
|
|
165
|
-
this.metadataFormGroups.push(this.utilityService.CreateFormFormGroup(this.field.MetadataFields, attachment, this.field.FormFormGroup.disabled, !this.field.IsMultiAttach));
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
this.updateMetadataValidity();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<div [formGroup]="field.FormFormGroup">
|
|
2
|
-
|
|
3
|
-
<!-- VISUALIZZAZIONE A TOGGLE -->
|
|
4
|
-
<mat-slide-toggle color="primary" *ngIf="field.PresetationType == BoolPresentantioEnum.Toggle"
|
|
5
|
-
[formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"
|
|
6
|
-
[(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">
|
|
7
|
-
{{field.Label + (field.Required ? " *" : "")}}
|
|
8
|
-
</mat-slide-toggle>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<!-- VISUALIZZAZIONE A RADIOBUTTON -->
|
|
12
|
-
<mat-label class="mr-3" *ngIf="field.PresetationType == BoolPresentantioEnum['Radio button']">
|
|
13
|
-
{{field.Label + (field.Required ? " *" : "")}}
|
|
14
|
-
</mat-label>
|
|
15
|
-
<mat-radio-group *ngIf="field.PresetationType == BoolPresentantioEnum['Radio button']"
|
|
16
|
-
[formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"
|
|
17
|
-
[(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">
|
|
18
|
-
<mat-radio-button class="mr-2" [value]="true" color="primary"> Si </mat-radio-button>
|
|
19
|
-
<mat-radio-button class="mr-2" [value]="false" color="primary"> No </mat-radio-button>
|
|
20
|
-
<mat-radio-button class="mr-2" [value]="null" color="primary" *ngIf="field.IsTristate"> ND
|
|
21
|
-
</mat-radio-button>
|
|
22
|
-
</mat-radio-group>
|
|
23
|
-
|
|
24
|
-
<!-- VISUALIZZAZIONE A CHECKBOX -->
|
|
25
|
-
<mat-checkbox class="mr-2" *ngIf="field.PresetationType == BoolPresentantioEnum.Checkbox"
|
|
26
|
-
[disabled]="field.FormFormGroup.disabled" [required]="field.Required" [formControlName]="field.Name"
|
|
27
|
-
[(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">
|
|
28
|
-
{{field.Label + (field.Required ? " *" : "")}}
|
|
29
|
-
</mat-checkbox>
|
|
30
|
-
|
|
31
|
-
<!-- TODO: Visualizzazione "Stringa true o false" e "Numerico 0 o 1" ?? -->
|
|
32
|
-
</div>
|
|
File without changes
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { Record } from '../../../../models/record.model';
|
|
3
|
-
import { BooleanField, BoolPresentantioEnum } from '../../../../models/fields/booleanField.model';
|
|
4
|
-
import { IBaseFieldComponent } from '../../../../interfaces/iBaseFieldComponent.interface';
|
|
5
|
-
import { UtilityHelperService } from '../../../../services/utilityHelper.services';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'boolean-field-template',
|
|
9
|
-
templateUrl: './boolean-field-template.component.html',
|
|
10
|
-
styleUrls: ['./boolean-field-template.component.scss']
|
|
11
|
-
})
|
|
12
|
-
export class BooleanFieldTemplateComponent implements OnInit, OnChanges, IBaseFieldComponent {
|
|
13
|
-
|
|
14
|
-
@Input() field: BooleanField;
|
|
15
|
-
@Input() record: Record;
|
|
16
|
-
@Output() recordChange: EventEmitter<Record> = new EventEmitter<Record>();
|
|
17
|
-
|
|
18
|
-
BoolPresentantioEnum = BoolPresentantioEnum;
|
|
19
|
-
|
|
20
|
-
constructor() { }
|
|
21
|
-
|
|
22
|
-
ngOnInit(): void {
|
|
23
|
-
if (this.record[this.field.Name] == undefined || this.record[this.field.Name] == null) {
|
|
24
|
-
this.record[this.field.Name] = this.field.IsTristate ? null : false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
29
|
-
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
30
|
-
if (changes['record'] != undefined && changes['record'].firstChange == false && JSON.stringify(changes['record'].currentValue) != JSON.stringify(changes['record'].previousValue)) {
|
|
31
|
-
this.record = changes['record'].currentValue;
|
|
32
|
-
this.updateField();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
38
|
-
*/
|
|
39
|
-
updateField() {
|
|
40
|
-
if (this.field.Formula) {
|
|
41
|
-
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
47
|
-
*/
|
|
48
|
-
onRecordValueChange() {
|
|
49
|
-
if (!this.field.Formula) {
|
|
50
|
-
this.recordChange.emit(this.record);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<eqp-datetimepicker [placeholder]="field.Label" [UTCDate]="true" [pickerMode]="pickerMode"
|
|
2
|
-
[formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name"
|
|
3
|
-
[minDate]="field.MinDate ? field.MinDate : null" [maxDate]="field.MaxDate ? field.MaxDate : null"
|
|
4
|
-
[isRequired]="field.Required" [disabled]="field.FormFormGroup.disabled" [(ngModelInput)]="record[field.Name]"
|
|
5
|
-
(ngModelInputChange)="onRecordValueChange()" [customDateFormat]="field.DateFormat ? field.DateFormat : null">
|
|
6
|
-
</eqp-datetimepicker>
|
|
File without changes
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { PickerModeEnum } from '@eqproject/eqp-datetimepicker';
|
|
3
|
-
import { Record } from '../../../../models/record.model';
|
|
4
|
-
import { DateField, DateTimeTypeEnum } from '../../../../models/fields/dateField.model';
|
|
5
|
-
import { IBaseFieldComponent } from '../../../../interfaces/iBaseFieldComponent.interface';
|
|
6
|
-
import { UtilityHelperService } from '../../../../services/utilityHelper.services';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'date-field-template',
|
|
10
|
-
templateUrl: './date-field-template.component.html',
|
|
11
|
-
styleUrls: ['./date-field-template.component.scss']
|
|
12
|
-
})
|
|
13
|
-
export class DateFieldTemplateComponent implements OnInit, OnChanges, IBaseFieldComponent {
|
|
14
|
-
|
|
15
|
-
@Input() field: DateField;
|
|
16
|
-
@Input() record: Record;
|
|
17
|
-
@Output() recordChange: EventEmitter<Record> = new EventEmitter<Record>();
|
|
18
|
-
|
|
19
|
-
pickerMode: PickerModeEnum;
|
|
20
|
-
|
|
21
|
-
constructor() { }
|
|
22
|
-
|
|
23
|
-
ngOnInit(): void {
|
|
24
|
-
this.setTimeType();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
28
|
-
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
29
|
-
if (changes['record'] != undefined && changes['record'].firstChange == false && JSON.stringify(changes['record'].currentValue) != JSON.stringify(changes['record'].previousValue)) {
|
|
30
|
-
this.record = changes['record'].currentValue;
|
|
31
|
-
this.updateField();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
37
|
-
*/
|
|
38
|
-
updateField() {
|
|
39
|
-
if (this.field.Formula) {
|
|
40
|
-
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
46
|
-
*/
|
|
47
|
-
onRecordValueChange() {
|
|
48
|
-
if (!this.field.Formula) {
|
|
49
|
-
this.recordChange.emit(this.record);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* In base al formato della data richiesta nel DateField (solo data, solo orario o data e ora)
|
|
55
|
-
* imposta la visualizzazione corretta del componente eqp-datetimepicker.
|
|
56
|
-
*/
|
|
57
|
-
private setTimeType() {
|
|
58
|
-
switch (this.field.IsOnlyDate) {
|
|
59
|
-
case DateTimeTypeEnum["Solo data"]:
|
|
60
|
-
this.pickerMode = PickerModeEnum.DATE;
|
|
61
|
-
break;
|
|
62
|
-
case DateTimeTypeEnum["Solo orario"]:
|
|
63
|
-
this.pickerMode = PickerModeEnum.TIME;
|
|
64
|
-
break;
|
|
65
|
-
case DateTimeTypeEnum["Data e ora"]:
|
|
66
|
-
this.pickerMode = PickerModeEnum.DATETIME;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA' DI DISEGNO -->
|
|
2
|
-
<div class="row" *ngIf="field.ImageIsContextualAttachment && field.ContextualAttachment">
|
|
3
|
-
<div class="col-sm-12 col-md-6 col-lg-4">
|
|
4
|
-
<p class="mb-2">
|
|
5
|
-
{{ field.Label + (field.Required ? " *" : "")}}
|
|
6
|
-
<br>
|
|
7
|
-
Nome immagine: {{ field.ImgName}}
|
|
8
|
-
</p>
|
|
9
|
-
<eqp-img-drawing
|
|
10
|
-
*ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"
|
|
11
|
-
[src]="'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64"
|
|
12
|
-
[showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false" [width]="width"
|
|
13
|
-
[height]="height" [i18n]="i18n" [showCancelButton]="true" (save)="saveDrowning($event)"
|
|
14
|
-
(cancel)="resetPreLoadedImage()">
|
|
15
|
-
</eqp-img-drawing>
|
|
16
|
-
|
|
17
|
-
<img *ngIf="!field.EnableDrawing"
|
|
18
|
-
[src]="'data:'+ record[field.Name][0].FileContentType+ ';base64,'+ record[field.Name][0].FileDataBase64">
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div class="col-sm-12 col-md-6 col-lg-8">
|
|
22
|
-
<div class="row"
|
|
23
|
-
*ngIf="field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup">
|
|
24
|
-
<div class="mt-2" *ngFor="let metadata of field.AttachDefinition.MetadataFields"
|
|
25
|
-
[ngClass]="utilityService.getFieldSyleClass(metadata)">
|
|
26
|
-
<dynamic-module-field #fieldTemplate [field]="metadata" [form]="preLoadedImageMetadataFormGroup"
|
|
27
|
-
[record]="record[field.Name][0]" (recordChange)="updateMetadataValidity()">
|
|
28
|
-
</dynamic-module-field>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI -->
|
|
35
|
-
<attachment-field-template [(record)]="record" [field]="field.AttachDefinition" [onlyImages]="true"
|
|
36
|
-
(onAttachmentsChange)="onAttachmentsChange()" *ngIf="!field.ImageIsContextualAttachment">
|
|
37
|
-
</attachment-field-template>
|
|
38
|
-
|
|
39
|
-
<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->
|
|
40
|
-
<ng-template #dialogImageDrowing>
|
|
41
|
-
<div *ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"
|
|
42
|
-
class="row">
|
|
43
|
-
<div class="col-sm-12 col-md-12">
|
|
44
|
-
<eqp-img-drawing [showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false"
|
|
45
|
-
[src]="'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64"
|
|
46
|
-
[i18n]="i18n" [showCancelButton]="false" (save)="saveDrowning($event)">
|
|
47
|
-
</eqp-img-drawing>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="row mt-2 mb-1">
|
|
51
|
-
<div class="col-sm-12 text-right">
|
|
52
|
-
<button class="btn mat-raised-button" (click)="closeImageDrowingDialog()" type="button">
|
|
53
|
-
Annulla disegno
|
|
54
|
-
</button>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</ng-template>
|