@eqproject/eqp-dynamic-module 0.0.3 → 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 +1166 -334
- 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 +107 -16
- 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 +10 -21
- 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 +148 -6
- 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 +6 -2
- package/esm2015/lib/models/endPointConfiguration.model.js +23 -0
- package/esm2015/lib/models/fields/dateField.model.js +1 -1
- package/esm2015/lib/models/fields/imageField.model.js +5 -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 +107 -16
- 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 +10 -21
- 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 +157 -6
- 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 +6 -2
- package/esm5/lib/models/endPointConfiguration.model.js +33 -0
- package/esm5/lib/models/fields/dateField.model.js +1 -1
- package/esm5/lib/models/fields/imageField.model.js +9 -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 +1021 -239
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +1160 -335
- 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 +42 -3
- package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +1 -17
- package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +51 -2
- package/lib/components/private/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/imageField.model.d.ts +10 -4
- 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 +5 -3
- package/public-api.d.ts +2 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { __extends, __decorate } from 'tslib';
|
|
1
|
+
import { __extends, __decorate, __awaiter, __generator } 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,12 +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';
|
|
43
|
+
import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';
|
|
40
44
|
import { EqpFiltersModule } from '@eqproject/eqp-filters';
|
|
41
|
-
import { EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
42
|
-
import Swal from 'sweetalert2';
|
|
45
|
+
import { EqpNumericInputMode, EqpNumericModule } from '@eqproject/eqp-numeric';
|
|
43
46
|
import { BrowserModule } from '@angular/platform-browser';
|
|
44
47
|
|
|
45
48
|
var Context = /** @class */ (function () {
|
|
@@ -54,6 +57,36 @@ var ContextUser = /** @class */ (function () {
|
|
|
54
57
|
return ContextUser;
|
|
55
58
|
}());
|
|
56
59
|
|
|
60
|
+
var EndPointConfiguration = /** @class */ (function () {
|
|
61
|
+
function EndPointConfiguration() {
|
|
62
|
+
}
|
|
63
|
+
return EndPointConfiguration;
|
|
64
|
+
}());
|
|
65
|
+
var EndPointData = /** @class */ (function () {
|
|
66
|
+
function EndPointData() {
|
|
67
|
+
}
|
|
68
|
+
return EndPointData;
|
|
69
|
+
}());
|
|
70
|
+
var EndPointDataParams = /** @class */ (function () {
|
|
71
|
+
function EndPointDataParams() {
|
|
72
|
+
this.ParamValue = null;
|
|
73
|
+
}
|
|
74
|
+
return EndPointDataParams;
|
|
75
|
+
}());
|
|
76
|
+
var ParamTypeEnum;
|
|
77
|
+
(function (ParamTypeEnum) {
|
|
78
|
+
ParamTypeEnum[ParamTypeEnum["Query param"] = 1] = "Query param";
|
|
79
|
+
ParamTypeEnum[ParamTypeEnum["In route"] = 2] = "In route";
|
|
80
|
+
ParamTypeEnum[ParamTypeEnum["In Body"] = 3] = "In Body";
|
|
81
|
+
})(ParamTypeEnum || (ParamTypeEnum = {}));
|
|
82
|
+
var RequestMethodEnum;
|
|
83
|
+
(function (RequestMethodEnum) {
|
|
84
|
+
RequestMethodEnum["GET"] = "GET";
|
|
85
|
+
RequestMethodEnum["POST"] = "POST";
|
|
86
|
+
RequestMethodEnum["PUT"] = "PUT";
|
|
87
|
+
RequestMethodEnum["DELETE"] = "DELETE";
|
|
88
|
+
})(RequestMethodEnum || (RequestMethodEnum = {}));
|
|
89
|
+
|
|
57
90
|
/**
|
|
58
91
|
* Classe base che implementa la valorizzazione dell'ID (se null) con una nuova GUID
|
|
59
92
|
* in creazione dell'oggetto.
|
|
@@ -100,6 +133,136 @@ var FormScalarTypeEnum;
|
|
|
100
133
|
FormScalarTypeEnum[FormScalarTypeEnum["In accordion"] = 4] = "In accordion"; //GROUPED_BY_ACCORDION
|
|
101
134
|
})(FormScalarTypeEnum || (FormScalarTypeEnum = {}));
|
|
102
135
|
|
|
136
|
+
var Record = /** @class */ (function () {
|
|
137
|
+
function Record() {
|
|
138
|
+
}
|
|
139
|
+
return Record;
|
|
140
|
+
}());
|
|
141
|
+
var DynRecord = /** @class */ (function () {
|
|
142
|
+
function DynRecord() {
|
|
143
|
+
this.Values = {};
|
|
144
|
+
}
|
|
145
|
+
return DynRecord;
|
|
146
|
+
}());
|
|
147
|
+
|
|
148
|
+
var EqpDynamicModuleDialogService = /** @class */ (function () {
|
|
149
|
+
function EqpDynamicModuleDialogService() {
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
|
|
153
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
154
|
+
* @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
|
|
155
|
+
*/
|
|
156
|
+
EqpDynamicModuleDialogService.Success = function (message, title) {
|
|
157
|
+
if (title === void 0) { title = null; }
|
|
158
|
+
var currentTitle = title != null ? title : 'Operazione completata con successo.';
|
|
159
|
+
Swal.fire(currentTitle, message, 'success');
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
163
|
+
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
164
|
+
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
165
|
+
*/
|
|
166
|
+
EqpDynamicModuleDialogService.Error = function (message, title) {
|
|
167
|
+
if (title === void 0) { title = null; }
|
|
168
|
+
var currentTitle = title != null ? title : 'Errore';
|
|
169
|
+
if (Array.isArray(message)) {
|
|
170
|
+
currentTitle = title != null ? title : 'Errore';
|
|
171
|
+
var htmlErrors = message.join("<br>");
|
|
172
|
+
Swal.fire({
|
|
173
|
+
title: currentTitle,
|
|
174
|
+
html: htmlErrors,
|
|
175
|
+
icon: 'error'
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
Swal.fire(currentTitle, message, 'error');
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
184
|
+
* CONFERMA lancia la funzione di callback passata come parametro
|
|
185
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
186
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
187
|
+
*/
|
|
188
|
+
EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
|
|
189
|
+
if (isWarning === void 0) { isWarning = false; }
|
|
190
|
+
if (title === void 0) { title = null; }
|
|
191
|
+
if (customWidth === void 0) { customWidth = null; }
|
|
192
|
+
var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
193
|
+
if (Array.isArray(message)) {
|
|
194
|
+
var htmlErrors = message.join("<br>");
|
|
195
|
+
Swal.fire({
|
|
196
|
+
title: currentTitle,
|
|
197
|
+
html: htmlErrors,
|
|
198
|
+
width: customWidth ? customWidth : '32rem',
|
|
199
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
200
|
+
showCancelButton: true,
|
|
201
|
+
allowOutsideClick: false,
|
|
202
|
+
allowEscapeKey: false
|
|
203
|
+
}).then(function (result) {
|
|
204
|
+
if (result.value && confirmCallback) {
|
|
205
|
+
confirmCallback();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
Swal.fire({
|
|
211
|
+
title: currentTitle,
|
|
212
|
+
text: message,
|
|
213
|
+
width: customWidth ? customWidth : '32rem',
|
|
214
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
215
|
+
showCancelButton: true,
|
|
216
|
+
allowOutsideClick: false,
|
|
217
|
+
allowEscapeKey: false
|
|
218
|
+
}).then(function (result) {
|
|
219
|
+
if (result.value && confirmCallback) {
|
|
220
|
+
confirmCallback();
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
227
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
228
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
229
|
+
*/
|
|
230
|
+
EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
|
|
231
|
+
if (title === void 0) { title = null; }
|
|
232
|
+
if (isToast === void 0) { isToast = null; }
|
|
233
|
+
var currentTitle = title != null ? title : "Informazione:";
|
|
234
|
+
Swal.fire(currentTitle, message, 'info');
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
238
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
239
|
+
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
240
|
+
*/
|
|
241
|
+
EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
|
|
242
|
+
if (title === void 0) { title = null; }
|
|
243
|
+
if (isToast === void 0) { isToast = null; }
|
|
244
|
+
var currentTitle = title != null ? title : "Attenzione!";
|
|
245
|
+
if (Array.isArray(message)) {
|
|
246
|
+
var htmlWarnings = message.join("<br>");
|
|
247
|
+
Swal.fire({
|
|
248
|
+
title: currentTitle,
|
|
249
|
+
html: htmlWarnings,
|
|
250
|
+
icon: 'warning'
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
Swal.fire(currentTitle, message, 'warning');
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
|
|
258
|
+
EqpDynamicModuleDialogService = __decorate([
|
|
259
|
+
Injectable({
|
|
260
|
+
providedIn: 'root'
|
|
261
|
+
})
|
|
262
|
+
], EqpDynamicModuleDialogService);
|
|
263
|
+
return EqpDynamicModuleDialogService;
|
|
264
|
+
}());
|
|
265
|
+
|
|
103
266
|
/**
|
|
104
267
|
* Contiene le informazioni di base del campo, indipendentemente dal tipo.
|
|
105
268
|
* Questa classe è volutamente astratta perché il tipo di campo è dettato dal tipo
|
|
@@ -140,6 +303,24 @@ var ColSpanSizesEnum;
|
|
|
140
303
|
ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"] = 12] = "col-lg-12";
|
|
141
304
|
})(ColSpanSizesEnum || (ColSpanSizesEnum = {}));
|
|
142
305
|
|
|
306
|
+
/**Campo di testo */
|
|
307
|
+
var TextField = /** @class */ (function (_super) {
|
|
308
|
+
__extends(TextField, _super);
|
|
309
|
+
function TextField() {
|
|
310
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
311
|
+
}
|
|
312
|
+
return TextField;
|
|
313
|
+
}(BaseField));
|
|
314
|
+
var TextMaskEnum;
|
|
315
|
+
(function (TextMaskEnum) {
|
|
316
|
+
TextMaskEnum[TextMaskEnum["Password"] = 1] = "Password";
|
|
317
|
+
TextMaskEnum[TextMaskEnum["Email"] = 2] = "Email";
|
|
318
|
+
TextMaskEnum[TextMaskEnum["Telefono"] = 3] = "Telefono";
|
|
319
|
+
TextMaskEnum[TextMaskEnum["Url"] = 4] = "Url";
|
|
320
|
+
})(TextMaskEnum || (TextMaskEnum = {}));
|
|
321
|
+
var UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
|
|
322
|
+
var TelRegex = '([+]?[0-9]{10,14})';
|
|
323
|
+
|
|
143
324
|
var ArrayValidators = /** @class */ (function () {
|
|
144
325
|
function ArrayValidators() {
|
|
145
326
|
}
|
|
@@ -162,18 +343,73 @@ var ArrayValidators = /** @class */ (function () {
|
|
|
162
343
|
return ArrayValidators;
|
|
163
344
|
}());
|
|
164
345
|
|
|
346
|
+
var SpinnerService = /** @class */ (function () {
|
|
347
|
+
function SpinnerService() {
|
|
348
|
+
this.isLoading = new Subject();
|
|
349
|
+
this.requestsCount = 0;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Mostra lo spinner
|
|
353
|
+
*/
|
|
354
|
+
SpinnerService.prototype.show = function () {
|
|
355
|
+
var _this = this;
|
|
356
|
+
setTimeout(function () {
|
|
357
|
+
_this.isLoading.next(true);
|
|
358
|
+
}, 100);
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Nasconde lo spinner
|
|
362
|
+
*/
|
|
363
|
+
SpinnerService.prototype.hide = function () {
|
|
364
|
+
var _this = this;
|
|
365
|
+
setTimeout(function () {
|
|
366
|
+
_this.isLoading.next(false);
|
|
367
|
+
}, 100);
|
|
368
|
+
};
|
|
369
|
+
SpinnerService.prototype.addRequestCounter = function () {
|
|
370
|
+
this.requestsCount++;
|
|
371
|
+
this.show();
|
|
372
|
+
};
|
|
373
|
+
SpinnerService.prototype.removeRequestCounter = function () {
|
|
374
|
+
this.requestsCount--;
|
|
375
|
+
if (this.requestsCount == 0)
|
|
376
|
+
this.hide();
|
|
377
|
+
};
|
|
378
|
+
SpinnerService.ɵprov = ɵɵdefineInjectable({ factory: function SpinnerService_Factory() { return new SpinnerService(); }, token: SpinnerService, providedIn: "root" });
|
|
379
|
+
SpinnerService = __decorate([
|
|
380
|
+
Injectable({
|
|
381
|
+
providedIn: 'root'
|
|
382
|
+
})
|
|
383
|
+
], SpinnerService);
|
|
384
|
+
return SpinnerService;
|
|
385
|
+
}());
|
|
386
|
+
|
|
165
387
|
var UtilityHelperService = /** @class */ (function () {
|
|
166
|
-
function UtilityHelperService(formBuilder) {
|
|
388
|
+
function UtilityHelperService(formBuilder, http, spinnerService) {
|
|
167
389
|
this.formBuilder = formBuilder;
|
|
390
|
+
this.http = http;
|
|
391
|
+
this.spinnerService = spinnerService;
|
|
168
392
|
}
|
|
169
393
|
UtilityHelperService_1 = UtilityHelperService;
|
|
170
394
|
UtilityHelperService.EvaluateFieldFormula = function (formula, rec, ctx) {
|
|
171
|
-
var evaluatedValue = eval(formula
|
|
395
|
+
var evaluatedValue = eval(formula);
|
|
172
396
|
return (evaluatedValue ? evaluatedValue : null);
|
|
173
397
|
};
|
|
174
398
|
UtilityHelperService.SetContext = function (ctx) {
|
|
175
399
|
this.context = ctx;
|
|
176
400
|
};
|
|
401
|
+
UtilityHelperService.GetFieldType = function (field) {
|
|
402
|
+
switch (field.FieldType) {
|
|
403
|
+
case FieldTypeEnum["Campo di testo"]: {
|
|
404
|
+
var t = Object.assign(new TextField, field);
|
|
405
|
+
return t;
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
default: {
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
};
|
|
177
413
|
/**
|
|
178
414
|
* Metodo per impostare i valori da suggerire nell'autocomplete per i campi in cui l'utente deve scrivere comandi javascript.
|
|
179
415
|
* In base all'ultimo carattere digitato viene impostato un elenco di oggetti o proprietà che l'utente ha a disposizione in quel momento.
|
|
@@ -221,7 +457,7 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
221
457
|
// funzione javascript. Controllo la parola che l'utente sta digitando e se fa parte di uno degli oggetti a disposizione
|
|
222
458
|
// o una proprietà di essi allora suggerisco i possibili match.
|
|
223
459
|
else {
|
|
224
|
-
var
|
|
460
|
+
var availableOptions_1 = [];
|
|
225
461
|
// Prendo tutti i blocchi di caratteri digitati dall'utente
|
|
226
462
|
var allFormulaWords = typedFormula.split(" ");
|
|
227
463
|
// Prendo l'ultimo blocco di caratteri digitato dall'utente
|
|
@@ -230,7 +466,7 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
230
466
|
// sui "." e imposto i suggerimenti in base al path della prorpietà che si sta digitando.
|
|
231
467
|
if (!new RegExp("[^0-9a-zA-Z_.]").test(lastTypedString)) {
|
|
232
468
|
var propertyPath = lastTypedString.split(".");
|
|
233
|
-
var
|
|
469
|
+
var lastTypedWork_1 = propertyPath[propertyPath.length - 1];
|
|
234
470
|
var propertiesToCheck = [];
|
|
235
471
|
if (propertyPath.length == 1) {
|
|
236
472
|
propertiesToCheck = ["rec", "ctx"];
|
|
@@ -244,15 +480,15 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
244
480
|
else if (propertyPath.length > 1 && propertyPath[propertyPath.length - 2] === "rec") {
|
|
245
481
|
propertiesToCheck = availableRecProperties;
|
|
246
482
|
}
|
|
247
|
-
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
483
|
+
// Eseguo il controllo sulle proprietà recuperate, aggiungo ai suggerimenti tutti i nomi che iniziano con
|
|
248
484
|
// quello che sta digitando l'utente.
|
|
249
485
|
propertiesToCheck.forEach(function (prop) {
|
|
250
|
-
if (prop.startsWith(
|
|
251
|
-
|
|
486
|
+
if (prop.startsWith(lastTypedWork_1)) {
|
|
487
|
+
availableOptions_1.push({ label: prop, value: typedFormula + prop.substring(lastTypedWork_1.length, prop.length) });
|
|
252
488
|
}
|
|
253
489
|
});
|
|
254
490
|
}
|
|
255
|
-
autocompleteOptions =
|
|
491
|
+
autocompleteOptions = availableOptions_1;
|
|
256
492
|
}
|
|
257
493
|
return autocompleteOptions;
|
|
258
494
|
};
|
|
@@ -342,6 +578,17 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
342
578
|
if (field.MinLenght) {
|
|
343
579
|
validators.push(Validators.minLength(field.MinLenght));
|
|
344
580
|
}
|
|
581
|
+
switch (field.TextMask) {
|
|
582
|
+
case TextMaskEnum.Url:
|
|
583
|
+
validators.push(Validators.pattern(UrlRegex));
|
|
584
|
+
break;
|
|
585
|
+
case TextMaskEnum.Email:
|
|
586
|
+
validators.push(Validators.email);
|
|
587
|
+
break;
|
|
588
|
+
case TextMaskEnum.Telefono:
|
|
589
|
+
validators.push(Validators.pattern(TelRegex));
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
345
592
|
break;
|
|
346
593
|
case FieldTypeEnum["Area di testo"]:
|
|
347
594
|
if (field.MaxLenght) {
|
|
@@ -364,12 +611,151 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
364
611
|
}
|
|
365
612
|
return new FormControl(record[field.Name], validators);
|
|
366
613
|
};
|
|
614
|
+
/**
|
|
615
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
616
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
617
|
+
* @param baseServerUrl Stringa dell'url base del server (es: "http://localhost:5000").
|
|
618
|
+
* @param userToken Token dell'utente loggato da usare per autenticarsi se necessario.
|
|
619
|
+
* @returns Resituisce la configurazione completa degli endPoint da usare di default.
|
|
620
|
+
*/
|
|
621
|
+
UtilityHelperService.prototype.ConfigureDefaultEndPoints = function (baseServerUrl, userToken) {
|
|
622
|
+
var endPointConfiguration = new EndPointConfiguration();
|
|
623
|
+
endPointConfiguration = new EndPointConfiguration();
|
|
624
|
+
endPointConfiguration.Records = {
|
|
625
|
+
GetByFormIDEndPoint: {
|
|
626
|
+
Url: baseServerUrl + "/api/v1/getall",
|
|
627
|
+
Token: userToken,
|
|
628
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
629
|
+
},
|
|
630
|
+
GetByIDEndPoint: {
|
|
631
|
+
Url: baseServerUrl + "/api/v1/getByID",
|
|
632
|
+
Token: userToken,
|
|
633
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
634
|
+
},
|
|
635
|
+
SaveEndPoint: {
|
|
636
|
+
Url: baseServerUrl + "/api/v1/save",
|
|
637
|
+
Token: userToken,
|
|
638
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
639
|
+
},
|
|
640
|
+
DuplicateEndPoint: {
|
|
641
|
+
Url: baseServerUrl + "/api/v1/duplicate",
|
|
642
|
+
Token: userToken,
|
|
643
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
644
|
+
},
|
|
645
|
+
DeleteEndPoint: {
|
|
646
|
+
Url: baseServerUrl + "/api/v1/delete",
|
|
647
|
+
Token: userToken,
|
|
648
|
+
RequestMethod: RequestMethodEnum.DELETE,
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
endPointConfiguration.Forms = {
|
|
652
|
+
GetByIDEndPoint: {
|
|
653
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
654
|
+
Token: userToken,
|
|
655
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
656
|
+
},
|
|
657
|
+
SaveEndPoint: {
|
|
658
|
+
Url: baseServerUrl + "/api/conf/form",
|
|
659
|
+
Token: userToken,
|
|
660
|
+
RequestMethod: RequestMethodEnum.POST,
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
return endPointConfiguration;
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* Metodo che data la configurazione di un endpoint costruisce l'url da chiamare, gli eventuali parametri
|
|
667
|
+
* da passare (nel body o nella rotta) ed effettua la chiamata. Al termine della chiamata esegue le eventuali
|
|
668
|
+
* funzioni di callback (sia in caso di successo che in caso di errore) passate in input.
|
|
669
|
+
* @param endPointData Cofigurazione dell'endpoint da chiamare.
|
|
670
|
+
* @param dynamicModuleParams Array dei parametri aggiunti dal modulo dinamico a quelli già configurati
|
|
671
|
+
* (ad esempio il record o la form da salvare oppure l'ID per recuperare una particolare entità).
|
|
672
|
+
* @param callback Metodo da eseguire in caso di successo dopo la chiamata http.
|
|
673
|
+
* NOTA: in input viene passata la risposta della chiamata stessa.
|
|
674
|
+
* @param errorCallBack Metodo da eseguire in caso di errore dopo la chiamata http.
|
|
675
|
+
* NOTA: in input viene passato l'errore generato della chiamata stessa.
|
|
676
|
+
*/
|
|
677
|
+
UtilityHelperService.prototype.RunEndPointCall = function (endPointData, dynamicModuleParams, callback, errorCallBack) {
|
|
678
|
+
var _this = this;
|
|
679
|
+
if (dynamicModuleParams === void 0) { dynamicModuleParams = null; }
|
|
680
|
+
if (callback === void 0) { callback = null; }
|
|
681
|
+
if (errorCallBack === void 0) { errorCallBack = null; }
|
|
682
|
+
this.spinnerService.addRequestCounter();
|
|
683
|
+
var url = "" + endPointData.Url;
|
|
684
|
+
var queryParams = null;
|
|
685
|
+
var bodyParams = {
|
|
686
|
+
AdditionalParams: {}
|
|
687
|
+
};
|
|
688
|
+
// Se nella configurazione sono stati definiti parametri da aggiungere alla chiamata questi vengono ciclati
|
|
689
|
+
// e aggiunti nel punto in cui devono essere usati.
|
|
690
|
+
if (endPointData.Params) {
|
|
691
|
+
endPointData.Params.forEach(function (p) {
|
|
692
|
+
switch (p.ParamType) {
|
|
693
|
+
case ParamTypeEnum['Query param']: {
|
|
694
|
+
var stringParam = p.ParamName + "=" + p.ParamValue;
|
|
695
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
case ParamTypeEnum['In route']: {
|
|
699
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
case ParamTypeEnum['In Body']: {
|
|
703
|
+
bodyParams.AdditionalParams[p.ParamName] = p.ParamValue;
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
// Se sono stati passati parametri da aggiungere alla chiamata definiti all'interno del modulo dinamico
|
|
710
|
+
// vengono ciclati e aggiunti nel punto in cui devono essere usati dopo quelli definiti nella configurazione.
|
|
711
|
+
if (dynamicModuleParams) {
|
|
712
|
+
dynamicModuleParams.forEach(function (p) {
|
|
713
|
+
switch (p.ParamType) {
|
|
714
|
+
case ParamTypeEnum['Query param']: {
|
|
715
|
+
var stringParam = p.ParamName + "=" + p.ParamValue;
|
|
716
|
+
queryParams = (queryParams == null ? "" : queryParams + "&") + stringParam;
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
case ParamTypeEnum['In route']: {
|
|
720
|
+
url = url + (url.endsWith("/") ? "" : "/") + p.ParamValue;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
case ParamTypeEnum['In Body']: {
|
|
724
|
+
bodyParams[p.ParamName] = p.ParamValue;
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
if (queryParams != null) {
|
|
731
|
+
url = (url.endsWith("/") ? url.substring(0, url.length - 1) : url) + "?" + queryParams;
|
|
732
|
+
}
|
|
733
|
+
this.http.request(endPointData.RequestMethod, url, {
|
|
734
|
+
headers: endPointData.Token ? { Authorization: endPointData.Token } : null,
|
|
735
|
+
body: ![RequestMethodEnum.DELETE, RequestMethodEnum.GET].includes(endPointData.RequestMethod) ? bodyParams : null
|
|
736
|
+
})
|
|
737
|
+
.subscribe(function (res) {
|
|
738
|
+
_this.spinnerService.removeRequestCounter();
|
|
739
|
+
if (callback) {
|
|
740
|
+
callback(res);
|
|
741
|
+
}
|
|
742
|
+
}, function (error) {
|
|
743
|
+
_this.spinnerService.removeRequestCounter();
|
|
744
|
+
if (errorCallBack) {
|
|
745
|
+
errorCallBack(error);
|
|
746
|
+
}
|
|
747
|
+
EqpDynamicModuleDialogService.Error(error.message);
|
|
748
|
+
throw new Error(error.message);
|
|
749
|
+
});
|
|
750
|
+
};
|
|
367
751
|
var UtilityHelperService_1;
|
|
368
752
|
UtilityHelperService.context = new Context();
|
|
369
753
|
UtilityHelperService.ctorParameters = function () { return [
|
|
370
|
-
{ type: FormBuilder }
|
|
754
|
+
{ type: FormBuilder },
|
|
755
|
+
{ type: HttpClient },
|
|
756
|
+
{ type: SpinnerService }
|
|
371
757
|
]; };
|
|
372
|
-
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder)); }, token: UtilityHelperService, providedIn: "root" });
|
|
758
|
+
UtilityHelperService.ɵprov = ɵɵdefineInjectable({ factory: function UtilityHelperService_Factory() { return new UtilityHelperService(ɵɵinject(FormBuilder), ɵɵinject(HttpClient), ɵɵinject(SpinnerService)); }, token: UtilityHelperService, providedIn: "root" });
|
|
373
759
|
UtilityHelperService = UtilityHelperService_1 = __decorate([
|
|
374
760
|
Injectable({
|
|
375
761
|
providedIn: 'root'
|
|
@@ -379,55 +765,219 @@ var UtilityHelperService = /** @class */ (function () {
|
|
|
379
765
|
}());
|
|
380
766
|
|
|
381
767
|
var EqpDynamicModuleComponent = /** @class */ (function () {
|
|
382
|
-
function EqpDynamicModuleComponent() {
|
|
768
|
+
function EqpDynamicModuleComponent(utilityHelperService) {
|
|
769
|
+
this.utilityHelperService = utilityHelperService;
|
|
383
770
|
this.context = new Context();
|
|
384
|
-
this.form = new Form();
|
|
385
771
|
this.showButtons = true;
|
|
386
772
|
this.showTitle = true;
|
|
387
|
-
|
|
773
|
+
/**
|
|
774
|
+
* Url del server da chiamare per recuperare, salvare o eliminare i record.
|
|
775
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
776
|
+
*/
|
|
777
|
+
this.baseServerUrl = null;
|
|
778
|
+
/**
|
|
779
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
780
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
781
|
+
*/
|
|
782
|
+
this.userToken = null;
|
|
783
|
+
/**
|
|
784
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
785
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
786
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
787
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
788
|
+
*/
|
|
789
|
+
this.endPointConfiguration = null;
|
|
790
|
+
/**
|
|
791
|
+
* Eventi emessi quando si salva, elimina o duplica un record
|
|
792
|
+
* se non è stato specificato un endpoint da chiamare.
|
|
793
|
+
*/
|
|
388
794
|
this.saveRecord = new EventEmitter();
|
|
389
795
|
this.deleteRecord = new EventEmitter();
|
|
390
796
|
this.duplicateRecord = new EventEmitter();
|
|
797
|
+
/**
|
|
798
|
+
* Eventi emessi DOPO aver eseguito una chiamata al server per il salvataggio,
|
|
799
|
+
* l'eliminazione o la duplicazione di un record all'endpoint specificato.
|
|
800
|
+
*/
|
|
801
|
+
this.afterSaveRecord = new EventEmitter();
|
|
802
|
+
this.afterDeleteRecord = new EventEmitter();
|
|
803
|
+
this.afterDuplicateRecord = new EventEmitter();
|
|
804
|
+
this.form = new Form();
|
|
805
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
391
806
|
this.FormTypeEnum = FormTypeEnum;
|
|
392
807
|
}
|
|
393
808
|
EqpDynamicModuleComponent.prototype.ngOnInit = function () {
|
|
394
809
|
UtilityHelperService.SetContext(this.context);
|
|
810
|
+
this.configureDefaultEndPoints();
|
|
811
|
+
this.getFormByID();
|
|
812
|
+
};
|
|
813
|
+
EqpDynamicModuleComponent.prototype.getFormByID = function () {
|
|
814
|
+
var _this = this;
|
|
815
|
+
var dynamicModuleParams = new Array();
|
|
816
|
+
dynamicModuleParams.push({
|
|
817
|
+
ParamName: "id",
|
|
818
|
+
ParamValue: this.formID,
|
|
819
|
+
ParamType: ParamTypeEnum['Query param']
|
|
820
|
+
});
|
|
821
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, dynamicModuleParams, function (res) {
|
|
822
|
+
_this.form = res;
|
|
823
|
+
_this.getRecordsByFormID();
|
|
824
|
+
}, function (err) {
|
|
825
|
+
console.log(err);
|
|
826
|
+
});
|
|
395
827
|
};
|
|
828
|
+
/**
|
|
829
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
830
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
831
|
+
* Se la proprietà "baseServerUrl" è null e non sono stati configurati i vari endpoint allora
|
|
832
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
833
|
+
*/
|
|
834
|
+
EqpDynamicModuleComponent.prototype.configureDefaultEndPoints = function () {
|
|
835
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
836
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
841
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
842
|
+
* La risposta della chiamata deve essere un array di oggetti di tipo "DynRecord"
|
|
843
|
+
* a partire dai quali vengono ricreati i Record usati nel client.
|
|
844
|
+
*/
|
|
845
|
+
EqpDynamicModuleComponent.prototype.getRecordsByFormID = function () {
|
|
846
|
+
var _this = this;
|
|
847
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByFormIDEndPoint) {
|
|
848
|
+
var dynamicModuleParams = [
|
|
849
|
+
{ ParamName: 'EntID', ParamValue: this.form.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
850
|
+
];
|
|
851
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint, dynamicModuleParams, function (res) {
|
|
852
|
+
_this.values = new Array();
|
|
853
|
+
res.forEach(function (r) {
|
|
854
|
+
var tmpRec = new Record();
|
|
855
|
+
tmpRec = JSON.parse(r.SerializedValues);
|
|
856
|
+
tmpRec.ID = r.ID;
|
|
857
|
+
tmpRec.EntID = r.EntID;
|
|
858
|
+
_this.values.push(tmpRec);
|
|
859
|
+
});
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
/**
|
|
864
|
+
* Metodo invocato quando si vuole aggiungere, visualizzare o modificare un record.
|
|
865
|
+
* Se l'evento è null vuol dire che stiamo aggiungendo un nuovo record altrimenti siamo in modifica
|
|
866
|
+
* o visualizzazione. In questi ultimi due casi, se è stato configurato un endpoint per il recupero
|
|
867
|
+
* del record completo allora viene effettuata una chiamata al server, altrimenti viene usato l'oggetto selezionato.
|
|
868
|
+
* @param event Oggetto con due proprietà:
|
|
869
|
+
* "record" = oggetto da modificare/visualizzare,
|
|
870
|
+
* "onlyView" = booleano (se TRUE siamo in visualizzazione altrimenti in modifica)
|
|
871
|
+
*/
|
|
396
872
|
EqpDynamicModuleComponent.prototype.onAddViewEditRecord = function (event) {
|
|
873
|
+
var _this = this;
|
|
397
874
|
if (event != null) {
|
|
398
|
-
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
399
875
|
this.onlyView = event.onlyView;
|
|
876
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records && this.endPointConfiguration.Records.GetByIDEndPoint) {
|
|
877
|
+
var dynamicModuleParams = [
|
|
878
|
+
{ ParamName: "id", ParamValue: event.record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
879
|
+
];
|
|
880
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint, dynamicModuleParams, function (res) {
|
|
881
|
+
_this.selectedRecord = JSON.parse(res.SerializedValues);
|
|
882
|
+
_this.selectedRecord.ID = res.ID;
|
|
883
|
+
_this.selectedRecord.EntID = res.EntID;
|
|
884
|
+
_this.viewMode = FormTypeEnum.SCALAR;
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
this.selectedRecord = JSON.parse(JSON.stringify(event.record));
|
|
889
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
890
|
+
}
|
|
400
891
|
}
|
|
401
892
|
else {
|
|
402
893
|
this.selectedRecord = null;
|
|
403
894
|
this.onlyView = false;
|
|
895
|
+
this.viewMode = FormTypeEnum.SCALAR;
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
/**
|
|
899
|
+
* Metodo per salvare il record aggiunto o modificato.
|
|
900
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
901
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveRecord".
|
|
902
|
+
* @param event Oggetto di tipo Record da salvare.
|
|
903
|
+
*/
|
|
904
|
+
EqpDynamicModuleComponent.prototype.onSaveRecord = function (event) {
|
|
905
|
+
var _this = this;
|
|
906
|
+
var _a;
|
|
907
|
+
if (event != null && this.endPointConfiguration != null && this.endPointConfiguration.Records.SaveEndPoint) {
|
|
908
|
+
var dynRec = new DynRecord();
|
|
909
|
+
dynRec.ID = (_a = event.ID, (_a !== null && _a !== void 0 ? _a : null));
|
|
910
|
+
dynRec.EntID = this.form.ID;
|
|
911
|
+
dynRec.Values = (event !== null && event !== void 0 ? event : null);
|
|
912
|
+
var dynamicModuleParams = [
|
|
913
|
+
{ ParamName: "Record", ParamValue: dynRec, ParamType: ParamTypeEnum['In Body'] }
|
|
914
|
+
];
|
|
915
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint, dynamicModuleParams, function (res) {
|
|
916
|
+
_this.getRecordsByFormID();
|
|
917
|
+
_this.afterSaveRecord.emit(event);
|
|
918
|
+
_this.viewMode = FormTypeEnum.LIST;
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
this.saveRecord.emit(event);
|
|
923
|
+
this.viewMode = FormTypeEnum.LIST;
|
|
404
924
|
}
|
|
405
|
-
this.viewMode = FormTypeEnum.SCALAR;
|
|
406
|
-
};
|
|
407
|
-
EqpDynamicModuleComponent.prototype.onSaveForm = function (event) {
|
|
408
|
-
//TODO: Salvare il record!
|
|
409
|
-
// if (event != null) {
|
|
410
|
-
// if (event.ID && this.values.find(v => v.ID == event.ID)) {
|
|
411
|
-
// this.values[this.values.findIndex(v => v.ID == event.ID)] = event;
|
|
412
|
-
// } else {
|
|
413
|
-
// this.values.push(event);
|
|
414
|
-
// }
|
|
415
|
-
// }
|
|
416
|
-
this.saveRecord.emit(event);
|
|
417
|
-
this.viewMode = FormTypeEnum.LIST;
|
|
418
925
|
};
|
|
926
|
+
/**
|
|
927
|
+
* Metodo per duplicare un record precedentemente salvato.
|
|
928
|
+
* Se è stato configurato un endPoint per la duplicazione lato server allora effettua una chiamata passando nel body
|
|
929
|
+
* un oggetto contenente il record da duplicare, altrimenti scatena l'evento di output "duplicateRecord".
|
|
930
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
931
|
+
*/
|
|
419
932
|
EqpDynamicModuleComponent.prototype.onDuplicateRecord = function (record) {
|
|
420
|
-
this
|
|
933
|
+
var _this = this;
|
|
934
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DuplicateEndPoint) {
|
|
935
|
+
EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', function () {
|
|
936
|
+
var dynamicModuleParams = [
|
|
937
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
938
|
+
];
|
|
939
|
+
_this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DuplicateEndPoint, dynamicModuleParams, function (res) {
|
|
940
|
+
_this.getRecordsByFormID();
|
|
941
|
+
_this.afterDuplicateRecord.emit(record);
|
|
942
|
+
});
|
|
943
|
+
}, false, 'Richiesta conferma');
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
this.duplicateRecord.emit(record);
|
|
947
|
+
}
|
|
421
948
|
};
|
|
949
|
+
/**
|
|
950
|
+
* Metodo per eliminare un record.
|
|
951
|
+
* Se è stato configurato un endPoint per l'eliminazione allora effettua una chiamata passando l'ID del record da eliminare
|
|
952
|
+
* come query param all'interno della rotta, altrimenti scatena l'evento di output "deleteRecord".
|
|
953
|
+
* @param record Oggetto di tipo Record da duplicare.
|
|
954
|
+
*/
|
|
422
955
|
EqpDynamicModuleComponent.prototype.onDeleteRecord = function (record) {
|
|
423
|
-
this
|
|
956
|
+
var _this = this;
|
|
957
|
+
if (this.endPointConfiguration && this.endPointConfiguration.Records.DeleteEndPoint) {
|
|
958
|
+
EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', function () {
|
|
959
|
+
var dynamicModuleParams = [
|
|
960
|
+
{ ParamName: "id", ParamValue: record.ID, ParamType: ParamTypeEnum['Query param'] }
|
|
961
|
+
];
|
|
962
|
+
_this.utilityHelperService.RunEndPointCall(_this.endPointConfiguration.Records.DeleteEndPoint, dynamicModuleParams, function (res) {
|
|
963
|
+
_this.getRecordsByFormID();
|
|
964
|
+
_this.afterDeleteRecord.emit(record);
|
|
965
|
+
});
|
|
966
|
+
}, false, 'Richiesta conferma');
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
this.deleteRecord.emit(record);
|
|
970
|
+
}
|
|
424
971
|
};
|
|
972
|
+
EqpDynamicModuleComponent.ctorParameters = function () { return [
|
|
973
|
+
{ type: UtilityHelperService }
|
|
974
|
+
]; };
|
|
425
975
|
__decorate([
|
|
426
976
|
Input()
|
|
427
977
|
], EqpDynamicModuleComponent.prototype, "context", void 0);
|
|
428
978
|
__decorate([
|
|
429
979
|
Input()
|
|
430
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
980
|
+
], EqpDynamicModuleComponent.prototype, "formID", void 0);
|
|
431
981
|
__decorate([
|
|
432
982
|
Input()
|
|
433
983
|
], EqpDynamicModuleComponent.prototype, "values", void 0);
|
|
@@ -439,7 +989,13 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
|
|
|
439
989
|
], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
|
|
440
990
|
__decorate([
|
|
441
991
|
Input()
|
|
442
|
-
], EqpDynamicModuleComponent.prototype, "
|
|
992
|
+
], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
|
|
993
|
+
__decorate([
|
|
994
|
+
Input()
|
|
995
|
+
], EqpDynamicModuleComponent.prototype, "userToken", void 0);
|
|
996
|
+
__decorate([
|
|
997
|
+
Input()
|
|
998
|
+
], EqpDynamicModuleComponent.prototype, "endPointConfiguration", void 0);
|
|
443
999
|
__decorate([
|
|
444
1000
|
Output()
|
|
445
1001
|
], EqpDynamicModuleComponent.prototype, "saveRecord", void 0);
|
|
@@ -449,220 +1005,178 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
|
|
|
449
1005
|
__decorate([
|
|
450
1006
|
Output()
|
|
451
1007
|
], EqpDynamicModuleComponent.prototype, "duplicateRecord", void 0);
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
NgModule({
|
|
467
|
-
imports: [
|
|
468
|
-
MatCheckboxModule,
|
|
469
|
-
MatButtonModule,
|
|
470
|
-
MatInputModule,
|
|
471
|
-
MatAutocompleteModule,
|
|
472
|
-
MatDatepickerModule,
|
|
473
|
-
MatFormFieldModule,
|
|
474
|
-
MatRadioModule,
|
|
475
|
-
MatSelectModule,
|
|
476
|
-
MatSliderModule,
|
|
477
|
-
MatSlideToggleModule,
|
|
478
|
-
MatMenuModule,
|
|
479
|
-
MatSidenavModule,
|
|
480
|
-
MatToolbarModule,
|
|
481
|
-
MatListModule,
|
|
482
|
-
MatGridListModule,
|
|
483
|
-
MatCardModule,
|
|
484
|
-
MatStepperModule,
|
|
485
|
-
MatTabsModule,
|
|
486
|
-
MatExpansionModule,
|
|
487
|
-
MatButtonToggleModule,
|
|
488
|
-
MatChipsModule,
|
|
489
|
-
MatIconModule,
|
|
490
|
-
MatProgressSpinnerModule,
|
|
491
|
-
MatProgressBarModule,
|
|
492
|
-
MatDialogModule,
|
|
493
|
-
MatTooltipModule,
|
|
494
|
-
MatSnackBarModule,
|
|
495
|
-
MatTableModule,
|
|
496
|
-
MatSortModule,
|
|
497
|
-
MatPaginatorModule,
|
|
498
|
-
MatDatepickerModule,
|
|
499
|
-
MatNativeDateModule
|
|
500
|
-
],
|
|
501
|
-
exports: [
|
|
502
|
-
MatCheckboxModule,
|
|
503
|
-
MatButtonModule,
|
|
504
|
-
MatInputModule,
|
|
505
|
-
MatAutocompleteModule,
|
|
506
|
-
MatDatepickerModule,
|
|
507
|
-
MatFormFieldModule,
|
|
508
|
-
MatRadioModule,
|
|
509
|
-
MatSelectModule,
|
|
510
|
-
MatSliderModule,
|
|
511
|
-
MatSlideToggleModule,
|
|
512
|
-
MatMenuModule,
|
|
513
|
-
MatSidenavModule,
|
|
514
|
-
MatToolbarModule,
|
|
515
|
-
MatListModule,
|
|
516
|
-
MatGridListModule,
|
|
517
|
-
MatCardModule,
|
|
518
|
-
MatStepperModule,
|
|
519
|
-
MatTabsModule,
|
|
520
|
-
MatExpansionModule,
|
|
521
|
-
MatButtonToggleModule,
|
|
522
|
-
MatChipsModule,
|
|
523
|
-
MatIconModule,
|
|
524
|
-
MatProgressSpinnerModule,
|
|
525
|
-
MatProgressBarModule,
|
|
526
|
-
MatDialogModule,
|
|
527
|
-
MatTooltipModule,
|
|
528
|
-
MatSnackBarModule,
|
|
529
|
-
MatTableModule,
|
|
530
|
-
MatSortModule,
|
|
531
|
-
MatPaginatorModule
|
|
532
|
-
],
|
|
533
|
-
})
|
|
534
|
-
], MaterialModule);
|
|
535
|
-
return MaterialModule;
|
|
536
|
-
}());
|
|
537
|
-
|
|
538
|
-
var EqpDynamicModuleDialogService = /** @class */ (function () {
|
|
539
|
-
function EqpDynamicModuleDialogService() {
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
543
|
-
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
544
|
-
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
545
|
-
*/
|
|
546
|
-
EqpDynamicModuleDialogService.Error = function (message, title) {
|
|
547
|
-
if (title === void 0) { title = null; }
|
|
548
|
-
var currentTitle = title != null ? title : 'Errore';
|
|
549
|
-
if (Array.isArray(message)) {
|
|
550
|
-
currentTitle = title != null ? title : 'Errore';
|
|
551
|
-
var htmlErrors = message.join("<br>");
|
|
552
|
-
Swal.fire({
|
|
553
|
-
title: currentTitle,
|
|
554
|
-
html: htmlErrors,
|
|
555
|
-
icon: 'error'
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
Swal.fire(currentTitle, message, 'error');
|
|
560
|
-
}
|
|
561
|
-
};
|
|
562
|
-
/**
|
|
563
|
-
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
564
|
-
* CONFERMA lancia la funzione di callback passata come parametro
|
|
565
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
566
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
567
|
-
*/
|
|
568
|
-
EqpDynamicModuleDialogService.Confirm = function (message, confirmCallback, isWarning, title, customWidth) {
|
|
569
|
-
if (isWarning === void 0) { isWarning = false; }
|
|
570
|
-
if (title === void 0) { title = null; }
|
|
571
|
-
if (customWidth === void 0) { customWidth = null; }
|
|
572
|
-
var currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
573
|
-
if (Array.isArray(message)) {
|
|
574
|
-
var htmlErrors = message.join("<br>");
|
|
575
|
-
Swal.fire({
|
|
576
|
-
title: currentTitle,
|
|
577
|
-
html: htmlErrors,
|
|
578
|
-
width: customWidth ? customWidth : '32rem',
|
|
579
|
-
icon: !isWarning ? 'question' : 'warning',
|
|
580
|
-
showCancelButton: true,
|
|
581
|
-
allowOutsideClick: false,
|
|
582
|
-
allowEscapeKey: false
|
|
583
|
-
}).then(function (result) {
|
|
584
|
-
if (result.value && confirmCallback) {
|
|
585
|
-
confirmCallback();
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
Swal.fire({
|
|
591
|
-
title: currentTitle,
|
|
592
|
-
text: message,
|
|
593
|
-
width: customWidth ? customWidth : '32rem',
|
|
594
|
-
icon: !isWarning ? 'question' : 'warning',
|
|
595
|
-
showCancelButton: true,
|
|
596
|
-
allowOutsideClick: false,
|
|
597
|
-
allowEscapeKey: false
|
|
598
|
-
}).then(function (result) {
|
|
599
|
-
if (result.value && confirmCallback) {
|
|
600
|
-
confirmCallback();
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
/**
|
|
606
|
-
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
607
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
608
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
609
|
-
*/
|
|
610
|
-
EqpDynamicModuleDialogService.Info = function (message, title, isToast) {
|
|
611
|
-
if (title === void 0) { title = null; }
|
|
612
|
-
if (isToast === void 0) { isToast = null; }
|
|
613
|
-
var currentTitle = title != null ? title : "Informazione:";
|
|
614
|
-
Swal.fire(currentTitle, message, 'info');
|
|
615
|
-
};
|
|
616
|
-
/**
|
|
617
|
-
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
618
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
619
|
-
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
620
|
-
*/
|
|
621
|
-
EqpDynamicModuleDialogService.Warning = function (message, title, isToast) {
|
|
622
|
-
if (title === void 0) { title = null; }
|
|
623
|
-
if (isToast === void 0) { isToast = null; }
|
|
624
|
-
var currentTitle = title != null ? title : "Attenzione!";
|
|
625
|
-
if (Array.isArray(message)) {
|
|
626
|
-
var htmlWarnings = message.join("<br>");
|
|
627
|
-
Swal.fire({
|
|
628
|
-
title: currentTitle,
|
|
629
|
-
html: htmlWarnings,
|
|
630
|
-
icon: 'warning'
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
Swal.fire(currentTitle, message, 'warning');
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
EqpDynamicModuleDialogService.ɵprov = ɵɵdefineInjectable({ factory: function EqpDynamicModuleDialogService_Factory() { return new EqpDynamicModuleDialogService(); }, token: EqpDynamicModuleDialogService, providedIn: "root" });
|
|
638
|
-
EqpDynamicModuleDialogService = __decorate([
|
|
639
|
-
Injectable({
|
|
640
|
-
providedIn: 'root'
|
|
1008
|
+
__decorate([
|
|
1009
|
+
Output()
|
|
1010
|
+
], EqpDynamicModuleComponent.prototype, "afterSaveRecord", void 0);
|
|
1011
|
+
__decorate([
|
|
1012
|
+
Output()
|
|
1013
|
+
], EqpDynamicModuleComponent.prototype, "afterDeleteRecord", void 0);
|
|
1014
|
+
__decorate([
|
|
1015
|
+
Output()
|
|
1016
|
+
], EqpDynamicModuleComponent.prototype, "afterDuplicateRecord", void 0);
|
|
1017
|
+
EqpDynamicModuleComponent = __decorate([
|
|
1018
|
+
Component({
|
|
1019
|
+
selector: 'eqp-dynamic-module',
|
|
1020
|
+
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>",
|
|
1021
|
+
styles: ["::ng-deep mat-form-field{width:100%}"]
|
|
641
1022
|
})
|
|
642
|
-
],
|
|
643
|
-
return
|
|
1023
|
+
], EqpDynamicModuleComponent);
|
|
1024
|
+
return EqpDynamicModuleComponent;
|
|
1025
|
+
}());
|
|
1026
|
+
|
|
1027
|
+
var MaterialModule = /** @class */ (function () {
|
|
1028
|
+
function MaterialModule() {
|
|
1029
|
+
}
|
|
1030
|
+
MaterialModule = __decorate([
|
|
1031
|
+
NgModule({
|
|
1032
|
+
imports: [
|
|
1033
|
+
MatCheckboxModule,
|
|
1034
|
+
MatButtonModule,
|
|
1035
|
+
MatInputModule,
|
|
1036
|
+
MatAutocompleteModule,
|
|
1037
|
+
MatDatepickerModule,
|
|
1038
|
+
MatFormFieldModule,
|
|
1039
|
+
MatRadioModule,
|
|
1040
|
+
MatSelectModule,
|
|
1041
|
+
MatSliderModule,
|
|
1042
|
+
MatSlideToggleModule,
|
|
1043
|
+
MatMenuModule,
|
|
1044
|
+
MatSidenavModule,
|
|
1045
|
+
MatToolbarModule,
|
|
1046
|
+
MatListModule,
|
|
1047
|
+
MatGridListModule,
|
|
1048
|
+
MatCardModule,
|
|
1049
|
+
MatStepperModule,
|
|
1050
|
+
MatTabsModule,
|
|
1051
|
+
MatExpansionModule,
|
|
1052
|
+
MatButtonToggleModule,
|
|
1053
|
+
MatChipsModule,
|
|
1054
|
+
MatIconModule,
|
|
1055
|
+
MatProgressSpinnerModule,
|
|
1056
|
+
MatProgressBarModule,
|
|
1057
|
+
MatDialogModule,
|
|
1058
|
+
MatTooltipModule,
|
|
1059
|
+
MatSnackBarModule,
|
|
1060
|
+
MatTableModule,
|
|
1061
|
+
MatSortModule,
|
|
1062
|
+
MatPaginatorModule,
|
|
1063
|
+
MatDatepickerModule,
|
|
1064
|
+
MatNativeDateModule
|
|
1065
|
+
],
|
|
1066
|
+
exports: [
|
|
1067
|
+
MatCheckboxModule,
|
|
1068
|
+
MatButtonModule,
|
|
1069
|
+
MatInputModule,
|
|
1070
|
+
MatAutocompleteModule,
|
|
1071
|
+
MatDatepickerModule,
|
|
1072
|
+
MatFormFieldModule,
|
|
1073
|
+
MatRadioModule,
|
|
1074
|
+
MatSelectModule,
|
|
1075
|
+
MatSliderModule,
|
|
1076
|
+
MatSlideToggleModule,
|
|
1077
|
+
MatMenuModule,
|
|
1078
|
+
MatSidenavModule,
|
|
1079
|
+
MatToolbarModule,
|
|
1080
|
+
MatListModule,
|
|
1081
|
+
MatGridListModule,
|
|
1082
|
+
MatCardModule,
|
|
1083
|
+
MatStepperModule,
|
|
1084
|
+
MatTabsModule,
|
|
1085
|
+
MatExpansionModule,
|
|
1086
|
+
MatButtonToggleModule,
|
|
1087
|
+
MatChipsModule,
|
|
1088
|
+
MatIconModule,
|
|
1089
|
+
MatProgressSpinnerModule,
|
|
1090
|
+
MatProgressBarModule,
|
|
1091
|
+
MatDialogModule,
|
|
1092
|
+
MatTooltipModule,
|
|
1093
|
+
MatSnackBarModule,
|
|
1094
|
+
MatTableModule,
|
|
1095
|
+
MatSortModule,
|
|
1096
|
+
MatPaginatorModule
|
|
1097
|
+
],
|
|
1098
|
+
})
|
|
1099
|
+
], MaterialModule);
|
|
1100
|
+
return MaterialModule;
|
|
644
1101
|
}());
|
|
645
1102
|
|
|
646
1103
|
var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
|
|
647
|
-
function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog) {
|
|
1104
|
+
function EqpDynamicModuleConfiguratorComponent(formBuilder, dialog, utilityHelperService) {
|
|
648
1105
|
this.formBuilder = formBuilder;
|
|
649
1106
|
this.dialog = dialog;
|
|
1107
|
+
this.utilityHelperService = utilityHelperService;
|
|
650
1108
|
this.context = new Context();
|
|
651
1109
|
this.form = new Form();
|
|
1110
|
+
this.formID = null;
|
|
652
1111
|
this.innerFormManagment = false;
|
|
1112
|
+
/**
|
|
1113
|
+
* Url del server da chiamare per recuerare, salvare o eliminare i record.
|
|
1114
|
+
* Usato per creare la configurazione di default degli endpoint da chiamare.
|
|
1115
|
+
*/
|
|
1116
|
+
this.baseServerUrl = null;
|
|
1117
|
+
/**
|
|
1118
|
+
* Token da usare negli endpoint da chiamare per recuperare o salvare i record.
|
|
1119
|
+
* Usato solo se viene popolata la proprietà "baseServerUrl".
|
|
1120
|
+
*/
|
|
1121
|
+
this.userToken = null;
|
|
1122
|
+
/**
|
|
1123
|
+
* Configurazione degli endpoint da chiamare per recuperare o salvare i dati.
|
|
1124
|
+
* Può essere definita dall'utente oppure lasciata null, viene popolata con dei
|
|
1125
|
+
* valori di default se viene valorizzata la proprietà "baseServerUrl" altrimenti
|
|
1126
|
+
* viene lasciata null e non viene eseguita nessuna chiamata al server.
|
|
1127
|
+
*/
|
|
1128
|
+
this.endPointConfiguration = null;
|
|
653
1129
|
this.formCompleted = false;
|
|
654
1130
|
//#region Enumeratori usati nell'html
|
|
655
1131
|
this.FormTypeEnum = FormTypeEnum;
|
|
656
1132
|
this.FormScalarTypeEnum = FormScalarTypeEnum;
|
|
657
1133
|
//#endregion
|
|
1134
|
+
/**
|
|
1135
|
+
* Evento emesso quando si salva una form e non è stato specificato un endpoint da chiamare.
|
|
1136
|
+
*/
|
|
658
1137
|
this.saveFormEvent = new EventEmitter();
|
|
1138
|
+
/**
|
|
1139
|
+
* Evento emesso DOPO aver eseguito una chiamata al server per il salvataggiodi una form all'endpoint specificato.
|
|
1140
|
+
*/
|
|
1141
|
+
this.afterSaveFormEvent = new EventEmitter();
|
|
659
1142
|
}
|
|
660
1143
|
EqpDynamicModuleConfiguratorComponent.prototype.ngOnInit = function () {
|
|
1144
|
+
this.configureDefaultEndPoints();
|
|
1145
|
+
this.getFormByID();
|
|
661
1146
|
if (this.context) {
|
|
662
1147
|
UtilityHelperService.SetContext(this.context);
|
|
663
1148
|
}
|
|
664
|
-
|
|
665
|
-
|
|
1149
|
+
};
|
|
1150
|
+
/**
|
|
1151
|
+
* Metodo per configurare gli endpoint da usare di default a partire dall'url base del server
|
|
1152
|
+
* a cui si deve connettere e al token da passare per autenticarsi.
|
|
1153
|
+
* Se la proprietà baseServerUrl è null e non sono stati configurati i vari endpoint allora
|
|
1154
|
+
* non viene eseguita nessuna chiamata http per recuperare/salvare i dati.
|
|
1155
|
+
*/
|
|
1156
|
+
EqpDynamicModuleConfiguratorComponent.prototype.configureDefaultEndPoints = function () {
|
|
1157
|
+
if (!this.endPointConfiguration && this.baseServerUrl) {
|
|
1158
|
+
this.endPointConfiguration = this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl, this.userToken);
|
|
1159
|
+
if (this.formID) {
|
|
1160
|
+
this.endPointConfiguration.Forms.GetByIDEndPoint.Params = [{ ParamName: 'id', ParamValue: this.formID, ParamType: ParamTypeEnum['Query param'] }];
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
/**
|
|
1165
|
+
* Metodo per recuperare tutti i record salvati per una particolare Form.
|
|
1166
|
+
* La chiamata viene effettuata solo se è stato configurato l'endPoint da usare.
|
|
1167
|
+
*/
|
|
1168
|
+
EqpDynamicModuleConfiguratorComponent.prototype.getFormByID = function () {
|
|
1169
|
+
var _this = this;
|
|
1170
|
+
if (this.formID && this.endPointConfiguration && this.endPointConfiguration.Forms && this.endPointConfiguration.Forms.GetByIDEndPoint) {
|
|
1171
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint, null, function (res) {
|
|
1172
|
+
_this.setFormAndConfigure(res);
|
|
1173
|
+
}, function (err) {
|
|
1174
|
+
_this.setFormAndConfigure(new Form());
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
this.setFormAndConfigure();
|
|
1179
|
+
}
|
|
666
1180
|
};
|
|
667
1181
|
/**
|
|
668
1182
|
* Metodo invocato al cambio del tipo di visualizzazione della form.
|
|
@@ -938,10 +1452,54 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
|
|
|
938
1452
|
}
|
|
939
1453
|
};
|
|
940
1454
|
/**
|
|
941
|
-
* Metodo
|
|
1455
|
+
* Metodo per salvare la form creata alla fine del wizard.
|
|
1456
|
+
* Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
|
|
1457
|
+
* nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
|
|
1458
|
+
* NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
|
|
1459
|
+
* Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
942
1460
|
*/
|
|
943
1461
|
EqpDynamicModuleConfiguratorComponent.prototype.saveForm = function () {
|
|
944
|
-
this
|
|
1462
|
+
var _this = this;
|
|
1463
|
+
if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
|
|
1464
|
+
// Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
|
|
1465
|
+
// Necessario per far funzionare correttamente il FieldConverter del server.
|
|
1466
|
+
var formToSave_1 = JSON.parse(JSON.stringify(this.form));
|
|
1467
|
+
/*formToSave.Fields = [];
|
|
1468
|
+
this.form.Fields.forEach(field => {
|
|
1469
|
+
formToSave.Fields.push({
|
|
1470
|
+
FieldType: field.FieldType,
|
|
1471
|
+
Value: JSON.parse(JSON.stringify(field))
|
|
1472
|
+
});
|
|
1473
|
+
});*/
|
|
1474
|
+
formToSave_1.Fields = [];
|
|
1475
|
+
this.form.Fields.forEach(function (field) {
|
|
1476
|
+
var fld = UtilityHelperService.GetFieldType(field);
|
|
1477
|
+
formToSave_1.Fields.push(fld);
|
|
1478
|
+
});
|
|
1479
|
+
var dynamicModuleParams = [
|
|
1480
|
+
{ ParamName: "Form", ParamValue: formToSave_1, ParamType: ParamTypeEnum['In Body'] }
|
|
1481
|
+
];
|
|
1482
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, function (res) {
|
|
1483
|
+
EqpDynamicModuleDialogService.Success("Form salvata con successo!");
|
|
1484
|
+
_this.afterSaveFormEvent.emit(_this.form);
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
else {
|
|
1488
|
+
this.saveFormEvent.emit(this.form);
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
//#region FUNZIONI PRIVATE
|
|
1492
|
+
/**
|
|
1493
|
+
* Metodo per impostare la form e configurare colonne/FormGourp.
|
|
1494
|
+
* @param form Form da utilizzare.
|
|
1495
|
+
*/
|
|
1496
|
+
EqpDynamicModuleConfiguratorComponent.prototype.setFormAndConfigure = function (form) {
|
|
1497
|
+
if (form === void 0) { form = null; }
|
|
1498
|
+
if (form != null) {
|
|
1499
|
+
this.form = form;
|
|
1500
|
+
}
|
|
1501
|
+
this.configureColumns();
|
|
1502
|
+
this.createFormForm();
|
|
945
1503
|
};
|
|
946
1504
|
/**
|
|
947
1505
|
* Configura le colonne per le tabelle necessarie alla creazione della form:
|
|
@@ -1135,7 +1693,8 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
|
|
|
1135
1693
|
};
|
|
1136
1694
|
EqpDynamicModuleConfiguratorComponent.ctorParameters = function () { return [
|
|
1137
1695
|
{ type: FormBuilder },
|
|
1138
|
-
{ type: MatDialog }
|
|
1696
|
+
{ type: MatDialog },
|
|
1697
|
+
{ type: UtilityHelperService }
|
|
1139
1698
|
]; };
|
|
1140
1699
|
__decorate([
|
|
1141
1700
|
Input()
|
|
@@ -1143,9 +1702,21 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
|
|
|
1143
1702
|
__decorate([
|
|
1144
1703
|
Input()
|
|
1145
1704
|
], EqpDynamicModuleConfiguratorComponent.prototype, "form", void 0);
|
|
1705
|
+
__decorate([
|
|
1706
|
+
Input()
|
|
1707
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "formID", void 0);
|
|
1146
1708
|
__decorate([
|
|
1147
1709
|
Input()
|
|
1148
1710
|
], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
|
|
1711
|
+
__decorate([
|
|
1712
|
+
Input()
|
|
1713
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);
|
|
1714
|
+
__decorate([
|
|
1715
|
+
Input()
|
|
1716
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "userToken", void 0);
|
|
1717
|
+
__decorate([
|
|
1718
|
+
Input()
|
|
1719
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "endPointConfiguration", void 0);
|
|
1149
1720
|
__decorate([
|
|
1150
1721
|
ViewChild('fieldsTable', { static: false })
|
|
1151
1722
|
], EqpDynamicModuleConfiguratorComponent.prototype, "fieldsTable", void 0);
|
|
@@ -1167,10 +1738,13 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
|
|
|
1167
1738
|
__decorate([
|
|
1168
1739
|
Output()
|
|
1169
1740
|
], EqpDynamicModuleConfiguratorComponent.prototype, "saveFormEvent", void 0);
|
|
1741
|
+
__decorate([
|
|
1742
|
+
Output()
|
|
1743
|
+
], EqpDynamicModuleConfiguratorComponent.prototype, "afterSaveFormEvent", void 0);
|
|
1170
1744
|
EqpDynamicModuleConfiguratorComponent = __decorate([
|
|
1171
1745
|
Component({
|
|
1172
1746
|
selector: 'eqp-dynamic-module-configurator',
|
|
1173
|
-
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>",
|
|
1747
|
+
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>",
|
|
1174
1748
|
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)}"]
|
|
1175
1749
|
})
|
|
1176
1750
|
], EqpDynamicModuleConfiguratorComponent);
|
|
@@ -1242,6 +1816,11 @@ var ListValueField = /** @class */ (function (_super) {
|
|
|
1242
1816
|
}
|
|
1243
1817
|
return ListValueField;
|
|
1244
1818
|
}(BaseField));
|
|
1819
|
+
var ButtonImage = /** @class */ (function () {
|
|
1820
|
+
function ButtonImage() {
|
|
1821
|
+
}
|
|
1822
|
+
return ButtonImage;
|
|
1823
|
+
}());
|
|
1245
1824
|
var ListPresentationEnum;
|
|
1246
1825
|
(function (ListPresentationEnum) {
|
|
1247
1826
|
ListPresentationEnum[ListPresentationEnum["Combo box"] = 1] = "Combo box";
|
|
@@ -1252,10 +1831,11 @@ var ListPresentationEnum;
|
|
|
1252
1831
|
|
|
1253
1832
|
var AddFormFieldComponent = /** @class */ (function () {
|
|
1254
1833
|
//#endregion
|
|
1255
|
-
function AddFormFieldComponent(formBuilder, enumHelper, dialog) {
|
|
1834
|
+
function AddFormFieldComponent(formBuilder, enumHelper, dialog, cdr) {
|
|
1256
1835
|
this.formBuilder = formBuilder;
|
|
1257
1836
|
this.enumHelper = enumHelper;
|
|
1258
1837
|
this.dialog = dialog;
|
|
1838
|
+
this.cdr = cdr;
|
|
1259
1839
|
this.fieldTypesToExclude = [FieldTypeEnum['Form di dettaglio']];
|
|
1260
1840
|
this.keyValueObject = { key: '', value: '' };
|
|
1261
1841
|
this.availableColSpanSizes = [];
|
|
@@ -1268,6 +1848,8 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1268
1848
|
this.BoolPresentantioEnum = BoolPresentantioEnum;
|
|
1269
1849
|
this.DateTimeTypeEnum = DateTimeTypeEnum;
|
|
1270
1850
|
this.ListPresentationEnum = ListPresentationEnum;
|
|
1851
|
+
this.TextMaskEnum = TextMaskEnum;
|
|
1852
|
+
this.AttachmentType = AttachmentType;
|
|
1271
1853
|
}
|
|
1272
1854
|
AddFormFieldComponent.prototype.ngOnInit = function () {
|
|
1273
1855
|
var _this = this;
|
|
@@ -1306,7 +1888,7 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1306
1888
|
Required: [this.field.Required],
|
|
1307
1889
|
FieldType: [this.field.FieldType, Validators.required],
|
|
1308
1890
|
Formula: [this.field.Formula],
|
|
1309
|
-
|
|
1891
|
+
ColSpanSizes: [this.field.ColSpanSizes],
|
|
1310
1892
|
InListView: [this.field.InListView],
|
|
1311
1893
|
});
|
|
1312
1894
|
if (this.formFieldsGroups) {
|
|
@@ -1325,7 +1907,7 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1325
1907
|
if (restoreField)
|
|
1326
1908
|
this.restoreBaseFieldProperties();
|
|
1327
1909
|
this.createFieldForm();
|
|
1328
|
-
this.
|
|
1910
|
+
this.onColSpanSizeSelect();
|
|
1329
1911
|
this.fieldTypeFormTemplate = null;
|
|
1330
1912
|
switch (this.field.FieldType) {
|
|
1331
1913
|
case FieldTypeEnum['Campo di testo']:
|
|
@@ -1349,13 +1931,16 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1349
1931
|
this.fieldFormGroup.addControl('IsOnlyDate', new FormControl(this.field.IsOnlyDate, Validators.required));
|
|
1350
1932
|
this.fieldFormGroup.addControl('MinDate', new FormControl(this.field.MinDate));
|
|
1351
1933
|
this.fieldFormGroup.addControl('MaxDate', new FormControl(this.field.MaxDate));
|
|
1934
|
+
this.fieldFormGroup.addControl('DateFormat', new FormControl(this.field.DateFormat));
|
|
1352
1935
|
this.fieldTypeFormTemplate = this.dateFieldFormTemplate;
|
|
1353
1936
|
break;
|
|
1354
1937
|
case FieldTypeEnum['Campo numerico']:
|
|
1355
1938
|
this.fieldFormGroup.addControl('IsInteger', new FormControl(this.field.IsInteger));
|
|
1356
1939
|
this.fieldFormGroup.addControl('MinValue', new FormControl(this.field.MinValue));
|
|
1357
1940
|
this.fieldFormGroup.addControl('MaxValue', new FormControl(this.field.MaxValue));
|
|
1358
|
-
this.fieldFormGroup.addControl('
|
|
1941
|
+
this.fieldFormGroup.addControl('DecimalSeparator', new FormControl(this.field.DecimalSeparator));
|
|
1942
|
+
this.fieldFormGroup.addControl('DecimalPrecision', new FormControl(this.field.DecimalPrecision));
|
|
1943
|
+
this.fieldFormGroup.addControl('ThousandsSeparator', new FormControl(this.field.ThousandsSeparator));
|
|
1359
1944
|
this.fieldFormGroup.addControl('CurrencySymbol', new FormControl(this.field.CurrencySymbol));
|
|
1360
1945
|
this.fieldTypeFormTemplate = this.numericFieldFormTemplate;
|
|
1361
1946
|
break;
|
|
@@ -1366,11 +1951,10 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1366
1951
|
break;
|
|
1367
1952
|
case FieldTypeEnum.Immagine:
|
|
1368
1953
|
this.field.AttachDefinition = new AttachmentField();
|
|
1369
|
-
this.fieldFormGroup.addControl('
|
|
1370
|
-
// this.fieldFormGroup.addControl('ImgName', new FormControl((this.field as ImageField).ImgName, Validators.required));
|
|
1371
|
-
this.fieldFormGroup.addControl('IsMultiPoint', new FormControl(this.field.IsMultiPoint));
|
|
1372
|
-
this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
|
|
1954
|
+
this.fieldFormGroup.addControl('EnableDrawing', new FormControl(this.field.EnableDrawing));
|
|
1373
1955
|
this.fieldFormGroup.addControl('ImageIsContextualAttachment', new FormControl(this.field.ImageIsContextualAttachment));
|
|
1956
|
+
// Imposto i FormControl variabili.
|
|
1957
|
+
this.onImageIsContextualAttachmentChange();
|
|
1374
1958
|
this.fieldTypeFormTemplate = this.imageFieldFormTemplate;
|
|
1375
1959
|
break;
|
|
1376
1960
|
case FieldTypeEnum['Elenco generico']:
|
|
@@ -1387,10 +1971,50 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1387
1971
|
if ([FieldTypeEnum.Allegato, FieldTypeEnum.Immagine, FieldTypeEnum['Form di dettaglio']].includes(this.field.FieldType)) {
|
|
1388
1972
|
this.field.Formula = null;
|
|
1389
1973
|
this.fieldFormGroup.controls["Formula"].disable();
|
|
1974
|
+
this.fieldFormGroup.controls["InListView"].disable();
|
|
1390
1975
|
}
|
|
1391
1976
|
else {
|
|
1392
1977
|
this.fieldFormGroup.controls["Formula"].enable();
|
|
1978
|
+
this.fieldFormGroup.controls["InListView"].enable();
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
/**
|
|
1982
|
+
* Metodo invocato al cambio del valore della proprietà ImageIsContextualAttachment nel caso
|
|
1983
|
+
* di campi di tipo Immagine. Se TRUE allora rimuove i FormControl per le proprietà IsMultiAttach
|
|
1984
|
+
* e AllowedExtensions e aggiunge i FormControl per le proprietà ImgName e ContextualAttachment,
|
|
1985
|
+
* altrimenti il contrario.
|
|
1986
|
+
*/
|
|
1987
|
+
AddFormFieldComponent.prototype.onImageIsContextualAttachmentChange = function () {
|
|
1988
|
+
this.field.ImgName = null;
|
|
1989
|
+
this.field.AttachDefinition.AllowedExtensions = [];
|
|
1990
|
+
this.field.AttachDefinition.IsMultiAttach = false;
|
|
1991
|
+
this.field.ContextualAttachment = null;
|
|
1992
|
+
if (this.field.ImageIsContextualAttachment) {
|
|
1993
|
+
this.fieldFormGroup.removeControl("IsMultiAttach");
|
|
1994
|
+
this.fieldFormGroup.removeControl("AllowedExtensions");
|
|
1995
|
+
this.fieldFormGroup.addControl('ImgName', new FormControl(this.field.ImgName, Validators.required));
|
|
1996
|
+
this.fieldFormGroup.addControl('ContextualAttachment', new FormControl(this.field.ContextualAttachment, Validators.required));
|
|
1997
|
+
}
|
|
1998
|
+
else {
|
|
1999
|
+
this.fieldFormGroup.removeControl("ImgName");
|
|
2000
|
+
this.fieldFormGroup.removeControl("ContextualAttachment");
|
|
2001
|
+
this.fieldFormGroup.addControl('IsMultiAttach', new FormControl(this.field.AttachDefinition.IsMultiAttach));
|
|
2002
|
+
this.fieldFormGroup.addControl("AllowedExtensions", new FormControl(this.field.AttachDefinition.AllowedExtensions));
|
|
2003
|
+
}
|
|
2004
|
+
};
|
|
2005
|
+
/**
|
|
2006
|
+
* Metodo per intercettare l'aggiunta di un allegato nei campi di tipo Immagine per aggiornare
|
|
2007
|
+
* il valore della proprietà ContextualAttachment e la validazione del relativo FormControl.
|
|
2008
|
+
* @param event Array contenente l'elenco aggiornato degli allegati caricati (nel nostro caso ne contiene al più 1).
|
|
2009
|
+
*/
|
|
2010
|
+
AddFormFieldComponent.prototype.catchContextualAttachmentChange = function (event) {
|
|
2011
|
+
if (event && event.length > 0) {
|
|
2012
|
+
this.field.ContextualAttachment = event[0];
|
|
2013
|
+
}
|
|
2014
|
+
else {
|
|
2015
|
+
this.field.ContextualAttachment = null;
|
|
1393
2016
|
}
|
|
2017
|
+
this.fieldFormGroup.controls['ContextualAttachment'].setValue(this.field.ContextualAttachment);
|
|
1394
2018
|
};
|
|
1395
2019
|
/**
|
|
1396
2020
|
* Metodo invocato alla selezione di una classe nella select per le colonne di bootstrap
|
|
@@ -1400,17 +2024,50 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1400
2024
|
* seleziona la classe "col-sm-6", al change del valore questo metodo rimuove dalla select
|
|
1401
2025
|
* tutti gli altri valori per la grandezza di schermo selezionata.
|
|
1402
2026
|
*/
|
|
1403
|
-
AddFormFieldComponent.prototype.
|
|
2027
|
+
AddFormFieldComponent.prototype.onColSpanSizeSelect = function () {
|
|
1404
2028
|
// Recupero l'array degli oggetti chiave-valore che rappreseta l'enumeratore
|
|
1405
2029
|
var colSizeClassEnumArray = this.enumHelper.getEnumArray(ColSpanSizesEnum, false, null);
|
|
1406
2030
|
// Costruisco l'array delle classi selezionate dall'utente in formato stringa
|
|
1407
|
-
var selectedDimensions = this.field.
|
|
2031
|
+
var selectedDimensions = this.field.ColSpanSizes ? this.field.ColSpanSizes.map(function (col) { return ColSpanSizesEnum[col]; }) : [];
|
|
1408
2032
|
// Filtro i valori ottenuti dall'enumeratore per escludere tutti i valori per le
|
|
1409
2033
|
// grandezze di schermo già selezionatead esclusione dei valori selezionati.
|
|
1410
2034
|
this.availableColSpanSizes = colSizeClassEnumArray.filter(function (value) {
|
|
1411
2035
|
return !selectedDimensions.find(function (col) { return value.value.includes(col.substring(4, 6)) && value.value != col; });
|
|
1412
2036
|
});
|
|
1413
2037
|
};
|
|
2038
|
+
/**
|
|
2039
|
+
* Metodo invocato al cambio del tipo di visualizzazione scelta per i campi di tipo elenco generico.
|
|
2040
|
+
* Se viene scelta la visualizzazione ad immagini svuota la lista delle coppie chiave-valore inserite
|
|
2041
|
+
* in precedenza, altrimenti svuota la lista delle immagini caricate.
|
|
2042
|
+
*/
|
|
2043
|
+
AddFormFieldComponent.prototype.onPresentationModeChange = function () {
|
|
2044
|
+
if (this.field.PresentationMode === ListPresentationEnum.Immagini) {
|
|
2045
|
+
this.field.ValuePairs = null;
|
|
2046
|
+
}
|
|
2047
|
+
else {
|
|
2048
|
+
this.field.ButtonImageList = null;
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
/**
|
|
2052
|
+
* Metodo invocato quando viene caricato il componente eqp-attachments per caricare le immagini da usare
|
|
2053
|
+
* nella visualizzazione ad immagini dei campi di tipo "Elenco generico". Aggiunge due colonne a quelle
|
|
2054
|
+
* configurate nel componente in cui l'utente può indicare chiave e valore della scelta.
|
|
2055
|
+
* @param component Istanza del componente eqp-attachments in cui effettuare la modifica.
|
|
2056
|
+
*/
|
|
2057
|
+
AddFormFieldComponent.prototype.configureButtonImagesColumns = function (component) {
|
|
2058
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonKey", display: "Label", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
2059
|
+
component.attachmentsColumns.splice(component.attachmentsColumns.length - 1, 0, { key: "ButtonValue", display: "Valore", type: TypeColumn.ExternalTemplate, externalTemplate: this.buttonImagesKeyValueInputColumn });
|
|
2060
|
+
this.cdr.detectChanges();
|
|
2061
|
+
};
|
|
2062
|
+
/**
|
|
2063
|
+
* Metodo invocato al salvataggio degli allegati quando viene configurato un campo di tipo "Elenco generico"
|
|
2064
|
+
* con il tipo di visualizzazione ad immagini. Intercetta l'elenco aggiornato delle immagini caricate e lo
|
|
2065
|
+
* memorizza nell'oggetto field corrente.
|
|
2066
|
+
* @param attachments Array aggiornato degli allegati caricati.
|
|
2067
|
+
*/
|
|
2068
|
+
AddFormFieldComponent.prototype.catchButtonImagesChange = function (attachments) {
|
|
2069
|
+
this.field.ButtonImageList = attachments;
|
|
2070
|
+
};
|
|
1414
2071
|
/**
|
|
1415
2072
|
* Metodo chiamato al keyup degli input testuali che prevedono l'aggiunta del valore inserito in un array.
|
|
1416
2073
|
* Se l'utente preme il tasto invio, in base al tipo di campo che sta inserendo/modificando, questo metodo
|
|
@@ -1558,7 +2215,14 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1558
2215
|
}
|
|
1559
2216
|
switch (this.field.FieldType) {
|
|
1560
2217
|
case FieldTypeEnum['Elenco generico']:
|
|
1561
|
-
|
|
2218
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2219
|
+
return !this.field.ValuePairs || this.field.ValuePairs.length === 0;
|
|
2220
|
+
}
|
|
2221
|
+
else {
|
|
2222
|
+
return (!this.field.ButtonImageList
|
|
2223
|
+
|| this.field.ButtonImageList.length === 0
|
|
2224
|
+
|| !!this.field.ButtonImageList.find(function (i) { return !i.ButtonKey || !i.ButtonValue; }));
|
|
2225
|
+
}
|
|
1562
2226
|
case FieldTypeEnum.Lookup:
|
|
1563
2227
|
return !this.field.FieldNames || this.field.FieldNames.length === 0;
|
|
1564
2228
|
default:
|
|
@@ -1592,7 +2256,7 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1592
2256
|
this.field.Required = tmpBaseField.Required;
|
|
1593
2257
|
this.field.FieldType = tmpBaseField.FieldType;
|
|
1594
2258
|
this.field.Formula = tmpBaseField.Formula;
|
|
1595
|
-
this.field.
|
|
2259
|
+
this.field.ColSpanSizes = tmpBaseField.ColSpanSizes;
|
|
1596
2260
|
this.field.FieldGroup = tmpBaseField.FieldGroup;
|
|
1597
2261
|
}
|
|
1598
2262
|
};
|
|
@@ -1670,7 +2334,8 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1670
2334
|
AddFormFieldComponent.ctorParameters = function () { return [
|
|
1671
2335
|
{ type: FormBuilder },
|
|
1672
2336
|
{ type: EnumHelper },
|
|
1673
|
-
{ type: MatDialog }
|
|
2337
|
+
{ type: MatDialog },
|
|
2338
|
+
{ type: ChangeDetectorRef }
|
|
1674
2339
|
]; };
|
|
1675
2340
|
__decorate([
|
|
1676
2341
|
Input()
|
|
@@ -1723,10 +2388,13 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1723
2388
|
__decorate([
|
|
1724
2389
|
ViewChild('dialogMetadata', { static: true })
|
|
1725
2390
|
], AddFormFieldComponent.prototype, "dialogMetadata", void 0);
|
|
2391
|
+
__decorate([
|
|
2392
|
+
ViewChild('buttonImagesKeyValueInputColumn', { static: true })
|
|
2393
|
+
], AddFormFieldComponent.prototype, "buttonImagesKeyValueInputColumn", void 0);
|
|
1726
2394
|
AddFormFieldComponent = __decorate([
|
|
1727
2395
|
Component({
|
|
1728
2396
|
selector: 'eqp-dynamic-module-add-form-field',
|
|
1729
|
-
template: "<div class=\"container-fluid\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\n <form [formGroup]=\"fieldFormGroup\">\n <div class=\"row\">\n <div class=\"header-title-standard\">{{indexField != null && indexField >= 0 ? \"Modifica\"\n : \"Aggiungi\"}} campo</div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"FieldTypeEnum\" [(ngModelInput)]=\"field.FieldType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo campo\" (ngModelInputChange)=\"onFieldTypeChange()\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldType'\"\n [enumDataToExclude]=\"fieldTypesToExclude\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Label </mat-label>\n <input formControlName=\"Label\" required matInput [(ngModel)]=\"field.Label\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Descrizione </mat-label>\n <input formControlName=\"Description\" required matInput [(ngModel)]=\"field.Description\">\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.Required\" formControlName=\"Required\" color=\"primary\">\n Obbligatorio\n </mat-slide-toggle>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <mat-form-field>\n <mat-label> Formula (Javascript) </mat-label>\n <input formControlName=\"Formula\" matInput [(ngModel)]=\"field.Formula\"\n [matAutocomplete]=\"formulaAutocomplete\" (keyup)=\"setFormulaAutocompleteOptions($event)\"\n (focus)=\"setFormulaAutocompleteOptions(null)\">\n <mat-autocomplete #formulaAutocomplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of formulaAutocompleteOptions\" [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\" *ngIf=\"formFieldsGroups\">\n <eqp-select [arrayData]=\"formFieldsGroups\" [(ngModelInput)]=\"field.FieldGroup\"\n [arrayKeyProperty]=\"'Name'\" [arrayValueProperty]=\"'Name'\" placeholder=\"Sezione\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'FieldGroup'\" [isRequired]=\"true\"\n [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"availableColSpanSizes\" [(ngModelInput)]=\"field.ColSizes\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" (ngModelInputChange)=\"onColSizeSelect()\"\n [isMultiSelect]=\"true\" placeholder=\"Larghezza campo\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'ColSizes'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\">\n <mat-slide-toggle [(ngModel)]=\"field.InListView\" formControlName=\"InListView\" color=\"primary\">\n Mostrare nella visualizzazione a lista\n </mat-slide-toggle>\n </div>\n\n <ng-container *ngTemplateOutlet=\"fieldTypeFormTemplate\">\n </ng-container>\n </div>\n\n\n <div class=\"row mt-2 mb-1\">\n <div class=\"col-sm-12 text-right\">\n <button class=\"mr-2\" mat-raised-button color=\"primary\" (click)=\"saveAndExitAddField(true)\"\n [disabled]=\"disableSaveField()\" type=\"button\">\n Salva\n </button>\n <button class=\"btn mat-raised-button\" (click)=\"saveAndExitAddField(false)\" type=\"button\">\n Esci\n </button>\n </div>\n </div>\n </form>\n</div>\n\n\n<!-- FORM PROPRIET\u00C0 CAMPI DI TESTO -->\n<ng-template #textFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Maschera </mat-label>\n <input formControlName=\"TextMask\" matInput [(ngModel)]=\"field.TextMask\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI AREA DI TESTO -->\n<ng-template #textareaFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Righe </mat-label>\n <input formControlName=\"Rows\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.Rows\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName=\"MaxLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxLenght\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName=\"MinLenght\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinLenght\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI BOOLEANI -->\n<ng-template #booleadFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsTristate\" formControlName=\"IsTristate\" color=\"primary\">\n A tre stati\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"BoolPresentantioEnum\" [(ngModelInput)]=\"field.PresetationType\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresetationType'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI DATA -->\n<ng-template #dateFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data minima'\" [(ngModelInput)]=\"field.MinDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MinDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-datetimepicker [placeholder]=\"'Data massima'\" [(ngModelInput)]=\"field.MaxDate\"\n [formGroupInput]=\"fieldFormGroup\" [formControlNameInput]=\"'MaxDate'\" [UTCDate]=\"true\" [showSeconds]=\"false\">\n </eqp-datetimepicker>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"DateTimeTypeEnum\" [(ngModelInput)]=\"field.IsOnlyDate\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di data\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'IsOnlyDate'\">\n </eqp-select>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI NUMERICI -->\n<ng-template #numericFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsInteger\" formControlName=\"IsInteger\" color=\"primary\">\n Valore intero\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Formato numerico </mat-label>\n <input formControlName=\"NumberFormat\" matInput [(ngModel)]=\"field.NumberFormat\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Simbolo valuta </mat-label>\n <input formControlName=\"CurrencySymbol\" matInput [(ngModel)]=\"field.CurrencySymbol\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore massimo </mat-label>\n <input formControlName=\"MinValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MinValue\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Valore minimo </mat-label>\n <input formControlName=\"MaxValue\" type=\"number\" [min]=\"0\" matInput [(ngModel)]=\"field.MaxValue\">\n </mat-form-field>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI ALLEGATO -->\n<ng-template #attachmentFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiAttach\" formControlName=\"IsMultiAttach\" color=\"primary\">\n Allegati multipli\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"AvailableFileExtensions.concat(AvailableImageExtensions)\"\n [(ngModelInput)]=\"field.AllowedExtensions\" [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\"\n [isMultiSelect]=\"true\" placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\" [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI IMMAGINE -->\n<ng-template #imageFieldFormTemplate>\n <!-- <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName=\"ImgName\" matInput [(ngModel)]=\"field.ImgName\">\n </mat-form-field>\n </div> -->\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiPoint\" formControlName=\"IsMultiPoint\" color=\"primary\">\n Immagine multi-point\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.ImageIsContextualAttachment\" formControlName=\"ImageIsContextualAttachment\"\n color=\"primary\">\n Carica immagine come allegato\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.AttachDefinition.IsMultiAttach\" formControlName=\"IsMultiAttach\"\n color=\"primary\">\n Immagini multiple\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [arrayData]=\"AvailableImageExtensions\" [(ngModelInput)]=\"field.AttachDefinition.AllowedExtensions\"\n [arrayKeyProperty]=\"'key'\" [arrayValueProperty]=\"'value'\" [isMultiSelect]=\"true\"\n placeholder=\"Estensioni accettate\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'AllowedExtensions'\" [includeFullObject]=\"false\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row mt-2\">\n <div class=\"col-sm-12 col-md-6\">\n <div class=\"header-title-standard\">\n Elenco metadata\n </div>\n </div>\n <div class=\"col-sm-12 col-md-6 text-right\">\n <button class=\"btn btn-primary\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"openMetadataDialog()\">\n <mat-icon>add</mat-icon>\n <span style=\"margin-left: 10px;\">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]=\"false\" [columns]=\"metadataColumns\"\n [data]=\"field.AttachDefinition.MetadataFields\" [emptyTableMessage]=\"'Nessun metadata inserito'\"\n [searchText]=\"'Cerca'\">\n </eqp-table>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LISTA DI VALORI -->\n<ng-template #listValueFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.IsMultiChoiche\" formControlName=\"IsMultiChoiche\" color=\"primary\">\n Scelta multipla\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\">\n <eqp-select [enumData]=\"ListPresentationEnum\" [(ngModelInput)]=\"field.PresentationMode\" [isRequired]=\"true\"\n [showCancelButton]=\"false\" placeholder=\"Tipo di presentazione\" [formGroupInput]=\"fieldFormGroup\"\n [formControlNameInput]=\"'PresentationMode'\">\n </eqp-select>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <h4 class=\"key-value-list-section-title\"> </h4>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Label opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.key\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <mat-form-field>\n <mat-label> Valore opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]=\"keyValueObject.value\" (keyup)=\"onMultiSelectInputKeyup($event, null)\">\n </mat-form-field>\n </div>\n <div class=\"col-md-4 d-flex align-items-center\">\n <span class=\"mr-3\">Opzioni inserite:</span>\n <ul class=\"value-pairs-list\">\n <li *ngFor=\"let keyValuePair of getDictionaryKeyValue()\">\n <mat-icon class=\"mr-1\" (click)=\"deleteKeyFromDictionary(keyValuePair.key)\">close\n </mat-icon>\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- FORM PROPRIET\u00C0 CAMPI LOOKUP -->\n<ng-template #lookupFieldFormTemplate>\n <div class=\"col-sm-12 col-md-4 mt-2 d-flex align-items-center\" [formGroup]=\"fieldFormGroup\">\n <mat-slide-toggle [(ngModel)]=\"field.UseAsGetOrDiscard\" formControlName=\"UseAsGetOrDiscard\" color=\"primary\"\n matTooltip=\"Se true la lookup viene visualizzata in una modale per lo scegli scarta\">\n Usa per scegli o scarta\n </mat-slide-toggle>\n </div>\n <div class=\"col-sm-12 col-md-4 mt-2\" [formGroup]=\"fieldFormGroup\">\n <mat-form-field matTooltip=\"Nome dell'entit\u00E0 relazionata\">\n <mat-label> Nome entit\u00E0 </mat-label>\n <input formControlName=\"EntitySourceName\" required matInput [(ngModel)]=\"field.EntitySourceName\">\n </mat-form-field>\n </div>\n <div class=\"col-sm-12 mt-2\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <mat-form-field\n matTooltip=\"Elenco di campi ordinato che verr\u00E0 visualizzato nella lookup (premere invio per confermare)\">\n <mat-label>\n Nomi dei campi (invio per confermare) </mat-label>\n <input matInput (keyup)=\"onMultiSelectInputKeyup($event, 'FieldNames')\">\n </mat-form-field>\n </div>\n <div class=\"col-md-8 d-flex align-items-center\">\n <span class=\"mr-3\">Nomi selezionati:</span>\n <div class=\"extension-container\" *ngFor=\"let extension of field.FieldNames; let i = index\">\n <span>{{extension}}</span>\n <mat-icon class=\"ml-1\" (click)=\"field.FieldNames.splice(i,1)\">close\n </mat-icon>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE -->\n<ng-template #dialogMetadata>\n <eqp-dynamic-module-add-form-field [field]=\"selectedMetadata\" [availableFields]=\"availableFields\"\n [indexField]=\"indexSelectedMetadata\" (saveFieldEvent)=\"onSaveMetadata($event)\" [fieldTypesToExclude]=\"[6,7,10]\">\n </eqp-dynamic-module-add-form-field>\n</ng-template>",
|
|
2397
|
+
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>",
|
|
1730
2398
|
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}"]
|
|
1731
2399
|
})
|
|
1732
2400
|
], AddFormFieldComponent);
|
|
@@ -1736,6 +2404,7 @@ var AddFormFieldComponent = /** @class */ (function () {
|
|
|
1736
2404
|
var TextFieldTemplateComponent = /** @class */ (function () {
|
|
1737
2405
|
function TextFieldTemplateComponent() {
|
|
1738
2406
|
this.recordChange = new EventEmitter();
|
|
2407
|
+
this.InputMaskEnum = TextMaskEnum;
|
|
1739
2408
|
}
|
|
1740
2409
|
TextFieldTemplateComponent.prototype.ngOnInit = function () {
|
|
1741
2410
|
};
|
|
@@ -1746,6 +2415,20 @@ var TextFieldTemplateComponent = /** @class */ (function () {
|
|
|
1746
2415
|
this.updateField();
|
|
1747
2416
|
}
|
|
1748
2417
|
};
|
|
2418
|
+
TextFieldTemplateComponent.prototype.getInputType = function () {
|
|
2419
|
+
switch (this.field.TextMask) {
|
|
2420
|
+
case TextMaskEnum.Email:
|
|
2421
|
+
return 'email';
|
|
2422
|
+
case TextMaskEnum.Password:
|
|
2423
|
+
return 'password';
|
|
2424
|
+
case TextMaskEnum.Telefono:
|
|
2425
|
+
return 'tel';
|
|
2426
|
+
case TextMaskEnum.Url:
|
|
2427
|
+
return 'url';
|
|
2428
|
+
default:
|
|
2429
|
+
return 'text';
|
|
2430
|
+
}
|
|
2431
|
+
};
|
|
1749
2432
|
/**
|
|
1750
2433
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
1751
2434
|
*/
|
|
@@ -1774,7 +2457,7 @@ var TextFieldTemplateComponent = /** @class */ (function () {
|
|
|
1774
2457
|
TextFieldTemplateComponent = __decorate([
|
|
1775
2458
|
Component({
|
|
1776
2459
|
selector: 'text-field-template',
|
|
1777
|
-
template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput type=\"
|
|
2460
|
+
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>",
|
|
1778
2461
|
styles: [""]
|
|
1779
2462
|
})
|
|
1780
2463
|
], TextFieldTemplateComponent);
|
|
@@ -1826,7 +2509,7 @@ var BooleanFieldTemplateComponent = /** @class */ (function () {
|
|
|
1826
2509
|
BooleanFieldTemplateComponent = __decorate([
|
|
1827
2510
|
Component({
|
|
1828
2511
|
selector: 'boolean-field-template',
|
|
1829
|
-
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>",
|
|
2512
|
+
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>",
|
|
1830
2513
|
styles: [""]
|
|
1831
2514
|
})
|
|
1832
2515
|
], BooleanFieldTemplateComponent);
|
|
@@ -1892,7 +2575,7 @@ var DateFieldTemplateComponent = /** @class */ (function () {
|
|
|
1892
2575
|
DateFieldTemplateComponent = __decorate([
|
|
1893
2576
|
Component({
|
|
1894
2577
|
selector: 'date-field-template',
|
|
1895
|
-
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>",
|
|
2578
|
+
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>",
|
|
1896
2579
|
styles: [""]
|
|
1897
2580
|
})
|
|
1898
2581
|
], DateFieldTemplateComponent);
|
|
@@ -1940,7 +2623,7 @@ var TextareaFieldTemplateComponent = /** @class */ (function () {
|
|
|
1940
2623
|
TextareaFieldTemplateComponent = __decorate([
|
|
1941
2624
|
Component({
|
|
1942
2625
|
selector: 'textarea-field-template',
|
|
1943
|
-
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>",
|
|
2626
|
+
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>",
|
|
1944
2627
|
styles: [""]
|
|
1945
2628
|
})
|
|
1946
2629
|
], TextareaFieldTemplateComponent);
|
|
@@ -1983,10 +2666,17 @@ var NumericFieldTemplateComponent = /** @class */ (function () {
|
|
|
1983
2666
|
*/
|
|
1984
2667
|
NumericFieldTemplateComponent.prototype.configureEqpNumericOptions = function () {
|
|
1985
2668
|
this.eqpNumericOptions.prefix = this.field.CurrencySymbol ? this.field.CurrencySymbol : "";
|
|
2669
|
+
this.eqpNumericOptions.inputMode = this.field.CurrencySymbol ? EqpNumericInputMode.FINANCIAL : EqpNumericInputMode.NATURAL;
|
|
1986
2670
|
if (this.field.MinValue != null && this.field.MinValue != undefined)
|
|
1987
2671
|
this.eqpNumericOptions.min = this.field.MinValue;
|
|
1988
2672
|
if (this.field.MaxValue != null && this.field.MaxValue != undefined)
|
|
1989
2673
|
this.eqpNumericOptions.max = this.field.MaxValue;
|
|
2674
|
+
if (this.field.DecimalSeparator != null && this.field.DecimalSeparator != undefined)
|
|
2675
|
+
this.eqpNumericOptions.decimal = this.field.DecimalSeparator;
|
|
2676
|
+
if (this.field.ThousandsSeparator != null && this.field.ThousandsSeparator != undefined)
|
|
2677
|
+
this.eqpNumericOptions.thousands = this.field.ThousandsSeparator;
|
|
2678
|
+
if (this.field.DecimalPrecision != null && this.field.DecimalPrecision != undefined)
|
|
2679
|
+
this.eqpNumericOptions.precision = this.field.DecimalPrecision;
|
|
1990
2680
|
};
|
|
1991
2681
|
__decorate([
|
|
1992
2682
|
Input()
|
|
@@ -2000,7 +2690,7 @@ var NumericFieldTemplateComponent = /** @class */ (function () {
|
|
|
2000
2690
|
NumericFieldTemplateComponent = __decorate([
|
|
2001
2691
|
Component({
|
|
2002
2692
|
selector: 'numeric-field-template',
|
|
2003
|
-
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>",
|
|
2693
|
+
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>",
|
|
2004
2694
|
styles: [""]
|
|
2005
2695
|
})
|
|
2006
2696
|
], NumericFieldTemplateComponent);
|
|
@@ -2038,26 +2728,17 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
|
|
|
2038
2728
|
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
2039
2729
|
}
|
|
2040
2730
|
};
|
|
2041
|
-
/**
|
|
2042
|
-
* Metodo per recuperare la classe da applicare al button (nella relativa visualizzazione).
|
|
2043
|
-
* Se il pulsante è stato selezionato imposta la classe "selected-button".
|
|
2044
|
-
* @param data Oggetto bindato al pulsante
|
|
2045
|
-
* @returns Restituisce la classe da applicare tramite [ngClass]
|
|
2046
|
-
*/
|
|
2047
|
-
ListValueFieldTemplateComponent.prototype.getSelectButtonClass = function (data) {
|
|
2048
|
-
var selectedButtonClass = "selected-button";
|
|
2049
|
-
return data.Selected ? selectedButtonClass : null;
|
|
2050
|
-
};
|
|
2051
2731
|
/**
|
|
2052
2732
|
* Metodo invocato quando viene selezionata un'opzione nella visualizzazione a button
|
|
2053
2733
|
* @param data Rappresenta l'oggetto selezionato
|
|
2054
2734
|
*/
|
|
2055
2735
|
ListValueFieldTemplateComponent.prototype.buttonSelectClick = function (data) {
|
|
2736
|
+
data.Selected = !data.Selected;
|
|
2056
2737
|
if (this.field.IsMultiChoiche) {
|
|
2057
|
-
data.Selected = !data.Selected;
|
|
2058
2738
|
this.updateSelected(false);
|
|
2059
2739
|
}
|
|
2060
2740
|
else {
|
|
2741
|
+
this.arrayData.filter(function (d) { return d.Key != data.Key && d.Value != data.Value; }).forEach(function (d) { return d.Selected = false; });
|
|
2061
2742
|
this.record[this.field.Name] = data.Value;
|
|
2062
2743
|
}
|
|
2063
2744
|
this.onRecordValueChange();
|
|
@@ -2087,16 +2768,23 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
|
|
|
2087
2768
|
*/
|
|
2088
2769
|
ListValueFieldTemplateComponent.prototype.setArrayData = function () {
|
|
2089
2770
|
var _this = this;
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2771
|
+
if (this.field.PresentationMode != ListPresentationEnum.Immagini) {
|
|
2772
|
+
Object.keys(this.field.ValuePairs).forEach(function (k) { _this.createArrayDataElement(k, _this.field.ValuePairs[k]); });
|
|
2773
|
+
}
|
|
2774
|
+
else {
|
|
2775
|
+
this.field.ButtonImageList.forEach(function (i) { _this.createArrayDataElement(i.ButtonKey, i.ButtonValue, 'data:' + i.FileContentType + ';base64,' + i.FileDataBase64); });
|
|
2776
|
+
}
|
|
2777
|
+
};
|
|
2778
|
+
ListValueFieldTemplateComponent.prototype.createArrayDataElement = function (key, value, imgUrl) {
|
|
2779
|
+
if (imgUrl === void 0) { imgUrl = null; }
|
|
2780
|
+
var isOptionSelected;
|
|
2781
|
+
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
2782
|
+
isOptionSelected = !!this.record[this.field.Name].find(function (v) { return v == value; });
|
|
2783
|
+
}
|
|
2784
|
+
else {
|
|
2785
|
+
isOptionSelected = this.record[this.field.Name] === value;
|
|
2786
|
+
}
|
|
2787
|
+
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
2100
2788
|
};
|
|
2101
2789
|
/**
|
|
2102
2790
|
* Metodo per aggiornare il valore e il validator del FormControl associato al campo.
|
|
@@ -2116,39 +2804,21 @@ var ListValueFieldTemplateComponent = /** @class */ (function () {
|
|
|
2116
2804
|
ListValueFieldTemplateComponent = __decorate([
|
|
2117
2805
|
Component({
|
|
2118
2806
|
selector: 'list-value-field-template',
|
|
2119
|
-
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\"
|
|
2120
|
-
styles: [".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]
|
|
2807
|
+
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>",
|
|
2808
|
+
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}"]
|
|
2121
2809
|
})
|
|
2122
2810
|
], ListValueFieldTemplateComponent);
|
|
2123
2811
|
return ListValueFieldTemplateComponent;
|
|
2124
2812
|
}());
|
|
2125
2813
|
|
|
2126
2814
|
var AttachmentFieldTemplateComponent = /** @class */ (function () {
|
|
2127
|
-
//#endregion
|
|
2128
2815
|
function AttachmentFieldTemplateComponent(utilityService, cdr) {
|
|
2129
2816
|
this.utilityService = utilityService;
|
|
2130
2817
|
this.cdr = cdr;
|
|
2131
2818
|
this.onlyImages = false;
|
|
2132
2819
|
this.recordChange = new EventEmitter();
|
|
2820
|
+
this.onAttachmentsChange = new EventEmitter();
|
|
2133
2821
|
this.metadataFormGroups = new Array();
|
|
2134
|
-
//#region Etichette per eqp-attachments
|
|
2135
|
-
this.previewLabel = "Anteprima";
|
|
2136
|
-
this.emptyTableMessage = "No record found";
|
|
2137
|
-
this.downloadTooltipPosition = "below";
|
|
2138
|
-
this.openLinkLabel = "Apri link";
|
|
2139
|
-
this.addButtonLabel = "Aggiungi";
|
|
2140
|
-
this.downloadLabel = "Download";
|
|
2141
|
-
this.deleteLabel = "Elimina";
|
|
2142
|
-
this.fileNameLabel = "Nome file";
|
|
2143
|
-
this.uploadFileLabel = "Carica file";
|
|
2144
|
-
this.confirmLabel = "Conferma";
|
|
2145
|
-
this.abortLabel = "Annulla";
|
|
2146
|
-
this.saveLabel = "Salva";
|
|
2147
|
-
this.exitLabel = "Esci";
|
|
2148
|
-
this.eqpTableSearchText = "Cerca...";
|
|
2149
|
-
this.deleteDialogTitle = "Attenzione:";
|
|
2150
|
-
this.deleteDialogMessage = "Sicuro di voler eliminare questo allegato?";
|
|
2151
|
-
this.noImageSelectedErrorMessage = "Nessuna immagine selezionata!";
|
|
2152
2822
|
}
|
|
2153
2823
|
AttachmentFieldTemplateComponent.prototype.ngOnInit = function () {
|
|
2154
2824
|
// Nel caso in cui sono in modifica di un Record aggiorno il valore
|
|
@@ -2199,6 +2869,10 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
|
|
|
2199
2869
|
this.createMetadataFormGroups();
|
|
2200
2870
|
this.setFormControlValue();
|
|
2201
2871
|
this.onRecordValueChange();
|
|
2872
|
+
// Scateno un evento di output necessario al componente ImageFieldTemplate al
|
|
2873
|
+
// variare degli allegati caricati. Viene usato per aprire il dialog per disegnare
|
|
2874
|
+
// sull'immagine caricata in base alla configurazione del Field.
|
|
2875
|
+
this.onAttachmentsChange.emit();
|
|
2202
2876
|
this.cdr.detectChanges();
|
|
2203
2877
|
};
|
|
2204
2878
|
/**
|
|
@@ -2285,6 +2959,9 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
|
|
|
2285
2959
|
__decorate([
|
|
2286
2960
|
Output()
|
|
2287
2961
|
], AttachmentFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
2962
|
+
__decorate([
|
|
2963
|
+
Output()
|
|
2964
|
+
], AttachmentFieldTemplateComponent.prototype, "onAttachmentsChange", void 0);
|
|
2288
2965
|
__decorate([
|
|
2289
2966
|
ViewChild("eqpAttachments", { static: true })
|
|
2290
2967
|
], AttachmentFieldTemplateComponent.prototype, "eqpAttachments", void 0);
|
|
@@ -2294,16 +2971,38 @@ var AttachmentFieldTemplateComponent = /** @class */ (function () {
|
|
|
2294
2971
|
AttachmentFieldTemplateComponent = __decorate([
|
|
2295
2972
|
Component({
|
|
2296
2973
|
selector: 'attachment-field-template',
|
|
2297
|
-
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\"
|
|
2974
|
+
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>",
|
|
2298
2975
|
styles: [""]
|
|
2299
2976
|
})
|
|
2300
2977
|
], AttachmentFieldTemplateComponent);
|
|
2301
2978
|
return AttachmentFieldTemplateComponent;
|
|
2302
2979
|
}());
|
|
2303
2980
|
|
|
2981
|
+
/**
|
|
2982
|
+
* Metodo per recuperare, a partire da un Blob, la stringa contenente il base64 del file.
|
|
2983
|
+
* Usato per prendere il base64 dell'immagine dopo che l'utente ci ha disegnato sopra.
|
|
2984
|
+
* @param file Blob che rappresenta l'immagine.
|
|
2985
|
+
*/
|
|
2986
|
+
var toBase64 = function (file) { return new Promise(function (resolve, reject) {
|
|
2987
|
+
var reader = new FileReader();
|
|
2988
|
+
reader.readAsDataURL(file);
|
|
2989
|
+
reader.onload = function () { return resolve(reader.result.toString()); };
|
|
2990
|
+
reader.onerror = function (error) { return reject(error); };
|
|
2991
|
+
}); };
|
|
2992
|
+
var ɵ0 = toBase64;
|
|
2304
2993
|
var ImageFieldTemplateComponent = /** @class */ (function () {
|
|
2305
|
-
|
|
2994
|
+
//#endregion
|
|
2995
|
+
function ImageFieldTemplateComponent(dialog, utilityService) {
|
|
2996
|
+
this.dialog = dialog;
|
|
2997
|
+
this.utilityService = utilityService;
|
|
2306
2998
|
this.recordChange = new EventEmitter();
|
|
2999
|
+
//#region Proprietà per configurare il componente ngx-image-drawing e aprire il relativo dialog.
|
|
3000
|
+
this.width = null;
|
|
3001
|
+
this.height = null;
|
|
3002
|
+
this.i18n = {
|
|
3003
|
+
saveBtn: 'Salva modifiche',
|
|
3004
|
+
cancelBtn: 'Ricarica originale'
|
|
3005
|
+
};
|
|
2307
3006
|
}
|
|
2308
3007
|
ImageFieldTemplateComponent.prototype.ngOnInit = function () {
|
|
2309
3008
|
this.field.AttachDefinition.FormFormGroup = this.field.FormFormGroup;
|
|
@@ -2316,6 +3015,19 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
|
|
|
2316
3015
|
this.field.AttachDefinition.Required = this.field.Required;
|
|
2317
3016
|
this.field.AttachDefinition.Formula = this.field.Formula;
|
|
2318
3017
|
this.field.AttachDefinition.FieldValue = this.field.FieldValue;
|
|
3018
|
+
// Se il campo prevede un'immagine pre-caricata (ImageIsContextualAttachment == true) sulla quale
|
|
3019
|
+
// l'utente può disegnare (EnableDrawing == true) e non sono in modifica di un record (ovvero nel record
|
|
3020
|
+
// non ho un'immagine già salvata) allora imposta l'immagine pre caricata come valore iniziale
|
|
3021
|
+
// nel record corrente e ne recupera le dimensioni per visualizzare correttamente l'area in cui
|
|
3022
|
+
// l'utente può disegnare. Se non effettua modifiche o non salva i disegni fatti viene salvata
|
|
3023
|
+
// l'immagine originale.
|
|
3024
|
+
if (this.field.ImageIsContextualAttachment && this.field.ContextualAttachment) {
|
|
3025
|
+
if (!this.record[this.field.Name] || !Array.isArray(this.record[this.field.Name]) || !(this.record[this.field.Name].length > 0)) {
|
|
3026
|
+
this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
|
|
3027
|
+
}
|
|
3028
|
+
this.preLoadedImageMetadataFormGroup = this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields, this.record[this.field.Name][0]);
|
|
3029
|
+
this.getImageDimensions();
|
|
3030
|
+
}
|
|
2319
3031
|
};
|
|
2320
3032
|
ImageFieldTemplateComponent.prototype.ngOnChanges = function (changes) {
|
|
2321
3033
|
// Se viene modificato il valore di "ngModelInput" allora aggiorna l'input
|
|
@@ -2324,6 +3036,15 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
|
|
|
2324
3036
|
this.updateField();
|
|
2325
3037
|
}
|
|
2326
3038
|
};
|
|
3039
|
+
ImageFieldTemplateComponent.prototype.updateMetadataValidity = function () {
|
|
3040
|
+
if (this.preLoadedImageMetadataFormGroup.invalid) {
|
|
3041
|
+
this.field.FormFormGroup.controls[this.field.Name].setErrors({ 'incorrect': true });
|
|
3042
|
+
}
|
|
3043
|
+
else {
|
|
3044
|
+
this.field.FormFormGroup.controls[this.field.Name].setErrors(null);
|
|
3045
|
+
}
|
|
3046
|
+
this.onRecordValueChange();
|
|
3047
|
+
};
|
|
2327
3048
|
/**
|
|
2328
3049
|
* Metodo per aggiornare il valore del campo quando questo è rappresentato da una formula.
|
|
2329
3050
|
*/
|
|
@@ -2332,6 +3053,108 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
|
|
|
2332
3053
|
this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
2333
3054
|
}
|
|
2334
3055
|
};
|
|
3056
|
+
ImageFieldTemplateComponent.prototype.resetPreLoadedImage = function () {
|
|
3057
|
+
this.width = null;
|
|
3058
|
+
this.height = null;
|
|
3059
|
+
this.record[this.field.Name] = [JSON.parse(JSON.stringify(this.field.ContextualAttachment))];
|
|
3060
|
+
this.getImageDimensions();
|
|
3061
|
+
};
|
|
3062
|
+
/**
|
|
3063
|
+
* Metodo invocato quando vengono aggiunti o eliminati gli allegati nel componente AttachmentFieldTemplate.
|
|
3064
|
+
* Se l'ImageField è abilitato al disegno (EnableDrawing == true), non permette allegati multipli (IsMulitAttach == false)
|
|
3065
|
+
* e nel Record corrente è presente l'immagine caricata dall'utente allora recupera le dimensioni dell'immagine e
|
|
3066
|
+
* apre il dialog con il componente image-drawing per permettere il disegno sull'immagine appena caricata.
|
|
3067
|
+
*/
|
|
3068
|
+
ImageFieldTemplateComponent.prototype.onAttachmentsChange = function () {
|
|
3069
|
+
if (!this.field.AttachDefinition.IsMultiAttach && this.field.EnableDrawing && this.record[this.field.Name] && this.record[this.field.Name][0]) {
|
|
3070
|
+
this.getImageDimensions();
|
|
3071
|
+
this.dialogImageDrowingRef = this.dialog.open(this.dialogImageDrowing, {
|
|
3072
|
+
disableClose: true,
|
|
3073
|
+
hasBackdrop: true,
|
|
3074
|
+
width: '75%'
|
|
3075
|
+
});
|
|
3076
|
+
}
|
|
3077
|
+
};
|
|
3078
|
+
/**
|
|
3079
|
+
* Metodo invocato al salvataggio dell'immagine dal componente image-drawing.
|
|
3080
|
+
* Trasforma il Blob ricevuto in un base64, aggiorna il FileContetType e il FileDataBase64
|
|
3081
|
+
* dell'allegato caricato e chiude il dialog in cui disegnare.
|
|
3082
|
+
* @param drawnPicture Blob dell'immagine disegnata.
|
|
3083
|
+
*/
|
|
3084
|
+
ImageFieldTemplateComponent.prototype.saveDrowning = function (drawnPicture) {
|
|
3085
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3086
|
+
var base64File;
|
|
3087
|
+
return __generator(this, function (_a) {
|
|
3088
|
+
switch (_a.label) {
|
|
3089
|
+
case 0: return [4 /*yield*/, toBase64(drawnPicture)];
|
|
3090
|
+
case 1:
|
|
3091
|
+
base64File = _a.sent();
|
|
3092
|
+
if (base64File) {
|
|
3093
|
+
this.record[this.field.Name][0].FileContentType = base64File.split(",")[0].split(":")[1].split(";")[0];
|
|
3094
|
+
this.record[this.field.Name][0].FileDataBase64 = base64File.split(",")[1];
|
|
3095
|
+
}
|
|
3096
|
+
if (this.dialogImageDrowingRef) {
|
|
3097
|
+
this.closeImageDrowingDialog();
|
|
3098
|
+
}
|
|
3099
|
+
return [2 /*return*/];
|
|
3100
|
+
}
|
|
3101
|
+
});
|
|
3102
|
+
});
|
|
3103
|
+
};
|
|
3104
|
+
/**
|
|
3105
|
+
* Metodo per chiudere il dialog in cui disegnare sull'immagine cariata e svuotare le dimensioni.
|
|
3106
|
+
*/
|
|
3107
|
+
ImageFieldTemplateComponent.prototype.closeImageDrowingDialog = function () {
|
|
3108
|
+
this.dialogImageDrowingRef.close();
|
|
3109
|
+
this.width = null;
|
|
3110
|
+
this.height = null;
|
|
3111
|
+
};
|
|
3112
|
+
/**
|
|
3113
|
+
* Metodo per recuperare le dimensioni dell'immagine caricata per mostrare correttamente
|
|
3114
|
+
* il componente image-drawing. Se non viene eseguito questo passaggio l'area in cui disegnare
|
|
3115
|
+
* è più grande dell'immagine stessa e al salvataggio i tratti disegnati vengono spostati.
|
|
3116
|
+
*/
|
|
3117
|
+
ImageFieldTemplateComponent.prototype.getImageDimensions = function () {
|
|
3118
|
+
var _this = this;
|
|
3119
|
+
var blob = this.getBlobFromBase64();
|
|
3120
|
+
var reader = new FileReader();
|
|
3121
|
+
reader.onload = function (e) {
|
|
3122
|
+
var image = new Image();
|
|
3123
|
+
image.src = e.target.result;
|
|
3124
|
+
image.onload = function (rs) {
|
|
3125
|
+
_this.height = rs.currentTarget['height'];
|
|
3126
|
+
_this.width = rs.currentTarget['width'];
|
|
3127
|
+
};
|
|
3128
|
+
};
|
|
3129
|
+
reader.readAsDataURL(blob);
|
|
3130
|
+
};
|
|
3131
|
+
/**
|
|
3132
|
+
* Metodo per convertire il base64 di un'immagine in un Blob.
|
|
3133
|
+
* Necessario per il recupero delle dimensioni dell'immagine caricata a partire dal suo base64.
|
|
3134
|
+
* Viene eseguito solo nel caso in cui l'ImageField non ammette allegati multipli.
|
|
3135
|
+
* @returns Restituisce il Blob dell'immagine caricata.
|
|
3136
|
+
*/
|
|
3137
|
+
ImageFieldTemplateComponent.prototype.getBlobFromBase64 = function () {
|
|
3138
|
+
var byteCharacters = atob(this.record[this.field.Name][0].FileDataBase64);
|
|
3139
|
+
var byteNumbers = new Array(byteCharacters.length);
|
|
3140
|
+
for (var i = 0; i < byteCharacters.length; i++) {
|
|
3141
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
3142
|
+
}
|
|
3143
|
+
var byteArray = new Uint8Array(byteNumbers);
|
|
3144
|
+
return new Blob([byteArray], { type: this.record[this.field.Name][0].FileContentType });
|
|
3145
|
+
};
|
|
3146
|
+
/**
|
|
3147
|
+
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
3148
|
+
*/
|
|
3149
|
+
ImageFieldTemplateComponent.prototype.onRecordValueChange = function () {
|
|
3150
|
+
if (!this.field.Formula) {
|
|
3151
|
+
this.recordChange.emit(this.record);
|
|
3152
|
+
}
|
|
3153
|
+
};
|
|
3154
|
+
ImageFieldTemplateComponent.ctorParameters = function () { return [
|
|
3155
|
+
{ type: MatDialog },
|
|
3156
|
+
{ type: UtilityHelperService }
|
|
3157
|
+
]; };
|
|
2335
3158
|
__decorate([
|
|
2336
3159
|
Input()
|
|
2337
3160
|
], ImageFieldTemplateComponent.prototype, "record", void 0);
|
|
@@ -2341,11 +3164,14 @@ var ImageFieldTemplateComponent = /** @class */ (function () {
|
|
|
2341
3164
|
__decorate([
|
|
2342
3165
|
Output()
|
|
2343
3166
|
], ImageFieldTemplateComponent.prototype, "recordChange", void 0);
|
|
3167
|
+
__decorate([
|
|
3168
|
+
ViewChild("dialogImageDrowing", { static: true })
|
|
3169
|
+
], ImageFieldTemplateComponent.prototype, "dialogImageDrowing", void 0);
|
|
2344
3170
|
ImageFieldTemplateComponent = __decorate([
|
|
2345
3171
|
Component({
|
|
2346
3172
|
selector: 'image-field-template',
|
|
2347
|
-
template: "<attachment-field-template [(record)]=\"record\" [field]=\"field.AttachDefinition\"
|
|
2348
|
-
styles: [""]
|
|
3173
|
+
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>",
|
|
3174
|
+
styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]
|
|
2349
3175
|
})
|
|
2350
3176
|
], ImageFieldTemplateComponent);
|
|
2351
3177
|
return ImageFieldTemplateComponent;
|
|
@@ -2426,30 +3252,14 @@ var ListFormRecordComponent = /** @class */ (function () {
|
|
|
2426
3252
|
* @param record Record da duplicare.
|
|
2427
3253
|
*/
|
|
2428
3254
|
ListFormRecordComponent.prototype.duplicateRecord = function (record) {
|
|
2429
|
-
// EqpDynamicModuleDialogService.Confirm('Duplicare il record selezionato?', () => {
|
|
2430
|
-
// var copiedRecord: Record = JSON.parse(JSON.stringify(record));
|
|
2431
|
-
// if (!isNaN(parseInt(copiedRecord.ID))) {
|
|
2432
|
-
// copiedRecord.ID = (parseInt(copiedRecord.ID) + 1).toString();
|
|
2433
|
-
// } else {
|
|
2434
|
-
// copiedRecord.ID = "xxxxxxxxx".replace("x", (c) => { return (Math.random() + 16 | 0).toString(16); });
|
|
2435
|
-
// }
|
|
2436
|
-
// this.values.push(copiedRecord);
|
|
2437
|
-
// this.reloadTables();
|
|
2438
|
-
// }, false, 'Richiesta conferma');
|
|
2439
3255
|
this.onDuplicateRecord.emit(record);
|
|
2440
|
-
//TODO
|
|
2441
3256
|
};
|
|
2442
3257
|
/**
|
|
2443
3258
|
* Metodo per eliminare un record dalla lista.
|
|
2444
3259
|
* @param record Record da eliminare selezionato sulla eqp-table.
|
|
2445
3260
|
*/
|
|
2446
3261
|
ListFormRecordComponent.prototype.deleteRecord = function (record) {
|
|
2447
|
-
// EqpDynamicModuleDialogService.Confirm('Eliminare il record selezionato?', () => {
|
|
2448
|
-
// this.values.splice(this.values.indexOf(record), 1);
|
|
2449
|
-
// this.reloadTables();
|
|
2450
|
-
// }, false, 'Richiesta conferma');
|
|
2451
3262
|
this.onDeleteRecord.emit(record);
|
|
2452
|
-
// TODO
|
|
2453
3263
|
};
|
|
2454
3264
|
/**
|
|
2455
3265
|
* Metodo per creare la configurazione delle colonne per la eqp-table.
|
|
@@ -2492,7 +3302,7 @@ var ListFormRecordComponent = /** @class */ (function () {
|
|
|
2492
3302
|
column.format = "dd/MM/yyyy HH:mm";
|
|
2493
3303
|
}
|
|
2494
3304
|
else if (field.IsOnlyDate == DateTimeTypeEnum['Solo data']) {
|
|
2495
|
-
column.format = "dd/MM/yyyy";
|
|
3305
|
+
column.format = field.DateFormat ? field.DateFormat.replace("DD", "dd") : "dd/MM/yyyy";
|
|
2496
3306
|
}
|
|
2497
3307
|
}
|
|
2498
3308
|
break;
|
|
@@ -2580,12 +3390,6 @@ var ListFormRecordComponent = /** @class */ (function () {
|
|
|
2580
3390
|
return ListFormRecordComponent;
|
|
2581
3391
|
}());
|
|
2582
3392
|
|
|
2583
|
-
var Record = /** @class */ (function () {
|
|
2584
|
-
function Record() {
|
|
2585
|
-
}
|
|
2586
|
-
return Record;
|
|
2587
|
-
}());
|
|
2588
|
-
|
|
2589
3393
|
var AddFormRecordComponent = /** @class */ (function () {
|
|
2590
3394
|
function AddFormRecordComponent(cdr, utilityService) {
|
|
2591
3395
|
this.cdr = cdr;
|
|
@@ -2705,7 +3509,7 @@ var AddFormRecordComponent = /** @class */ (function () {
|
|
|
2705
3509
|
AddFormRecordComponent = __decorate([
|
|
2706
3510
|
Component({
|
|
2707
3511
|
selector: 'add-form-record',
|
|
2708
|
-
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>",
|
|
3512
|
+
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>",
|
|
2709
3513
|
styles: [""]
|
|
2710
3514
|
})
|
|
2711
3515
|
], AddFormRecordComponent);
|
|
@@ -2827,13 +3631,33 @@ var DynamicModuleFieldComponent = /** @class */ (function () {
|
|
|
2827
3631
|
DynamicModuleFieldComponent = __decorate([
|
|
2828
3632
|
Component({
|
|
2829
3633
|
selector: 'dynamic-module-field',
|
|
2830
|
-
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>",
|
|
3634
|
+
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>",
|
|
2831
3635
|
styles: [""]
|
|
2832
3636
|
})
|
|
2833
3637
|
], DynamicModuleFieldComponent);
|
|
2834
3638
|
return DynamicModuleFieldComponent;
|
|
2835
3639
|
}());
|
|
2836
3640
|
|
|
3641
|
+
var SpinnerComponent = /** @class */ (function () {
|
|
3642
|
+
function SpinnerComponent(spinnerService) {
|
|
3643
|
+
this.spinnerService = spinnerService;
|
|
3644
|
+
this.isLoading = this.spinnerService.isLoading;
|
|
3645
|
+
}
|
|
3646
|
+
SpinnerComponent.prototype.ngOnInit = function () {
|
|
3647
|
+
};
|
|
3648
|
+
SpinnerComponent.ctorParameters = function () { return [
|
|
3649
|
+
{ type: SpinnerService }
|
|
3650
|
+
]; };
|
|
3651
|
+
SpinnerComponent = __decorate([
|
|
3652
|
+
Component({
|
|
3653
|
+
selector: 'eqp-dynamic-module-spinner',
|
|
3654
|
+
template: "<div class=\"eqp-splash-screen\" *ngIf=\"isLoading | async\">\r\n <div id=\"loader\"></div>\r\n</div>",
|
|
3655
|
+
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}"]
|
|
3656
|
+
})
|
|
3657
|
+
], SpinnerComponent);
|
|
3658
|
+
return SpinnerComponent;
|
|
3659
|
+
}());
|
|
3660
|
+
|
|
2837
3661
|
var EqpDynamicModuleModule = /** @class */ (function () {
|
|
2838
3662
|
function EqpDynamicModuleModule() {
|
|
2839
3663
|
}
|
|
@@ -2854,6 +3678,7 @@ var EqpDynamicModuleModule = /** @class */ (function () {
|
|
|
2854
3678
|
ListFormRecordComponent,
|
|
2855
3679
|
AddFormRecordComponent,
|
|
2856
3680
|
DynamicModuleFieldComponent,
|
|
3681
|
+
SpinnerComponent,
|
|
2857
3682
|
],
|
|
2858
3683
|
imports: [
|
|
2859
3684
|
BrowserModule,
|
|
@@ -2866,7 +3691,8 @@ var EqpDynamicModuleModule = /** @class */ (function () {
|
|
|
2866
3691
|
EqpSelectModule,
|
|
2867
3692
|
EqpDatetimepickerModule,
|
|
2868
3693
|
EqpFiltersModule,
|
|
2869
|
-
EqpNumericModule
|
|
3694
|
+
EqpNumericModule,
|
|
3695
|
+
EqpImgDrawingModule
|
|
2870
3696
|
],
|
|
2871
3697
|
exports: [
|
|
2872
3698
|
EqpDynamicModuleComponent,
|
|
@@ -2893,6 +3719,14 @@ var ImageField = /** @class */ (function (_super) {
|
|
|
2893
3719
|
function ImageField() {
|
|
2894
3720
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2895
3721
|
}
|
|
3722
|
+
Object.defineProperty(ImageField.prototype, "_contextualAttachments", {
|
|
3723
|
+
/**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
|
|
3724
|
+
get: function () {
|
|
3725
|
+
return this.ContextualAttachment ? [this.ContextualAttachment] : [];
|
|
3726
|
+
},
|
|
3727
|
+
enumerable: true,
|
|
3728
|
+
configurable: true
|
|
3729
|
+
});
|
|
2896
3730
|
return ImageField;
|
|
2897
3731
|
}(BaseField));
|
|
2898
3732
|
|
|
@@ -2922,15 +3756,6 @@ var TextareaField = /** @class */ (function (_super) {
|
|
|
2922
3756
|
return TextareaField;
|
|
2923
3757
|
}(BaseField));
|
|
2924
3758
|
|
|
2925
|
-
/**Campo di testo */
|
|
2926
|
-
var TextField = /** @class */ (function (_super) {
|
|
2927
|
-
__extends(TextField, _super);
|
|
2928
|
-
function TextField() {
|
|
2929
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
2930
|
-
}
|
|
2931
|
-
return TextField;
|
|
2932
|
-
}(BaseField));
|
|
2933
|
-
|
|
2934
3759
|
/*
|
|
2935
3760
|
* Public API Surface of eqp-dynamic-module
|
|
2936
3761
|
*/
|
|
@@ -2939,5 +3764,5 @@ var TextField = /** @class */ (function (_super) {
|
|
|
2939
3764
|
* Generated bundle index. Do not edit.
|
|
2940
3765
|
*/
|
|
2941
3766
|
|
|
2942
|
-
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,
|
|
3767
|
+
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 };
|
|
2943
3768
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.js.map
|