@eqproject/eqp-dynamic-module 0.0.4 → 0.0.6
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 +43 -24
- package/bundles/eqproject-eqp-dynamic-module.umd.js +871 -227
- 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.d.ts +2 -1
- package/eqproject-eqp-dynamic-module.metadata.json +1 -1
- package/esm2015/eqproject-eqp-dynamic-module.js +3 -2
- package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +198 -22
- package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +124 -9
- package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +64 -12
- package/esm2015/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +21 -24
- package/esm2015/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
- package/esm2015/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
- package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
- package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
- package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
- package/esm2015/lib/components/private/spinner/spinner.component.js +23 -0
- package/esm2015/lib/eqp-dynamic-module.module.js +3 -3
- package/esm2015/lib/models/endPointConfiguration.model.js +23 -0
- package/esm2015/lib/models/fields/dateField.model.js +1 -1
- package/esm2015/lib/models/fields/listValueField.model.js +3 -1
- package/esm2015/lib/models/fields/numericField.model.js +1 -1
- package/esm2015/lib/models/fields/textField.model.js +10 -1
- package/esm2015/lib/models/form.model.js +1 -1
- package/esm2015/lib/models/record.model.js +6 -1
- package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +10 -1
- package/esm2015/lib/services/spinner.service.js +43 -0
- package/esm2015/lib/services/utilityHelper.services.js +180 -13
- package/esm2015/public-api.js +3 -1
- package/esm5/eqproject-eqp-dynamic-module.js +3 -2
- package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +204 -22
- package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +126 -8
- package/esm5/lib/components/private/add-form-field/add-form-field.component.js +64 -12
- package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
- package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +22 -24
- package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
- package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
- package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
- package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
- package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
- package/esm5/lib/components/private/spinner/spinner.component.js +24 -0
- package/esm5/lib/eqp-dynamic-module.module.js +3 -3
- package/esm5/lib/models/endPointConfiguration.model.js +33 -0
- package/esm5/lib/models/fields/dateField.model.js +1 -1
- package/esm5/lib/models/fields/listValueField.model.js +7 -1
- package/esm5/lib/models/fields/numericField.model.js +1 -1
- package/esm5/lib/models/fields/textField.model.js +10 -1
- package/esm5/lib/models/form.model.js +1 -1
- package/esm5/lib/models/record.model.js +8 -1
- package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +11 -1
- package/esm5/lib/services/spinner.service.js +46 -0
- package/esm5/lib/services/utilityHelper.services.js +182 -11
- package/esm5/public-api.js +3 -1
- package/fesm2015/eqproject-eqp-dynamic-module.js +820 -214
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +864 -228
- package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +78 -4
- package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +51 -2
- package/lib/components/private/add-form-field/add-form-field.component.d.ts +29 -4
- package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +3 -11
- package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +3 -1
- package/lib/components/private/spinner/spinner.component.d.ts +9 -0
- package/lib/models/endPointConfiguration.model.d.ts +35 -0
- package/lib/models/fields/dateField.model.d.ts +1 -0
- package/lib/models/fields/listValueField.model.d.ts +17 -0
- package/lib/models/fields/numericField.model.d.ts +3 -1
- package/lib/models/fields/textField.model.d.ts +9 -1
- package/lib/models/form.model.d.ts +1 -0
- package/lib/models/record.model.d.ts +8 -0
- package/lib/services/eqp-dynamic-module-dialog.service.d.ts +6 -0
- package/lib/services/spinner.service.d.ts +15 -0
- package/lib/services/utilityHelper.services.d.ts +30 -1
- package/package.json +3 -3
- package/public-api.d.ts +2 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { __decorate, __awaiter } from 'tslib';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { ɵɵdefineInjectable,
|
|
3
|
+
import { ɵɵdefineInjectable, Injectable, ɵɵinject, EventEmitter, Input, Output, Component, NgModule, ViewChild, ChangeDetectorRef, ViewChildren } from '@angular/core';
|
|
4
4
|
import { Validators, FormControl, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import Swal from 'sweetalert2';
|
|
6
|
+
import { HttpClient } from '@angular/common/http';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
5
8
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
6
9
|
import { MatButtonModule } from '@angular/material/button';
|
|
7
10
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -34,14 +37,12 @@ import { MatSortModule } from '@angular/material/sort';
|
|
|
34
37
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
35
38
|
import { MatNativeDateModule } from '@angular/material/core';
|
|
36
39
|
import { TypeColumn, CellAlignmentEnum, NumberColumnPipe, EqpTableModule } from '@eqproject/eqp-table';
|
|
37
|
-
import { EqpAttachmentsModule } from '@eqproject/eqp-attachments';
|
|
40
|
+
import { AttachmentType, EqpAttachmentsModule } from '@eqproject/eqp-attachments';
|
|
38
41
|
import { EnumHelper, EqpSelectModule } from '@eqproject/eqp-select';
|
|
39
42
|
import { PickerModeEnum, EqpDatetimepickerModule } from '@eqproject/eqp-datetimepicker';
|
|
40
43
|
import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';
|
|
41
44
|
import { EqpFiltersModule } from '@eqproject/eqp-filters';
|
|
42
|
-
import { EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
43
|
-
import Swal from 'sweetalert2';
|
|
44
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
45
|
+
import { EqpNumericInputMode, EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
45
46
|
|
|
46
47
|
class Context {
|
|
47
48
|
constructor() {
|
|
@@ -51,6 +52,29 @@ class Context {
|
|
|
51
52
|
class ContextUser {
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
class EndPointConfiguration {
|
|
56
|
+
}
|
|
57
|
+
class EndPointData {
|
|
58
|
+
}
|
|
59
|
+
class EndPointDataParams {
|
|
60
|
+
constructor() {
|
|
61
|
+
this.ParamValue = null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var ParamTypeEnum;
|
|
65
|
+
(function (ParamTypeEnum) {
|
|
66
|
+
ParamTypeEnum[ParamTypeEnum["Query param"] = 1] = "Query param";
|
|
67
|
+
ParamTypeEnum[ParamTypeEnum["In route"] = 2] = "In route";
|
|
68
|
+
ParamTypeEnum[ParamTypeEnum["In Body"] = 3] = "In Body";
|
|
69
|
+
})(ParamTypeEnum || (ParamTypeEnum = {}));
|
|
70
|
+
var RequestMethodEnum;
|
|
71
|
+
(function (RequestMethodEnum) {
|
|
72
|
+
RequestMethodEnum["GET"] = "GET";
|
|
73
|
+
RequestMethodEnum["POST"] = "POST";
|
|
74
|
+
RequestMethodEnum["PUT"] = "PUT";
|
|
75
|
+
RequestMethodEnum["DELETE"] = "DELETE";
|
|
76
|
+
})(RequestMethodEnum || (RequestMethodEnum = {}));
|
|
77
|
+
|
|
54
78
|
/**
|
|
55
79
|
* Classe base che implementa la valorizzazione dell'ID (se null) con una nuova GUID
|
|
56
80
|
* in creazione dell'oggetto.
|
|
@@ -83,6 +107,122 @@ var FormScalarTypeEnum;
|
|
|
83
107
|
FormScalarTypeEnum[FormScalarTypeEnum["In accordion"] = 4] = "In accordion"; //GROUPED_BY_ACCORDION
|
|
84
108
|
})(FormScalarTypeEnum || (FormScalarTypeEnum = {}));
|
|
85
109
|
|
|
110
|
+
class Record {
|
|
111
|
+
}
|
|
112
|
+
class DynRecord {
|
|
113
|
+
constructor() {
|
|
114
|
+
this.Values = {};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let EqpDynamicModuleDialogService = class EqpDynamicModuleDialogService {
|
|
119
|
+
constructor() {
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
|
|
123
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
124
|
+
* @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
|
|
125
|
+
*/
|
|
126
|
+
static Success(message, title = null) {
|
|
127
|
+
let currentTitle = title != null ? title : 'Operazione completata con successo.';
|
|
128
|
+
Swal.fire(currentTitle, message, 'success');
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
132
|
+
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
133
|
+
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
134
|
+
*/
|
|
135
|
+
static Error(message, title = null) {
|
|
136
|
+
let currentTitle = title != null ? title : 'Errore';
|
|
137
|
+
if (Array.isArray(message)) {
|
|
138
|
+
currentTitle = title != null ? title : 'Errore';
|
|
139
|
+
let htmlErrors = message.join("<br>");
|
|
140
|
+
Swal.fire({
|
|
141
|
+
title: currentTitle,
|
|
142
|
+
html: htmlErrors,
|
|
143
|
+
icon: 'error'
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
Swal.fire(currentTitle, message, 'error');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
152
|
+
* CONFERMA lancia la funzione di callback passata come parametro
|
|
153
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
154
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
155
|
+
*/
|
|
156
|
+
static Confirm(message, confirmCallback, isWarning = false, title = null, customWidth = null) {
|
|
157
|
+
let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
158
|
+
if (Array.isArray(message)) {
|
|
159
|
+
let htmlErrors = message.join("<br>");
|
|
160
|
+
Swal.fire({
|
|
161
|
+
title: currentTitle,
|
|
162
|
+
html: htmlErrors,
|
|
163
|
+
width: customWidth ? customWidth : '32rem',
|
|
164
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
165
|
+
showCancelButton: true,
|
|
166
|
+
allowOutsideClick: false,
|
|
167
|
+
allowEscapeKey: false
|
|
168
|
+
}).then((result) => {
|
|
169
|
+
if (result.value && confirmCallback) {
|
|
170
|
+
confirmCallback();
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
Swal.fire({
|
|
176
|
+
title: currentTitle,
|
|
177
|
+
text: message,
|
|
178
|
+
width: customWidth ? customWidth : '32rem',
|
|
179
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
180
|
+
showCancelButton: true,
|
|
181
|
+
allowOutsideClick: false,
|
|
182
|
+
allowEscapeKey: false
|
|
183
|
+
}).then((result) => {
|
|
184
|
+
if (result.value && confirmCallback) {
|
|
185
|
+
confirmCallback();
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
192
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
193
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
194
|
+
*/
|
|
195
|
+
static Info(message, title = null, isToast = null) {
|
|
196
|
+
let currentTitle = title != null ? title : "Informazione:";
|
|
197
|
+
Swal.fire(currentTitle, message, 'info');
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
201
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
202
|
+
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
203
|
+
*/
|
|
204
|
+
static Warning(message, title = null, isToast = null) {
|
|
205
|
+
let currentTitle = title != null ? title : "Attenzione!";
|
|
206
|
+
if (Array.isArray(message)) {
|
|
207
|
+
let htmlWarnings = message.join("<br>");
|
|
208
|
+
Swal.fire({
|
|
209
|
+
title: currentTitle,
|
|
210
|
+
html: htmlWarnings,
|
|
211
|
+
icon: 'warning'
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
Swal.fire(currentTitle, message, 'warning');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
|
|
220
|
+
EqpDynamicModuleDialogService = __decorate([
|
|
221
|
+
Injectable({
|
|
222
|
+
providedIn: 'root'
|
|
223
|
+
})
|
|
224
|
+
], EqpDynamicModuleDialogService);
|
|
225
|
+
|
|
86
226
|
/**
|
|
87
227
|
* Contiene le informazioni di base del campo, indipendentemente dal tipo.
|
|
88
228
|
* Questa classe è volutamente astratta perché il tipo di campo è dettato dal tipo
|
|
@@ -118,6 +258,19 @@ var ColSpanSizesEnum;
|
|
|
118
258
|
ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"] = 12] = "col-lg-12";
|
|
119
259
|
})(ColSpanSizesEnum || (ColSpanSizesEnum = {}));
|
|
120
260
|
|
|
261
|
+
/**Campo di testo */
|
|
262
|
+
class TextField extends BaseField {
|
|
263
|
+
}
|
|
264
|
+
var TextMaskEnum;
|
|
265
|
+
(function (TextMaskEnum) {
|
|
266
|
+
TextMaskEnum[TextMaskEnum["Password"] = 1] = "Password";
|
|
267
|
+
TextMaskEnum[TextMaskEnum["Email"] = 2] = "Email";
|
|
268
|
+
TextMaskEnum[TextMaskEnum["Telefono"] = 3] = "Telefono";
|
|
269
|
+
TextMaskEnum[TextMaskEnum["Url"] = 4] = "Url";
|
|
270
|
+
})(TextMaskEnum || (TextMaskEnum = {}));
|
|
271
|
+
const UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
|
|
272
|
+
const TelRegex = '([+]?[0-9]{10,14})';
|
|
273
|
+
|
|
121
274
|
class ArrayValidators {
|
|
122
275
|
static minLenght(minLenght) {
|
|
123
276
|
var validationFunction = (control) => {
|
|
@@ -137,18 +290,70 @@ class ArrayValidators {
|
|
|
137
290
|
}
|
|
138
291
|
}
|
|
139
292
|
|
|
293
|
+
let SpinnerService = class SpinnerService {
|
|
294
|
+
constructor() {
|
|
295
|
+
this.isLoading = new Subject();
|
|
296
|
+
this.requestsCount = 0;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Mostra lo spinner
|
|
300
|
+
*/
|
|
301
|
+
show() {
|
|
302
|
+
setTimeout(() => {
|
|
303
|
+
this.isLoading.next(true);
|
|
304
|
+
}, 100);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Nasconde lo spinner
|
|
308
|
+
*/
|
|
309
|
+
hide() {
|
|
310
|
+
setTimeout(() => {
|
|
311
|
+
this.isLoading.next(false);
|
|
312
|
+
}, 100);
|
|
313
|
+
}
|
|
314
|
+
addRequestCounter() {
|
|
315
|
+
this.requestsCount++;
|
|
316
|
+
this.show();
|
|
317
|
+
}
|
|
318
|
+
removeRequestCounter() {
|
|
319
|
+
this.requestsCount--;
|
|
320
|
+
if (this.requestsCount == 0)
|
|
321
|
+
this.hide();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
SpinnerService.ɵprov = ɵɵdefineInjectable({ factory: function SpinnerService_Factory() { return new SpinnerService(); }, token: SpinnerService, providedIn: "root" });
|
|
325
|
+
SpinnerService = __decorate([
|
|
326
|
+
Injectable({
|
|
327
|
+
providedIn: 'root'
|
|
328
|
+
})
|
|
329
|
+
], SpinnerService);
|
|
330
|
+
|
|
140
331
|
var UtilityHelperService_1;
|
|
141
332
|
let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
142
|
-
constructor(formBuilder) {
|
|
333
|
+
constructor(formBuilder, http, spinnerService) {
|
|
143
334
|
this.formBuilder = formBuilder;
|
|
335
|
+
this.http = http;
|
|
336
|
+
this.spinnerService = spinnerService;
|
|
144
337
|
}
|
|
145
338
|
static EvaluateFieldFormula(formula, rec, ctx) {
|
|
146
|
-
const evaluatedValue = eval(formula
|
|
339
|
+
const evaluatedValue = eval(formula);
|
|
147
340
|
return (evaluatedValue ? evaluatedValue : null);
|
|
148
341
|
}
|
|
149
342
|
static SetContext(ctx) {
|
|
150
343
|
this.context = ctx;
|
|
151
344
|
}
|
|
345
|
+
static GetFieldType(field) {
|
|
346
|
+
switch (field.FieldType) {
|
|
347
|
+
case FieldTypeEnum["Campo di testo"]: {
|
|
348
|
+
const t = Object.assign(new TextField, field);
|
|
349
|
+
return t;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
default: {
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
152
357
|
/**
|
|
153
358
|
* Metodo per impostare i valori da suggerire nell'autocomplete per i campi in cui l'utente deve scrivere comandi javascript.
|
|
154
359
|
* In base all'ultimo carattere digitato viene impostato un elenco di oggetti o proprietà che l'utente ha a disposizione in quel momento.
|
|
@@ -160,7 +365,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
160
365
|
* 3) la stringa digitata dall'utente non coincide con nessun altro caso sopra (finisce con un carattere qualunque)
|
|
161
366
|
*/
|
|
162
367
|
static GetAutocompleteOptions(fields, typedFormula) {
|
|
163
|
-
|
|
368
|
+
let autocompleteOptions = [];
|
|
164
369
|
// Recupero i nomi di tutti i campi creati fino ad ora nella form.
|
|
165
370
|
const availableRecProperties = fields.map(f => f.Label.split(' ').join('_'));
|
|
166
371
|
// Nel casi in cui l'utente non ha inserito nulla oppure la stringa finisce con uno spazio vuoto o un simbolo diverso da "."
|
|
@@ -196,17 +401,17 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
196
401
|
// funzione javascript. Controllo la parola che l'utente sta digitando e se fa parte di uno degli oggetti a disposizione
|
|
197
402
|
// o una proprietà di essi allora suggerisco i possibili match.
|
|
198
403
|
else {
|
|
199
|
-
|
|
404
|
+
const availableOptions = [];
|
|
200
405
|
// Prendo tutti i blocchi di caratteri digitati dall'utente
|
|
201
406
|
const allFormulaWords = typedFormula.split(" ");
|
|
202
407
|
// Prendo l'ultimo blocco di caratteri digitato dall'utente
|
|
203
|
-
|
|
408
|
+
const lastTypedString = allFormulaWords[allFormulaWords.length - 1];
|
|
204
409
|
// Se la l'ultima stringa digitata non contiene caratteri speciali allora splitto la stringa
|
|
205
410
|
// sui "." e imposto i suggerimenti in base al path della prorpietà che si sta digitando.
|
|
206
411
|
if (!new RegExp("[^0-9a-zA-Z_.]").test(lastTypedString)) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
412
|
+
const propertyPath = lastTypedString.split(".");
|
|
413
|
+
const lastTypedWork = propertyPath[propertyPath.length - 1];
|
|
414
|
+
let propertiesToCheck = [];
|
|
210
415
|
if (propertyPath.length == 1) {
|
|
211
416
|
propertiesToCheck = ["rec", "ctx"];
|
|
212
417
|
}
|
|
@@ -219,7 +424,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
219
424
|
else if (propertyPath.length > 1 && propertyPath[propertyPath.length - 2] === "rec") {
|
|
220
425
|
propertiesToCheck = availableRecProperties;
|
|
221
426
|
}
|
|
222
|
-
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
427
|
+
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
223
428
|
// quello che sta digitando l'utente.
|
|
224
429
|
propertiesToCheck.forEach(prop => {
|
|
225
430
|
if (prop.startsWith(lastTypedWork)) {
|
|
@@ -285,7 +490,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
285
490
|
* @returns Restituisce un FormGroup rappresentate la Form a cui appartengono i BaseField ricevuti in input.
|
|
286
491
|
*/
|
|
287
492
|
CreateFormFormGroup(formFields, record, onlyView = false, includeCurrentFormInField = true) {
|
|
288
|
-
|
|
493
|
+
const formForm = this.formBuilder.group([]);
|
|
289
494
|
formFields.forEach(field => {
|
|
290
495
|
formForm.addControl(field.Name, this.createFieldFormControl(field, record));
|
|
291
496
|
if (includeCurrentFormInField) {
|
|
@@ -314,6 +519,17 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
314
519
|
if (field.MinLenght) {
|
|
315
520
|
validators.push(Validators.minLength(field.MinLenght));
|
|
316
521
|
}
|
|
522
|
+
switch (field.TextMask) {
|
|
523
|
+
case TextMaskEnum.Url:
|
|
524
|
+
validators.push(Validators.pattern(UrlRegex));
|
|
525
|
+
break;
|
|
526
|
+
case TextMaskEnum.Email:
|
|
527
|
+
validators.push(Validators.email);
|
|
528
|
+
break;
|
|
529
|
+
case TextMaskEnum.Telefono:
|
|
530
|
+
validators.push(Validators.pattern(TelRegex));
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
317
533
|
break;
|
|
318
534
|
case FieldTypeEnum["Area di testo"]:
|
|
319
535
|
if (field.MaxLenght) {
|
|
@@ -336,12 +552,147 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
336
552
|
}
|
|
337
553
|
return new FormControl(record[field.Name], validators);
|
|
338
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
557
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
558
|
+
* @param baseServerUrl Stringa dell'url base del server (es: "http://localhost:5000").
|
|
559
|
+
* @param userToken Token dell'utente loggato da usare per autenticarsi se necessario.
|
|
560
|
+
* @returns Resituisce la configurazione completa degli endPoint da usare di default.
|
|
561
|
+
*/
|
|
562
|
+
ConfigureDefaultEndPoints(baseServerUrl, userToken) {
|
|
563
|
+
let endPointConfiguration = new EndPointConfiguration();
|
|
564
|
+
endPointConfiguration = new EndPointConfiguration();
|
|
565
|
+
endPointConfiguration.Records = {
|
|
566
|
+
GetByFormIDEndPoint: {
|
|
567
|
+
Url: baseServerUrl + "/api/v1/getall",
|
|
568
|
+
Token: userToken,
|
|
569
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
570
|
+
},
|
|
571
|
+
GetByIDEndPoint: {
|
|
572
|
+
Url: baseServerUrl + "/api/v1/getByID",
|
|
573
|
+
Token: userToken,
|
|
574
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
575
|
+
},
|
|
576
|
+
SaveEndPoint: {
|
|
577
|
+
Url: baseServerUrl + "/api/v1/save",
|
|
578
|
+
Token: userToken,
|
|
579
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
580
|
+
},
|
|
581
|
+
DuplicateEndPoint: {
|
|
582
|
+
Url: baseServerUrl + "/api/v1/duplicate",
|
|
583
|
+
Token: userToken,
|
|
584
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
585
|
+
},
|
|
586
|
+
DeleteEndPoint: {
|
|
587
|
+
Url: baseServerUrl + "/api/v1/delete",
|
|
588
|
+
Token: userToken,
|
|
589
|
+
RequestMethod: RequestMethodEnum.DELETE,
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
endPointConfiguration.Forms = {
|
|
593
|
+
GetByIDEndPoint: {
|
|
594
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
595
|
+
Token: userToken,
|
|
596
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
597
|
+
},
|
|
598
|
+
SaveEndPoint: {
|
|
599
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
600
|
+
Token: userToken,
|
|
601
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
return endPointConfiguration;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Metodo che data la configurazione di un endpoint costruisce l'url da chiamare, gli eventuali parametri
|
|
608
|
+
* da passare (nel body o nella rotta) ed effettua la chiamata. Al termine della chiamata esegue le eventuali
|
|
609
|
+
* funzioni di callback (sia in caso di successo che in caso di errore) passate in input.
|
|
610
|
+
* @param endPointData Cofigurazione dell'endpoint da chiamare.
|
|
611
|
+
* @param dynamicModuleParams Array dei parametri aggiunti dal modulo dinamico a quelli già configurati
|
|
612
|
+
* (ad esempio il record o la form da salvare oppure l'ID per recuperare una particolare entità).
|
|
613
|
+
* @param callback Metodo da eseguire in caso di successo dopo la chiamata http.
|
|
614
|
+
* NOTA: in input viene passata la risposta della chiamata stessa.
|
|
615
|
+
* @param errorCallBack Metodo da eseguire in caso di errore dopo la chiamata http.
|
|
616
|
+
* NOTA: in input viene passato l'errore generato della chiamata stessa.
|
|
617
|
+
*/
|
|
618
|
+
RunEndPointCall(endPointData, dynamicModuleParams = null, callback = null, errorCallBack = null) {
|
|
619
|
+
this.spinnerService.addRequestCounter();
|
|
620
|
+
let url = `${endPointData.Url}`;
|
|
621
|
+
let queryParams = null;
|
|
622
|
+
const bodyParams = {
|
|
623
|
+
AdditionalParams: {}
|
|
624
|
+
};
|
|
625
|
+
// Se nella configurazione sono stati definiti parametri da aggiungere alla chiamata questi vengono ciclati
|
|
626
|
+
// e aggiunti nel punto in cui devono essere usati.
|
|
627
|
+
if (endPointData.Params) {
|
|
628
|
+
endPointData.Params.forEach(p => {
|
|
629
|
+
switch (p.ParamType) {
|
|
630
|
+
case ParamTypeEnum['Query param']: {
|
|
631
|
+
const stringParam = p.ParamName + "=" + p.ParamValue;
|
|
632
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
case ParamTypeEnum['In route']: {
|
|
636
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
case ParamTypeEnum['In Body']: {
|
|
640
|
+
bodyParams.AdditionalParams[p.ParamName] = p.ParamValue;
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
// Se sono stati passati parametri da aggiungere alla chiamata definiti all'interno del modulo dinamico
|
|
647
|
+
// vengono ciclati e aggiunti nel punto in cui devono essere usati dopo quelli definiti nella configurazione.
|
|
648
|
+
if (dynamicModuleParams) {
|
|
649
|
+
dynamicModuleParams.forEach(p => {
|
|
650
|
+
switch (p.ParamType) {
|
|
651
|
+
case ParamTypeEnum['Query param']: {
|
|
652
|
+
const stringParam = p.ParamName + "=" + p.ParamValue;
|
|
653
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
case ParamTypeEnum['In route']: {
|
|
657
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
case ParamTypeEnum['In Body']: {
|
|
661
|
+
bodyParams[p.ParamName] = p.ParamValue;
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
if (queryParams != null) {
|
|
668
|
+
url = (url.endsWith("/") ? url.substring(0, url.length - 1) : url) + "?" + queryParams;
|
|
669
|
+
}
|
|
670
|
+
this.http.request(endPointData.RequestMethod, url, {
|
|
671
|
+
headers: endPointData.Token ? { Authorization: endPointData.Token } : null,
|
|
672
|
+
body: ![RequestMethodEnum.DELETE, RequestMethodEnum.GET].includes(endPointData.RequestMethod) ? bodyParams : null
|
|
673
|
+
})
|
|
674
|
+
.subscribe((res) => {
|
|
675
|
+
this.spinnerService.removeRequestCounter();
|
|
676
|
+
if (callback) {
|
|
677
|
+
callback(res);
|
|
678
|
+
}
|
|
679
|
+
}, (error) => {
|
|
680
|
+
this.spinnerService.removeRequestCounter();
|
|
681
|
+
if (errorCallBack) {
|
|
682
|
+
errorCallBack(error);
|
|
683
|
+
}
|
|
684
|
+
EqpDynamicModuleDialogService.Error(error.message);
|
|
685
|
+
throw new Error(error.message);
|
|
686
|
+
});
|
|
687
|
+
}
|
|
339
688
|
};
|
|
340
689
|
UtilityHelperService.context = new Context();
|
|
341
690
|
UtilityHelperService.ctorParameters = () => [
|
|
342
|
-
{ type: FormBuilder }
|
|
691
|
+
{ type: FormBuilder },
|
|
692
|
+
{ type: HttpClient },
|
|
693
|
+
{ type: SpinnerService }
|
|
343
694
|
];
|
|
344
|
-
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder)); }, token: UtilityHelperService, providedIn: "root" });
|
|
695
|
+
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder), ɵɵinject(HttpClient), ɵɵinject(SpinnerService)); }, token: UtilityHelperService, providedIn: "root" });
|
|
345
696
|
UtilityHelperService = UtilityHelperService_1 = __decorate([
|
|
346
697
|
Injectable({
|
|
347
698
|
providedIn: 'root'
|
|
@@ -349,56 +700,214 @@ UtilityHelperService = UtilityHelperService_1 = __decorate([
|
|
|
349
700
|
], UtilityHelperService);
|
|
350
701
|
|
|
351
702
|
let EqpDynamicModuleComponent = class EqpDynamicModuleComponent {
|
|
352
|
-
constructor() {
|
|
703
|
+
constructor(utilityHelperService) {
|
|
704
|
+
this.utilityHelperService = utilityHelperService;
|
|
353
705
|
this.context = new Context();
|
|
354
|
-
this.form = new Form();
|
|
355
706
|
this.showButtons = true;
|
|
356
707
|
this.showTitle = true;
|
|
357
|
-
|
|
708
|
+
/**
|
|
709
|
+
* Url del server da chiamare per recuperare, salvare o eliminare i record.
|
|
710
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
711
|
+
*/
|
|
712
|
+
this.baseServerUrl = null;
|
|
713
|
+
/**
|
|
714
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
715
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
716
|
+
*/
|
|
717
|
+
this.userToken = null;
|
|
718
|
+
/**
|
|
719
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
720
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
721
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
722
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
723
|
+
*/
|
|
724
|
+
this.endPointConfiguration = null;
|
|
725
|
+
/**
|
|
726
|
+
* Eventi emessi quando si salva, elimina o duplica un record
|
|
727
|
+
* se non è stato specificato un endpoint da chiamare.
|
|
728
|
+
*/
|
|
358
729
|
this.saveRecord = new EventEmitter();
|
|
359
730
|
this.deleteRecord = new EventEmitter();
|
|
360
731
|
this.duplicateRecord = new EventEmitter();
|
|
732
|
+
/**
|
|
733
|
+
* Eventi emessi DOPO aver eseguito una chiamata al server per il salvataggio,
|
|
734
|
+
* l'eliminazione o la duplicazione di un record all'endpoint specificato.
|
|
735
|
+
*/
|
|
736
|
+
this.afterSaveRecord = new EventEmitter();
|
|
737
|
+
this.afterDeleteRecord = new EventEmitter();
|
|
738
|
+
this.afterDuplicateRecord = new EventEmitter();
|
|
739
|
+
this.form = new Form();
|
|
740
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
361
741
|
this.FormTypeEnum = FormTypeEnum;
|
|
362
742
|
}
|
|
363
743
|
ngOnInit() {
|
|
364
744
|
UtilityHelperService.SetContext(this.context);
|
|
745
|
+
this.configureDefaultEndPoints();
|
|
746
|
+
this.getFormByID();
|
|
747
|
+
}
|
|
748
|
+
getFormByID() {
|
|
749
|
+
const dynamicModuleParams = new Array();
|
|
750
|
+
dynamicModuleParams.push({
|
|
751
|
+
ParamName: "id",
|
|
752
|
+
ParamValue: this.formID,
|
|
753
|
+
ParamType: ParamTypeEnum['Query param']
|
|
754
|
+
});
|
|
755
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, dynamicModuleParams, (res) => {
|
|
756
|
+
this.form = res;
|
|
757
|
+
this.getRecordsByFormID();
|
|
758
|
+
}, (err) => {
|
|
759
|
+
console.log(err);
|
|
760
|
+
});
|
|
365
761
|
}
|
|
762
|
+
/**
|
|
763
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
764
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
765
|
+
* Se la proprietà "baseServerUrl" è null e non sono stati configurati i vari endpoint allora
|
|
766
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
767
|
+
*/
|
|
768
|
+
configureDefaultEndPoints() {
|
|
769
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
770
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
775
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
776
|
+
* La risposta della chiamata deve essere un array di oggetti di tipo "DynRecord"
|
|
777
|
+
* a partire dai quali vengono ricreati i Record usati nel client.
|
|
778
|
+
*/
|
|
779
|
+
getRecordsByFormID() {
|
|
780
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByFormIDEndPoint) {
|
|
781
|
+
var dynamicModuleParams = [
|
|
782
|
+
{ ParamName: 'EntID', ParamValue: this.form.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
783
|
+
];
|
|
784
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint, dynamicModuleParams, (res) => {
|
|
785
|
+
this.values = new Array();
|
|
786
|
+
res.forEach(r => {
|
|
787
|
+
var tmpRec = new Record();
|
|
788
|
+
tmpRec = JSON.parse(r.SerializedValues);
|
|
789
|
+
tmpRec.ID = r.ID;
|
|
790
|
+
tmpRec.EntID = r.EntID;
|
|
791
|
+
this.values.push(tmpRec);
|
|
792
|
+
});
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Metodo invocato quando si vuole aggiungere, visualizzare o modificare un record.
|
|
798
|
+
* Se l'evento è null vuol dire che stiamo aggiungendo un nuovo record altrimenti siamo in modifica
|
|
799
|
+
* o visualizzazione. In questi ultimi due casi, se è stato configurato un endpoint per il recupero
|
|
800
|
+
* del record completo allora viene effettuata una chiamata al server, altrimenti viene usato l'oggetto selezionato.
|
|
801
|
+
* @param event Oggetto con due proprietà:
|
|
802
|
+
* "record" = oggetto da modificare/visualizzare,
|
|
803
|
+
* "onlyView" = booleano (se TRUE siamo in visualizzazione altrimenti in modifica)
|
|
804
|
+
*/
|
|
366
805
|
onAddViewEditRecord(event) {
|
|
367
806
|
if (event != null) {
|
|
368
|
-
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
369
807
|
this.onlyView = event.onlyView;
|
|
808
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByIDEndPoint) {
|
|
809
|
+
var dynamicModuleParams = [
|
|
810
|
+
{ ParamName: "id", ParamValue: event.record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
811
|
+
];
|
|
812
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint, dynamicModuleParams, (res) => {
|
|
813
|
+
this.selectedRecord = JSON.parse(res.SerializedValues);
|
|
814
|
+
this.selectedRecord.ID = res.ID;
|
|
815
|
+
this.selectedRecord.EntID = res.EntID;
|
|
816
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
821
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
822
|
+
}
|
|
370
823
|
}
|
|
371
824
|
else {
|
|
372
825
|
this.selectedRecord = null;
|
|
373
826
|
this.onlyView = false;
|
|
827
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Metodo per salvare il record aggiunto o modificato.
|
|
832
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
833
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveRecord".
|
|
834
|
+
* @param event Oggetto di tipo Record da salvare.
|
|
835
|
+
*/
|
|
836
|
+
onSaveRecord(event) {
|
|
837
|
+
var _a;
|
|
838
|
+
if (event != null && this.endPointConfiguration != null && this.endPointConfiguration.Records.SaveEndPoint) {
|
|
839
|
+
var dynRec = new DynRecord();
|
|
840
|
+
dynRec.ID = (_a = event.ID, (_a !== null && _a !== void 0 ? _a : null));
|
|
841
|
+
dynRec.EntID = this.form.ID;
|
|
842
|
+
dynRec.Values = (event !== null && event !== void 0 ? event : null);
|
|
843
|
+
var dynamicModuleParams = [
|
|
844
|
+
{ ParamName: "Record", ParamValue: dynRec, ParamType: ParamTypeEnum['In Body'] }
|
|
845
|
+
];
|
|
846
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint, dynamicModuleParams, (res) => {
|
|
847
|
+
this.getRecordsByFormID();
|
|
848
|
+
this.afterSaveRecord.emit(event);
|
|
849
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
this.saveRecord.emit(event);
|
|
854
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
374
855
|
}
|
|
375
|
-
this.viewMode = FormTypeEnum.SCALAR;
|
|
376
|
-
}
|
|
377
|
-
onSaveForm(event) {
|
|
378
|
-
//TODO: Salvare il record!
|
|
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);
|
|
387
|
-
this.viewMode = FormTypeEnum.LIST;
|
|
388
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Metodo per duplicare un record precedentemente salvato.
|
|
859
|
+
* Se è stato configurato un endPoint per la duplicazione lato server allora effettua una chiamata passando nel body
|
|
860
|
+
* un oggetto contenente il record da duplicare, altrimenti scatena l'evento di output "duplicateRecord".
|
|
861
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
862
|
+
*/
|
|
389
863
|
onDuplicateRecord(record) {
|
|
390
|
-
this.
|
|
864
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DuplicateEndPoint) {
|
|
865
|
+
EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
|
|
866
|
+
var dynamicModuleParams = [
|
|
867
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
868
|
+
];
|
|
869
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.DuplicateEndPoint, dynamicModuleParams, (res) => {
|
|
870
|
+
this.getRecordsByFormID();
|
|
871
|
+
this.afterDuplicateRecord.emit(record);
|
|
872
|
+
});
|
|
873
|
+
}, false, 'Richiesta conferma');
|
|
874
|
+
}
|
|
875
|
+
else {
|
|
876
|
+
this.duplicateRecord.emit(record);
|
|
877
|
+
}
|
|
391
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* Metodo per eliminare un record.
|
|
881
|
+
* Se è stato configurato un endPoint per l'eliminazione allora effettua una chiamata passando l'ID del record da eliminare
|
|
882
|
+
* come query param all'interno della rotta, altrimenti scatena l'evento di output "deleteRecord".
|
|
883
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
884
|
+
*/
|
|
392
885
|
onDeleteRecord(record) {
|
|
393
|
-
this.
|
|
886
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DeleteEndPoint) {
|
|
887
|
+
EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
|
|
888
|
+
var dynamicModuleParams = [
|
|
889
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
890
|
+
];
|
|
891
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.DeleteEndPoint, dynamicModuleParams, (res) => {
|
|
892
|
+
this.getRecordsByFormID();
|
|
893
|
+
this.afterDeleteRecord.emit(record);
|
|
894
|
+
});
|
|
895
|
+
}, false, 'Richiesta conferma');
|
|
896
|
+
}
|
|
897
|
+
else {
|
|
898
|
+
this.deleteRecord.emit(record);
|
|
899
|
+
}
|
|
394
900
|
}
|
|
395
901
|
};
|
|
902
|
+
EqpDynamicModuleComponent.ctorParameters = () => [
|
|
903
|
+
{ type: UtilityHelperService }
|
|
904
|
+
];
|
|
396
905
|
__decorate([
|
|
397
906
|
Input()
|
|
398
907
|
], EqpDynamicModuleComponent.prototype, "context", void 0);
|
|
399
908
|
__decorate([
|
|
400
909
|
Input()
|
|
401
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
910
|
+
], EqpDynamicModuleComponent.prototype, "formID", void 0);
|
|
402
911
|
__decorate([
|
|
403
912
|
Input()
|
|
404
913
|
], EqpDynamicModuleComponent.prototype, "values", void 0);
|
|
@@ -410,7 +919,13 @@ __decorate([
|
|
|
410
919
|
], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
|
|
411
920
|
__decorate([
|
|
412
921
|
Input()
|
|
413
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
922
|
+
], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
|
|
923
|
+
__decorate([
|
|
924
|
+
Input()
|
|
925
|
+
], EqpDynamicModuleComponent.prototype, "userToken", void 0);
|
|
926
|
+
__decorate([
|
|
927
|
+
Input()
|
|
928
|
+
], EqpDynamicModuleComponent.prototype, "endPointConfiguration", void 0);
|
|
414
929
|
__decorate([
|
|
415
930
|
Output()
|
|
416
931
|
], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
|
|
@@ -420,10 +935,19 @@ __decorate([
|
|
|
420
935
|
__decorate([
|
|
421
936
|
Output()
|
|
422
937
|
], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
|
|
938
|
+
__decorate([
|
|
939
|
+
Output()
|
|
940
|
+
], EqpDynamicModuleComponent.prototype, "afterSaveRecord", void 0);
|
|
941
|
+
__decorate([
|
|
942
|
+
Output()
|
|
943
|
+
], EqpDynamicModuleComponent.prototype, "afterDeleteRecord", void 0);
|
|
944
|
+
__decorate([
|
|
945
|
+
Output()
|
|
946
|
+
], EqpDynamicModuleComponent.prototype, "afterDuplicateRecord", void 0);
|
|
423
947
|
EqpDynamicModuleComponent = __decorate([
|
|
424
948
|
Component({
|
|
425
949
|
selector: 'eqp-dynamic-module',
|
|
426
|
-
template: "<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"
|
|
950
|
+
template: "<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"onSaveRecord($event)\" [showTitle]=\"showTitle\">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf=\"viewMode == FormTypeEnum.LIST && values\" [form]=\"form\" [values]=\"values\"\r\n (onAddViewEditRecord)=\"onAddViewEditRecord($event)\" [showTitle]=\"showTitle\"\r\n (onDeleteRecord)=\"onDeleteRecord($event)\" (onDuplicateRecord)=\"onDuplicateRecord($event)\">\r\n</list-form-record>",
|
|
427
951
|
styles: ["::ng-deep mat-form-field{width:100%}"]
|
|
428
952
|
})
|
|
429
953
|
], EqpDynamicModuleComponent);
|
|
@@ -501,125 +1025,82 @@ MaterialModule = __decorate([
|
|
|
501
1025
|
})
|
|
502
1026
|
], MaterialModule);
|
|
503
1027
|
|
|
504
|
-
let EqpDynamicModuleDialogService = class EqpDynamicModuleDialogService {
|
|
505
|
-
constructor() {
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
509
|
-
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
510
|
-
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
511
|
-
*/
|
|
512
|
-
static Error(message, title = null) {
|
|
513
|
-
let currentTitle = title != null ? title : 'Errore';
|
|
514
|
-
if (Array.isArray(message)) {
|
|
515
|
-
currentTitle = title != null ? title : 'Errore';
|
|
516
|
-
let htmlErrors = message.join("<br>");
|
|
517
|
-
Swal.fire({
|
|
518
|
-
title: currentTitle,
|
|
519
|
-
html: htmlErrors,
|
|
520
|
-
icon: 'error'
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
else {
|
|
524
|
-
Swal.fire(currentTitle, message, 'error');
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
529
|
-
* CONFERMA lancia la funzione di callback passata come parametro
|
|
530
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
531
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
532
|
-
*/
|
|
533
|
-
static Confirm(message, confirmCallback, isWarning = false, title = null, customWidth = null) {
|
|
534
|
-
let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
535
|
-
if (Array.isArray(message)) {
|
|
536
|
-
let htmlErrors = message.join("<br>");
|
|
537
|
-
Swal.fire({
|
|
538
|
-
title: currentTitle,
|
|
539
|
-
html: htmlErrors,
|
|
540
|
-
width: customWidth ? customWidth : '32rem',
|
|
541
|
-
icon: !isWarning ? 'question' : 'warning',
|
|
542
|
-
showCancelButton: true,
|
|
543
|
-
allowOutsideClick: false,
|
|
544
|
-
allowEscapeKey: false
|
|
545
|
-
}).then((result) => {
|
|
546
|
-
if (result.value && confirmCallback) {
|
|
547
|
-
confirmCallback();
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
else {
|
|
552
|
-
Swal.fire({
|
|
553
|
-
title: currentTitle,
|
|
554
|
-
text: message,
|
|
555
|
-
width: customWidth ? customWidth : '32rem',
|
|
556
|
-
icon: !isWarning ? 'question' : 'warning',
|
|
557
|
-
showCancelButton: true,
|
|
558
|
-
allowOutsideClick: false,
|
|
559
|
-
allowEscapeKey: false
|
|
560
|
-
}).then((result) => {
|
|
561
|
-
if (result.value && confirmCallback) {
|
|
562
|
-
confirmCallback();
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
569
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
570
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
571
|
-
*/
|
|
572
|
-
static Info(message, title = null, isToast = null) {
|
|
573
|
-
let currentTitle = title != null ? title : "Informazione:";
|
|
574
|
-
Swal.fire(currentTitle, message, 'info');
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
578
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
579
|
-
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
580
|
-
*/
|
|
581
|
-
static Warning(message, title = null, isToast = null) {
|
|
582
|
-
let currentTitle = title != null ? title : "Attenzione!";
|
|
583
|
-
if (Array.isArray(message)) {
|
|
584
|
-
let htmlWarnings = message.join("<br>");
|
|
585
|
-
Swal.fire({
|
|
586
|
-
title: currentTitle,
|
|
587
|
-
html: htmlWarnings,
|
|
588
|
-
icon: 'warning'
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
Swal.fire(currentTitle, message, 'warning');
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
|
|
597
|
-
EqpDynamicModuleDialogService = __decorate([
|
|
598
|
-
Injectable({
|
|
599
|
-
providedIn: 'root'
|
|
600
|
-
})
|
|
601
|
-
], EqpDynamicModuleDialogService);
|
|
602
|
-
|
|
603
1028
|
let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorComponent {
|
|
604
|
-
constructor(formBuilder, dialog) {
|
|
1029
|
+
constructor(formBuilder, dialog, utilityHelperService) {
|
|
605
1030
|
this.formBuilder = formBuilder;
|
|
606
1031
|
this.dialog = dialog;
|
|
1032
|
+
this.utilityHelperService = utilityHelperService;
|
|
607
1033
|
this.context = new Context();
|
|
608
1034
|
this.form = new Form();
|
|
1035
|
+
this.formID = null;
|
|
609
1036
|
this.innerFormManagment = false;
|
|
1037
|
+
/**
|
|
1038
|
+
* Url del server da chiamare per recuerare, salvare o eliminare i record.
|
|
1039
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
1040
|
+
*/
|
|
1041
|
+
this.baseServerUrl = null;
|
|
1042
|
+
/**
|
|
1043
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
1044
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
1045
|
+
*/
|
|
1046
|
+
this.userToken = null;
|
|
1047
|
+
/**
|
|
1048
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
1049
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
1050
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
1051
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
1052
|
+
*/
|
|
1053
|
+
this.endPointConfiguration = null;
|
|
610
1054
|
this.formCompleted = false;
|
|
611
1055
|
//#region Enumeratori usati nell'html
|
|
612
1056
|
this.FormTypeEnum = FormTypeEnum;
|
|
613
1057
|
this.FormScalarTypeEnum = FormScalarTypeEnum;
|
|
614
1058
|
//#endregion
|
|
1059
|
+
/**
|
|
1060
|
+
* Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare.
|
|
1061
|
+
*/
|
|
615
1062
|
this.saveFormEvent = new EventEmitter();
|
|
1063
|
+
/**
|
|
1064
|
+
* Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato.
|
|
1065
|
+
*/
|
|
1066
|
+
this.afterSaveFormEvent = new EventEmitter();
|
|
616
1067
|
}
|
|
617
1068
|
ngOnInit() {
|
|
1069
|
+
this.configureDefaultEndPoints();
|
|
1070
|
+
this.getFormByID();
|
|
618
1071
|
if (this.context) {
|
|
619
1072
|
UtilityHelperService.SetContext(this.context);
|
|
620
1073
|
}
|
|
621
|
-
|
|
622
|
-
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
1077
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
1078
|
+
* Se la proprietà baseServerUrl è null e non sono stati configurati i vari endpoint allora
|
|
1079
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
1080
|
+
*/
|
|
1081
|
+
configureDefaultEndPoints() {
|
|
1082
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
1083
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
1084
|
+
if (this.formID) {
|
|
1085
|
+
this.endPointConfiguration.Forms.GetByIDEndPoint.Params = [{ ParamName: 'id', ParamValue: this.formID, ParamType: ParamTypeEnum['Query param'] }];
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
1091
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
1092
|
+
*/
|
|
1093
|
+
getFormByID() {
|
|
1094
|
+
if (this.formID && this.endPointConfiguration && this.endPointConfiguration.Forms && this.endPointConfiguration.Forms.GetByIDEndPoint) {
|
|
1095
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, null, (res) => {
|
|
1096
|
+
this.setFormAndConfigure(res);
|
|
1097
|
+
}, (err) => {
|
|
1098
|
+
this.setFormAndConfigure(new Form());
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
this.setFormAndConfigure();
|
|
1103
|
+
}
|
|
623
1104
|
}
|
|
624
1105
|
/**
|
|
625
1106
|
* Metodo invocato al cambio del tipo di visualizzazione della form.
|
|
@@ -777,7 +1258,7 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
777
1258
|
EqpDynamicModuleDialogService.Warning('Impossibile inserire due form di dettaglio con lo stesso nome.');
|
|
778
1259
|
throw new Error('Impossibile inserire due form di dettaglio con lo stesso nome.');
|
|
779
1260
|
}
|
|
780
|
-
|
|
1261
|
+
const innerFormField = new BaseField();
|
|
781
1262
|
innerFormField.Name = event.Name.split(" ").join("_");
|
|
782
1263
|
innerFormField.Label = event.Name;
|
|
783
1264
|
innerFormField.FieldType = FieldTypeEnum['Form di dettaglio'];
|
|
@@ -888,10 +1369,52 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
888
1369
|
}
|
|
889
1370
|
}
|
|
890
1371
|
/**
|
|
891
|
-
* Metodo
|
|
1372
|
+
* Metodo per salvare la form creata alla fine del wizard.
|
|
1373
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
1374
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
|
|
1375
|
+
* NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
|
|
1376
|
+
* Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
892
1377
|
*/
|
|
893
1378
|
saveForm() {
|
|
894
|
-
this.
|
|
1379
|
+
if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
|
|
1380
|
+
// Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
1381
|
+
// Necessario per far funzionare correttamente il FieldConverter del server.
|
|
1382
|
+
const formToSave = JSON.parse(JSON.stringify(this.form));
|
|
1383
|
+
/*formToSave.Fields = [];
|
|
1384
|
+
this.form.Fields.forEach(field => {
|
|
1385
|
+
formToSave.Fields.push({
|
|
1386
|
+
FieldType: field.FieldType,
|
|
1387
|
+
Value: JSON.parse(JSON.stringify(field))
|
|
1388
|
+
});
|
|
1389
|
+
});*/
|
|
1390
|
+
formToSave.Fields = [];
|
|
1391
|
+
this.form.Fields.forEach(field => {
|
|
1392
|
+
let fld = UtilityHelperService.GetFieldType(field);
|
|
1393
|
+
formToSave.Fields.push(fld);
|
|
1394
|
+
});
|
|
1395
|
+
const dynamicModuleParams = [
|
|
1396
|
+
{ ParamName: "Form", ParamValue: formToSave, ParamType: ParamTypeEnum['In Body'] }
|
|
1397
|
+
];
|
|
1398
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, (res) => {
|
|
1399
|
+
EqpDynamicModuleDialogService.Success("Form salvata con successo!");
|
|
1400
|
+
this.afterSaveFormEvent.emit(this.form);
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
else {
|
|
1404
|
+
this.saveFormEvent.emit(this.form);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
//#region FUNZIONI PRIVATE
|
|
1408
|
+
/**
|
|
1409
|
+
* Metodo per impostare la form e configurare colonne/FormGourp.
|
|
1410
|
+
* @param form Form da utilizzare.
|
|
1411
|
+
*/
|
|
1412
|
+
setFormAndConfigure(form = null) {
|
|
1413
|
+
if (form != null) {
|
|
1414
|
+
this.form = form;
|
|
1415
|
+
}
|
|
1416
|
+
this.configureColumns();
|
|
1417
|
+
this.createFormForm();
|
|
895
1418
|
}
|
|
896
1419
|
/**
|
|
897
1420
|
* Configura le colonne per le tabelle necessarie alla creazione della form:
|
|
@@ -1082,7 +1605,8 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
1082
1605
|
};
|
|
1083
1606
|
EqpDynamicModuleConfiguratorComponent.ctorParameters = () => [
|
|
1084
1607
|
{ type: FormBuilder },
|
|
1085
|
-
{ type: MatDialog }
|
|
1608
|
+
{ type: MatDialog },
|
|
1609
|
+
{ type: UtilityHelperService }
|
|
1086
1610
|
];
|
|
1087
1611
|
__decorate([
|
|
1088
1612
|
Input()
|
|
@@ -1090,9 +1614,21 @@ __decorate([
|
|
|
1090
1614
|
__decorate([
|
|
1091
1615
|
Input()
|
|
1092
1616
|
], EqpDynamicModuleConfiguratorComponent.prototype, "form", void 0);
|
|
1617
|
+
__decorate([
|
|
1618
|
+
Input()
|
|
1619
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "formID", void 0);
|
|
1093
1620
|
__decorate([
|
|
1094
1621
|
Input()
|
|
1095
1622
|
], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
|
|
1623
|
+
__decorate([
|
|
1624
|
+
Input()
|
|
1625
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);
|
|
1626
|
+
__decorate([
|
|
1627
|
+
Input()
|
|
1628
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "userToken", void 0);
|
|
1629
|
+
__decorate([
|
|
1630
|
+
Input()
|
|
1631
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "endPointConfiguration", void 0);
|
|
1096
1632
|
__decorate([
|
|
1097
1633
|
ViewChild('fieldsTable', { static: false })
|
|
1098
1634
|
], EqpDynamicModuleConfiguratorComponent.prototype, "fieldsTable", void 0);
|
|
@@ -1114,10 +1650,13 @@ __decorate([
|
|
|
1114
1650
|
__decorate([
|
|
1115
1651
|
Output()
|
|
1116
1652
|
], EqpDynamicModuleConfiguratorComponent.prototype, "saveFormEvent", void 0);
|
|
1653
|
+
__decorate([
|
|
1654
|
+
Output()
|
|
1655
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "afterSaveFormEvent", void 0);
|
|
1117
1656
|
EqpDynamicModuleConfiguratorComponent = __decorate([
|
|
1118
1657
|
Component({
|
|
1119
1658
|
selector: 'eqp-dynamic-module-configurator',
|
|
1120
|
-
template: "<mat-horizontal-stepper linear #stepper>\r\n <!-- DATI GENERALI DELLA FORM -->\r\n <mat-step [stepControl]=\"formFormGroup\">\r\n <form [formGroup]=\"formFormGroup\" (keydown.enter)=\"false\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName=\"Name\" [(ngModel)]=\"form.Name\" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-md-4\">\r\n <eqp-select [enumData]=\"FormScalarTypeEnum\" [(ngModelInput)]=\"form.FormScalarType\"\r\n [isRequired]=\"true\" [showCancelButton]=\"false\" placeholder=\"Tipo di visualizzazione\"\r\n [formGroupInput]=\"formFormGroup\" [formControlNameInput]=\"'FormScalarType'\"\r\n (ngModelInputChange)=\"onChangeFormScalarType()\">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice\">\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]=\"formFieldGroupName\" [ngModelOptions]=\"{standalone: true}\"\r\n (keyup)=\"onFormFieldGroupNameKeyUp($event)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Sezioni inserite:</span>\r\n <ul class=\"section-list\">\r\n <li *ngFor=\"let groupName of form.FormFieldsGroups, let i=index\">\r\n <mat-icon class=\"mr-1\" (click)=\"onDeleteFormFieldGroupName(groupName.Name)\">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button mat-raised-button color=\"primary\" matStepperNext\r\n [disabled]=\"formFormGroup.invalid\">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DEI CAMPI DELLA FORM -->\r\n <mat-step [completed]=\"isFieldStepCompleted()\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"openFieldDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class=\"btn btn-primary ml-2\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openInnerFormDialog()\" *ngIf=\"!innerFormManagment\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]=\"false\" [columns]=\"fieldsColumns\" [data]=\"form.Fields\"\r\n [emptyTableMessage]=\"'Nessun campo inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext [disabled]=\"!isFieldStepCompleted()\"\r\n (click)=\"setFormStatus(false)\">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openActionOnRecordDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]=\"false\" [columns]=\"actionsOnRecordColumns\"\r\n [data]=\"form.ActionsOnRecord\" [emptyTableMessage]=\"'Nessuna action inserita'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext (click)=\"setFormStatus(true)\">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- VISUALIZZAZIONE FORM CREATA -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\"\r\n (click)=\"setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)\"></div>\r\n Riepilogo\r\n </ng-template>\r\n\r\n <eqp-dynamic-module [form]=\"previewForm\" *ngIf=\"previewForm && formCompleted\" [showButtons]=\"false\"\r\n [viewMode]=\"FormTypeEnum.SCALAR\"></eqp-dynamic-module>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious (click)=\"setFormStatus(false)\">Precedente</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveForm()\">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class=\"row\" *ngIf=\"innerFormManagment\">\r\n <div class=\"col-md-12 text-right\">\r\n <button mat-raised-button (click)=\"saveFormEvent.emit(null)\">Esci</button>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG AGGIUNTA/MODIFICA CAMPO -->\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedField\" [indexField]=\"indexSelectedField\"\r\n (saveFieldEvent)=\"onSaveField($event)\" [availableFields]=\"form.Fields\"\r\n [formFieldsGroups]=\"form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #fieldSectionColumnTemplate let-row=\"row\">\r\n <eqp-select [arrayData]=\"form.FormFieldsGroups\" [(ngModelInput)]=\"row.FieldGroup\" [arrayKeyProperty]=\"'Name'\"\r\n [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\" [isRequired]=\"true\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM -->\r\n<ng-template #dialogActionOnRecord>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"actionOnRecordFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n \"Modifica\"\r\n : \"Aggiungi\"}} azione sul record</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName=\"Name\" required matInput [(ngModel)]=\"selectedAction.Name\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName=\"Icon\" required matInput [(ngModel)]=\"selectedAction.Icon\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12 mt-2\">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"'Azione (Javascript)'\" [rows]=\"3\" formControlName=\"Action\"\r\n required [(ngModel)]=\"selectedAction.Action\" [matAutocomplete]=\"actionAutocomplete\"\r\n (keyup)=\"setActionAutocompleteOptions($event)\"\r\n (focus)=\"setActionAutocompleteOptions(null)\"></textarea>\r\n <mat-autocomplete #actionAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of actionAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveActionOnRecord()\"\r\n [disabled]=\"actionOnRecordFormGroup.invalid\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"closeDialogActionOnRecord()\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]=\"selectedInnerForm\" [innerFormManagment]=\"true\"\r\n (saveFormEvent)=\"onSaveOrExitInnerForm($event)\"></eqp-dynamic-module-configurator>\r\n</ng-template>",
|
|
1659
|
+
template: "<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<mat-horizontal-stepper linear #stepper>\r\n <!-- DATI GENERALI DELLA FORM -->\r\n <mat-step [stepControl]=\"formFormGroup\">\r\n <form [formGroup]=\"formFormGroup\" (keydown.enter)=\"false\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName=\"Name\" [(ngModel)]=\"form.Name\" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-md-4\">\r\n <eqp-select [enumData]=\"FormScalarTypeEnum\" [(ngModelInput)]=\"form.FormScalarType\"\r\n [isRequired]=\"true\" [showCancelButton]=\"false\" placeholder=\"Tipo di visualizzazione\"\r\n [formGroupInput]=\"formFormGroup\" [formControlNameInput]=\"'FormScalarType'\"\r\n (ngModelInputChange)=\"onChangeFormScalarType()\">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice\">\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]=\"formFieldGroupName\" [ngModelOptions]=\"{standalone: true}\"\r\n (keyup)=\"onFormFieldGroupNameKeyUp($event)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Sezioni inserite:</span>\r\n <ul class=\"section-list\">\r\n <li *ngFor=\"let groupName of form.FormFieldsGroups, let i=index\">\r\n <mat-icon class=\"mr-1\" (click)=\"onDeleteFormFieldGroupName(groupName.Name)\">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button mat-raised-button color=\"primary\" matStepperNext\r\n [disabled]=\"formFormGroup.invalid\">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DEI CAMPI DELLA FORM -->\r\n <mat-step [completed]=\"isFieldStepCompleted()\">\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"openFieldDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class=\"btn btn-primary ml-2\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openInnerFormDialog()\" *ngIf=\"!innerFormManagment\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]=\"false\" [columns]=\"fieldsColumns\" [data]=\"form.Fields\"\r\n [emptyTableMessage]=\"'Nessun campo inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext [disabled]=\"!isFieldStepCompleted()\"\r\n (click)=\"setFormStatus(false)\">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\" (click)=\"setFormStatus(false)\"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openActionOnRecordDialog()\">\r\n <mat-icon>add</mat-icon>\r\n <span style=\"margin-left: 10px;\">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]=\"false\" [columns]=\"actionsOnRecordColumns\"\r\n [data]=\"form.ActionsOnRecord\" [emptyTableMessage]=\"'Nessuna action inserita'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color=\"primary\" matStepperNext (click)=\"setFormStatus(true)\">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n <!-- VISUALIZZAZIONE FORM CREATA -->\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class=\"stepper-header-overlay\"\r\n (click)=\"setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)\"></div>\r\n Anteprima\r\n </ng-template>\r\n\r\n <add-form-record *ngIf=\"previewForm && formCompleted\" [form]=\"previewForm\" [showButtons]=\"false\">\r\n </add-form-record>\r\n\r\n\r\n <div class=\"mt-2 d-flex justify-content-end\">\r\n <button class=\"mr-2\" mat-raised-button matStepperPrevious (click)=\"setFormStatus(false)\">Precedente</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveForm()\">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class=\"row\" *ngIf=\"innerFormManagment\">\r\n <div class=\"col-md-12 text-right\">\r\n <button mat-raised-button (click)=\"saveFormEvent.emit(null)\">Esci</button>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG AGGIUNTA/MODIFICA CAMPO -->\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedField\" [indexField]=\"indexSelectedField\"\r\n (saveFieldEvent)=\"onSaveField($event)\" [availableFields]=\"form.Fields\"\r\n [formFieldsGroups]=\"form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #fieldSectionColumnTemplate let-row=\"row\">\r\n <eqp-select [arrayData]=\"form.FormFieldsGroups\" [(ngModelInput)]=\"row.FieldGroup\" [arrayKeyProperty]=\"'Name'\"\r\n [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\" [isRequired]=\"true\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM -->\r\n<ng-template #dialogActionOnRecord>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"actionOnRecordFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n \"Modifica\"\r\n : \"Aggiungi\"}} azione sul record</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName=\"Name\" required matInput [(ngModel)]=\"selectedAction.Name\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName=\"Icon\" required matInput [(ngModel)]=\"selectedAction.Icon\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12 mt-2\">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"'Azione (Javascript)'\" [rows]=\"3\" formControlName=\"Action\"\r\n required [(ngModel)]=\"selectedAction.Action\" [matAutocomplete]=\"actionAutocomplete\"\r\n (keyup)=\"setActionAutocompleteOptions($event)\"\r\n (focus)=\"setActionAutocompleteOptions(null)\"></textarea>\r\n <mat-autocomplete #actionAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of actionAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveActionOnRecord()\"\r\n [disabled]=\"actionOnRecordFormGroup.invalid\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"closeDialogActionOnRecord()\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- TEMPLATE PER CONFIGURARE LE FORM DI DETTAGLIO -->\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]=\"selectedInnerForm\" [innerFormManagment]=\"true\"\r\n (saveFormEvent)=\"onSaveOrExitInnerForm($event)\"></eqp-dynamic-module-configurator>\r\n</ng-template>",
|
|
1121
1660
|
styles: ["::ng-deep mat-form-field{width:100%}.stepper-header-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.section-list{list-style:none;padding:0}.section-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.danger-color{color:var(--danger)}"]
|
|
1122
1661
|
})
|
|
1123
1662
|
], EqpDynamicModuleConfiguratorComponent);
|
|
@@ -1167,6 +1706,8 @@ var DateTimeTypeEnum;
|
|
|
1167
1706
|
/**Lista di valori */
|
|
1168
1707
|
class ListValueField extends BaseField {
|
|
1169
1708
|
}
|
|
1709
|
+
class ButtonImage {
|
|
1710
|
+
}
|
|
1170
1711
|
var ListPresentationEnum;
|
|
1171
1712
|
(function (ListPresentationEnum) {
|
|
1172
1713
|
ListPresentationEnum[ListPresentationEnum["Combo box"] = 1] = "Combo box";
|
|
@@ -1177,10 +1718,11 @@ var ListPresentationEnum;
|
|
|
1177
1718
|
|
|
1178
1719
|
let AddFormFieldComponent = class AddFormFieldComponent {
|
|
1179
1720
|
//#endregion
|
|
1180
|
-
constructor(formBuilder, enumHelper, dialog) {
|
|
1721
|
+
constructor(formBuilder, enumHelper, dialog, cdr) {
|
|
1181
1722
|
this.formBuilder = formBuilder;
|
|
1182
1723
|
this.enumHelper = enumHelper;
|
|
1183
1724
|
this.dialog = dialog;
|
|
1725
|
+
this.cdr = cdr;
|
|
1184
1726
|
this.fieldTypesToExclude = [FieldTypeEnum['Form di dettaglio']];
|
|
1185
1727
|
this.keyValueObject = { key: '', value: '' };
|
|
1186
1728
|
this.availableColSpanSizes = [];
|
|
@@ -1193,6 +1735,8 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1193
1735
|
this.BoolPresentantioEnum = BoolPresentantioEnum;
|
|
1194
1736
|
this.DateTimeTypeEnum = DateTimeTypeEnum;
|
|
1195
1737
|
this.ListPresentationEnum = ListPresentationEnum;
|
|
1738
|
+
this.TextMaskEnum = TextMaskEnum;
|
|
1739
|
+
this.AttachmentType = AttachmentType;
|
|
1196
1740
|
}
|
|
1197
1741
|
ngOnInit() {
|
|
1198
1742
|
if (!this.fieldTypesToExclude.includes(FieldTypeEnum['Form di dettaglio'])) {
|
|
@@ -1230,7 +1774,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1230
1774
|
Required: [this.field.Required],
|
|
1231
1775
|
FieldType: [this.field.FieldType, Validators.required],
|
|
1232
1776
|
Formula: [this.field.Formula],
|
|
1233
|
-
|
|
1777
|
+
ColSpanSizes: [this.field.ColSpanSizes],
|
|
1234
1778
|
InListView: [this.field.InListView],
|
|
1235
1779
|
});
|
|
1236
1780
|
if (this.formFieldsGroups) {
|
|
@@ -1248,7 +1792,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1248
1792
|
if (restoreField)
|
|
1249
1793
|
this.restoreBaseFieldProperties();
|
|
1250
1794
|
this.createFieldForm();
|
|
1251
|
-
this.
|
|
1795
|
+
this.onColSpanSizeSelect();
|
|
1252
1796
|
this.fieldTypeFormTemplate = null;
|
|
1253
1797
|
switch (this.field.FieldType) {
|
|
1254
1798
|
case FieldTypeEnum['Campo di testo']:
|
|
@@ -1272,13 +1816,16 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1272
1816
|
this.fieldFormGroup.addControl('IsOnlyDate', new FormControl(this.field.IsOnlyDate, Validators.required));
|
|
1273
1817
|
this.fieldFormGroup.addControl('MinDate', new FormControl(this.field.MinDate));
|
|
1274
1818
|
this.fieldFormGroup.addControl('MaxDate', new FormControl(this.field.MaxDate));
|
|
1819
|
+
this.fieldFormGroup.addControl('DateFormat', new FormControl(this.field.DateFormat));
|
|
1275
1820
|
this.fieldTypeFormTemplate = this.dateFieldFormTemplate;
|
|
1276
1821
|
break;
|
|
1277
1822
|
case FieldTypeEnum['Campo numerico']:
|
|
1278
1823
|
this.fieldFormGroup.addControl('IsInteger', new FormControl(this.field.IsInteger));
|
|
1279
1824
|
this.fieldFormGroup.addControl('MinValue', new FormControl(this.field.MinValue));
|
|
1280
1825
|
this.fieldFormGroup.addControl('MaxValue', new FormControl(this.field.MaxValue));
|
|
1281
|
-
this.fieldFormGroup.addControl('
|
|
1826
|
+
this.fieldFormGroup.addControl('DecimalSeparator', new FormControl(this.field.DecimalSeparator));
|
|
1827
|
+
this.fieldFormGroup.addControl('DecimalPrecision', new FormControl(this.field.DecimalPrecision));
|
|
1828
|
+
this.fieldFormGroup.addControl('ThousandsSeparator', new FormControl(this.field.ThousandsSeparator));
|
|
1282
1829
|
this.fieldFormGroup.addControl('CurrencySymbol', new FormControl(this.field.CurrencySymbol));
|
|
1283
1830
|
this.fieldTypeFormTemplate = this.numericFieldFormTemplate;
|
|
1284
1831
|
break;
|
|
@@ -1362,15 +1909,48 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1362
1909
|
* seleziona la classe "col-sm-6", al change del valore questo metodo rimuove dalla select
|
|
1363
1910
|
* tutti gli altri valori per la grandezza di schermo selezionata.
|
|
1364
1911
|
*/
|
|
1365
|
-
|
|
1912
|
+
onColSpanSizeSelect() {
|
|
1366
1913
|
// Recupero l'array degli oggetti chiave-valore che rappreseta l'enumeratore
|
|
1367
1914
|
let colSizeClassEnumArray = this.enumHelper.getEnumArray(ColSpanSizesEnum, false, null);
|
|
1368
1915
|
// Costruisco l'array delle classi selezionate dall'utente in formato stringa
|
|
1369
|
-
let selectedDimensions = this.field.
|
|
1916
|
+
let selectedDimensions = this.field.ColSpanSizes ? this.field.ColSpanSizes.map(col => ColSpanSizesEnum[col]) : [];
|
|
1370
1917
|
// Filtro i valori ottenuti dall'enumeratore per escludere tutti i valori per le
|
|
1371
1918
|
// grandezze di schermo già selezionatead esclusione dei valori selezionati.
|
|
1372
1919
|
this.availableColSpanSizes = colSizeClassEnumArray.filter((value) => !selectedDimensions.find(col => value.value.includes(col.substring(4, 6)) && value.value != col));
|
|
1373
1920
|
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Metodo invocato al cambio del tipo di visualizzazione scelta per i campi di tipo elenco generico.
|
|
1923
|
+
* Se viene scelta la visualizzazione ad immagini svuota la lista delle coppie chiave-valore inserite
|
|
1924
|
+
* in precedenza, altrimenti svuota la lista delle immagini caricate.
|
|
1925
|
+
*/
|
|
1926
|
+
onPresentationModeChange() {
|
|
1927
|
+
if (this.field.PresentationMode === ListPresentationEnum.Immagini) {
|
|
1928
|
+
this.field.ValuePairs = null;
|
|
1929
|
+
}
|
|
1930
|
+
else {
|
|
1931
|
+
this.field.ButtonImageList = null;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Metodo invocato quando viene caricato il componente eqp-attachments per caricare le immagini da usare
|
|
1936
|
+
* nella visualizzazione ad immagini dei campi di tipo "Elenco generico". Aggiunge due colonne a quelle
|
|
1937
|
+
* configurate nel componente in cui l'utente può indicare chiave e valore della scelta.
|
|
1938
|
+
* @param component Istanza del componente eqp-attachments in cui effettuare la modifica.
|
|
1939
|
+
*/
|
|
1940
|
+
configureButtonImagesColumns(component) {
|
|
1941
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonKey", display: "Label", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
1942
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonValue", display: "Valore", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
1943
|
+
this.cdr.detectChanges();
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Metodo invocato al salvataggio degli allegati quando viene configurato un campo di tipo "Elenco generico"
|
|
1947
|
+
* con il tipo di visualizzazione ad immagini. Intercetta l'elenco aggiornato delle immagini caricate e lo
|
|
1948
|
+
* memorizza nell'oggetto field corrente.
|
|
1949
|
+
* @param attachments Array aggiornato degli allegati caricati.
|
|
1950
|
+
*/
|
|
1951
|
+
catchButtonImagesChange(attachments) {
|
|
1952
|
+
this.field.ButtonImageList = attachments;
|
|
1953
|
+
}
|
|
1374
1954
|
/**
|
|
1375
1955
|
* Metodo chiamato al keyup degli input testuali che prevedono l'aggiunta del valore inserito in un array.
|
|
1376
1956
|
* Se l'utente preme il tasto invio, in base al tipo di campo che sta inserendo/modificando, questo metodo
|
|
@@ -1515,7 +2095,14 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1515
2095
|
}
|
|
1516
2096
|
switch (this.field.FieldType) {
|
|
1517
2097
|
case FieldTypeEnum['Elenco generico']:
|
|
1518
|
-
|
|
2098
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2099
|
+
return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
|
|
2100
|
+
}
|
|
2101
|
+
else {
|
|
2102
|
+
return (!this.field.ButtonImageList
|
|
2103
|
+
|| this.field.ButtonImageList.length === 0
|
|
2104
|
+
|| !!this.field.ButtonImageList.find(i => !i.ButtonKey || !i.ButtonValue));
|
|
2105
|
+
}
|
|
1519
2106
|
case FieldTypeEnum.Lookup:
|
|
1520
2107
|
return !this.field.FieldNames || this.field.FieldNames.length === 0;
|
|
1521
2108
|
default:
|
|
@@ -1549,7 +2136,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1549
2136
|
this.field.Required = tmpBaseField.Required;
|
|
1550
2137
|
this.field.FieldType = tmpBaseField.FieldType;
|
|
1551
2138
|
this.field.Formula = tmpBaseField.Formula;
|
|
1552
|
-
this.field.
|
|
2139
|
+
this.field.ColSpanSizes = tmpBaseField.ColSpanSizes;
|
|
1553
2140
|
this.field.FieldGroup = tmpBaseField.FieldGroup;
|
|
1554
2141
|
}
|
|
1555
2142
|
}
|
|
@@ -1625,7 +2212,8 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1625
2212
|
AddFormFieldComponent.ctorParameters = () => [
|
|
1626
2213
|
{ type: FormBuilder },
|
|
1627
2214
|
{ type: EnumHelper },
|
|
1628
|
-
{ type: MatDialog }
|
|
2215
|
+
{ type: MatDialog },
|
|
2216
|
+
{ type: ChangeDetectorRef }
|
|
1629
2217
|
];
|
|
1630
2218
|
__decorate([
|
|
1631
2219
|
Input()
|
|
@@ -1678,10 +2266,13 @@ __decorate([
|
|
|
1678
2266
|
__decorate([
|
|
1679
2267
|
ViewChild('dialogMetadata', { static: true })
|
|
1680
2268
|
], AddFormFieldComponent.prototype, "dialogMetadata", void 0);
|
|
2269
|
+
__decorate([
|
|
2270
|
+
ViewChild('buttonImagesKeyValueInputColumn', { static: true })
|
|
2271
|
+
], AddFormFieldComponent.prototype, "buttonImagesKeyValueInputColumn", void 0);
|
|
1681
2272
|
AddFormFieldComponent = __decorate([
|
|
1682
2273
|
Component({
|
|
1683
2274
|
selector: 'eqp-dynamic-module-add-form-field',
|
|
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>",
|
|
2275
|
+
template: "<div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"fieldFormGroup\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">{{indexField != null && indexField >= 0 ? \"Modifica\"\r\n : \"Aggiungi\"}} campo</div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"FieldTypeEnum\" [(ngModelInput)]=\"field.FieldType\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo campo\" (ngModelInputChange)=\"onFieldTypeChange()\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldType'\"\r\n [enumDataToExclude]=\"fieldTypesToExclude\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Label </mat-label>\r\n <input formControlName=\"Label\" required matInput [(ngModel)]=\"field.Label\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Descrizione </mat-label>\r\n <input formControlName=\"Description\" required matInput [(ngModel)]=\"field.Description\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\r\n <mat-slide-toggle [(ngModel)]=\"field.Required\" formControlName=\"Required\" color=\"primary\">\r\n Obbligatorio\r\n </mat-slide-toggle>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <mat-form-field>\r\n <mat-label> Formula (Javascript) </mat-label>\r\n <input formControlName=\"Formula\" matInput [(ngModel)]=\"field.Formula\"\r\n [matAutocomplete]=\"formulaAutocomplete\" (keyup)=\"setFormulaAutocompleteOptions($event)\"\r\n (focus)=\"setFormulaAutocompleteOptions(null)\">\r\n <mat-autocomplete #formulaAutocomplete=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of formulaAutocompleteOptions\" [value]=\"option.value\">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"formFieldsGroups\">\r\n <eqp-select [arrayData]=\"formFieldsGroups\" [(ngModelInput)]=\"field.FieldGroup\"\r\n [arrayKeyProperty]=\"'Name'\" [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldGroup'\" [isRequired]=\"true\"\r\n [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [arrayData]=\"availableColSpanSizes\" [(ngModelInput)]=\"field.ColSpanSizes\"\r\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" (ngModelInputChange)=\"onColSpanSizeSelect()\"\r\n [isMultiSelect]=\"true\" placeholder=\"Larghezza campo\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'ColSpanSizes'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\r\n <mat-slide-toggle [(ngModel)]=\"field.InListView\" formControlName=\"InListView\" color=\"primary\"\r\n [disabled]=\"fieldFormGroup.controls['InListView'].disabled\">\r\n Mostrare nella visualizzazione a lista\r\n </mat-slide-toggle>\r\n </div>\r\n\r\n <ng-container *ngTemplateOutlet=\"fieldTypeFormTemplate\">\r\n </ng-container>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveAndExitAddField(true)\"\r\n [disabled]=\"disableSaveField()\" type=\"button\">\r\n Salva\r\n </button>\r\n <button class=\"btn mat-raised-button\" (click)=\"saveAndExitAddField(false)\" type=\"button\">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI DI TESTO -->\r\n<ng-template #textFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4\">\r\n <eqp-select [enumData]=\"TextMaskEnum\" [(ngModelInput)]=\"field.TextMask\" placeholder=\"Maschera\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'TextMask'\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI AREA DI TESTO -->\r\n<ng-template #textareaFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Righe </mat-label>\r\n <input formControlName=\"Rows\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.Rows\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI BOOLEANI -->\r\n<ng-template #booleadFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsTristate\" formControlName=\"IsTristate\" color=\"primary\">\r\n A tre stati\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"BoolPresentantioEnum\" [(ngModelInput)]=\"field.PresetationType\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'PresetationType'\">\r\n </eqp-select>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI DATA -->\r\n<ng-template #dateFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-datetimepicker [placeholder]=\"'Data minima'\" [(ngModelInput)]=\"field.MinDate\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MinDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-datetimepicker [placeholder]=\"'Data massima'\" [(ngModelInput)]=\"field.MaxDate\"\r\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MaxDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"DateTimeTypeEnum\" [(ngModelInput)]=\"field.IsOnlyDate\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di data\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'IsOnlyDate'\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Formato </mat-label>\r\n <input formControlName=\"DateFormat\" matInput [(ngModel)]=\"field.DateFormat\"\r\n [matTooltip]=\"'Indicare il formato senguendo la guida del pacchetto momentjs.'\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI NUMERICI -->\r\n<ng-template #numericFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsInteger\" formControlName=\"IsInteger\" color=\"primary\">\r\n Valore intero\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Separatore decimali </mat-label>\r\n <input formControlName=\"DecimalSeparator\" matInput [(ngModel)]=\"field.DecimalSeparator\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Precisione decimali </mat-label>\r\n <input formControlName=\"DecimalPrecision\" type=\"number\" [min]=\"0\" matInput\r\n [(ngModel)]=\"field.DecimalPrecision\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Separatore migliaia </mat-label>\r\n <input formControlName=\"ThousandsSeparator\" matInput [(ngModel)]=\"field.ThousandsSeparator\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Simbolo valuta </mat-label>\r\n <input formControlName=\"CurrencySymbol\" matInput [(ngModel)]=\"field.CurrencySymbol\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Valore massimo </mat-label>\r\n <input formControlName=\"MinValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinValue\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field>\r\n <mat-label> Valore minimo </mat-label>\r\n <input formControlName=\"MaxValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxValue\">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI ALLEGATO -->\r\n<ng-template #attachmentFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiAttach\" formControlName=\"IsMultiAttach\" color=\"primary\">\r\n Allegati multipli\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [arrayData]=\"AvailableFileExtensions.concat(AvailableImageExtensions)\"\r\n [(ngModelInput)]=\"field.AllowedExtensions\" [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\"\r\n [isMultiSelect]=\"true\" placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 col-md-6\">\r\n <div class=\"header-title-standard\">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openMetadataDialog()\">\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 <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\r\n [data]=\"field.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\" [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI IMMAGINE -->\r\n<ng-template #imageFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\r\n color=\"primary\" (ngModelChange)=\"onImageIsContextualAttachmentChange()\">\r\n Immagine pre-caricata nel campo\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.EnableDrawing\" formControlName=\"EnableDrawing\" color=\"primary\">\r\n Abilita il disegno\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\"\r\n *ngIf=\"!field.ImageIsContextualAttachment\">\r\n <mat-slide-toggle [(ngModel)]=\"field.AttachDefinition.IsMultiAttach\" formControlName=\"IsMultiAttach\"\r\n color=\"primary\">\r\n Immagini multiple\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"!field.ImageIsContextualAttachment\">\r\n <eqp-select [arrayData]=\"AvailableImageExtensions\" [(ngModelInput)]=\"field.AttachDefinition.AllowedExtensions\"\r\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" [isMultiSelect]=\"true\"\r\n placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\r\n <mat-form-field>\r\n <mat-label> Nome immagine </mat-label>\r\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\" required>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 col-md-8 mt-2\" [formGroup]=\"fieldFormGroup\" *ngIf=\"field.ImageIsContextualAttachment\">\r\n <eqp-attachments [attachmentsList]=\"field._contextualAttachments\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\r\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"false\" [showHeader]=\"false\"\r\n (localEditedAttachments)=\"catchContextualAttachmentChange($event)\" #contextualAttachmentEqpAttachments>\r\n </eqp-attachments>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 col-md-6\">\r\n <div class=\"header-title-standard\">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-6 text-right\">\r\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"openMetadataDialog()\">\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 <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\r\n [data]=\"field.AttachDefinition.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\"\r\n [searchText]=\"'Cerca'\">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI LISTA DI VALORI -->\r\n<ng-template #listValueFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiChoiche\" formControlName=\"IsMultiChoiche\" color=\"primary\">\r\n Scelta multipla\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\">\r\n <eqp-select [enumData]=\"ListPresentationEnum\" [(ngModelInput)]=\"field.PresentationMode\" [isRequired]=\"true\"\r\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\r\n [formControlNameInput]=\"'PresentationMode'\" (ngModelInputChange)=\"onPresentationModeChange()\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\" *ngIf=\"field.PresentationMode != ListPresentationEnum.Immagini\">\r\n <div class=\"row\">\r\n <h4 class=\"key-value-list-section-title\"> </h4>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Label opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]=\"keyValueObject.key\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <mat-form-field>\r\n <mat-label> Valore opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]=\"keyValueObject.value\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-4 d-flex align-items-center\">\r\n <span class=\"mr-3\">Opzioni inserite:</span>\r\n <ul class=\"value-pairs-list\">\r\n <li *ngFor=\"let keyValuePair of getDictionaryKeyValue()\">\r\n <mat-icon class=\"mr-1\" (click)=\"deleteKeyFromDictionary(keyValuePair.key)\">close\r\n </mat-icon>\r\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-sm-12 col-md-12 mt-2\" *ngIf=\"field.PresentationMode == ListPresentationEnum.Immagini\">\r\n <eqp-attachments [attachmentsList]=\"field.ButtonImageList\" [showMatCard]=\"false\" [allowOnlyImages]=\"true\"\r\n [isDisabled]=\"false\" [showInlinePreview]=\"true\" [multipleAttachment]=\"true\" [showHeader]=\"false\"\r\n [allowedTypes]=\"[AttachmentType.FILE]\" (localEditedAttachments)=\"catchButtonImagesChange($event)\"\r\n (onComponentLoaded)=\"configureButtonImagesColumns($event)\">\r\n </eqp-attachments>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- FORM PROPRIET\u00C0 CAMPI LOOKUP -->\r\n<ng-template #lookupFieldFormTemplate>\r\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\r\n <mat-slide-toggle [(ngModel)]=\"field.UseAsGetOrDiscard\" formControlName=\"UseAsGetOrDiscard\" color=\"primary\"\r\n matTooltip=\"Se true la lookup viene visualizzata in una modale per lo scegli scarta\">\r\n Usa per scegli o scarta\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\r\n <mat-form-field matTooltip=\"Nome dell'entit\u00E0 relazionata\">\r\n <mat-label> Nome entit\u00E0 </mat-label>\r\n <input formControlName=\"EntitySourceName\" required matInput [(ngModel)]=\"field.EntitySourceName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12 mt-2\">\r\n <div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <mat-form-field\r\n matTooltip=\"Elenco di campi ordinato che verr\u00E0 visualizzato nella lookup (premere invio per confermare)\">\r\n <mat-label>\r\n Nomi dei campi (invio per confermare) </mat-label>\r\n <input matInput (keyup)=\"onMultiSelectInputKeyup($event, 'FieldNames')\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-md-8 d-flex align-items-center\">\r\n <span class=\"mr-3\">Nomi selezionati:</span>\r\n <div class=\"extension-container\" *ngFor=\"let extension of field.FieldNames; let i = index\">\r\n <span>{{extension}}</span>\r\n <mat-icon class=\"ml-1\" (click)=\"field.FieldNames.splice(i,1)\">close\r\n </mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE -->\r\n<ng-template #dialogMetadata>\r\n <eqp-dynamic-module-add-form-field [field]=\"selectedMetadata\" [availableFields]=\"availableFields\"\r\n [indexField]=\"indexSelectedMetadata\" (saveFieldEvent)=\"onSaveMetadata($event)\" [fieldTypesToExclude]=\"[6,7,10]\">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<ng-template #buttonImagesKeyValueInputColumn let-row=\"row\" let-col=\"col\">\r\n <mat-form-field>\r\n <mat-label> {{col.display}} </mat-label>\r\n <input matInput [(ngModel)]=\"row[col.key]\" required>\r\n </mat-form-field>\r\n</ng-template>",
|
|
1685
2276
|
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}"]
|
|
1686
2277
|
})
|
|
1687
2278
|
], AddFormFieldComponent);
|
|
@@ -1689,6 +2280,7 @@ AddFormFieldComponent = __decorate([
|
|
|
1689
2280
|
let TextFieldTemplateComponent = class TextFieldTemplateComponent {
|
|
1690
2281
|
constructor() {
|
|
1691
2282
|
this.recordChange = new EventEmitter();
|
|
2283
|
+
this.InputMaskEnum = TextMaskEnum;
|
|
1692
2284
|
}
|
|
1693
2285
|
ngOnInit() {
|
|
1694
2286
|
}
|
|
@@ -1699,6 +2291,20 @@ let TextFieldTemplateComponent = class TextFieldTemplateComponent {
|
|
|
1699
2291
|
this.updateField();
|
|
1700
2292
|
}
|
|
1701
2293
|
}
|
|
2294
|
+
getInputType() {
|
|
2295
|
+
switch (this.field.TextMask) {
|
|
2296
|
+
case TextMaskEnum.Email:
|
|
2297
|
+
return 'email';
|
|
2298
|
+
case TextMaskEnum.Password:
|
|
2299
|
+
return 'password';
|
|
2300
|
+
case TextMaskEnum.Telefono:
|
|
2301
|
+
return 'tel';
|
|
2302
|
+
case TextMaskEnum.Url:
|
|
2303
|
+
return 'url';
|
|
2304
|
+
default:
|
|
2305
|
+
return 'text';
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
1702
2308
|
/**
|
|
1703
2309
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
1704
2310
|
*/
|
|
@@ -1728,7 +2334,7 @@ __decorate([
|
|
|
1728
2334
|
TextFieldTemplateComponent = __decorate([
|
|
1729
2335
|
Component({
|
|
1730
2336
|
selector: 'text-field-template',
|
|
1731
|
-
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput type=\"
|
|
2337
|
+
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput [type]=\"getInputType()\" [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n</mat-form-field>",
|
|
1732
2338
|
styles: [""]
|
|
1733
2339
|
})
|
|
1734
2340
|
], TextFieldTemplateComponent);
|
|
@@ -1779,7 +2385,7 @@ __decorate([
|
|
|
1779
2385
|
BooleanFieldTemplateComponent = __decorate([
|
|
1780
2386
|
Component({
|
|
1781
2387
|
selector: 'boolean-field-template',
|
|
1782
|
-
template: "<div [formGroup]=\"field.FormFormGroup\">\n\n <!-- VISUALIZZAZIONE A TOGGLE -->\n <mat-slide-toggle color=\"primary\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Toggle\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-slide-toggle>\n\n\n <!-- VISUALIZZAZIONE A RADIOBUTTON -->\n <mat-label class=\"mr-3\" *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-label>\n <mat-radio-group *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n <mat-radio-button class=\"mr-2\" [value]=\"true\" color=\"primary\"> Si </mat-radio-button>\n <mat-radio-button class=\"mr-2\" [value]=\"false\" color=\"primary\"> No </mat-radio-button>\n <mat-radio-button class=\"mr-2\" [value]=\"null\" color=\"primary\" *ngIf=\"field.IsTristate\"> ND\n </mat-radio-button>\n </mat-radio-group>\n\n <!-- VISUALIZZAZIONE A CHECKBOX -->\n <mat-checkbox class=\"mr-2\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Checkbox\"\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [formControlName]=\"field.Name\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n {{field.Label + (field.Required ? \" *\" : \"\")}}\n </mat-checkbox>\n\n <!-- TODO: Visualizzazione \"Stringa true o false\" e \"Numerico 0 o 1\" ?? -->\n</div>",
|
|
2388
|
+
template: "<div [formGroup]=\"field.FormFormGroup\">\r\n\r\n <!-- VISUALIZZAZIONE A TOGGLE -->\r\n <mat-slide-toggle color=\"primary\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Toggle\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-slide-toggle>\r\n\r\n\r\n <!-- VISUALIZZAZIONE A RADIOBUTTON -->\r\n <mat-label class=\"mr-3\" *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-label>\r\n <mat-radio-group *ngIf=\"field.PresetationType == BoolPresentantioEnum['Radio button']\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n <mat-radio-button class=\"mr-2\" [value]=\"true\" color=\"primary\"> Si </mat-radio-button>\r\n <mat-radio-button class=\"mr-2\" [value]=\"false\" color=\"primary\"> No </mat-radio-button>\r\n <mat-radio-button class=\"mr-2\" [value]=\"null\" color=\"primary\" *ngIf=\"field.IsTristate\"> ND\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n <!-- VISUALIZZAZIONE A CHECKBOX -->\r\n <mat-checkbox class=\"mr-2\" *ngIf=\"field.PresetationType == BoolPresentantioEnum.Checkbox\"\r\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [formControlName]=\"field.Name\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n </mat-checkbox>\r\n\r\n <!-- TODO: Visualizzazione \"Stringa true o false\" e \"Numerico 0 o 1\" ?? -->\r\n</div>",
|
|
1783
2389
|
styles: [""]
|
|
1784
2390
|
})
|
|
1785
2391
|
], BooleanFieldTemplateComponent);
|
|
@@ -1844,7 +2450,7 @@ __decorate([
|
|
|
1844
2450
|
DateFieldTemplateComponent = __decorate([
|
|
1845
2451
|
Component({
|
|
1846
2452
|
selector: 'date-field-template',
|
|
1847
|
-
template: "<eqp-datetimepicker [placeholder]=\"field.Label\" [UTCDate]=\"true\" [pickerMode]=\"pickerMode\"\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\"\n [minDate]=\"field.MinDate ? field.MinDate : null\" [maxDate]=\"field.MaxDate ? field.MaxDate : null\"\n [isRequired]=\"field.Required\" [disabled]=\"field.FormFormGroup.disabled\" [(ngModelInput)]=\"record[field.Name]\"\n (ngModelInputChange)=\"onRecordValueChange()\">\n</eqp-datetimepicker>",
|
|
2453
|
+
template: "<eqp-datetimepicker [placeholder]=\"field.Label\" [UTCDate]=\"true\" [pickerMode]=\"pickerMode\"\r\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\"\r\n [minDate]=\"field.MinDate ? field.MinDate : null\" [maxDate]=\"field.MaxDate ? field.MaxDate : null\"\r\n [isRequired]=\"field.Required\" [disabled]=\"field.FormFormGroup.disabled\" [(ngModelInput)]=\"record[field.Name]\"\r\n (ngModelInputChange)=\"onRecordValueChange()\" [customDateFormat]=\"field.DateFormat ? field.DateFormat : null\">\r\n</eqp-datetimepicker>",
|
|
1848
2454
|
styles: [""]
|
|
1849
2455
|
})
|
|
1850
2456
|
], DateFieldTemplateComponent);
|
|
@@ -1891,7 +2497,7 @@ __decorate([
|
|
|
1891
2497
|
TextareaFieldTemplateComponent = __decorate([
|
|
1892
2498
|
Component({
|
|
1893
2499
|
selector: 'textarea-field-template',
|
|
1894
|
-
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\n <textarea matInput [placeholder]=\"field.Label\" [rows]=\"field.Rows\" [formControlName]=\"field.Name\"\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\"\n (ngModelChange)=\"onRecordValueChange()\"></textarea>\n</mat-form-field>",
|
|
2500
|
+
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <textarea matInput [placeholder]=\"field.Label\" [rows]=\"field.Rows\" [formControlName]=\"field.Name\"\r\n [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\"\r\n (ngModelChange)=\"onRecordValueChange()\"></textarea>\r\n</mat-form-field>",
|
|
1895
2501
|
styles: [""]
|
|
1896
2502
|
})
|
|
1897
2503
|
], TextareaFieldTemplateComponent);
|
|
@@ -1932,10 +2538,17 @@ let NumericFieldTemplateComponent = class NumericFieldTemplateComponent {
|
|
|
1932
2538
|
*/
|
|
1933
2539
|
configureEqpNumericOptions() {
|
|
1934
2540
|
this.eqpNumericOptions.prefix = this.field.CurrencySymbol ? this.field.CurrencySymbol : "";
|
|
2541
|
+
this.eqpNumericOptions.inputMode = this.field.CurrencySymbol ? EqpNumericInputMode.FINANCIAL : EqpNumericInputMode.NATURAL;
|
|
1935
2542
|
if (this.field.MinValue != null && this.field.MinValue != undefined)
|
|
1936
2543
|
this.eqpNumericOptions.min = this.field.MinValue;
|
|
1937
2544
|
if (this.field.MaxValue != null && this.field.MaxValue != undefined)
|
|
1938
2545
|
this.eqpNumericOptions.max = this.field.MaxValue;
|
|
2546
|
+
if (this.field.DecimalSeparator != null && this.field.DecimalSeparator != undefined)
|
|
2547
|
+
this.eqpNumericOptions.decimal = this.field.DecimalSeparator;
|
|
2548
|
+
if (this.field.ThousandsSeparator != null && this.field.ThousandsSeparator != undefined)
|
|
2549
|
+
this.eqpNumericOptions.thousands = this.field.ThousandsSeparator;
|
|
2550
|
+
if (this.field.DecimalPrecision != null && this.field.DecimalPrecision != undefined)
|
|
2551
|
+
this.eqpNumericOptions.precision = this.field.DecimalPrecision;
|
|
1939
2552
|
}
|
|
1940
2553
|
};
|
|
1941
2554
|
__decorate([
|
|
@@ -1950,7 +2563,7 @@ __decorate([
|
|
|
1950
2563
|
NumericFieldTemplateComponent = __decorate([
|
|
1951
2564
|
Component({
|
|
1952
2565
|
selector: 'numeric-field-template',
|
|
1953
|
-
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\n <mat-label> {{field.Label}} </mat-label>\n <input matInput eqpNumericMask [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" [options]=\"eqpNumericOptions\"\n [step]=\"field.IsInteger ? 1 : null\" (ngModelChange)=\"onRecordValueChange()\" />\n</mat-form-field>",
|
|
2566
|
+
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput eqpNumericMask [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" [options]=\"eqpNumericOptions\"\r\n [step]=\"field.IsInteger ? 1 : null\" (ngModelChange)=\"onRecordValueChange()\" />\r\n</mat-form-field>",
|
|
1954
2567
|
styles: [""]
|
|
1955
2568
|
})
|
|
1956
2569
|
], NumericFieldTemplateComponent);
|
|
@@ -1986,26 +2599,17 @@ let ListValueFieldTemplateComponent = class ListValueFieldTemplateComponent {
|
|
|
1986
2599
|
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
1987
2600
|
}
|
|
1988
2601
|
}
|
|
1989
|
-
/**
|
|
1990
|
-
* Metodo per recuperare la classe da applicare al button (nella relativa visualizzazione).
|
|
1991
|
-
* Se il pulsante è stato selezionato imposta la classe "selected-button".
|
|
1992
|
-
* @param data Oggetto bindato al pulsante
|
|
1993
|
-
* @returns Restituisce la classe da applicare tramite [ngClass]
|
|
1994
|
-
*/
|
|
1995
|
-
getSelectButtonClass(data) {
|
|
1996
|
-
const selectedButtonClass = "selected-button";
|
|
1997
|
-
return data.Selected ? selectedButtonClass : null;
|
|
1998
|
-
}
|
|
1999
2602
|
/**
|
|
2000
2603
|
* Metodo invocato quando viene selezionata un'opzione nella visualizzazione a button
|
|
2001
2604
|
* @param data Rappresenta l'oggetto selezionato
|
|
2002
2605
|
*/
|
|
2003
2606
|
buttonSelectClick(data) {
|
|
2607
|
+
data.Selected = !data.Selected;
|
|
2004
2608
|
if (this.field.IsMultiChoiche) {
|
|
2005
|
-
data.Selected = !data.Selected;
|
|
2006
2609
|
this.updateSelected(false);
|
|
2007
2610
|
}
|
|
2008
2611
|
else {
|
|
2612
|
+
this.arrayData.filter(d => d.Key != data.Key && d.Value != data.Value).forEach(d => d.Selected = false);
|
|
2009
2613
|
this.record[this.field.Name] = data.Value;
|
|
2010
2614
|
}
|
|
2011
2615
|
this.onRecordValueChange();
|
|
@@ -2033,16 +2637,22 @@ let ListValueFieldTemplateComponent = class ListValueFieldTemplateComponent {
|
|
|
2033
2637
|
* Metodo per creare un array di oggetti del tipo { Key: string, Value: any } da usare come sorgente dati per la eqp-select.
|
|
2034
2638
|
*/
|
|
2035
2639
|
setArrayData() {
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2640
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2641
|
+
Object.keys(this.field.ValuePairs).forEach(k => { this.createArrayDataElement(k, this.field.ValuePairs[k]); });
|
|
2642
|
+
}
|
|
2643
|
+
else {
|
|
2644
|
+
this.field.ButtonImageList.forEach(i => { this.createArrayDataElement(i.ButtonKey, i.ButtonValue, 'data:' + i.FileContentType + ';base64,' + i.FileDataBase64); });
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
createArrayDataElement(key, value, imgUrl = null) {
|
|
2648
|
+
var isOptionSelected;
|
|
2649
|
+
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
2650
|
+
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
2651
|
+
}
|
|
2652
|
+
else {
|
|
2653
|
+
isOptionSelected = this.record[this.field.Name] === value;
|
|
2654
|
+
}
|
|
2655
|
+
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
2046
2656
|
}
|
|
2047
2657
|
/**
|
|
2048
2658
|
* Metodo per aggiornare il valore e il validator del FormControl associato al campo.
|
|
@@ -2063,8 +2673,8 @@ __decorate([
|
|
|
2063
2673
|
ListValueFieldTemplateComponent = __decorate([
|
|
2064
2674
|
Component({
|
|
2065
2675
|
selector: 'list-value-field-template',
|
|
2066
|
-
template: "<eqp-select *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\" [placeholder]=\"field.Label\"\n [includeFullObject]=\"false\" [isRequired]=\"field.Required\" [isDisabled]=\"field.FormFormGroup.disabled\"\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\"\n (ngModelInputChange)=\"onRecordValueChange()\">\n</eqp-select>\n\n<div *ngIf=\"field.PresentationMode != ListPresentationEnum['Combo box']\" [formGroup]=\"field.FormFormGroup\">\n\n <mat-label class=\"mr-3\"> {{field.Label + (field.Required ? \" *\" : \"\")}} </mat-label>\n\n <!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) -->\n <mat-radio-group *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && !field.IsMultiChoiche\"\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\n <mat-radio-button class=\"mr-2\" *ngFor=\"let data of arrayData\" [value]=\"data.Value\" color=\"primary\">\n {{data.Key}}\n </mat-radio-button>\n </mat-radio-group>\n\n <!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) -->\n <div class=\"d-inline-block\"\n *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && field.IsMultiChoiche\">\n <mat-checkbox class=\"mr-2\" *ngFor=\"let data of arrayData\" [disabled]=\"field.FormFormGroup.disabled\"\n [formControlName]=\"field.Name\" [(ngModel)]=\"data.Selected\" (ngModelChange)=\"updateSelected()\">\n {{data.Key}}\n </mat-checkbox>\n </div>\n\n <!-- VISUALIZZAZIONE A PULSANTI (CON TESTO) -->\n <div class=\"d-inline-block\"
|
|
2067
|
-
styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]
|
|
2676
|
+
template: "<eqp-select *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\r\n [formGroupInput]=\"field.FormFormGroup\" [formControlNameInput]=\"field.Name\" [placeholder]=\"field.Label\"\r\n [includeFullObject]=\"false\" [isRequired]=\"field.Required\" [isDisabled]=\"field.FormFormGroup.disabled\"\r\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\"\r\n (ngModelInputChange)=\"onRecordValueChange()\">\r\n</eqp-select>\r\n\r\n<div *ngIf=\"field.PresentationMode != ListPresentationEnum['Combo box']\" [formGroup]=\"field.FormFormGroup\">\r\n\r\n <mat-label class=\"mr-3\"> {{field.Label + (field.Required ? \" *\" : \"\")}} </mat-label>\r\n\r\n <!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) -->\r\n <mat-radio-group *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && !field.IsMultiChoiche\"\r\n [formControlName]=\"field.Name\" [disabled]=\"field.FormFormGroup.disabled\" [required]=\"field.Required\"\r\n [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange()\">\r\n <mat-radio-button class=\"mr-2\" *ngFor=\"let data of arrayData\" [value]=\"data.Value\" color=\"primary\">\r\n {{data.Key}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n <!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) -->\r\n <div class=\"d-inline-block\"\r\n *ngIf=\"field.PresentationMode == ListPresentationEnum['Radio button'] && field.IsMultiChoiche\">\r\n <mat-checkbox class=\"mr-2\" *ngFor=\"let data of arrayData\" [disabled]=\"field.FormFormGroup.disabled\"\r\n [formControlName]=\"field.Name\" [(ngModel)]=\"data.Selected\" (ngModelChange)=\"updateSelected()\">\r\n {{data.Key}}\r\n </mat-checkbox>\r\n </div>\r\n\r\n <!-- VISUALIZZAZIONE A PULSANTI (CON TESTO O IMMAGINI) -->\r\n <div class=\"d-inline-block\"\r\n *ngIf=\"[ListPresentationEnum['Pulsante con testo'], ListPresentationEnum.Immagini].includes(field.PresentationMode)\">\r\n <button mat-raised-button color=\"primary\" class=\"btn btn-primary m-1 data-button\" *ngFor=\"let data of arrayData\"\r\n [ngClass]=\"{'selected-button': data.Selected == true, 'p-0': field.PresentationMode == ListPresentationEnum.Immagini}\"\r\n (click)=\"buttonSelectClick(data)\" [disabled]=\"field.FormFormGroup.disabled\">\r\n\r\n <!-- TESTO DEL PULSANTE -->\r\n <span *ngIf=\"field.PresentationMode == ListPresentationEnum['Pulsante con testo']\"> {{data.Key}}</span>\r\n\r\n <!-- IMMAGINE DEL PULSANTE -->\r\n <img *ngIf=\"field.PresentationMode == ListPresentationEnum.Immagini\" [src]=\"data.ImgUrl\">\r\n </button>\r\n </div>\r\n\r\n</div>",
|
|
2677
|
+
styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}.data-button img{max-height:300px;max-width:300px}"]
|
|
2068
2678
|
})
|
|
2069
2679
|
], ListValueFieldTemplateComponent);
|
|
2070
2680
|
|
|
@@ -2227,7 +2837,7 @@ __decorate([
|
|
|
2227
2837
|
AttachmentFieldTemplateComponent = __decorate([
|
|
2228
2838
|
Component({
|
|
2229
2839
|
selector: 'attachment-field-template',
|
|
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>",
|
|
2840
|
+
template: "<p *ngIf=\"!field.IsMultiAttach\" class=\"mb-2\">\r\n {{field.Label + (field.Required ? \" *\" : \"\")}}\r\n</p>\r\n<div class=\"row\" *ngIf=\"!field.IsMultiAttach && record[field.Name] && record[field.Name][0]\">\r\n <div class=\"mt-2\" *ngFor=\"let metadata of field.MetadataFields\"\r\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\r\n <dynamic-module-field [field]=\"metadata\" [record]=\"record[field.Name][0]\"\r\n (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n </div>\r\n</div>\r\n\r\n<eqp-attachments [attachmentsList]=\"record[field.Name]\" [showMatCard]=\"true\" [allowOnlyImages]=\"onlyImages\"\r\n [isDisabled]=\"field.FormFormGroup.disabled\" [showInlinePreview]=\"true\" [multipleAttachment]=\"field.IsMultiAttach\"\r\n [disableAction]=\"field.FormFormGroup.disabled\" [acceptedFileTypes]=\"field.AllowedExtensions\" [showHeader]=\"true\"\r\n [headerTitle]=\"field.Label + (field.Required ? ' *' : '')\" (localEditedAttachments)=\"catchAttachmentList($event)\"\r\n #eqpAttachments>\r\n</eqp-attachments>\r\n\r\n<!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS -->\r\n<ng-template #metadataColumnTemplate let-row=\"row\" let-col=\"col\">\r\n <dynamic-module-field [field]=\"getFieldFromMetadata(col, row)\" [record]=\"row\"\r\n (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n</ng-template>",
|
|
2231
2841
|
styles: [""]
|
|
2232
2842
|
})
|
|
2233
2843
|
], AttachmentFieldTemplateComponent);
|
|
@@ -2416,7 +3026,7 @@ __decorate([
|
|
|
2416
3026
|
ImageFieldTemplateComponent = __decorate([
|
|
2417
3027
|
Component({
|
|
2418
3028
|
selector: 'image-field-template',
|
|
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>",
|
|
3029
|
+
template: "<!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA' DI DISEGNO -->\r\n<div class=\"row\" *ngIf=\"field.ImageIsContextualAttachment && field.ContextualAttachment\">\r\n <div class=\"col-sm-12 col-md-6 col-lg-4\">\r\n <p class=\"mb-2\">\r\n {{ field.Label + (field.Required ? \" *\" : \"\")}}\r\n <br>\r\n Nome immagine: {{ field.ImgName}}\r\n </p>\r\n <eqp-img-drawing\r\n *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\r\n [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\" [width]=\"width\"\r\n [height]=\"height\" [i18n]=\"i18n\" [showCancelButton]=\"true\" (save)=\"saveDrowning($event)\"\r\n (cancel)=\"resetPreLoadedImage()\">\r\n </eqp-img-drawing>\r\n\r\n <img *ngIf=\"!field.EnableDrawing\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType+ ';base64,'+ record[field.Name][0].FileDataBase64\">\r\n </div>\r\n\r\n <div class=\"col-sm-12 col-md-6 col-lg-8\">\r\n <div class=\"row\"\r\n *ngIf=\"field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup\">\r\n <div class=\"mt-2\" *ngFor=\"let metadata of field.AttachDefinition.MetadataFields\"\r\n [ngClass]=\"utilityService.getFieldSyleClass(metadata)\">\r\n <dynamic-module-field #fieldTemplate [field]=\"metadata\" [form]=\"preLoadedImageMetadataFormGroup\"\r\n [record]=\"record[field.Name][0]\" (recordChange)=\"updateMetadataValidity()\">\r\n </dynamic-module-field>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI -->\r\n<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\" [onlyImages]=\"true\"\r\n (onAttachmentsChange)=\"onAttachmentsChange()\" *ngIf=\"!field.ImageIsContextualAttachment\">\r\n</attachment-field-template>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrowing>\r\n <div *ngIf=\"field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null\"\r\n class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <eqp-img-drawing [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\" [enableRemoveImage]=\"false\"\r\n [src]=\"'data:'+ record[field.Name][0].FileContentType + ';base64,'+ record[field.Name][0].FileDataBase64\"\r\n [i18n]=\"i18n\" [showCancelButton]=\"false\" (save)=\"saveDrowning($event)\">\r\n </eqp-img-drawing>\r\n </div>\r\n </div>\r\n <div class=\"row mt-2 mb-1\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn mat-raised-button\" (click)=\"closeImageDrowingDialog()\" type=\"button\">\r\n Annulla disegno\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
2420
3030
|
styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
|
|
2421
3031
|
})
|
|
2422
3032
|
], ImageFieldTemplateComponent);
|
|
@@ -2494,30 +3104,14 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2494
3104
|
* @param record Record da duplicare.
|
|
2495
3105
|
*/
|
|
2496
3106
|
duplicateRecord(record) {
|
|
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
3107
|
this.onDuplicateRecord.emit(record);
|
|
2508
|
-
//TODO
|
|
2509
3108
|
}
|
|
2510
3109
|
/**
|
|
2511
3110
|
* Metodo per eliminare un record dalla lista.
|
|
2512
3111
|
* @param record Record da eliminare selezionato sulla eqp-table.
|
|
2513
3112
|
*/
|
|
2514
3113
|
deleteRecord(record) {
|
|
2515
|
-
// EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
|
|
2516
|
-
// this.values.splice(this.values.indexOf(record), 1);
|
|
2517
|
-
// this.reloadTables();
|
|
2518
|
-
// }, false, 'Richiesta conferma');
|
|
2519
3114
|
this.onDeleteRecord.emit(record);
|
|
2520
|
-
// TODO
|
|
2521
3115
|
}
|
|
2522
3116
|
/**
|
|
2523
3117
|
* Metodo per creare la configurazione delle colonne per la eqp-table.
|
|
@@ -2559,7 +3153,7 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2559
3153
|
column.format = "dd/MM/yyyy HH:mm";
|
|
2560
3154
|
}
|
|
2561
3155
|
else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
|
|
2562
|
-
column.format = "dd/MM/yyyy";
|
|
3156
|
+
column.format = field.DateFormat ? field.DateFormat.replace("DD", "dd") : "dd/MM/yyyy";
|
|
2563
3157
|
}
|
|
2564
3158
|
}
|
|
2565
3159
|
break;
|
|
@@ -2646,9 +3240,6 @@ ListFormRecordComponent = __decorate([
|
|
|
2646
3240
|
})
|
|
2647
3241
|
], ListFormRecordComponent);
|
|
2648
3242
|
|
|
2649
|
-
class Record {
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
3243
|
let AddFormRecordComponent = class AddFormRecordComponent {
|
|
2653
3244
|
constructor(cdr, utilityService) {
|
|
2654
3245
|
this.cdr = cdr;
|
|
@@ -2767,7 +3358,7 @@ __decorate([
|
|
|
2767
3358
|
AddFormRecordComponent = __decorate([
|
|
2768
3359
|
Component({
|
|
2769
3360
|
selector: 'add-form-record',
|
|
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>",
|
|
3361
|
+
template: "<div class=\"row eqp-dynamic-module-title\" *ngIf=\"showTitle\">\r\n <div class=\"col-md-12\">\r\n <h4><b>{{form.Name}}</b></h4>\r\n </div>\r\n</div>\r\n\r\n<form [formGroup]=\"formForm\">\r\n\r\n <!-- VISUALIZZAZIONE SEMPLICE -->\r\n <ng-container *ngIf=\"form.FormScalarType == FormScalarTypeEnum.Semplice\" [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: form.Fields }\">\r\n </ng-container>\r\n\r\n <!-- VISUALIZZAZIONE A STEPPER -->\r\n <mat-horizontal-stepper linear *ngIf=\"form.FormScalarType == FormScalarTypeEnum['A step']\">\r\n <mat-step *ngFor=\"let group of form.FormFieldsGroups\">\r\n <ng-template matStepLabel>\r\n {{group.Name}}\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </mat-step>\r\n </mat-horizontal-stepper>\r\n\r\n <!-- VISUALIZZAZIONE A TAB -->\r\n <mat-tab-group *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In tab']\">\r\n <mat-tab *ngFor=\"let group of form.FormFieldsGroups\" [label]=\"group.Name\">\r\n <div class=\"mt-3\">\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </div>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n <!-- VISUALIZZAZIONE AD ACCORDION -->\r\n <mat-accordion multi *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In accordion']\">\r\n <mat-expansion-panel *ngFor=\"let group of form.FormFieldsGroups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{group.Name}}\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n</form>\r\n\r\n<div class=\"row mt-2\" *ngIf=\"showButtons\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button (click)=\"saveOrExitForm(true)\" type=\"button\">\r\n Annulla\r\n </button>\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveOrExitForm(false)\"\r\n [disabled]=\"formForm.invalid || formForm.disabled\" type=\"button\">\r\n Salva\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM -->\r\n<ng-template #fieldTemplates let-fields='fields'>\r\n <div class=\"row\">\r\n <div class=\"mt-2\" *ngFor=\"let field of fields\" [ngClass]=\"utilityService.getFieldSyleClass(field)\">\r\n <dynamic-module-field #fieldTemplate [field]=\"field\" [form]=\"form\" [record]=\"record\"\r\n (recordChange)=\"onRecordChange()\"></dynamic-module-field>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
2771
3362
|
styles: [""]
|
|
2772
3363
|
})
|
|
2773
3364
|
], AddFormRecordComponent);
|
|
@@ -2888,11 +3479,30 @@ __decorate([
|
|
|
2888
3479
|
DynamicModuleFieldComponent = __decorate([
|
|
2889
3480
|
Component({
|
|
2890
3481
|
selector: 'dynamic-module-field',
|
|
2891
|
-
template: "<text-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo di testo']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</text-field-template>\n\n<textarea-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Area di testo']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</textarea-field-template>\n\n<boolean-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Booleano']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</boolean-field-template>\n\n<date-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Data e/o ora']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</date-field-template>\n\n<numeric-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo numerico']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</numeric-field-template>\n\n<list-value-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Elenco generico']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</list-value-field-template>\n\n<attachment-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Allegato']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</attachment-field-template>\n\n<image-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Immagine']\"\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\n</image-field-template>\n\n<list-form-record #listInnerFormRecords *ngIf=\"field.FieldType == FieldTypeEnum['Form di dettaglio']\"\n [form]=\"getInnerFormFromField(field)\" [values]=\"record[field.Name]\"\n (onAddViewEditRecord)=\"onAddViewEditInnerFormRecord($event, field)\">\n</list-form-record>\n\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO -->\n<ng-template #dialogInnerFormRecord>\n <add-form-record [form]=\"selectedInnerForm\" [record]=\"selectedInnerFormRecord\" [onlyView]=\"onlyViewInnerFormRecord\"\n (saveRecordEvent)=\"onSaveInnerFormRecord($event)\"></add-form-record>\n</ng-template>",
|
|
3482
|
+
template: "<text-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</text-field-template>\r\n\r\n<textarea-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</textarea-field-template>\r\n\r\n<boolean-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Booleano']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</boolean-field-template>\r\n\r\n<date-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</date-field-template>\r\n\r\n<numeric-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</numeric-field-template>\r\n\r\n<list-value-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Elenco generico']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</list-value-field-template>\r\n\r\n<attachment-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Allegato']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</attachment-field-template>\r\n\r\n<image-field-template #fieldTemplate *ngIf=\"field.FieldType == FieldTypeEnum['Immagine']\"\r\n [matTooltip]=\"field.Description\" [(record)]=\"record\" [field]=\"field\" (recordChange)=\"onRecordChange()\">\r\n</image-field-template>\r\n\r\n<list-form-record #listInnerFormRecords *ngIf=\"field.FieldType == FieldTypeEnum['Form di dettaglio']\"\r\n [form]=\"getInnerFormFromField(field)\" [values]=\"record[field.Name]\"\r\n (onAddViewEditRecord)=\"onAddViewEditInnerFormRecord($event, field)\">\r\n</list-form-record>\r\n\r\n<!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO -->\r\n<ng-template #dialogInnerFormRecord>\r\n <add-form-record [form]=\"selectedInnerForm\" [record]=\"selectedInnerFormRecord\" [onlyView]=\"onlyViewInnerFormRecord\"\r\n (saveRecordEvent)=\"onSaveInnerFormRecord($event)\"></add-form-record>\r\n</ng-template>",
|
|
2892
3483
|
styles: [""]
|
|
2893
3484
|
})
|
|
2894
3485
|
], DynamicModuleFieldComponent);
|
|
2895
3486
|
|
|
3487
|
+
let SpinnerComponent = class SpinnerComponent {
|
|
3488
|
+
constructor(spinnerService) {
|
|
3489
|
+
this.spinnerService = spinnerService;
|
|
3490
|
+
this.isLoading = this.spinnerService.isLoading;
|
|
3491
|
+
}
|
|
3492
|
+
ngOnInit() {
|
|
3493
|
+
}
|
|
3494
|
+
};
|
|
3495
|
+
SpinnerComponent.ctorParameters = () => [
|
|
3496
|
+
{ type: SpinnerService }
|
|
3497
|
+
];
|
|
3498
|
+
SpinnerComponent = __decorate([
|
|
3499
|
+
Component({
|
|
3500
|
+
selector: 'eqp-dynamic-module-spinner',
|
|
3501
|
+
template: "<div class=\"eqp-splash-screen\" *ngIf=\"isLoading | async\">\r\n <div id=\"loader\"></div>\r\n</div>",
|
|
3502
|
+
styles: [":host #loader{display:block;position:relative;width:150px;height:150px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:2s linear infinite spin;animation:2s linear infinite spin}:host #loader:before{content:\"\";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:3s linear infinite spin;animation:3s linear infinite spin}:host #loader:after{content:\"\";position:absolute;top:15px;left:15px;right:15px;bottom:15px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:1.5s linear infinite spin;animation:1.5s linear infinite spin}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}:host .eqp-splash-screen{background-color:#343a4040;position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;z-index:9999}:host .eqp-splash-screen img{margin-left:calc(100vw - 100%);width:90px;margin-bottom:30px}:host .eqp-splash-screen span{margin-left:calc(100vw - 100%);margin-bottom:30px}:host .eqp-splash-screen ::ng-deep .mat-progress-spinner circle,:host .eqp-splash-screen ::ng-deep .mat-spinner circle{stroke:#5d78ff}"]
|
|
3503
|
+
})
|
|
3504
|
+
], SpinnerComponent);
|
|
3505
|
+
|
|
2896
3506
|
let EqpDynamicModuleModule = class EqpDynamicModuleModule {
|
|
2897
3507
|
};
|
|
2898
3508
|
EqpDynamicModuleModule = __decorate([
|
|
@@ -2912,9 +3522,9 @@ EqpDynamicModuleModule = __decorate([
|
|
|
2912
3522
|
ListFormRecordComponent,
|
|
2913
3523
|
AddFormRecordComponent,
|
|
2914
3524
|
DynamicModuleFieldComponent,
|
|
3525
|
+
SpinnerComponent,
|
|
2915
3526
|
],
|
|
2916
3527
|
imports: [
|
|
2917
|
-
BrowserModule,
|
|
2918
3528
|
MaterialModule,
|
|
2919
3529
|
FormsModule,
|
|
2920
3530
|
CommonModule,
|
|
@@ -2958,10 +3568,6 @@ class NumericField extends BaseField {
|
|
|
2958
3568
|
class TextareaField extends BaseField {
|
|
2959
3569
|
}
|
|
2960
3570
|
|
|
2961
|
-
/**Campo di testo */
|
|
2962
|
-
class TextField extends BaseField {
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
3571
|
/*
|
|
2966
3572
|
* Public API Surface of eqp-dynamic-module
|
|
2967
3573
|
*/
|
|
@@ -2970,5 +3576,5 @@ class TextField extends BaseField {
|
|
|
2970
3576
|
* Generated bundle index. Do not edit.
|
|
2971
3577
|
*/
|
|
2972
3578
|
|
|
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,
|
|
3579
|
+
export { ActionOnRecord, AddFormFieldComponent, AddFormRecordComponent, ArrayValidators, AttachmentField, AttachmentFieldTemplateComponent, AvailableFileExtensions, AvailableImageExtensions, BaseField, BaseObj, BoolPresentantioEnum, BooleanField, BooleanFieldTemplateComponent, ButtonImage, ColSpanSizesEnum, Context, ContextUser, DateField, DateFieldTemplateComponent, DateTimeTypeEnum, DynRecord, DynamicModuleFieldComponent, EndPointConfiguration, EndPointData, EndPointDataParams, Entity, EqpDynamicModuleComponent, EqpDynamicModuleConfiguratorComponent, EqpDynamicModuleDialogService, EqpDynamicModuleModule, FieldTypeEnum, Form, FormFieldGroup, FormScalarTypeEnum, FormTypeEnum, ImageField, ImageFieldTemplateComponent, ListFormRecordComponent, ListPresentationEnum, ListValueField, ListValueFieldTemplateComponent, LookupField, NumericField, NumericFieldTemplateComponent, ParamTypeEnum, Record, RequestMethodEnum, SpinnerService, TelRegex, TextField, TextFieldTemplateComponent, TextMaskEnum, TextareaField, TextareaFieldTemplateComponent, UrlRegex, UtilityHelperService, ɵ0, SpinnerComponent as ɵa, MaterialModule as ɵb };
|
|
2974
3580
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.js.map
|