@eqproject/eqp-dynamic-module 0.0.4 → 0.0.5
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 -226
- 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 -1
- 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 -1
- 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 -212
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +864 -226
- 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,13 +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';
|
|
45
|
+
import { EqpNumericInputMode, EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
44
46
|
import { BrowserModule } from '@angular/platform-browser';
|
|
45
47
|
|
|
46
48
|
class Context {
|
|
@@ -51,6 +53,29 @@ class Context {
|
|
|
51
53
|
class ContextUser {
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
class EndPointConfiguration {
|
|
57
|
+
}
|
|
58
|
+
class EndPointData {
|
|
59
|
+
}
|
|
60
|
+
class EndPointDataParams {
|
|
61
|
+
constructor() {
|
|
62
|
+
this.ParamValue = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var ParamTypeEnum;
|
|
66
|
+
(function (ParamTypeEnum) {
|
|
67
|
+
ParamTypeEnum[ParamTypeEnum["Query param"] = 1] = "Query param";
|
|
68
|
+
ParamTypeEnum[ParamTypeEnum["In route"] = 2] = "In route";
|
|
69
|
+
ParamTypeEnum[ParamTypeEnum["In Body"] = 3] = "In Body";
|
|
70
|
+
})(ParamTypeEnum || (ParamTypeEnum = {}));
|
|
71
|
+
var RequestMethodEnum;
|
|
72
|
+
(function (RequestMethodEnum) {
|
|
73
|
+
RequestMethodEnum["GET"] = "GET";
|
|
74
|
+
RequestMethodEnum["POST"] = "POST";
|
|
75
|
+
RequestMethodEnum["PUT"] = "PUT";
|
|
76
|
+
RequestMethodEnum["DELETE"] = "DELETE";
|
|
77
|
+
})(RequestMethodEnum || (RequestMethodEnum = {}));
|
|
78
|
+
|
|
54
79
|
/**
|
|
55
80
|
* Classe base che implementa la valorizzazione dell'ID (se null) con una nuova GUID
|
|
56
81
|
* in creazione dell'oggetto.
|
|
@@ -83,6 +108,122 @@ var FormScalarTypeEnum;
|
|
|
83
108
|
FormScalarTypeEnum[FormScalarTypeEnum["In accordion"] = 4] = "In accordion"; //GROUPED_BY_ACCORDION
|
|
84
109
|
})(FormScalarTypeEnum || (FormScalarTypeEnum = {}));
|
|
85
110
|
|
|
111
|
+
class Record {
|
|
112
|
+
}
|
|
113
|
+
class DynRecord {
|
|
114
|
+
constructor() {
|
|
115
|
+
this.Values = {};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let EqpDynamicModuleDialogService = class EqpDynamicModuleDialogService {
|
|
120
|
+
constructor() {
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
|
|
124
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
125
|
+
* @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
|
|
126
|
+
*/
|
|
127
|
+
static Success(message, title = null) {
|
|
128
|
+
let currentTitle = title != null ? title : 'Operazione completata con successo.';
|
|
129
|
+
Swal.fire(currentTitle, message, 'success');
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
133
|
+
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
134
|
+
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
135
|
+
*/
|
|
136
|
+
static Error(message, title = null) {
|
|
137
|
+
let currentTitle = title != null ? title : 'Errore';
|
|
138
|
+
if (Array.isArray(message)) {
|
|
139
|
+
currentTitle = title != null ? title : 'Errore';
|
|
140
|
+
let htmlErrors = message.join("<br>");
|
|
141
|
+
Swal.fire({
|
|
142
|
+
title: currentTitle,
|
|
143
|
+
html: htmlErrors,
|
|
144
|
+
icon: 'error'
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
Swal.fire(currentTitle, message, 'error');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
153
|
+
* CONFERMA lancia la funzione di callback passata come parametro
|
|
154
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
155
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
156
|
+
*/
|
|
157
|
+
static Confirm(message, confirmCallback, isWarning = false, title = null, customWidth = null) {
|
|
158
|
+
let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
159
|
+
if (Array.isArray(message)) {
|
|
160
|
+
let htmlErrors = message.join("<br>");
|
|
161
|
+
Swal.fire({
|
|
162
|
+
title: currentTitle,
|
|
163
|
+
html: htmlErrors,
|
|
164
|
+
width: customWidth ? customWidth : '32rem',
|
|
165
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
166
|
+
showCancelButton: true,
|
|
167
|
+
allowOutsideClick: false,
|
|
168
|
+
allowEscapeKey: false
|
|
169
|
+
}).then((result) => {
|
|
170
|
+
if (result.value && confirmCallback) {
|
|
171
|
+
confirmCallback();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
Swal.fire({
|
|
177
|
+
title: currentTitle,
|
|
178
|
+
text: message,
|
|
179
|
+
width: customWidth ? customWidth : '32rem',
|
|
180
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
181
|
+
showCancelButton: true,
|
|
182
|
+
allowOutsideClick: false,
|
|
183
|
+
allowEscapeKey: false
|
|
184
|
+
}).then((result) => {
|
|
185
|
+
if (result.value && confirmCallback) {
|
|
186
|
+
confirmCallback();
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
193
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
194
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
195
|
+
*/
|
|
196
|
+
static Info(message, title = null, isToast = null) {
|
|
197
|
+
let currentTitle = title != null ? title : "Informazione:";
|
|
198
|
+
Swal.fire(currentTitle, message, 'info');
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
202
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
203
|
+
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
204
|
+
*/
|
|
205
|
+
static Warning(message, title = null, isToast = null) {
|
|
206
|
+
let currentTitle = title != null ? title : "Attenzione!";
|
|
207
|
+
if (Array.isArray(message)) {
|
|
208
|
+
let htmlWarnings = message.join("<br>");
|
|
209
|
+
Swal.fire({
|
|
210
|
+
title: currentTitle,
|
|
211
|
+
html: htmlWarnings,
|
|
212
|
+
icon: 'warning'
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
Swal.fire(currentTitle, message, 'warning');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
|
|
221
|
+
EqpDynamicModuleDialogService = __decorate([
|
|
222
|
+
Injectable({
|
|
223
|
+
providedIn: 'root'
|
|
224
|
+
})
|
|
225
|
+
], EqpDynamicModuleDialogService);
|
|
226
|
+
|
|
86
227
|
/**
|
|
87
228
|
* Contiene le informazioni di base del campo, indipendentemente dal tipo.
|
|
88
229
|
* Questa classe è volutamente astratta perché il tipo di campo è dettato dal tipo
|
|
@@ -118,6 +259,19 @@ var ColSpanSizesEnum;
|
|
|
118
259
|
ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"] = 12] = "col-lg-12";
|
|
119
260
|
})(ColSpanSizesEnum || (ColSpanSizesEnum = {}));
|
|
120
261
|
|
|
262
|
+
/**Campo di testo */
|
|
263
|
+
class TextField extends BaseField {
|
|
264
|
+
}
|
|
265
|
+
var TextMaskEnum;
|
|
266
|
+
(function (TextMaskEnum) {
|
|
267
|
+
TextMaskEnum[TextMaskEnum["Password"] = 1] = "Password";
|
|
268
|
+
TextMaskEnum[TextMaskEnum["Email"] = 2] = "Email";
|
|
269
|
+
TextMaskEnum[TextMaskEnum["Telefono"] = 3] = "Telefono";
|
|
270
|
+
TextMaskEnum[TextMaskEnum["Url"] = 4] = "Url";
|
|
271
|
+
})(TextMaskEnum || (TextMaskEnum = {}));
|
|
272
|
+
const UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
|
|
273
|
+
const TelRegex = '([+]?[0-9]{10,14})';
|
|
274
|
+
|
|
121
275
|
class ArrayValidators {
|
|
122
276
|
static minLenght(minLenght) {
|
|
123
277
|
var validationFunction = (control) => {
|
|
@@ -137,18 +291,70 @@ class ArrayValidators {
|
|
|
137
291
|
}
|
|
138
292
|
}
|
|
139
293
|
|
|
294
|
+
let SpinnerService = class SpinnerService {
|
|
295
|
+
constructor() {
|
|
296
|
+
this.isLoading = new Subject();
|
|
297
|
+
this.requestsCount = 0;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Mostra lo spinner
|
|
301
|
+
*/
|
|
302
|
+
show() {
|
|
303
|
+
setTimeout(() => {
|
|
304
|
+
this.isLoading.next(true);
|
|
305
|
+
}, 100);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Nasconde lo spinner
|
|
309
|
+
*/
|
|
310
|
+
hide() {
|
|
311
|
+
setTimeout(() => {
|
|
312
|
+
this.isLoading.next(false);
|
|
313
|
+
}, 100);
|
|
314
|
+
}
|
|
315
|
+
addRequestCounter() {
|
|
316
|
+
this.requestsCount++;
|
|
317
|
+
this.show();
|
|
318
|
+
}
|
|
319
|
+
removeRequestCounter() {
|
|
320
|
+
this.requestsCount--;
|
|
321
|
+
if (this.requestsCount == 0)
|
|
322
|
+
this.hide();
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
SpinnerService.ɵprov = ɵɵdefineInjectable({ factory: function SpinnerService_Factory() { return new SpinnerService(); }, token: SpinnerService, providedIn: "root" });
|
|
326
|
+
SpinnerService = __decorate([
|
|
327
|
+
Injectable({
|
|
328
|
+
providedIn: 'root'
|
|
329
|
+
})
|
|
330
|
+
], SpinnerService);
|
|
331
|
+
|
|
140
332
|
var UtilityHelperService_1;
|
|
141
333
|
let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
142
|
-
constructor(formBuilder) {
|
|
334
|
+
constructor(formBuilder, http, spinnerService) {
|
|
143
335
|
this.formBuilder = formBuilder;
|
|
336
|
+
this.http = http;
|
|
337
|
+
this.spinnerService = spinnerService;
|
|
144
338
|
}
|
|
145
339
|
static EvaluateFieldFormula(formula, rec, ctx) {
|
|
146
|
-
const evaluatedValue = eval(formula
|
|
340
|
+
const evaluatedValue = eval(formula);
|
|
147
341
|
return (evaluatedValue ? evaluatedValue : null);
|
|
148
342
|
}
|
|
149
343
|
static SetContext(ctx) {
|
|
150
344
|
this.context = ctx;
|
|
151
345
|
}
|
|
346
|
+
static GetFieldType(field) {
|
|
347
|
+
switch (field.FieldType) {
|
|
348
|
+
case FieldTypeEnum["Campo di testo"]: {
|
|
349
|
+
const t = Object.assign(new TextField, field);
|
|
350
|
+
return t;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
default: {
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
152
358
|
/**
|
|
153
359
|
* Metodo per impostare i valori da suggerire nell'autocomplete per i campi in cui l'utente deve scrivere comandi javascript.
|
|
154
360
|
* 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 +366,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
160
366
|
* 3) la stringa digitata dall'utente non coincide con nessun altro caso sopra (finisce con un carattere qualunque)
|
|
161
367
|
*/
|
|
162
368
|
static GetAutocompleteOptions(fields, typedFormula) {
|
|
163
|
-
|
|
369
|
+
let autocompleteOptions = [];
|
|
164
370
|
// Recupero i nomi di tutti i campi creati fino ad ora nella form.
|
|
165
371
|
const availableRecProperties = fields.map(f => f.Label.split(' ').join('_'));
|
|
166
372
|
// 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 +402,17 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
196
402
|
// funzione javascript. Controllo la parola che l'utente sta digitando e se fa parte di uno degli oggetti a disposizione
|
|
197
403
|
// o una proprietà di essi allora suggerisco i possibili match.
|
|
198
404
|
else {
|
|
199
|
-
|
|
405
|
+
const availableOptions = [];
|
|
200
406
|
// Prendo tutti i blocchi di caratteri digitati dall'utente
|
|
201
407
|
const allFormulaWords = typedFormula.split(" ");
|
|
202
408
|
// Prendo l'ultimo blocco di caratteri digitato dall'utente
|
|
203
|
-
|
|
409
|
+
const lastTypedString = allFormulaWords[allFormulaWords.length - 1];
|
|
204
410
|
// Se la l'ultima stringa digitata non contiene caratteri speciali allora splitto la stringa
|
|
205
411
|
// sui "." e imposto i suggerimenti in base al path della prorpietà che si sta digitando.
|
|
206
412
|
if (!new RegExp("[^0-9a-zA-Z_.]").test(lastTypedString)) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
413
|
+
const propertyPath = lastTypedString.split(".");
|
|
414
|
+
const lastTypedWork = propertyPath[propertyPath.length - 1];
|
|
415
|
+
let propertiesToCheck = [];
|
|
210
416
|
if (propertyPath.length == 1) {
|
|
211
417
|
propertiesToCheck = ["rec", "ctx"];
|
|
212
418
|
}
|
|
@@ -219,7 +425,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
219
425
|
else if (propertyPath.length > 1 && propertyPath[propertyPath.length - 2] === "rec") {
|
|
220
426
|
propertiesToCheck = availableRecProperties;
|
|
221
427
|
}
|
|
222
|
-
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
428
|
+
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
223
429
|
// quello che sta digitando l'utente.
|
|
224
430
|
propertiesToCheck.forEach(prop => {
|
|
225
431
|
if (prop.startsWith(lastTypedWork)) {
|
|
@@ -285,7 +491,7 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
285
491
|
* @returns Restituisce un FormGroup rappresentate la Form a cui appartengono i BaseField ricevuti in input.
|
|
286
492
|
*/
|
|
287
493
|
CreateFormFormGroup(formFields, record, onlyView = false, includeCurrentFormInField = true) {
|
|
288
|
-
|
|
494
|
+
const formForm = this.formBuilder.group([]);
|
|
289
495
|
formFields.forEach(field => {
|
|
290
496
|
formForm.addControl(field.Name, this.createFieldFormControl(field, record));
|
|
291
497
|
if (includeCurrentFormInField) {
|
|
@@ -314,6 +520,17 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
314
520
|
if (field.MinLenght) {
|
|
315
521
|
validators.push(Validators.minLength(field.MinLenght));
|
|
316
522
|
}
|
|
523
|
+
switch (field.TextMask) {
|
|
524
|
+
case TextMaskEnum.Url:
|
|
525
|
+
validators.push(Validators.pattern(UrlRegex));
|
|
526
|
+
break;
|
|
527
|
+
case TextMaskEnum.Email:
|
|
528
|
+
validators.push(Validators.email);
|
|
529
|
+
break;
|
|
530
|
+
case TextMaskEnum.Telefono:
|
|
531
|
+
validators.push(Validators.pattern(TelRegex));
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
317
534
|
break;
|
|
318
535
|
case FieldTypeEnum["Area di testo"]:
|
|
319
536
|
if (field.MaxLenght) {
|
|
@@ -336,12 +553,147 @@ let UtilityHelperService = UtilityHelperService_1 = class UtilityHelperService {
|
|
|
336
553
|
}
|
|
337
554
|
return new FormControl(record[field.Name], validators);
|
|
338
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
558
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
559
|
+
* @param baseServerUrl Stringa dell'url base del server (es: "http://localhost:5000").
|
|
560
|
+
* @param userToken Token dell'utente loggato da usare per autenticarsi se necessario.
|
|
561
|
+
* @returns Resituisce la configurazione completa degli endPoint da usare di default.
|
|
562
|
+
*/
|
|
563
|
+
ConfigureDefaultEndPoints(baseServerUrl, userToken) {
|
|
564
|
+
let endPointConfiguration = new EndPointConfiguration();
|
|
565
|
+
endPointConfiguration = new EndPointConfiguration();
|
|
566
|
+
endPointConfiguration.Records = {
|
|
567
|
+
GetByFormIDEndPoint: {
|
|
568
|
+
Url: baseServerUrl + "/api/v1/getall",
|
|
569
|
+
Token: userToken,
|
|
570
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
571
|
+
},
|
|
572
|
+
GetByIDEndPoint: {
|
|
573
|
+
Url: baseServerUrl + "/api/v1/getByID",
|
|
574
|
+
Token: userToken,
|
|
575
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
576
|
+
},
|
|
577
|
+
SaveEndPoint: {
|
|
578
|
+
Url: baseServerUrl + "/api/v1/save",
|
|
579
|
+
Token: userToken,
|
|
580
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
581
|
+
},
|
|
582
|
+
DuplicateEndPoint: {
|
|
583
|
+
Url: baseServerUrl + "/api/v1/duplicate",
|
|
584
|
+
Token: userToken,
|
|
585
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
586
|
+
},
|
|
587
|
+
DeleteEndPoint: {
|
|
588
|
+
Url: baseServerUrl + "/api/v1/delete",
|
|
589
|
+
Token: userToken,
|
|
590
|
+
RequestMethod: RequestMethodEnum.DELETE,
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
endPointConfiguration.Forms = {
|
|
594
|
+
GetByIDEndPoint: {
|
|
595
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
596
|
+
Token: userToken,
|
|
597
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
598
|
+
},
|
|
599
|
+
SaveEndPoint: {
|
|
600
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
601
|
+
Token: userToken,
|
|
602
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
return endPointConfiguration;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Metodo che data la configurazione di un endpoint costruisce l'url da chiamare, gli eventuali parametri
|
|
609
|
+
* da passare (nel body o nella rotta) ed effettua la chiamata. Al termine della chiamata esegue le eventuali
|
|
610
|
+
* funzioni di callback (sia in caso di successo che in caso di errore) passate in input.
|
|
611
|
+
* @param endPointData Cofigurazione dell'endpoint da chiamare.
|
|
612
|
+
* @param dynamicModuleParams Array dei parametri aggiunti dal modulo dinamico a quelli già configurati
|
|
613
|
+
* (ad esempio il record o la form da salvare oppure l'ID per recuperare una particolare entità).
|
|
614
|
+
* @param callback Metodo da eseguire in caso di successo dopo la chiamata http.
|
|
615
|
+
* NOTA: in input viene passata la risposta della chiamata stessa.
|
|
616
|
+
* @param errorCallBack Metodo da eseguire in caso di errore dopo la chiamata http.
|
|
617
|
+
* NOTA: in input viene passato l'errore generato della chiamata stessa.
|
|
618
|
+
*/
|
|
619
|
+
RunEndPointCall(endPointData, dynamicModuleParams = null, callback = null, errorCallBack = null) {
|
|
620
|
+
this.spinnerService.addRequestCounter();
|
|
621
|
+
let url = `${endPointData.Url}`;
|
|
622
|
+
let queryParams = null;
|
|
623
|
+
const bodyParams = {
|
|
624
|
+
AdditionalParams: {}
|
|
625
|
+
};
|
|
626
|
+
// Se nella configurazione sono stati definiti parametri da aggiungere alla chiamata questi vengono ciclati
|
|
627
|
+
// e aggiunti nel punto in cui devono essere usati.
|
|
628
|
+
if (endPointData.Params) {
|
|
629
|
+
endPointData.Params.forEach(p => {
|
|
630
|
+
switch (p.ParamType) {
|
|
631
|
+
case ParamTypeEnum['Query param']: {
|
|
632
|
+
const stringParam = p.ParamName + "=" + p.ParamValue;
|
|
633
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case ParamTypeEnum['In route']: {
|
|
637
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
case ParamTypeEnum['In Body']: {
|
|
641
|
+
bodyParams.AdditionalParams[p.ParamName] = p.ParamValue;
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
// Se sono stati passati parametri da aggiungere alla chiamata definiti all'interno del modulo dinamico
|
|
648
|
+
// vengono ciclati e aggiunti nel punto in cui devono essere usati dopo quelli definiti nella configurazione.
|
|
649
|
+
if (dynamicModuleParams) {
|
|
650
|
+
dynamicModuleParams.forEach(p => {
|
|
651
|
+
switch (p.ParamType) {
|
|
652
|
+
case ParamTypeEnum['Query param']: {
|
|
653
|
+
const stringParam = p.ParamName + "=" + p.ParamValue;
|
|
654
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
case ParamTypeEnum['In route']: {
|
|
658
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
case ParamTypeEnum['In Body']: {
|
|
662
|
+
bodyParams[p.ParamName] = p.ParamValue;
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
if (queryParams != null) {
|
|
669
|
+
url = (url.endsWith("/") ? url.substring(0, url.length - 1) : url) + "?" + queryParams;
|
|
670
|
+
}
|
|
671
|
+
this.http.request(endPointData.RequestMethod, url, {
|
|
672
|
+
headers: endPointData.Token ? { Authorization: endPointData.Token } : null,
|
|
673
|
+
body: ![RequestMethodEnum.DELETE, RequestMethodEnum.GET].includes(endPointData.RequestMethod) ? bodyParams : null
|
|
674
|
+
})
|
|
675
|
+
.subscribe((res) => {
|
|
676
|
+
this.spinnerService.removeRequestCounter();
|
|
677
|
+
if (callback) {
|
|
678
|
+
callback(res);
|
|
679
|
+
}
|
|
680
|
+
}, (error) => {
|
|
681
|
+
this.spinnerService.removeRequestCounter();
|
|
682
|
+
if (errorCallBack) {
|
|
683
|
+
errorCallBack(error);
|
|
684
|
+
}
|
|
685
|
+
EqpDynamicModuleDialogService.Error(error.message);
|
|
686
|
+
throw new Error(error.message);
|
|
687
|
+
});
|
|
688
|
+
}
|
|
339
689
|
};
|
|
340
690
|
UtilityHelperService.context = new Context();
|
|
341
691
|
UtilityHelperService.ctorParameters = () => [
|
|
342
|
-
{ type: FormBuilder }
|
|
692
|
+
{ type: FormBuilder },
|
|
693
|
+
{ type: HttpClient },
|
|
694
|
+
{ type: SpinnerService }
|
|
343
695
|
];
|
|
344
|
-
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder)); }, token: UtilityHelperService, providedIn: "root" });
|
|
696
|
+
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder), ɵɵinject(HttpClient), ɵɵinject(SpinnerService)); }, token: UtilityHelperService, providedIn: "root" });
|
|
345
697
|
UtilityHelperService = UtilityHelperService_1 = __decorate([
|
|
346
698
|
Injectable({
|
|
347
699
|
providedIn: 'root'
|
|
@@ -349,56 +701,214 @@ UtilityHelperService = UtilityHelperService_1 = __decorate([
|
|
|
349
701
|
], UtilityHelperService);
|
|
350
702
|
|
|
351
703
|
let EqpDynamicModuleComponent = class EqpDynamicModuleComponent {
|
|
352
|
-
constructor() {
|
|
704
|
+
constructor(utilityHelperService) {
|
|
705
|
+
this.utilityHelperService = utilityHelperService;
|
|
353
706
|
this.context = new Context();
|
|
354
|
-
this.form = new Form();
|
|
355
707
|
this.showButtons = true;
|
|
356
708
|
this.showTitle = true;
|
|
357
|
-
|
|
709
|
+
/**
|
|
710
|
+
* Url del server da chiamare per recuperare, salvare o eliminare i record.
|
|
711
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
712
|
+
*/
|
|
713
|
+
this.baseServerUrl = null;
|
|
714
|
+
/**
|
|
715
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
716
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
717
|
+
*/
|
|
718
|
+
this.userToken = null;
|
|
719
|
+
/**
|
|
720
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
721
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
722
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
723
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
724
|
+
*/
|
|
725
|
+
this.endPointConfiguration = null;
|
|
726
|
+
/**
|
|
727
|
+
* Eventi emessi quando si salva, elimina o duplica un record
|
|
728
|
+
* se non è stato specificato un endpoint da chiamare.
|
|
729
|
+
*/
|
|
358
730
|
this.saveRecord = new EventEmitter();
|
|
359
731
|
this.deleteRecord = new EventEmitter();
|
|
360
732
|
this.duplicateRecord = new EventEmitter();
|
|
733
|
+
/**
|
|
734
|
+
* Eventi emessi DOPO aver eseguito una chiamata al server per il salvataggio,
|
|
735
|
+
* l'eliminazione o la duplicazione di un record all'endpoint specificato.
|
|
736
|
+
*/
|
|
737
|
+
this.afterSaveRecord = new EventEmitter();
|
|
738
|
+
this.afterDeleteRecord = new EventEmitter();
|
|
739
|
+
this.afterDuplicateRecord = new EventEmitter();
|
|
740
|
+
this.form = new Form();
|
|
741
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
361
742
|
this.FormTypeEnum = FormTypeEnum;
|
|
362
743
|
}
|
|
363
744
|
ngOnInit() {
|
|
364
745
|
UtilityHelperService.SetContext(this.context);
|
|
746
|
+
this.configureDefaultEndPoints();
|
|
747
|
+
this.getFormByID();
|
|
748
|
+
}
|
|
749
|
+
getFormByID() {
|
|
750
|
+
const dynamicModuleParams = new Array();
|
|
751
|
+
dynamicModuleParams.push({
|
|
752
|
+
ParamName: "id",
|
|
753
|
+
ParamValue: this.formID,
|
|
754
|
+
ParamType: ParamTypeEnum['Query param']
|
|
755
|
+
});
|
|
756
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, dynamicModuleParams, (res) => {
|
|
757
|
+
this.form = res;
|
|
758
|
+
this.getRecordsByFormID();
|
|
759
|
+
}, (err) => {
|
|
760
|
+
console.log(err);
|
|
761
|
+
});
|
|
365
762
|
}
|
|
763
|
+
/**
|
|
764
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
765
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
766
|
+
* Se la proprietà "baseServerUrl" è null e non sono stati configurati i vari endpoint allora
|
|
767
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
768
|
+
*/
|
|
769
|
+
configureDefaultEndPoints() {
|
|
770
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
771
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
776
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
777
|
+
* La risposta della chiamata deve essere un array di oggetti di tipo "DynRecord"
|
|
778
|
+
* a partire dai quali vengono ricreati i Record usati nel client.
|
|
779
|
+
*/
|
|
780
|
+
getRecordsByFormID() {
|
|
781
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByFormIDEndPoint) {
|
|
782
|
+
var dynamicModuleParams = [
|
|
783
|
+
{ ParamName: 'EntID', ParamValue: this.form.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
784
|
+
];
|
|
785
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint, dynamicModuleParams, (res) => {
|
|
786
|
+
this.values = new Array();
|
|
787
|
+
res.forEach(r => {
|
|
788
|
+
var tmpRec = new Record();
|
|
789
|
+
tmpRec = JSON.parse(r.SerializedValues);
|
|
790
|
+
tmpRec.ID = r.ID;
|
|
791
|
+
tmpRec.EntID = r.EntID;
|
|
792
|
+
this.values.push(tmpRec);
|
|
793
|
+
});
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Metodo invocato quando si vuole aggiungere, visualizzare o modificare un record.
|
|
799
|
+
* Se l'evento è null vuol dire che stiamo aggiungendo un nuovo record altrimenti siamo in modifica
|
|
800
|
+
* o visualizzazione. In questi ultimi due casi, se è stato configurato un endpoint per il recupero
|
|
801
|
+
* del record completo allora viene effettuata una chiamata al server, altrimenti viene usato l'oggetto selezionato.
|
|
802
|
+
* @param event Oggetto con due proprietà:
|
|
803
|
+
* "record" = oggetto da modificare/visualizzare,
|
|
804
|
+
* "onlyView" = booleano (se TRUE siamo in visualizzazione altrimenti in modifica)
|
|
805
|
+
*/
|
|
366
806
|
onAddViewEditRecord(event) {
|
|
367
807
|
if (event != null) {
|
|
368
|
-
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
369
808
|
this.onlyView = event.onlyView;
|
|
809
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByIDEndPoint) {
|
|
810
|
+
var dynamicModuleParams = [
|
|
811
|
+
{ ParamName: "id", ParamValue: event.record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
812
|
+
];
|
|
813
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint, dynamicModuleParams, (res) => {
|
|
814
|
+
this.selectedRecord = JSON.parse(res.SerializedValues);
|
|
815
|
+
this.selectedRecord.ID = res.ID;
|
|
816
|
+
this.selectedRecord.EntID = res.EntID;
|
|
817
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
822
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
823
|
+
}
|
|
370
824
|
}
|
|
371
825
|
else {
|
|
372
826
|
this.selectedRecord = null;
|
|
373
827
|
this.onlyView = false;
|
|
828
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Metodo per salvare il record aggiunto o modificato.
|
|
833
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
834
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveRecord".
|
|
835
|
+
* @param event Oggetto di tipo Record da salvare.
|
|
836
|
+
*/
|
|
837
|
+
onSaveRecord(event) {
|
|
838
|
+
var _a;
|
|
839
|
+
if (event != null && this.endPointConfiguration != null && this.endPointConfiguration.Records.SaveEndPoint) {
|
|
840
|
+
var dynRec = new DynRecord();
|
|
841
|
+
dynRec.ID = (_a = event.ID, (_a !== null && _a !== void 0 ? _a : null));
|
|
842
|
+
dynRec.EntID = this.form.ID;
|
|
843
|
+
dynRec.Values = (event !== null && event !== void 0 ? event : null);
|
|
844
|
+
var dynamicModuleParams = [
|
|
845
|
+
{ ParamName: "Record", ParamValue: dynRec, ParamType: ParamTypeEnum['In Body'] }
|
|
846
|
+
];
|
|
847
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint, dynamicModuleParams, (res) => {
|
|
848
|
+
this.getRecordsByFormID();
|
|
849
|
+
this.afterSaveRecord.emit(event);
|
|
850
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
this.saveRecord.emit(event);
|
|
855
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
374
856
|
}
|
|
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
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* Metodo per duplicare un record precedentemente salvato.
|
|
860
|
+
* Se è stato configurato un endPoint per la duplicazione lato server allora effettua una chiamata passando nel body
|
|
861
|
+
* un oggetto contenente il record da duplicare, altrimenti scatena l'evento di output "duplicateRecord".
|
|
862
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
863
|
+
*/
|
|
389
864
|
onDuplicateRecord(record) {
|
|
390
|
-
this.
|
|
865
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DuplicateEndPoint) {
|
|
866
|
+
EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
|
|
867
|
+
var dynamicModuleParams = [
|
|
868
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
869
|
+
];
|
|
870
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.DuplicateEndPoint, dynamicModuleParams, (res) => {
|
|
871
|
+
this.getRecordsByFormID();
|
|
872
|
+
this.afterDuplicateRecord.emit(record);
|
|
873
|
+
});
|
|
874
|
+
}, false, 'Richiesta conferma');
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
this.duplicateRecord.emit(record);
|
|
878
|
+
}
|
|
391
879
|
}
|
|
880
|
+
/**
|
|
881
|
+
* Metodo per eliminare un record.
|
|
882
|
+
* Se è stato configurato un endPoint per l'eliminazione allora effettua una chiamata passando l'ID del record da eliminare
|
|
883
|
+
* come query param all'interno della rotta, altrimenti scatena l'evento di output "deleteRecord".
|
|
884
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
885
|
+
*/
|
|
392
886
|
onDeleteRecord(record) {
|
|
393
|
-
this.
|
|
887
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DeleteEndPoint) {
|
|
888
|
+
EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
|
|
889
|
+
var dynamicModuleParams = [
|
|
890
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
891
|
+
];
|
|
892
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.DeleteEndPoint, dynamicModuleParams, (res) => {
|
|
893
|
+
this.getRecordsByFormID();
|
|
894
|
+
this.afterDeleteRecord.emit(record);
|
|
895
|
+
});
|
|
896
|
+
}, false, 'Richiesta conferma');
|
|
897
|
+
}
|
|
898
|
+
else {
|
|
899
|
+
this.deleteRecord.emit(record);
|
|
900
|
+
}
|
|
394
901
|
}
|
|
395
902
|
};
|
|
903
|
+
EqpDynamicModuleComponent.ctorParameters = () => [
|
|
904
|
+
{ type: UtilityHelperService }
|
|
905
|
+
];
|
|
396
906
|
__decorate([
|
|
397
907
|
Input()
|
|
398
908
|
], EqpDynamicModuleComponent.prototype, "context", void 0);
|
|
399
909
|
__decorate([
|
|
400
910
|
Input()
|
|
401
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
911
|
+
], EqpDynamicModuleComponent.prototype, "formID", void 0);
|
|
402
912
|
__decorate([
|
|
403
913
|
Input()
|
|
404
914
|
], EqpDynamicModuleComponent.prototype, "values", void 0);
|
|
@@ -410,7 +920,13 @@ __decorate([
|
|
|
410
920
|
], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
|
|
411
921
|
__decorate([
|
|
412
922
|
Input()
|
|
413
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
923
|
+
], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
|
|
924
|
+
__decorate([
|
|
925
|
+
Input()
|
|
926
|
+
], EqpDynamicModuleComponent.prototype, "userToken", void 0);
|
|
927
|
+
__decorate([
|
|
928
|
+
Input()
|
|
929
|
+
], EqpDynamicModuleComponent.prototype, "endPointConfiguration", void 0);
|
|
414
930
|
__decorate([
|
|
415
931
|
Output()
|
|
416
932
|
], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
|
|
@@ -420,10 +936,19 @@ __decorate([
|
|
|
420
936
|
__decorate([
|
|
421
937
|
Output()
|
|
422
938
|
], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
|
|
939
|
+
__decorate([
|
|
940
|
+
Output()
|
|
941
|
+
], EqpDynamicModuleComponent.prototype, "afterSaveRecord", void 0);
|
|
942
|
+
__decorate([
|
|
943
|
+
Output()
|
|
944
|
+
], EqpDynamicModuleComponent.prototype, "afterDeleteRecord", void 0);
|
|
945
|
+
__decorate([
|
|
946
|
+
Output()
|
|
947
|
+
], EqpDynamicModuleComponent.prototype, "afterDuplicateRecord", void 0);
|
|
423
948
|
EqpDynamicModuleComponent = __decorate([
|
|
424
949
|
Component({
|
|
425
950
|
selector: 'eqp-dynamic-module',
|
|
426
|
-
template: "<add-form-record *ngIf=\"viewMode == FormTypeEnum.SCALAR\" [form]=\"form\" [record]=\"selectedRecord\"\r\n [showButtons]=\"showButtons\" [onlyView]=\"onlyView\" (saveRecordEvent)=\"
|
|
951
|
+
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
952
|
styles: ["::ng-deep mat-form-field{width:100%}"]
|
|
428
953
|
})
|
|
429
954
|
], EqpDynamicModuleComponent);
|
|
@@ -501,125 +1026,82 @@ MaterialModule = __decorate([
|
|
|
501
1026
|
})
|
|
502
1027
|
], MaterialModule);
|
|
503
1028
|
|
|
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
1029
|
let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorComponent {
|
|
604
|
-
constructor(formBuilder, dialog) {
|
|
1030
|
+
constructor(formBuilder, dialog, utilityHelperService) {
|
|
605
1031
|
this.formBuilder = formBuilder;
|
|
606
1032
|
this.dialog = dialog;
|
|
1033
|
+
this.utilityHelperService = utilityHelperService;
|
|
607
1034
|
this.context = new Context();
|
|
608
1035
|
this.form = new Form();
|
|
1036
|
+
this.formID = null;
|
|
609
1037
|
this.innerFormManagment = false;
|
|
1038
|
+
/**
|
|
1039
|
+
* Url del server da chiamare per recuerare, salvare o eliminare i record.
|
|
1040
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
1041
|
+
*/
|
|
1042
|
+
this.baseServerUrl = null;
|
|
1043
|
+
/**
|
|
1044
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
1045
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
1046
|
+
*/
|
|
1047
|
+
this.userToken = null;
|
|
1048
|
+
/**
|
|
1049
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
1050
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
1051
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
1052
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
1053
|
+
*/
|
|
1054
|
+
this.endPointConfiguration = null;
|
|
610
1055
|
this.formCompleted = false;
|
|
611
1056
|
//#region Enumeratori usati nell'html
|
|
612
1057
|
this.FormTypeEnum = FormTypeEnum;
|
|
613
1058
|
this.FormScalarTypeEnum = FormScalarTypeEnum;
|
|
614
1059
|
//#endregion
|
|
1060
|
+
/**
|
|
1061
|
+
* Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare.
|
|
1062
|
+
*/
|
|
615
1063
|
this.saveFormEvent = new EventEmitter();
|
|
1064
|
+
/**
|
|
1065
|
+
* Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato.
|
|
1066
|
+
*/
|
|
1067
|
+
this.afterSaveFormEvent = new EventEmitter();
|
|
616
1068
|
}
|
|
617
1069
|
ngOnInit() {
|
|
1070
|
+
this.configureDefaultEndPoints();
|
|
1071
|
+
this.getFormByID();
|
|
618
1072
|
if (this.context) {
|
|
619
1073
|
UtilityHelperService.SetContext(this.context);
|
|
620
1074
|
}
|
|
621
|
-
|
|
622
|
-
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
1078
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
1079
|
+
* Se la proprietà baseServerUrl è null e non sono stati configurati i vari endpoint allora
|
|
1080
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
1081
|
+
*/
|
|
1082
|
+
configureDefaultEndPoints() {
|
|
1083
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
1084
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
1085
|
+
if (this.formID) {
|
|
1086
|
+
this.endPointConfiguration.Forms.GetByIDEndPoint.Params = [{ ParamName: 'id', ParamValue: this.formID, ParamType: ParamTypeEnum['Query param'] }];
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
1092
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
1093
|
+
*/
|
|
1094
|
+
getFormByID() {
|
|
1095
|
+
if (this.formID && this.endPointConfiguration && this.endPointConfiguration.Forms && this.endPointConfiguration.Forms.GetByIDEndPoint) {
|
|
1096
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, null, (res) => {
|
|
1097
|
+
this.setFormAndConfigure(res);
|
|
1098
|
+
}, (err) => {
|
|
1099
|
+
this.setFormAndConfigure(new Form());
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
this.setFormAndConfigure();
|
|
1104
|
+
}
|
|
623
1105
|
}
|
|
624
1106
|
/**
|
|
625
1107
|
* Metodo invocato al cambio del tipo di visualizzazione della form.
|
|
@@ -777,7 +1259,7 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
777
1259
|
EqpDynamicModuleDialogService.Warning('Impossibile inserire due form di dettaglio con lo stesso nome.');
|
|
778
1260
|
throw new Error('Impossibile inserire due form di dettaglio con lo stesso nome.');
|
|
779
1261
|
}
|
|
780
|
-
|
|
1262
|
+
const innerFormField = new BaseField();
|
|
781
1263
|
innerFormField.Name = event.Name.split(" ").join("_");
|
|
782
1264
|
innerFormField.Label = event.Name;
|
|
783
1265
|
innerFormField.FieldType = FieldTypeEnum['Form di dettaglio'];
|
|
@@ -888,10 +1370,52 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
888
1370
|
}
|
|
889
1371
|
}
|
|
890
1372
|
/**
|
|
891
|
-
* Metodo
|
|
1373
|
+
* Metodo per salvare la form creata alla fine del wizard.
|
|
1374
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
1375
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
|
|
1376
|
+
* NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
|
|
1377
|
+
* Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
892
1378
|
*/
|
|
893
1379
|
saveForm() {
|
|
894
|
-
this.
|
|
1380
|
+
if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
|
|
1381
|
+
// Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
1382
|
+
// Necessario per far funzionare correttamente il FieldConverter del server.
|
|
1383
|
+
const formToSave = JSON.parse(JSON.stringify(this.form));
|
|
1384
|
+
/*formToSave.Fields = [];
|
|
1385
|
+
this.form.Fields.forEach(field => {
|
|
1386
|
+
formToSave.Fields.push({
|
|
1387
|
+
FieldType: field.FieldType,
|
|
1388
|
+
Value: JSON.parse(JSON.stringify(field))
|
|
1389
|
+
});
|
|
1390
|
+
});*/
|
|
1391
|
+
formToSave.Fields = [];
|
|
1392
|
+
this.form.Fields.forEach(field => {
|
|
1393
|
+
let fld = UtilityHelperService.GetFieldType(field);
|
|
1394
|
+
formToSave.Fields.push(fld);
|
|
1395
|
+
});
|
|
1396
|
+
const dynamicModuleParams = [
|
|
1397
|
+
{ ParamName: "Form", ParamValue: formToSave, ParamType: ParamTypeEnum['In Body'] }
|
|
1398
|
+
];
|
|
1399
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, (res) => {
|
|
1400
|
+
EqpDynamicModuleDialogService.Success("Form salvata con successo!");
|
|
1401
|
+
this.afterSaveFormEvent.emit(this.form);
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
this.saveFormEvent.emit(this.form);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
//#region FUNZIONI PRIVATE
|
|
1409
|
+
/**
|
|
1410
|
+
* Metodo per impostare la form e configurare colonne/FormGourp.
|
|
1411
|
+
* @param form Form da utilizzare.
|
|
1412
|
+
*/
|
|
1413
|
+
setFormAndConfigure(form = null) {
|
|
1414
|
+
if (form != null) {
|
|
1415
|
+
this.form = form;
|
|
1416
|
+
}
|
|
1417
|
+
this.configureColumns();
|
|
1418
|
+
this.createFormForm();
|
|
895
1419
|
}
|
|
896
1420
|
/**
|
|
897
1421
|
* Configura le colonne per le tabelle necessarie alla creazione della form:
|
|
@@ -1082,7 +1606,8 @@ let EqpDynamicModuleConfiguratorComponent = class EqpDynamicModuleConfiguratorCo
|
|
|
1082
1606
|
};
|
|
1083
1607
|
EqpDynamicModuleConfiguratorComponent.ctorParameters = () => [
|
|
1084
1608
|
{ type: FormBuilder },
|
|
1085
|
-
{ type: MatDialog }
|
|
1609
|
+
{ type: MatDialog },
|
|
1610
|
+
{ type: UtilityHelperService }
|
|
1086
1611
|
];
|
|
1087
1612
|
__decorate([
|
|
1088
1613
|
Input()
|
|
@@ -1090,9 +1615,21 @@ __decorate([
|
|
|
1090
1615
|
__decorate([
|
|
1091
1616
|
Input()
|
|
1092
1617
|
], EqpDynamicModuleConfiguratorComponent.prototype, "form", void 0);
|
|
1618
|
+
__decorate([
|
|
1619
|
+
Input()
|
|
1620
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "formID", void 0);
|
|
1093
1621
|
__decorate([
|
|
1094
1622
|
Input()
|
|
1095
1623
|
], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
|
|
1624
|
+
__decorate([
|
|
1625
|
+
Input()
|
|
1626
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);
|
|
1627
|
+
__decorate([
|
|
1628
|
+
Input()
|
|
1629
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "userToken", void 0);
|
|
1630
|
+
__decorate([
|
|
1631
|
+
Input()
|
|
1632
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "endPointConfiguration", void 0);
|
|
1096
1633
|
__decorate([
|
|
1097
1634
|
ViewChild('fieldsTable', { static: false })
|
|
1098
1635
|
], EqpDynamicModuleConfiguratorComponent.prototype, "fieldsTable", void 0);
|
|
@@ -1114,10 +1651,13 @@ __decorate([
|
|
|
1114
1651
|
__decorate([
|
|
1115
1652
|
Output()
|
|
1116
1653
|
], EqpDynamicModuleConfiguratorComponent.prototype, "saveFormEvent", void 0);
|
|
1654
|
+
__decorate([
|
|
1655
|
+
Output()
|
|
1656
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "afterSaveFormEvent", void 0);
|
|
1117
1657
|
EqpDynamicModuleConfiguratorComponent = __decorate([
|
|
1118
1658
|
Component({
|
|
1119
1659
|
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>",
|
|
1660
|
+
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
1661
|
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
1662
|
})
|
|
1123
1663
|
], EqpDynamicModuleConfiguratorComponent);
|
|
@@ -1167,6 +1707,8 @@ var DateTimeTypeEnum;
|
|
|
1167
1707
|
/**Lista di valori */
|
|
1168
1708
|
class ListValueField extends BaseField {
|
|
1169
1709
|
}
|
|
1710
|
+
class ButtonImage {
|
|
1711
|
+
}
|
|
1170
1712
|
var ListPresentationEnum;
|
|
1171
1713
|
(function (ListPresentationEnum) {
|
|
1172
1714
|
ListPresentationEnum[ListPresentationEnum["Combo box"] = 1] = "Combo box";
|
|
@@ -1177,10 +1719,11 @@ var ListPresentationEnum;
|
|
|
1177
1719
|
|
|
1178
1720
|
let AddFormFieldComponent = class AddFormFieldComponent {
|
|
1179
1721
|
//#endregion
|
|
1180
|
-
constructor(formBuilder, enumHelper, dialog) {
|
|
1722
|
+
constructor(formBuilder, enumHelper, dialog, cdr) {
|
|
1181
1723
|
this.formBuilder = formBuilder;
|
|
1182
1724
|
this.enumHelper = enumHelper;
|
|
1183
1725
|
this.dialog = dialog;
|
|
1726
|
+
this.cdr = cdr;
|
|
1184
1727
|
this.fieldTypesToExclude = [FieldTypeEnum['Form di dettaglio']];
|
|
1185
1728
|
this.keyValueObject = { key: '', value: '' };
|
|
1186
1729
|
this.availableColSpanSizes = [];
|
|
@@ -1193,6 +1736,8 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1193
1736
|
this.BoolPresentantioEnum = BoolPresentantioEnum;
|
|
1194
1737
|
this.DateTimeTypeEnum = DateTimeTypeEnum;
|
|
1195
1738
|
this.ListPresentationEnum = ListPresentationEnum;
|
|
1739
|
+
this.TextMaskEnum = TextMaskEnum;
|
|
1740
|
+
this.AttachmentType = AttachmentType;
|
|
1196
1741
|
}
|
|
1197
1742
|
ngOnInit() {
|
|
1198
1743
|
if (!this.fieldTypesToExclude.includes(FieldTypeEnum['Form di dettaglio'])) {
|
|
@@ -1230,7 +1775,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1230
1775
|
Required: [this.field.Required],
|
|
1231
1776
|
FieldType: [this.field.FieldType, Validators.required],
|
|
1232
1777
|
Formula: [this.field.Formula],
|
|
1233
|
-
|
|
1778
|
+
ColSpanSizes: [this.field.ColSpanSizes],
|
|
1234
1779
|
InListView: [this.field.InListView],
|
|
1235
1780
|
});
|
|
1236
1781
|
if (this.formFieldsGroups) {
|
|
@@ -1248,7 +1793,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1248
1793
|
if (restoreField)
|
|
1249
1794
|
this.restoreBaseFieldProperties();
|
|
1250
1795
|
this.createFieldForm();
|
|
1251
|
-
this.
|
|
1796
|
+
this.onColSpanSizeSelect();
|
|
1252
1797
|
this.fieldTypeFormTemplate = null;
|
|
1253
1798
|
switch (this.field.FieldType) {
|
|
1254
1799
|
case FieldTypeEnum['Campo di testo']:
|
|
@@ -1272,13 +1817,16 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1272
1817
|
this.fieldFormGroup.addControl('IsOnlyDate', new FormControl(this.field.IsOnlyDate, Validators.required));
|
|
1273
1818
|
this.fieldFormGroup.addControl('MinDate', new FormControl(this.field.MinDate));
|
|
1274
1819
|
this.fieldFormGroup.addControl('MaxDate', new FormControl(this.field.MaxDate));
|
|
1820
|
+
this.fieldFormGroup.addControl('DateFormat', new FormControl(this.field.DateFormat));
|
|
1275
1821
|
this.fieldTypeFormTemplate = this.dateFieldFormTemplate;
|
|
1276
1822
|
break;
|
|
1277
1823
|
case FieldTypeEnum['Campo numerico']:
|
|
1278
1824
|
this.fieldFormGroup.addControl('IsInteger', new FormControl(this.field.IsInteger));
|
|
1279
1825
|
this.fieldFormGroup.addControl('MinValue', new FormControl(this.field.MinValue));
|
|
1280
1826
|
this.fieldFormGroup.addControl('MaxValue', new FormControl(this.field.MaxValue));
|
|
1281
|
-
this.fieldFormGroup.addControl('
|
|
1827
|
+
this.fieldFormGroup.addControl('DecimalSeparator', new FormControl(this.field.DecimalSeparator));
|
|
1828
|
+
this.fieldFormGroup.addControl('DecimalPrecision', new FormControl(this.field.DecimalPrecision));
|
|
1829
|
+
this.fieldFormGroup.addControl('ThousandsSeparator', new FormControl(this.field.ThousandsSeparator));
|
|
1282
1830
|
this.fieldFormGroup.addControl('CurrencySymbol', new FormControl(this.field.CurrencySymbol));
|
|
1283
1831
|
this.fieldTypeFormTemplate = this.numericFieldFormTemplate;
|
|
1284
1832
|
break;
|
|
@@ -1362,15 +1910,48 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1362
1910
|
* seleziona la classe "col-sm-6", al change del valore questo metodo rimuove dalla select
|
|
1363
1911
|
* tutti gli altri valori per la grandezza di schermo selezionata.
|
|
1364
1912
|
*/
|
|
1365
|
-
|
|
1913
|
+
onColSpanSizeSelect() {
|
|
1366
1914
|
// Recupero l'array degli oggetti chiave-valore che rappreseta l'enumeratore
|
|
1367
1915
|
let colSizeClassEnumArray = this.enumHelper.getEnumArray(ColSpanSizesEnum, false, null);
|
|
1368
1916
|
// Costruisco l'array delle classi selezionate dall'utente in formato stringa
|
|
1369
|
-
let selectedDimensions = this.field.
|
|
1917
|
+
let selectedDimensions = this.field.ColSpanSizes ? this.field.ColSpanSizes.map(col => ColSpanSizesEnum[col]) : [];
|
|
1370
1918
|
// Filtro i valori ottenuti dall'enumeratore per escludere tutti i valori per le
|
|
1371
1919
|
// grandezze di schermo già selezionatead esclusione dei valori selezionati.
|
|
1372
1920
|
this.availableColSpanSizes = colSizeClassEnumArray.filter((value) => !selectedDimensions.find(col => value.value.includes(col.substring(4, 6)) && value.value != col));
|
|
1373
1921
|
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Metodo invocato al cambio del tipo di visualizzazione scelta per i campi di tipo elenco generico.
|
|
1924
|
+
* Se viene scelta la visualizzazione ad immagini svuota la lista delle coppie chiave-valore inserite
|
|
1925
|
+
* in precedenza, altrimenti svuota la lista delle immagini caricate.
|
|
1926
|
+
*/
|
|
1927
|
+
onPresentationModeChange() {
|
|
1928
|
+
if (this.field.PresentationMode === ListPresentationEnum.Immagini) {
|
|
1929
|
+
this.field.ValuePairs = null;
|
|
1930
|
+
}
|
|
1931
|
+
else {
|
|
1932
|
+
this.field.ButtonImageList = null;
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Metodo invocato quando viene caricato il componente eqp-attachments per caricare le immagini da usare
|
|
1937
|
+
* nella visualizzazione ad immagini dei campi di tipo "Elenco generico". Aggiunge due colonne a quelle
|
|
1938
|
+
* configurate nel componente in cui l'utente può indicare chiave e valore della scelta.
|
|
1939
|
+
* @param component Istanza del componente eqp-attachments in cui effettuare la modifica.
|
|
1940
|
+
*/
|
|
1941
|
+
configureButtonImagesColumns(component) {
|
|
1942
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonKey", display: "Label", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
1943
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonValue", display: "Valore", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
1944
|
+
this.cdr.detectChanges();
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Metodo invocato al salvataggio degli allegati quando viene configurato un campo di tipo "Elenco generico"
|
|
1948
|
+
* con il tipo di visualizzazione ad immagini. Intercetta l'elenco aggiornato delle immagini caricate e lo
|
|
1949
|
+
* memorizza nell'oggetto field corrente.
|
|
1950
|
+
* @param attachments Array aggiornato degli allegati caricati.
|
|
1951
|
+
*/
|
|
1952
|
+
catchButtonImagesChange(attachments) {
|
|
1953
|
+
this.field.ButtonImageList = attachments;
|
|
1954
|
+
}
|
|
1374
1955
|
/**
|
|
1375
1956
|
* Metodo chiamato al keyup degli input testuali che prevedono l'aggiunta del valore inserito in un array.
|
|
1376
1957
|
* Se l'utente preme il tasto invio, in base al tipo di campo che sta inserendo/modificando, questo metodo
|
|
@@ -1515,7 +2096,14 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1515
2096
|
}
|
|
1516
2097
|
switch (this.field.FieldType) {
|
|
1517
2098
|
case FieldTypeEnum['Elenco generico']:
|
|
1518
|
-
|
|
2099
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2100
|
+
return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
|
|
2101
|
+
}
|
|
2102
|
+
else {
|
|
2103
|
+
return (!this.field.ButtonImageList
|
|
2104
|
+
|| this.field.ButtonImageList.length === 0
|
|
2105
|
+
|| !!this.field.ButtonImageList.find(i => !i.ButtonKey || !i.ButtonValue));
|
|
2106
|
+
}
|
|
1519
2107
|
case FieldTypeEnum.Lookup:
|
|
1520
2108
|
return !this.field.FieldNames || this.field.FieldNames.length === 0;
|
|
1521
2109
|
default:
|
|
@@ -1549,7 +2137,7 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1549
2137
|
this.field.Required = tmpBaseField.Required;
|
|
1550
2138
|
this.field.FieldType = tmpBaseField.FieldType;
|
|
1551
2139
|
this.field.Formula = tmpBaseField.Formula;
|
|
1552
|
-
this.field.
|
|
2140
|
+
this.field.ColSpanSizes = tmpBaseField.ColSpanSizes;
|
|
1553
2141
|
this.field.FieldGroup = tmpBaseField.FieldGroup;
|
|
1554
2142
|
}
|
|
1555
2143
|
}
|
|
@@ -1625,7 +2213,8 @@ let AddFormFieldComponent = class AddFormFieldComponent {
|
|
|
1625
2213
|
AddFormFieldComponent.ctorParameters = () => [
|
|
1626
2214
|
{ type: FormBuilder },
|
|
1627
2215
|
{ type: EnumHelper },
|
|
1628
|
-
{ type: MatDialog }
|
|
2216
|
+
{ type: MatDialog },
|
|
2217
|
+
{ type: ChangeDetectorRef }
|
|
1629
2218
|
];
|
|
1630
2219
|
__decorate([
|
|
1631
2220
|
Input()
|
|
@@ -1678,10 +2267,13 @@ __decorate([
|
|
|
1678
2267
|
__decorate([
|
|
1679
2268
|
ViewChild('dialogMetadata', { static: true })
|
|
1680
2269
|
], AddFormFieldComponent.prototype, "dialogMetadata", void 0);
|
|
2270
|
+
__decorate([
|
|
2271
|
+
ViewChild('buttonImagesKeyValueInputColumn', { static: true })
|
|
2272
|
+
], AddFormFieldComponent.prototype, "buttonImagesKeyValueInputColumn", void 0);
|
|
1681
2273
|
AddFormFieldComponent = __decorate([
|
|
1682
2274
|
Component({
|
|
1683
2275
|
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>",
|
|
2276
|
+
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
2277
|
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
2278
|
})
|
|
1687
2279
|
], AddFormFieldComponent);
|
|
@@ -1689,6 +2281,7 @@ AddFormFieldComponent = __decorate([
|
|
|
1689
2281
|
let TextFieldTemplateComponent = class TextFieldTemplateComponent {
|
|
1690
2282
|
constructor() {
|
|
1691
2283
|
this.recordChange = new EventEmitter();
|
|
2284
|
+
this.InputMaskEnum = TextMaskEnum;
|
|
1692
2285
|
}
|
|
1693
2286
|
ngOnInit() {
|
|
1694
2287
|
}
|
|
@@ -1699,6 +2292,20 @@ let TextFieldTemplateComponent = class TextFieldTemplateComponent {
|
|
|
1699
2292
|
this.updateField();
|
|
1700
2293
|
}
|
|
1701
2294
|
}
|
|
2295
|
+
getInputType() {
|
|
2296
|
+
switch (this.field.TextMask) {
|
|
2297
|
+
case TextMaskEnum.Email:
|
|
2298
|
+
return 'email';
|
|
2299
|
+
case TextMaskEnum.Password:
|
|
2300
|
+
return 'password';
|
|
2301
|
+
case TextMaskEnum.Telefono:
|
|
2302
|
+
return 'tel';
|
|
2303
|
+
case TextMaskEnum.Url:
|
|
2304
|
+
return 'url';
|
|
2305
|
+
default:
|
|
2306
|
+
return 'text';
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
1702
2309
|
/**
|
|
1703
2310
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
1704
2311
|
*/
|
|
@@ -1728,7 +2335,7 @@ __decorate([
|
|
|
1728
2335
|
TextFieldTemplateComponent = __decorate([
|
|
1729
2336
|
Component({
|
|
1730
2337
|
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=\"
|
|
2338
|
+
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
2339
|
styles: [""]
|
|
1733
2340
|
})
|
|
1734
2341
|
], TextFieldTemplateComponent);
|
|
@@ -1779,7 +2386,7 @@ __decorate([
|
|
|
1779
2386
|
BooleanFieldTemplateComponent = __decorate([
|
|
1780
2387
|
Component({
|
|
1781
2388
|
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>",
|
|
2389
|
+
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
2390
|
styles: [""]
|
|
1784
2391
|
})
|
|
1785
2392
|
], BooleanFieldTemplateComponent);
|
|
@@ -1844,7 +2451,7 @@ __decorate([
|
|
|
1844
2451
|
DateFieldTemplateComponent = __decorate([
|
|
1845
2452
|
Component({
|
|
1846
2453
|
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>",
|
|
2454
|
+
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
2455
|
styles: [""]
|
|
1849
2456
|
})
|
|
1850
2457
|
], DateFieldTemplateComponent);
|
|
@@ -1891,7 +2498,7 @@ __decorate([
|
|
|
1891
2498
|
TextareaFieldTemplateComponent = __decorate([
|
|
1892
2499
|
Component({
|
|
1893
2500
|
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>",
|
|
2501
|
+
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
2502
|
styles: [""]
|
|
1896
2503
|
})
|
|
1897
2504
|
], TextareaFieldTemplateComponent);
|
|
@@ -1932,10 +2539,17 @@ let NumericFieldTemplateComponent = class NumericFieldTemplateComponent {
|
|
|
1932
2539
|
*/
|
|
1933
2540
|
configureEqpNumericOptions() {
|
|
1934
2541
|
this.eqpNumericOptions.prefix = this.field.CurrencySymbol ? this.field.CurrencySymbol : "";
|
|
2542
|
+
this.eqpNumericOptions.inputMode = this.field.CurrencySymbol ? EqpNumericInputMode.FINANCIAL : EqpNumericInputMode.NATURAL;
|
|
1935
2543
|
if (this.field.MinValue != null && this.field.MinValue != undefined)
|
|
1936
2544
|
this.eqpNumericOptions.min = this.field.MinValue;
|
|
1937
2545
|
if (this.field.MaxValue != null && this.field.MaxValue != undefined)
|
|
1938
2546
|
this.eqpNumericOptions.max = this.field.MaxValue;
|
|
2547
|
+
if (this.field.DecimalSeparator != null && this.field.DecimalSeparator != undefined)
|
|
2548
|
+
this.eqpNumericOptions.decimal = this.field.DecimalSeparator;
|
|
2549
|
+
if (this.field.ThousandsSeparator != null && this.field.ThousandsSeparator != undefined)
|
|
2550
|
+
this.eqpNumericOptions.thousands = this.field.ThousandsSeparator;
|
|
2551
|
+
if (this.field.DecimalPrecision != null && this.field.DecimalPrecision != undefined)
|
|
2552
|
+
this.eqpNumericOptions.precision = this.field.DecimalPrecision;
|
|
1939
2553
|
}
|
|
1940
2554
|
};
|
|
1941
2555
|
__decorate([
|
|
@@ -1950,7 +2564,7 @@ __decorate([
|
|
|
1950
2564
|
NumericFieldTemplateComponent = __decorate([
|
|
1951
2565
|
Component({
|
|
1952
2566
|
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>",
|
|
2567
|
+
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
2568
|
styles: [""]
|
|
1955
2569
|
})
|
|
1956
2570
|
], NumericFieldTemplateComponent);
|
|
@@ -1986,26 +2600,17 @@ let ListValueFieldTemplateComponent = class ListValueFieldTemplateComponent {
|
|
|
1986
2600
|
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
1987
2601
|
}
|
|
1988
2602
|
}
|
|
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
2603
|
/**
|
|
2000
2604
|
* Metodo invocato quando viene selezionata un'opzione nella visualizzazione a button
|
|
2001
2605
|
* @param data Rappresenta l'oggetto selezionato
|
|
2002
2606
|
*/
|
|
2003
2607
|
buttonSelectClick(data) {
|
|
2608
|
+
data.Selected = !data.Selected;
|
|
2004
2609
|
if (this.field.IsMultiChoiche) {
|
|
2005
|
-
data.Selected = !data.Selected;
|
|
2006
2610
|
this.updateSelected(false);
|
|
2007
2611
|
}
|
|
2008
2612
|
else {
|
|
2613
|
+
this.arrayData.filter(d => d.Key != data.Key && d.Value != data.Value).forEach(d => d.Selected = false);
|
|
2009
2614
|
this.record[this.field.Name] = data.Value;
|
|
2010
2615
|
}
|
|
2011
2616
|
this.onRecordValueChange();
|
|
@@ -2033,16 +2638,22 @@ let ListValueFieldTemplateComponent = class ListValueFieldTemplateComponent {
|
|
|
2033
2638
|
* Metodo per creare un array di oggetti del tipo { Key: string, Value: any } da usare come sorgente dati per la eqp-select.
|
|
2034
2639
|
*/
|
|
2035
2640
|
setArrayData() {
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2641
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2642
|
+
Object.keys(this.field.ValuePairs).forEach(k => { this.createArrayDataElement(k, this.field.ValuePairs[k]); });
|
|
2643
|
+
}
|
|
2644
|
+
else {
|
|
2645
|
+
this.field.ButtonImageList.forEach(i => { this.createArrayDataElement(i.ButtonKey, i.ButtonValue, 'data:' + i.FileContentType + ';base64,' + i.FileDataBase64); });
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
createArrayDataElement(key, value, imgUrl = null) {
|
|
2649
|
+
var isOptionSelected;
|
|
2650
|
+
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
2651
|
+
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
2652
|
+
}
|
|
2653
|
+
else {
|
|
2654
|
+
isOptionSelected = this.record[this.field.Name] === value;
|
|
2655
|
+
}
|
|
2656
|
+
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
2046
2657
|
}
|
|
2047
2658
|
/**
|
|
2048
2659
|
* Metodo per aggiornare il valore e il validator del FormControl associato al campo.
|
|
@@ -2063,8 +2674,8 @@ __decorate([
|
|
|
2063
2674
|
ListValueFieldTemplateComponent = __decorate([
|
|
2064
2675
|
Component({
|
|
2065
2676
|
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}"]
|
|
2677
|
+
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>",
|
|
2678
|
+
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
2679
|
})
|
|
2069
2680
|
], ListValueFieldTemplateComponent);
|
|
2070
2681
|
|
|
@@ -2227,7 +2838,7 @@ __decorate([
|
|
|
2227
2838
|
AttachmentFieldTemplateComponent = __decorate([
|
|
2228
2839
|
Component({
|
|
2229
2840
|
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>",
|
|
2841
|
+
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
2842
|
styles: [""]
|
|
2232
2843
|
})
|
|
2233
2844
|
], AttachmentFieldTemplateComponent);
|
|
@@ -2416,7 +3027,7 @@ __decorate([
|
|
|
2416
3027
|
ImageFieldTemplateComponent = __decorate([
|
|
2417
3028
|
Component({
|
|
2418
3029
|
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>",
|
|
3030
|
+
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
3031
|
styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
|
|
2421
3032
|
})
|
|
2422
3033
|
], ImageFieldTemplateComponent);
|
|
@@ -2494,30 +3105,14 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2494
3105
|
* @param record Record da duplicare.
|
|
2495
3106
|
*/
|
|
2496
3107
|
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
3108
|
this.onDuplicateRecord.emit(record);
|
|
2508
|
-
//TODO
|
|
2509
3109
|
}
|
|
2510
3110
|
/**
|
|
2511
3111
|
* Metodo per eliminare un record dalla lista.
|
|
2512
3112
|
* @param record Record da eliminare selezionato sulla eqp-table.
|
|
2513
3113
|
*/
|
|
2514
3114
|
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
3115
|
this.onDeleteRecord.emit(record);
|
|
2520
|
-
// TODO
|
|
2521
3116
|
}
|
|
2522
3117
|
/**
|
|
2523
3118
|
* Metodo per creare la configurazione delle colonne per la eqp-table.
|
|
@@ -2559,7 +3154,7 @@ let ListFormRecordComponent = class ListFormRecordComponent {
|
|
|
2559
3154
|
column.format = "dd/MM/yyyy HH:mm";
|
|
2560
3155
|
}
|
|
2561
3156
|
else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
|
|
2562
|
-
column.format = "dd/MM/yyyy";
|
|
3157
|
+
column.format = field.DateFormat ? field.DateFormat.replace("DD", "dd") : "dd/MM/yyyy";
|
|
2563
3158
|
}
|
|
2564
3159
|
}
|
|
2565
3160
|
break;
|
|
@@ -2646,9 +3241,6 @@ ListFormRecordComponent = __decorate([
|
|
|
2646
3241
|
})
|
|
2647
3242
|
], ListFormRecordComponent);
|
|
2648
3243
|
|
|
2649
|
-
class Record {
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
3244
|
let AddFormRecordComponent = class AddFormRecordComponent {
|
|
2653
3245
|
constructor(cdr, utilityService) {
|
|
2654
3246
|
this.cdr = cdr;
|
|
@@ -2767,7 +3359,7 @@ __decorate([
|
|
|
2767
3359
|
AddFormRecordComponent = __decorate([
|
|
2768
3360
|
Component({
|
|
2769
3361
|
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>",
|
|
3362
|
+
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
3363
|
styles: [""]
|
|
2772
3364
|
})
|
|
2773
3365
|
], AddFormRecordComponent);
|
|
@@ -2888,11 +3480,30 @@ __decorate([
|
|
|
2888
3480
|
DynamicModuleFieldComponent = __decorate([
|
|
2889
3481
|
Component({
|
|
2890
3482
|
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>",
|
|
3483
|
+
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
3484
|
styles: [""]
|
|
2893
3485
|
})
|
|
2894
3486
|
], DynamicModuleFieldComponent);
|
|
2895
3487
|
|
|
3488
|
+
let SpinnerComponent = class SpinnerComponent {
|
|
3489
|
+
constructor(spinnerService) {
|
|
3490
|
+
this.spinnerService = spinnerService;
|
|
3491
|
+
this.isLoading = this.spinnerService.isLoading;
|
|
3492
|
+
}
|
|
3493
|
+
ngOnInit() {
|
|
3494
|
+
}
|
|
3495
|
+
};
|
|
3496
|
+
SpinnerComponent.ctorParameters = () => [
|
|
3497
|
+
{ type: SpinnerService }
|
|
3498
|
+
];
|
|
3499
|
+
SpinnerComponent = __decorate([
|
|
3500
|
+
Component({
|
|
3501
|
+
selector: 'eqp-dynamic-module-spinner',
|
|
3502
|
+
template: "<div class=\"eqp-splash-screen\" *ngIf=\"isLoading | async\">\r\n <div id=\"loader\"></div>\r\n</div>",
|
|
3503
|
+
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}"]
|
|
3504
|
+
})
|
|
3505
|
+
], SpinnerComponent);
|
|
3506
|
+
|
|
2896
3507
|
let EqpDynamicModuleModule = class EqpDynamicModuleModule {
|
|
2897
3508
|
};
|
|
2898
3509
|
EqpDynamicModuleModule = __decorate([
|
|
@@ -2912,6 +3523,7 @@ EqpDynamicModuleModule = __decorate([
|
|
|
2912
3523
|
ListFormRecordComponent,
|
|
2913
3524
|
AddFormRecordComponent,
|
|
2914
3525
|
DynamicModuleFieldComponent,
|
|
3526
|
+
SpinnerComponent,
|
|
2915
3527
|
],
|
|
2916
3528
|
imports: [
|
|
2917
3529
|
BrowserModule,
|
|
@@ -2958,10 +3570,6 @@ class NumericField extends BaseField {
|
|
|
2958
3570
|
class TextareaField extends BaseField {
|
|
2959
3571
|
}
|
|
2960
3572
|
|
|
2961
|
-
/**Campo di testo */
|
|
2962
|
-
class TextField extends BaseField {
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
3573
|
/*
|
|
2966
3574
|
* Public API Surface of eqp-dynamic-module
|
|
2967
3575
|
*/
|
|
@@ -2970,5 +3578,5 @@ class TextField extends BaseField {
|
|
|
2970
3578
|
* Generated bundle index. Do not edit.
|
|
2971
3579
|
*/
|
|
2972
3580
|
|
|
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,
|
|
3581
|
+
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
3582
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.js.map
|