@eqproject/eqp-dynamic-module 2.10.85 → 2.10.86
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/README.md +14 -0
- package/esm2020/lib/components/private/add-form-field/add-form-field.component.mjs +4 -2
- package/esm2020/lib/components/private/field-templates/image-field-template/image-field-template.component.mjs +3 -3
- package/esm2020/lib/components/private/field-templates/image-with-markers-field-template/image-with-markers-field-template.component.mjs +3 -3
- package/esm2020/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.mjs +32 -10
- package/esm2020/lib/components/private/form-records/add-form-record/add-form-record.component.mjs +23 -12
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +63 -28
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +59 -25
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/private/form-records/add-form-record/add-form-record.component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -5055,6 +5055,7 @@ class ListValueFieldTemplateComponent {
|
|
|
5055
5055
|
this.record[this.field.Label] = initialvalue;
|
|
5056
5056
|
}
|
|
5057
5057
|
updateField() {
|
|
5058
|
+
var _a;
|
|
5058
5059
|
if (this.field.ReadonlyIf) {
|
|
5059
5060
|
this.field.Readonly = UtilityHelperService.EvaluateFieldFormula(this.field.ReadonlyIf, this.record, this.formulaObject);
|
|
5060
5061
|
this.checkReadonly();
|
|
@@ -5062,12 +5063,24 @@ class ListValueFieldTemplateComponent {
|
|
|
5062
5063
|
GlobalService.debugLog("list-value-field updateField", this.field);
|
|
5063
5064
|
if (this.field.Formula) {
|
|
5064
5065
|
GlobalService.debugLog("list-value-field - updateField - Formula", "formula");
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5066
|
+
if (((_a = this.field.DataGetter) === null || _a === void 0 ? void 0 : _a.DataGetterType) === DataGetterTypeEnum.Formula) {
|
|
5067
|
+
// La formula calcola il VALORE SELEZIONATO (non le opzioni): comportamento analogo al campo numerico.
|
|
5068
|
+
// Le opzioni vengono da ValueString/ValuePairs. Non si chiama resetArrayData() per evitare loop.
|
|
5069
|
+
const newValue = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, this.formulaObject);
|
|
5070
|
+
if (this.record[this.field.Name] !== newValue) {
|
|
5071
|
+
this.record[this.field.Name] = newValue;
|
|
5072
|
+
this.setFormControlValue();
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5075
|
+
else {
|
|
5076
|
+
// La formula calcola le OPZIONI (ValuePairs) — caso d'uso originale
|
|
5077
|
+
const tempValuePairs = this.field.ValuePairs;
|
|
5078
|
+
this.field.ValuePairs = {};
|
|
5079
|
+
const temp = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, this.formulaObject);
|
|
5080
|
+
this.field.ValuePairs = GlobalService.stringToValuePairs(temp);
|
|
5081
|
+
if (!(JSON.stringify(tempValuePairs) === JSON.stringify(this.field.ValuePairs))) {
|
|
5082
|
+
this.resetArrayData();
|
|
5083
|
+
}
|
|
5071
5084
|
}
|
|
5072
5085
|
}
|
|
5073
5086
|
else if (this.field.ValuePairs != null && this.field.ValuePairs.lenght > 0) {
|
|
@@ -5101,7 +5114,13 @@ class ListValueFieldTemplateComponent {
|
|
|
5101
5114
|
this.onRecordValueChange();
|
|
5102
5115
|
}
|
|
5103
5116
|
updateSelected(emitChange = true) {
|
|
5104
|
-
|
|
5117
|
+
const selectedValues = this.arrayData.filter(data => data.Selected).map(data => data.Value);
|
|
5118
|
+
// Single-choice: usa null (non []) quando nessun valore è selezionato.
|
|
5119
|
+
// [] !== [] in JS (confronto per referenza): mat-select._assignValue vede sempre un "cambio"
|
|
5120
|
+
// su ogni cycle di CD e scatena _onChange → ngModelChange → loop infinito.
|
|
5121
|
+
this.record[this.field.Name] = this.field.IsMultiChoiche
|
|
5122
|
+
? selectedValues
|
|
5123
|
+
: (selectedValues.length > 0 ? selectedValues[0] : null);
|
|
5105
5124
|
this.setFormControlValue();
|
|
5106
5125
|
if (emitChange) {
|
|
5107
5126
|
this.onRecordValueChange();
|
|
@@ -5112,7 +5131,7 @@ class ListValueFieldTemplateComponent {
|
|
|
5112
5131
|
}
|
|
5113
5132
|
resetArrayData() {
|
|
5114
5133
|
this.arrayData = [];
|
|
5115
|
-
this.updateSelected(
|
|
5134
|
+
this.updateSelected(false);
|
|
5116
5135
|
this.setArrayData();
|
|
5117
5136
|
}
|
|
5118
5137
|
reloadArrayData() {
|
|
@@ -5150,7 +5169,10 @@ class ListValueFieldTemplateComponent {
|
|
|
5150
5169
|
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
5151
5170
|
}
|
|
5152
5171
|
setFormControlValue() {
|
|
5153
|
-
|
|
5172
|
+
// emitModelToViewChange:false impedisce che FormControl.setValue() notifichi i callback
|
|
5173
|
+
// _onChange registrati da NgModel (via [formControlName] sul mat-checkbox), evitando che
|
|
5174
|
+
// NgModel emetta ngModelChange → updateSelected() → setFormControlValue() ricorsivamente.
|
|
5175
|
+
this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name], { emitEvent: false, emitModelToViewChange: false });
|
|
5154
5176
|
}
|
|
5155
5177
|
}
|
|
5156
5178
|
ListValueFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueFieldTemplateComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -6103,10 +6125,10 @@ class ImageFieldTemplateComponent {
|
|
|
6103
6125
|
}
|
|
6104
6126
|
}
|
|
6105
6127
|
ImageFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldTemplateComponent, deps: [{ token: i1$3.MatDialog }, { token: UtilityHelperService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
6106
|
-
ImageFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldTemplateComponent, selector: "image-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageDraw: "imageDraw" }, viewQueries: [{ propertyName: "dialogImageDrawing", first: true, predicate: ["dialogImageDrawing"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
6128
|
+
ImageFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldTemplateComponent, selector: "image-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageDraw: "imageDraw" }, viewQueries: [{ propertyName: "dialogImageDrawing", first: true, predicate: ["dialogImageDrawing"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\"\r\n class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div>\r\n <div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\"\r\n class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrawing>\r\n <div class=\"padder\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <tmw-image-drawer *ngIf=\"drawingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\" [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\"\r\n [enableRemoveImage]=\"false\" [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\" [i18n]=\"i18n\" [showCancelButton]=\"true\"\r\n (save)=\"saveDraw($event)\" (loadOriginal)=\"loadOriginal()\"\r\n (closeDialog)=\"closeImageDrowingDialog()\">\r\n </tmw-image-drawer>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TmwImageDrawerComponent, selector: "tmw-image-drawer", inputs: ["src", "width", "height", "forceSizeCanvas", "forceSizeExport", "enableRemoveImage", "enableLoadAnotherImage", "enableTooltip", "showCancelButton", "inConfig", "i18n", "locale", "loadingTemplate", "errorTemplate", "outputMimeType", "outputQuality", "borderCss", "drawingSizes", "colors"], outputs: ["closeDialog", "save", "loadOriginal"] }] });
|
|
6107
6129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldTemplateComponent, decorators: [{
|
|
6108
6130
|
type: Component,
|
|
6109
|
-
args: [{ selector: 'image-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
6131
|
+
args: [{ selector: 'image-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\"\r\n class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div>\r\n <div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\"\r\n class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrawing>\r\n <div class=\"padder\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <tmw-image-drawer *ngIf=\"drawingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\" [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\"\r\n [enableRemoveImage]=\"false\" [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\" [i18n]=\"i18n\" [showCancelButton]=\"true\"\r\n (save)=\"saveDraw($event)\" (loadOriginal)=\"loadOriginal()\"\r\n (closeDialog)=\"closeImageDrowingDialog()\">\r\n </tmw-image-drawer>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"] }]
|
|
6110
6132
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }, { type: UtilityHelperService }, { type: i0.Renderer2 }]; }, propDecorators: { endPointConfiguration: [{
|
|
6111
6133
|
type: Input
|
|
6112
6134
|
}], record: [{
|
|
@@ -7125,10 +7147,10 @@ class ImageWithMarkersFieldTemplateComponent {
|
|
|
7125
7147
|
}
|
|
7126
7148
|
}
|
|
7127
7149
|
ImageWithMarkersFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageWithMarkersFieldTemplateComponent, deps: [{ token: i1$3.MatDialog }, { token: UtilityHelperService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
7128
|
-
ImageWithMarkersFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageWithMarkersFieldTemplateComponent, selector: "image-with-markers-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageMark: "imageMark" }, viewQueries: [{ propertyName: "dialogImageMarking", first: true, predicate: ["dialogImageMarking"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
7150
|
+
ImageWithMarkersFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageWithMarkersFieldTemplateComponent, selector: "image-with-markers-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageMark: "imageMark" }, viewQueries: [{ propertyName: "dialogImageMarking", first: true, predicate: ["dialogImageMarking"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\" class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div><div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\" class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER MARCATURA -->\r\n<ng-template #dialogImageMarking>\r\n <tmw-image-marker *ngIf=\"MarkingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\"\r\n [savedMarkers]=\"extraJSON\"\r\n (save)=\"saveMark($event)\"\r\n (closeDialog)=\"closeDialog()\"\r\n [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\"\r\n >\r\n </tmw-image-marker>\r\n</ng-template>\r\n", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TmwImageMarkerComponent, selector: "tmw-image-marker", inputs: ["src", "width", "height", "inConfig", "savedMarkers", "outputMimeType", "outputQuality", "forceSizeCanvas"], outputs: ["closeDialog", "save"] }] });
|
|
7129
7151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageWithMarkersFieldTemplateComponent, decorators: [{
|
|
7130
7152
|
type: Component,
|
|
7131
|
-
args: [{ selector: 'image-with-markers-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
7153
|
+
args: [{ selector: 'image-with-markers-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\" class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div><div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\" class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER MARCATURA -->\r\n<ng-template #dialogImageMarking>\r\n <tmw-image-marker *ngIf=\"MarkingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\"\r\n [savedMarkers]=\"extraJSON\"\r\n (save)=\"saveMark($event)\"\r\n (closeDialog)=\"closeDialog()\"\r\n [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\"\r\n >\r\n </tmw-image-marker>\r\n</ng-template>\r\n", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"] }]
|
|
7132
7154
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }, { type: UtilityHelperService }, { type: i0.Renderer2 }]; }, propDecorators: { endPointConfiguration: [{
|
|
7133
7155
|
type: Input
|
|
7134
7156
|
}], record: [{
|
|
@@ -8314,6 +8336,7 @@ class AddFormRecordComponent {
|
|
|
8314
8336
|
this.loader = false;
|
|
8315
8337
|
this.isSaving = false;
|
|
8316
8338
|
this.formloaded = false;
|
|
8339
|
+
this._recordChanging = false;
|
|
8317
8340
|
this.fieldGroups = {};
|
|
8318
8341
|
this.FormScalarTypeEnum = FormScalarTypeEnum;
|
|
8319
8342
|
this.FieldTypeEnum = FieldTypeEnum;
|
|
@@ -8367,24 +8390,34 @@ class AddFormRecordComponent {
|
|
|
8367
8390
|
/**
|
|
8368
8391
|
* Metodo invocato al cambio del valore di ogni proprietà dell'oggetto record.
|
|
8369
8392
|
* Serve ad aggiornare il valore di tutti i campi che hanno una formula.
|
|
8393
|
+
* Il guard _recordChanging previene la rientranza: i campi formula aggiornano
|
|
8394
|
+
* record[name] e ciò riemette recordChange; senza guard si genera un loop infinito.
|
|
8370
8395
|
*/
|
|
8371
8396
|
onRecordChange() {
|
|
8372
8397
|
var _a;
|
|
8373
|
-
if (this.
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8398
|
+
if (this._recordChanging)
|
|
8399
|
+
return;
|
|
8400
|
+
this._recordChanging = true;
|
|
8401
|
+
try {
|
|
8402
|
+
if (this.fieldTemplate && this.fieldTemplate.length > 0) {
|
|
8403
|
+
this.fieldTemplate.forEach((f) => {
|
|
8404
|
+
if (f != null && typeof f.updateField === 'function') {
|
|
8405
|
+
f.updateField();
|
|
8406
|
+
}
|
|
8407
|
+
});
|
|
8408
|
+
}
|
|
8409
|
+
// I validator required leggono da record[field.Name] (closure su record), quindi basta
|
|
8410
|
+
// chiamare updateValueAndValidity per far rileggere il valore aggiornato dalla formula/ActionButton.
|
|
8411
|
+
// Non si usa setValue per evitare che writeValue sui ControlValueAccessor scateni eventi → loop.
|
|
8412
|
+
if ((_a = this.form) === null || _a === void 0 ? void 0 : _a.Fields) {
|
|
8413
|
+
this.form.Fields.forEach(field => {
|
|
8414
|
+
var _a, _b;
|
|
8415
|
+
(_b = (_a = field.FormFormGroup) === null || _a === void 0 ? void 0 : _a.get(field.Name)) === null || _b === void 0 ? void 0 : _b.updateValueAndValidity({ emitEvent: false });
|
|
8416
|
+
});
|
|
8417
|
+
}
|
|
8379
8418
|
}
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
// Non si usa setValue per evitare che writeValue sui ControlValueAccessor scateni eventi → loop.
|
|
8383
|
-
if ((_a = this.form) === null || _a === void 0 ? void 0 : _a.Fields) {
|
|
8384
|
-
this.form.Fields.forEach(field => {
|
|
8385
|
-
var _a, _b;
|
|
8386
|
-
(_b = (_a = field.FormFormGroup) === null || _a === void 0 ? void 0 : _a.get(field.Name)) === null || _b === void 0 ? void 0 : _b.updateValueAndValidity({ emitEvent: false });
|
|
8387
|
-
});
|
|
8419
|
+
finally {
|
|
8420
|
+
this._recordChanging = false;
|
|
8388
8421
|
}
|
|
8389
8422
|
}
|
|
8390
8423
|
//#endregion onRecordChange
|
|
@@ -15896,7 +15929,9 @@ class AddFormFieldComponent {
|
|
|
15896
15929
|
disableClose: true,
|
|
15897
15930
|
hasBackdrop: true,
|
|
15898
15931
|
panelClass: 'query-editor-modal',
|
|
15899
|
-
width: '90%'
|
|
15932
|
+
width: '90%',
|
|
15933
|
+
maxHeight: '90vh',
|
|
15934
|
+
position: { top: '20px' },
|
|
15900
15935
|
});
|
|
15901
15936
|
}
|
|
15902
15937
|
else {
|