@esfaenza/extensions 13.3.6 → 13.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/models/CallResult.mjs +1 -1
- package/esm2020/lib/models/CsvHeaders.mjs +1 -1
- package/esm2020/lib/models/ExportConsts.mjs +9 -1
- package/esm2020/lib/modules/extensions.full.module.mjs +4 -4
- package/esm2020/lib/modules/extensions.module.mjs +4 -4
- package/esm2020/lib/services/extensions.clipboard.service.mjs +75 -23
- package/esm2020/lib/services/extensions.dates.service.mjs +11 -6
- package/esm2020/lib/services/extensions.exports.service.mjs +86 -32
- package/esm2020/lib/services/extensions.hashing.service.mjs +3 -3
- package/esm2020/lib/services/extensions.intercom.service.mjs +3 -3
- package/esm2020/lib/services/extensions.messages.service.mjs +66 -19
- package/esm2020/lib/services/extensions.utilities.service.mjs +46 -4
- package/fesm2015/esfaenza-extensions.mjs +312 -106
- package/fesm2015/esfaenza-extensions.mjs.map +1 -1
- package/fesm2020/esfaenza-extensions.mjs +299 -93
- package/fesm2020/esfaenza-extensions.mjs.map +1 -1
- package/lib/models/CallResult.d.ts +11 -25
- package/lib/models/CsvHeaders.d.ts +4 -0
- package/lib/models/ExportConsts.d.ts +8 -0
- package/lib/services/extensions.clipboard.service.d.ts +2 -0
- package/lib/services/extensions.exports.service.d.ts +2 -2
- package/lib/services/extensions.messages.service.d.ts +23 -7
- package/lib/services/extensions.utilities.service.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, NgModule,
|
|
2
|
+
import { InjectionToken, NgModule, Injector, Injectable, Inject, Optional } from '@angular/core';
|
|
3
3
|
import swal from 'sweetalert2';
|
|
4
|
+
import { ToastrService } from 'ngx-toastr';
|
|
4
5
|
import { of, Subject } from 'rxjs';
|
|
5
6
|
import { map } from 'rxjs/operators';
|
|
6
|
-
import * as i1 from 'ngx-toastr';
|
|
7
7
|
import { Deserialize } from 'cerialize';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -40,10 +40,10 @@ class ExtensionsModule {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
ExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
44
|
-
ExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.
|
|
45
|
-
ExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
43
|
+
ExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
44
|
+
ExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExtensionsModule });
|
|
45
|
+
ExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExtensionsModule });
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExtensionsModule, decorators: [{
|
|
47
47
|
type: NgModule
|
|
48
48
|
}] });
|
|
49
49
|
|
|
@@ -57,8 +57,8 @@ class MessageService {
|
|
|
57
57
|
*
|
|
58
58
|
* @ignore
|
|
59
59
|
*/
|
|
60
|
-
constructor(
|
|
61
|
-
this.
|
|
60
|
+
constructor(injector, FANCY_ALERTS, LOCALE) {
|
|
61
|
+
this.injector = injector;
|
|
62
62
|
this.FANCY_ALERTS = FANCY_ALERTS;
|
|
63
63
|
this.LOCALE = LOCALE;
|
|
64
64
|
/**
|
|
@@ -85,6 +85,20 @@ class MessageService {
|
|
|
85
85
|
allowOutsideClick: false,
|
|
86
86
|
icon: "warning"
|
|
87
87
|
});
|
|
88
|
+
this.successSwalWithCancel = swal.mixin({
|
|
89
|
+
title: this.loc["Success"][this.LOCALE ?? 'it-IT'],
|
|
90
|
+
customClass: {
|
|
91
|
+
confirmButton: "btn btn-primary",
|
|
92
|
+
cancelButton: "btn btn-secondary app-margin-right-10",
|
|
93
|
+
container: "app-wrap",
|
|
94
|
+
},
|
|
95
|
+
buttonsStyling: false,
|
|
96
|
+
reverseButtons: true,
|
|
97
|
+
showCancelButton: true,
|
|
98
|
+
confirmButtonText: this.loc["Confirm"][this.LOCALE ?? 'it-IT'],
|
|
99
|
+
cancelButtonText: this.loc["Cancel"][this.LOCALE ?? 'it-IT'],
|
|
100
|
+
icon: "success"
|
|
101
|
+
});
|
|
88
102
|
this.warningSwalWithCancel = swal.mixin({
|
|
89
103
|
title: this.loc["Warning"][this.LOCALE ?? 'it-IT'],
|
|
90
104
|
customClass: {
|
|
@@ -148,6 +162,9 @@ class MessageService {
|
|
|
148
162
|
icon: "info"
|
|
149
163
|
});
|
|
150
164
|
}
|
|
165
|
+
get toastr() {
|
|
166
|
+
return this.injector.get(ToastrService);
|
|
167
|
+
}
|
|
151
168
|
/**
|
|
152
169
|
* Presentazione di un semplice messaggio di successo
|
|
153
170
|
*
|
|
@@ -157,12 +174,12 @@ class MessageService {
|
|
|
157
174
|
* @param {string} text Testo da mostrare
|
|
158
175
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
159
176
|
*/
|
|
160
|
-
simpleSuccess(text, secondaryNotificationType = null) {
|
|
177
|
+
simpleSuccess(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
161
178
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
162
179
|
if (tos == "swal")
|
|
163
180
|
this.successSwal.fire("", text);
|
|
164
181
|
else
|
|
165
|
-
this.toastr.success(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
182
|
+
this.toastr.success(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: secondaryNotificationTimeout || (tos == "toastr" ? 0 : 5000), extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
166
183
|
}
|
|
167
184
|
/**
|
|
168
185
|
* Presentazione di un semplice messaggio di informazione
|
|
@@ -173,12 +190,12 @@ class MessageService {
|
|
|
173
190
|
* @param {string} text Testo da mostrare
|
|
174
191
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
175
192
|
*/
|
|
176
|
-
simpleInfo(text, secondaryNotificationType = null) {
|
|
193
|
+
simpleInfo(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
177
194
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
178
195
|
if (tos == "swal")
|
|
179
196
|
this.infoSwal.fire("", text);
|
|
180
197
|
else
|
|
181
|
-
this.toastr.info(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
198
|
+
this.toastr.info(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: secondaryNotificationTimeout || (tos == "toastr" ? 0 : 5000), extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
182
199
|
}
|
|
183
200
|
/**
|
|
184
201
|
* Presentazione di un semplice messaggio di errore
|
|
@@ -189,12 +206,12 @@ class MessageService {
|
|
|
189
206
|
* @param {string} text Testo da mostrare
|
|
190
207
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
191
208
|
*/
|
|
192
|
-
simpleError(text, secondaryNotificationType = null) {
|
|
209
|
+
simpleError(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
193
210
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
194
211
|
if (tos == "swal")
|
|
195
212
|
this.errorSwal.fire("", text);
|
|
196
213
|
else
|
|
197
|
-
this.toastr.error(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
214
|
+
this.toastr.error(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: secondaryNotificationTimeout || (tos == "toastr" ? 0 : 5000), extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
198
215
|
}
|
|
199
216
|
/**
|
|
200
217
|
* Presentazione di un semplice messaggio di avviso
|
|
@@ -205,12 +222,12 @@ class MessageService {
|
|
|
205
222
|
* @param {string} text Testo da mostrare
|
|
206
223
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
207
224
|
*/
|
|
208
|
-
simpleWarning(text, secondaryNotificationType = null) {
|
|
225
|
+
simpleWarning(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
209
226
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
210
227
|
if (tos == "swal")
|
|
211
228
|
this.warningSwal.fire("", text);
|
|
212
229
|
else
|
|
213
|
-
this.toastr.warning(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
230
|
+
this.toastr.warning(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: secondaryNotificationTimeout || (tos == "toastr" ? 0 : 5000), extendedTimeOut: tos == "toastr" ? 0 : 1000 });
|
|
214
231
|
}
|
|
215
232
|
/**
|
|
216
233
|
* Ripulisce tutti i messaggi presenti in un dato momento sullo schermo
|
|
@@ -258,6 +275,32 @@ class MessageService {
|
|
|
258
275
|
onerror();
|
|
259
276
|
});
|
|
260
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Mostra un messaggio di success con richiesta di conferma e gestisce il risultato chiamato i callback **onconfirm** o **onabort**
|
|
280
|
+
*
|
|
281
|
+
* @param {string} title Titolo del messaggio
|
|
282
|
+
* @param {string} text Contenuto del messaggio
|
|
283
|
+
* @param {Function} onconfirm Callback da chimare su conferma
|
|
284
|
+
* @param {Function} onabort Callback da chimare su annullamento
|
|
285
|
+
* @param {string} confirmtext Testo del pulsante di azione
|
|
286
|
+
* @param {string} aborttext Testo del pulsante di annullamento
|
|
287
|
+
*/
|
|
288
|
+
simpleSuccessWithChoice(title, text, onconfirm = null, onabort = null, confirmtext = "", aborttext = '') {
|
|
289
|
+
var configuration = {
|
|
290
|
+
title: title,
|
|
291
|
+
html: text
|
|
292
|
+
};
|
|
293
|
+
if (confirmtext)
|
|
294
|
+
configuration["confirmButtonText"] = confirmtext;
|
|
295
|
+
if (aborttext)
|
|
296
|
+
configuration["cancelButtonText"] = aborttext;
|
|
297
|
+
this.successSwalWithCancel.fire(configuration).then((result) => {
|
|
298
|
+
if (result.value && onconfirm)
|
|
299
|
+
onconfirm();
|
|
300
|
+
else if (onabort)
|
|
301
|
+
onabort();
|
|
302
|
+
});
|
|
303
|
+
}
|
|
261
304
|
/**
|
|
262
305
|
* Mostra un messaggio di avviso con richiesta di conferma e gestisce il risultato chiamato i callback **onsuccess** o **onerror**
|
|
263
306
|
*
|
|
@@ -299,8 +342,8 @@ class MessageService {
|
|
|
299
342
|
if (postSuccess)
|
|
300
343
|
postSuccess();
|
|
301
344
|
}
|
|
302
|
-
else
|
|
303
|
-
this.simpleError((errorMsg ? errorMsg + ": " : "") + response.error);
|
|
345
|
+
else {
|
|
346
|
+
this.simpleError((errorMsg ? errorMsg + ": " : "") + response.haserror ? response.error : '[NO ERR.]');
|
|
304
347
|
if (postFailure)
|
|
305
348
|
postFailure();
|
|
306
349
|
}
|
|
@@ -356,11 +399,14 @@ class MessageService {
|
|
|
356
399
|
}
|
|
357
400
|
}
|
|
358
401
|
}
|
|
359
|
-
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
360
|
-
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
402
|
+
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageService, deps: [{ token: Injector }, { token: EXT_FANCY_ALERTS, optional: true }, { token: EXT_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
403
|
+
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageService });
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageService, decorators: [{
|
|
362
405
|
type: Injectable
|
|
363
|
-
}], ctorParameters: function () { return [{ type:
|
|
406
|
+
}], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
|
|
407
|
+
type: Inject,
|
|
408
|
+
args: [Injector]
|
|
409
|
+
}] }, { type: undefined, decorators: [{
|
|
364
410
|
type: Optional
|
|
365
411
|
}, {
|
|
366
412
|
type: Inject,
|
|
@@ -404,7 +450,27 @@ class ClipboardService {
|
|
|
404
450
|
"Error during Clipboard content copy operation": {
|
|
405
451
|
'en-US': "Error during Clipboard content copy operation",
|
|
406
452
|
'it-IT': "Errore nella scrittura del contenuto nella Clipboard"
|
|
407
|
-
}
|
|
453
|
+
},
|
|
454
|
+
"Please insert your clipboard content": {
|
|
455
|
+
'en-US': "Please insert your clipboard content",
|
|
456
|
+
'it-IT': "Si prega di incollare il contenuto della Clipboard"
|
|
457
|
+
},
|
|
458
|
+
"User input required": {
|
|
459
|
+
'en-US': "User input required",
|
|
460
|
+
'it-IT': "Richiesto Input utente"
|
|
461
|
+
},
|
|
462
|
+
"Your current browser does not support reading from the clipboard directly. Please paste your clipboard's content in this Input field and confirm the operation": {
|
|
463
|
+
'en-US': "Your current browser does not support reading from the clipboard directly. Please paste your clipboard's content in this Input field and confirm the operation",
|
|
464
|
+
'it-IT': "Il browser corrente non supporta la lettura diretta dei dati della Clipboard, si prega di effettuare un'incolla (CTRL + V) nella casella di testo e confermare l'operazione"
|
|
465
|
+
},
|
|
466
|
+
"Confirm": {
|
|
467
|
+
'en-US': "Confirm",
|
|
468
|
+
'it-IT': "Conferma"
|
|
469
|
+
},
|
|
470
|
+
"Cancel": {
|
|
471
|
+
'en-US': "Cancel",
|
|
472
|
+
'it-IT': "Annulla"
|
|
473
|
+
},
|
|
408
474
|
};
|
|
409
475
|
}
|
|
410
476
|
/**
|
|
@@ -416,35 +482,63 @@ class ClipboardService {
|
|
|
416
482
|
*/
|
|
417
483
|
getClipboard(style, valueFoundCallback) {
|
|
418
484
|
if (navigator.userAgent.indexOf("Firefox") != -1) {
|
|
419
|
-
|
|
420
|
-
|
|
485
|
+
swal.fire({
|
|
486
|
+
title: this.loc["User input required"][this.LOCALE ?? 'it-IT'],
|
|
487
|
+
text: this.loc["Your current browser does not support reading from the clipboard directly. Please paste your clipboard's content in this Input field and confirm the operation"][this.LOCALE ?? 'it-IT'],
|
|
488
|
+
input: 'textarea',
|
|
489
|
+
icon: "warning",
|
|
490
|
+
confirmButtonText: this.loc["Confirm"][this.LOCALE ?? 'it-IT'],
|
|
491
|
+
cancelButtonText: this.loc["Cancel"][this.LOCALE ?? 'it-IT'],
|
|
492
|
+
showCancelButton: true,
|
|
493
|
+
customClass: {
|
|
494
|
+
confirmButton: "btn btn-primary",
|
|
495
|
+
cancelButton: "btn btn-secondary app-margin-right-15",
|
|
496
|
+
container: "app-wrap",
|
|
497
|
+
},
|
|
498
|
+
reverseButtons: true,
|
|
499
|
+
allowOutsideClick: false,
|
|
500
|
+
inputValidator: (value) => {
|
|
501
|
+
if (!value)
|
|
502
|
+
return this.loc["Please insert your clipboard content"][this.LOCALE ?? 'it-IT'];
|
|
503
|
+
}
|
|
504
|
+
}).then(t => {
|
|
505
|
+
if (t.isConfirmed) {
|
|
506
|
+
console.log("[@esfaenza/extensions] Retrieving input data from user input");
|
|
507
|
+
this.doClipboardDataGet(t.value, style, valueFoundCallback);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
421
510
|
return;
|
|
422
511
|
}
|
|
423
512
|
if (window.clipboardData) {
|
|
513
|
+
console.log("[@esfaenza/extensions] Found clipboardData");
|
|
424
514
|
let data = window.clipboardData.getData("Text");
|
|
425
|
-
|
|
426
|
-
style == "matrix" ? this.getClipboardMatrix(data) : [];
|
|
427
|
-
if (valueFoundCallback)
|
|
428
|
-
valueFoundCallback(value);
|
|
515
|
+
this.doClipboardDataGet(data, style, valueFoundCallback);
|
|
429
516
|
}
|
|
430
517
|
else if (window.navigator.clipboard) {
|
|
518
|
+
console.log("[@esfaenza/extensions] Found navigator clipboard");
|
|
431
519
|
window.navigator.permissions.query({ name: 'clipboard-read' }).then(result => {
|
|
432
|
-
if (!(result.state === 'granted' || result.state === 'prompt'))
|
|
520
|
+
if (!(result.state === 'granted' || result.state === 'prompt')) {
|
|
521
|
+
console.error("[@esfaenza/extensions] Clipboard permission not granted");
|
|
433
522
|
if (valueFoundCallback)
|
|
434
523
|
valueFoundCallback([]);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
console.log("[@esfaenza/extensions] Clipboard permission granted, retrieving values");
|
|
435
527
|
window.navigator.clipboard.readText()
|
|
436
|
-
.then(t =>
|
|
437
|
-
|
|
438
|
-
style == "matrix" ? this.getClipboardMatrix(t) : [];
|
|
439
|
-
if (valueFoundCallback)
|
|
440
|
-
valueFoundCallback(value);
|
|
441
|
-
})
|
|
442
|
-
.catch(err => {
|
|
443
|
-
this.msgService.simpleError(this.loc["Error during Clipboard content read operation"][this.LOCALE ?? 'it-IT'] + ": " + err);
|
|
444
|
-
});
|
|
528
|
+
.then((t) => this.doClipboardDataGet(t, style, valueFoundCallback))
|
|
529
|
+
.catch((err) => this.msgService.simpleError(this.loc["Error during Clipboard content read operation"][this.LOCALE ?? 'it-IT'] + ": " + err));
|
|
445
530
|
});
|
|
446
531
|
}
|
|
447
532
|
}
|
|
533
|
+
/** @ignore */
|
|
534
|
+
doClipboardDataGet(clipboardText, style, valueFoundCallback) {
|
|
535
|
+
console.log("[@esfaenza/extensions] Retrieved clipboard values: " + clipboardText);
|
|
536
|
+
let value = style == "array" ? this.getClipboardLines(clipboardText) :
|
|
537
|
+
style == "matrix" ? this.getClipboardMatrix(clipboardText) : [];
|
|
538
|
+
console.log(`[@esfaenza/extensions] Adapted for ${style}: ${JSON.stringify(value)}`);
|
|
539
|
+
if (valueFoundCallback)
|
|
540
|
+
valueFoundCallback(value);
|
|
541
|
+
}
|
|
448
542
|
/**
|
|
449
543
|
* Ottiene il contenuto della clipboard diviso per righe (separate da newline)
|
|
450
544
|
*
|
|
@@ -453,7 +547,10 @@ class ClipboardService {
|
|
|
453
547
|
* @returns {string[]} Array contenente il testo preso dalla clipboard diviso per riga
|
|
454
548
|
*/
|
|
455
549
|
getClipboardLines(data) {
|
|
456
|
-
|
|
550
|
+
let trimmedData = data.trim();
|
|
551
|
+
if (!trimmedData.includes("\r\n") && trimmedData.includes("\n"))
|
|
552
|
+
return trimmedData.split("\n");
|
|
553
|
+
return trimmedData.split("\r\n");
|
|
457
554
|
}
|
|
458
555
|
/**
|
|
459
556
|
* Ottiene il contenuto della clipboard diviso per righe (separate da newline) e colonne (separate da tab)
|
|
@@ -464,7 +561,7 @@ class ClipboardService {
|
|
|
464
561
|
*/
|
|
465
562
|
getClipboardMatrix(data) {
|
|
466
563
|
var ret = [];
|
|
467
|
-
var rows = data.split("\r\n");
|
|
564
|
+
var rows = !data.includes("\r\n") && data.includes("\n") ? data.split("\n") : data.split("\r\n");
|
|
468
565
|
// A quanto pare ogni valore è separato da un \t... spero che sia uno standard di quando si copia da excel altrimenti ciao
|
|
469
566
|
for (let i = 0; i < rows.length; i++)
|
|
470
567
|
ret.push(rows[i].split('\t').map(t => t.trim()));
|
|
@@ -522,9 +619,9 @@ class ClipboardService {
|
|
|
522
619
|
document.body.removeChild(textArea);
|
|
523
620
|
}
|
|
524
621
|
}
|
|
525
|
-
ClipboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
526
|
-
ClipboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
622
|
+
ClipboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ClipboardService, deps: [{ token: MessageService }, { token: EXT_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
623
|
+
ClipboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ClipboardService });
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ClipboardService, decorators: [{
|
|
528
625
|
type: Injectable
|
|
529
626
|
}], ctorParameters: function () { return [{ type: MessageService }, { type: undefined, decorators: [{
|
|
530
627
|
type: Optional
|
|
@@ -594,8 +691,13 @@ class DateService {
|
|
|
594
691
|
if (mydt == null)
|
|
595
692
|
return "FE: Not a Date";
|
|
596
693
|
let isZeroTime = mydt.startOf(timepart).valueOf() === mydt.valueOf();
|
|
597
|
-
if (!isZeroTime)
|
|
694
|
+
if (!isZeroTime) {
|
|
695
|
+
if (timepart == "day" && mydt.subtract(1, "hour").hour() == mydt.hour()) {
|
|
696
|
+
// Se l'ora precedente è lo stesso orario dell'ora attuale l'istante finale dev'essere mandato avanti di 1
|
|
697
|
+
mydt = mydt.add(1, "hour");
|
|
698
|
+
}
|
|
598
699
|
return printSeconds ? mydt.format(this.cfg.fulldateDisplay) : mydt.format(this.cfg.fulldateDisplayNoSS);
|
|
700
|
+
}
|
|
599
701
|
let tmpValue = mydt.subtract(1, timepart);
|
|
600
702
|
let value = "";
|
|
601
703
|
// Istante finale delle ore: 05/10/1992 --> 04/10/1992 24:00(:00)
|
|
@@ -703,7 +805,7 @@ class DateService {
|
|
|
703
805
|
tryThis = toCall(date, this.cfg.smallDate);
|
|
704
806
|
else if (length == this.cfg.fulldateNoSS.length)
|
|
705
807
|
tryThis = toCall(date, this.cfg.fulldateNoSS);
|
|
706
|
-
if (tryThis && tryThis.isValid())
|
|
808
|
+
if (tryThis && tryThis.isValid && tryThis.isValid())
|
|
707
809
|
return tryThis;
|
|
708
810
|
// Se niente funziona, null.
|
|
709
811
|
// Ricondurre l'Input ad una data non è possibile.
|
|
@@ -745,9 +847,9 @@ class DateService {
|
|
|
745
847
|
return date.format(small ? this.cfg.smallDate : seconds ? this.cfg.fulldateDisplay : this.cfg.fulldateDisplayNoSS);
|
|
746
848
|
}
|
|
747
849
|
}
|
|
748
|
-
DateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
749
|
-
DateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
850
|
+
DateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateService, deps: [{ token: EXT_LOCALE, optional: true }, { token: EXT_ALLOW_UTC, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
851
|
+
DateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateService });
|
|
852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateService, decorators: [{
|
|
751
853
|
type: Injectable
|
|
752
854
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
753
855
|
type: Optional
|
|
@@ -778,6 +880,10 @@ const csvVisPrefix = "_csvvis";
|
|
|
778
880
|
* Suffisso della proprietà da generare in cui salvare il nome della colonna in cui salvare questa proprietà
|
|
779
881
|
*/
|
|
780
882
|
const csvHdrPrefix = "_csvhdr";
|
|
883
|
+
/**
|
|
884
|
+
* Suffisso della proprietà da generare in cui salvare il codice del th a cui si riferisce questo campo
|
|
885
|
+
*/
|
|
886
|
+
const csvPropKey = "_csvkey";
|
|
781
887
|
/**
|
|
782
888
|
* Suffisso della proprietà da generare in cui salvare il valore da prendere per una proprietà di tipo Lista
|
|
783
889
|
*/
|
|
@@ -801,7 +907,11 @@ const dictionaryCsvHdrPrefix = "_flatlistcsvhdr";
|
|
|
801
907
|
/**
|
|
802
908
|
* Suffisso della proprietà da generare in cui salvare il formato della proprietà che si sta esportando
|
|
803
909
|
*/
|
|
804
|
-
const csvFormatPrefix = "_csvfmt";
|
|
910
|
+
const csvFormatPrefix = "_csvfmt";
|
|
911
|
+
/**
|
|
912
|
+
* Nome della proprietà che contiene tutti i nomi di tutte le proprietà da esportare
|
|
913
|
+
*/
|
|
914
|
+
const exportList = "__export_list__";
|
|
805
915
|
|
|
806
916
|
// Angular
|
|
807
917
|
/**
|
|
@@ -829,12 +939,18 @@ const csvFormatPrefix = "_csvfmt";
|
|
|
829
939
|
* @param {string} header Titolo della colonna nel file CSV esportato
|
|
830
940
|
* @param {string} format Formato di esportazione. Può essere un formato data per i campi data o 'F' per i campi floating point
|
|
831
941
|
*/
|
|
832
|
-
const Export = (order, header, format = null) => (target, propertyKey) => {
|
|
942
|
+
const Export = (order, header, format = null, tableid = null) => (target, propertyKey) => {
|
|
833
943
|
if (format)
|
|
834
944
|
Object.defineProperty(target, propertyKey + csvFormatPrefix, { value: format, writable: false });
|
|
835
945
|
Object.defineProperty(target, propertyKey + csvOrdPrefix, { value: order, writable: false });
|
|
836
946
|
Object.defineProperty(target, propertyKey + csvVisPrefix, { value: !!header, writable: false });
|
|
837
947
|
Object.defineProperty(target, propertyKey + csvHdrPrefix, { value: header, writable: false });
|
|
948
|
+
if (tableid)
|
|
949
|
+
Object.defineProperty(target, propertyKey + csvPropKey, { value: tableid, writable: false });
|
|
950
|
+
if (target[exportList])
|
|
951
|
+
target[exportList].push(propertyKey + csvVisPrefix);
|
|
952
|
+
else
|
|
953
|
+
target[exportList] = [propertyKey + csvVisPrefix];
|
|
838
954
|
};
|
|
839
955
|
/**
|
|
840
956
|
* Decoratore di esportazione utilizzabile su un oggetto.
|
|
@@ -868,8 +984,9 @@ const Export = (order, header, format = null) => (target, propertyKey) => {
|
|
|
868
984
|
*/
|
|
869
985
|
const ExportAs = (order, type) => (target, propertyKey) => {
|
|
870
986
|
var t = new type();
|
|
871
|
-
|
|
872
|
-
|
|
987
|
+
var props = t[exportList];
|
|
988
|
+
for (let i = 0; i < props.length; i++) {
|
|
989
|
+
let prop = props[i].replace(csvVisPrefix, '');
|
|
873
990
|
if (typeof t[prop + csvVisPrefix] !== "undefined") {
|
|
874
991
|
var toEmit = t[prop + csvVisPrefix];
|
|
875
992
|
var lbl = t[prop + csvHdrPrefix];
|
|
@@ -882,6 +999,10 @@ const ExportAs = (order, type) => (target, propertyKey) => {
|
|
|
882
999
|
Object.defineProperty(target, propertyKey + prop + csvValueNavigator, { value: propertyKey + "." + prop, writable: false });
|
|
883
1000
|
Object.defineProperty(target, propertyKey + prop + csvVisPrefix, { value: toEmit, writable: false });
|
|
884
1001
|
Object.defineProperty(target, propertyKey + prop + csvHdrPrefix, { value: lbl, writable: false });
|
|
1002
|
+
if (target[exportList])
|
|
1003
|
+
target[exportList].push(propertyKey + prop + csvVisPrefix);
|
|
1004
|
+
else
|
|
1005
|
+
target[exportList] = [propertyKey + prop + csvVisPrefix];
|
|
885
1006
|
}
|
|
886
1007
|
}
|
|
887
1008
|
};
|
|
@@ -908,6 +1029,10 @@ const ExportList = (order, headernavigator, valuenavigator, valueformat = null)
|
|
|
908
1029
|
Object.defineProperty(target, propertyKey + listCsvValPrefix, { value: valuenavigator, writable: false });
|
|
909
1030
|
Object.defineProperty(target, propertyKey + listCsvHdrPrefix, { value: headernavigator, writable: false });
|
|
910
1031
|
Object.defineProperty(target, propertyKey + listCsvValFormat, { value: valueformat, writable: false });
|
|
1032
|
+
if (target[exportList])
|
|
1033
|
+
target[exportList].push(propertyKey + listCsvHdrPrefix);
|
|
1034
|
+
else
|
|
1035
|
+
target[exportList] = [propertyKey + listCsvHdrPrefix];
|
|
911
1036
|
};
|
|
912
1037
|
/**
|
|
913
1038
|
* Decoratore di esportazione utilizzabile su un dizionario. Se ad esempio si vogliono generare le colonne
|
|
@@ -928,6 +1053,10 @@ const ExportDictionary = (order, headernavigator, valuenavigator) => (target, pr
|
|
|
928
1053
|
Object.defineProperty(target, propertyKey + csvOrdPrefix, { value: order, writable: false });
|
|
929
1054
|
Object.defineProperty(target, propertyKey + dictionaryCsvValPrefix, { value: valuenavigator, writable: false });
|
|
930
1055
|
Object.defineProperty(target, propertyKey + dictionaryCsvHdrPrefix, { value: headernavigator, writable: false });
|
|
1056
|
+
if (target[exportList])
|
|
1057
|
+
target[exportList].push(propertyKey + dictionaryCsvHdrPrefix);
|
|
1058
|
+
else
|
|
1059
|
+
target[exportList] = [propertyKey + dictionaryCsvHdrPrefix];
|
|
931
1060
|
};
|
|
932
1061
|
/**
|
|
933
1062
|
* Service che si occupa dell'esportazione degli oggetti marcati dai Decoratori **ExportDictionary**, **ExportList**, **ExportAs** o **Export**
|
|
@@ -948,15 +1077,19 @@ class ExportService {
|
|
|
948
1077
|
*
|
|
949
1078
|
* @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
|
|
950
1079
|
*/
|
|
951
|
-
setupForExport(objs) {
|
|
1080
|
+
setupForExport(objs, columns = []) {
|
|
952
1081
|
let headers = [];
|
|
953
1082
|
let headersCache = {};
|
|
954
1083
|
if (!objs || objs.length == 0)
|
|
955
1084
|
return headers;
|
|
956
1085
|
// Devo per forza farlo per tutti gli oggetti dato che devo esporre le proprietà che mi servono da esportare
|
|
957
1086
|
// Gli header li raccolgo tutti poi faccio uan distinct in modo da esportare tutte le proprietà per bene
|
|
1087
|
+
let columnSelectionDictionary = {};
|
|
1088
|
+
if (columns?.length > 0)
|
|
1089
|
+
for (let i = 0; i < columns?.length; i++)
|
|
1090
|
+
columnSelectionDictionary[columns[i]] = true;
|
|
958
1091
|
for (let i = 0; i < objs.length; i++) {
|
|
959
|
-
let hds = this.parseAndGetHeaders(objs[i]);
|
|
1092
|
+
let hds = this.parseAndGetHeaders(objs[i], columnSelectionDictionary);
|
|
960
1093
|
// Aggiungo gli header facendo in modo di non aggiungerne mai due uguali per non dover fare una distinct dopo
|
|
961
1094
|
// che costerebbe comunque risorse. Utilizzo un dizionario d'appoggio per lookup istantanei
|
|
962
1095
|
for (let k = 0; k < hds.length; k++) {
|
|
@@ -966,7 +1099,23 @@ class ExportService {
|
|
|
966
1099
|
}
|
|
967
1100
|
}
|
|
968
1101
|
}
|
|
969
|
-
|
|
1102
|
+
if (!columns || columns.length == 0)
|
|
1103
|
+
return headers.sort((a, b) => a.order - b.order);
|
|
1104
|
+
else {
|
|
1105
|
+
// Se mi arriva la lista di colonne non mi dà solo la visibilità, ma anche l'ordinamento
|
|
1106
|
+
// le esporto di conseguenza
|
|
1107
|
+
let orderedHeaders = [];
|
|
1108
|
+
for (let i = 0; i < columns.length; i++) {
|
|
1109
|
+
let thisId = columns[i];
|
|
1110
|
+
for (let i = 0; i < headers.length; i++) {
|
|
1111
|
+
if (headers[i].propKey == thisId) {
|
|
1112
|
+
orderedHeaders.push(headers[i]);
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
return orderedHeaders;
|
|
1118
|
+
}
|
|
970
1119
|
}
|
|
971
1120
|
/**
|
|
972
1121
|
* Data una lista di oggetti generici genera gli header per l'esportazione e integra ogni oggetto con le proprietà esportabili dalla libreria **@ctrl/ngx-csv**
|
|
@@ -1007,7 +1156,7 @@ class ExportService {
|
|
|
1007
1156
|
columns.forEach(t => {
|
|
1008
1157
|
var propValue = obj.properties[t.key];
|
|
1009
1158
|
Object.defineProperty(obj, t.key + "_exp", { value: propValue, writable: false, enumerable: true });
|
|
1010
|
-
headers.push({ label: t.label, key: t.key + "_exp", order: t.order, type: t.type });
|
|
1159
|
+
headers.push({ label: t.label, key: t.key + "_exp", order: t.order, type: t.type, propKey: null });
|
|
1011
1160
|
});
|
|
1012
1161
|
//Tirati fuori tutti gli header faccio sort sull'ordinamento
|
|
1013
1162
|
return headers.sort((a, b) => { return a.order - b.order; });
|
|
@@ -1021,23 +1170,33 @@ class ExportService {
|
|
|
1021
1170
|
*
|
|
1022
1171
|
* @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
|
|
1023
1172
|
*/
|
|
1024
|
-
parseAndGetHeaders(obj) {
|
|
1173
|
+
parseAndGetHeaders(obj, columnsSelection) {
|
|
1025
1174
|
var headers = [];
|
|
1026
1175
|
// Miracle incoming
|
|
1027
|
-
|
|
1176
|
+
let exportProps = obj[exportList] || [];
|
|
1177
|
+
if (exportProps.length == 0)
|
|
1178
|
+
console.warn("[@esfaenza/extensions] Nessuna colonna configurata da esportare!");
|
|
1179
|
+
for (let i = 0; i < exportProps.length; i++) {
|
|
1180
|
+
let prop = exportProps[i];
|
|
1181
|
+
let propBase = "";
|
|
1028
1182
|
let toCall;
|
|
1029
|
-
if (
|
|
1183
|
+
if (prop.endsWith(listCsvHdrPrefix)) {
|
|
1184
|
+
propBase = prop.replace(listCsvHdrPrefix, '');
|
|
1030
1185
|
toCall = this.parseList.bind(this);
|
|
1031
|
-
|
|
1186
|
+
}
|
|
1187
|
+
else if (prop.endsWith(dictionaryCsvHdrPrefix)) {
|
|
1032
1188
|
toCall = this.parseDictionary.bind(this);
|
|
1033
|
-
|
|
1034
|
-
|
|
1189
|
+
propBase = prop.replace(dictionaryCsvHdrPrefix, '');
|
|
1190
|
+
}
|
|
1191
|
+
else if (prop.endsWith(csvVisPrefix)) {
|
|
1192
|
+
propBase = prop.replace(csvVisPrefix, '');
|
|
1193
|
+
if (typeof obj[propBase + csvValueNavigator] !== "undefined")
|
|
1035
1194
|
toCall = this.parseObject.bind(this);
|
|
1036
1195
|
else
|
|
1037
1196
|
toCall = this.parseProperty.bind(this);
|
|
1038
1197
|
}
|
|
1039
1198
|
if (toCall)
|
|
1040
|
-
toCall(obj,
|
|
1199
|
+
toCall(obj, propBase, headers, columnsSelection);
|
|
1041
1200
|
}
|
|
1042
1201
|
return headers;
|
|
1043
1202
|
}
|
|
@@ -1049,9 +1208,14 @@ class ExportService {
|
|
|
1049
1208
|
* @param {string} prop Proprietà da esportare
|
|
1050
1209
|
* @param {CsvHeaders} headers Contenitore degli header, verrà riempito da questa funzione
|
|
1051
1210
|
*/
|
|
1052
|
-
parseProperty(obj, prop, headers) {
|
|
1211
|
+
parseProperty(obj, prop, headers, columnsSelection) {
|
|
1053
1212
|
let toEmit = obj[prop + csvVisPrefix];
|
|
1054
1213
|
let format = obj[prop + csvFormatPrefix];
|
|
1214
|
+
let propKey = obj[prop + csvPropKey];
|
|
1215
|
+
if (propKey && !columnsSelection[propKey] && Object.keys(columnsSelection).length > 0) {
|
|
1216
|
+
console.log("[@esfaenza/extensions] Colonna da non esportare: " + propKey);
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1055
1219
|
let lbl = obj[prop + csvHdrPrefix];
|
|
1056
1220
|
let order = obj[prop + csvOrdPrefix];
|
|
1057
1221
|
if (toEmit && lbl !== "undefined") {
|
|
@@ -1060,7 +1224,7 @@ class ExportService {
|
|
|
1060
1224
|
// Se è un formato data mi assicuro di non stampare mai una data 00:00:00 altrimenti in esportazione viene uno schifo
|
|
1061
1225
|
var val = obj[prop] ? this.dates.trimSeconds(obj[prop].toString()) : "";
|
|
1062
1226
|
Object.defineProperty(obj, prop + "_nofmt", { value: val, writable: false, enumerable: true });
|
|
1063
|
-
headers.push({ label: lbl ? lbl : prop + "_nofmt", key: prop + "_nofmt", order: order, type: "string" });
|
|
1227
|
+
headers.push({ label: lbl ? lbl : prop + "_nofmt", key: prop + "_nofmt", order: order, type: "string", propKey: propKey });
|
|
1064
1228
|
}
|
|
1065
1229
|
else {
|
|
1066
1230
|
// Caso formato numerico
|
|
@@ -1072,15 +1236,15 @@ class ExportService {
|
|
|
1072
1236
|
// Il singolo punto che c'è, se presente (separatore decimali) lo trasformo in virgola
|
|
1073
1237
|
let valConverted = val.replace(".", ",");
|
|
1074
1238
|
Object.defineProperty(obj, prop + "_fmt", { value: valConverted, writable: false, enumerable: true });
|
|
1075
|
-
headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order, type: "number" });
|
|
1239
|
+
headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order, type: "number", propKey: propKey });
|
|
1076
1240
|
}
|
|
1077
1241
|
else {
|
|
1078
1242
|
// Se ho un formato data trasformo in dayjs, formatto ed esporto
|
|
1079
1243
|
// Per la trasformazione in dayjs provo prima a passargli la stringa di netto, sperando la riconosca
|
|
1080
1244
|
// Se non funziona provo a definirgli la formattazione standard del metering per quel linguaggio
|
|
1081
|
-
let val = this.dates.getFormatted(obj[prop], format.length <= 10,
|
|
1245
|
+
let val = this.dates.getFormatted(obj[prop], format.length <= 10, format.length > 16);
|
|
1082
1246
|
Object.defineProperty(obj, prop + "_fmt", { value: val ?? "", writable: false, enumerable: true });
|
|
1083
|
-
headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order, type: "date" });
|
|
1247
|
+
headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order, type: "date", propKey: propKey });
|
|
1084
1248
|
}
|
|
1085
1249
|
}
|
|
1086
1250
|
}
|
|
@@ -1121,11 +1285,11 @@ class ExportService {
|
|
|
1121
1285
|
type = "number";
|
|
1122
1286
|
}
|
|
1123
1287
|
else if (format) {
|
|
1124
|
-
value = this.dates.getFormatted(value, format.length <= 10,
|
|
1288
|
+
value = this.dates.getFormatted(value, format.length <= 10, format.length > 16);
|
|
1125
1289
|
type = "date";
|
|
1126
1290
|
}
|
|
1127
|
-
Object.defineProperty(obj, prop, { value: value, writable: false, enumerable: true });
|
|
1128
|
-
headers.push({ label: lbl ? lbl : prop, key: prop, order: order, type: type });
|
|
1291
|
+
Object.defineProperty(obj, prop, { value: value ?? "", writable: false, enumerable: true });
|
|
1292
|
+
headers.push({ label: lbl ? lbl : prop, key: prop, order: order, type: type, propKey: null });
|
|
1129
1293
|
}
|
|
1130
1294
|
/**
|
|
1131
1295
|
* Setup per l'esportazione di una lista di valori pivottati dinamicamente:
|
|
@@ -1175,11 +1339,11 @@ class ExportService {
|
|
|
1175
1339
|
type = "number";
|
|
1176
1340
|
}
|
|
1177
1341
|
else if (valueformat) {
|
|
1178
|
-
value = this.dates.getFormatted(obj[prop], valueformat.length <= 10,
|
|
1342
|
+
value = this.dates.getFormatted(obj[prop], valueformat.length <= 10, valueformat.length > 16);
|
|
1179
1343
|
type = "date";
|
|
1180
1344
|
}
|
|
1181
|
-
Object.defineProperty(obj, prop + idx, { value: value, writable: false });
|
|
1182
|
-
headers.push({ label: header, key: prop + idx, order: order + idx, type: type });
|
|
1345
|
+
Object.defineProperty(obj, prop + idx, { value: value ?? "", writable: false });
|
|
1346
|
+
headers.push({ label: header, key: prop + idx, order: order + idx, type: type, propKey: null });
|
|
1183
1347
|
}
|
|
1184
1348
|
}
|
|
1185
1349
|
/**
|
|
@@ -1225,8 +1389,8 @@ class ExportService {
|
|
|
1225
1389
|
jumps.forEach(pp => { tmpRes = tmpRes[pp]; });
|
|
1226
1390
|
let value = tmpRes;
|
|
1227
1391
|
let propname = prop + idx.toString() + idxinternal.toString();
|
|
1228
|
-
Object.defineProperty(obj, propname, { value: value, writable: false });
|
|
1229
|
-
headers.push({ label: header + " " + desc, key: propname, order: order + idx, type: 'string' });
|
|
1392
|
+
Object.defineProperty(obj, propname, { value: value ?? "", writable: false });
|
|
1393
|
+
headers.push({ label: header + " " + desc, key: propname, order: order + idx, type: 'string', propKey: null });
|
|
1230
1394
|
});
|
|
1231
1395
|
}
|
|
1232
1396
|
}
|
|
@@ -1243,9 +1407,9 @@ class ExportService {
|
|
|
1243
1407
|
return Deserialize(items, type);
|
|
1244
1408
|
}
|
|
1245
1409
|
}
|
|
1246
|
-
ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1247
|
-
ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1248
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
1410
|
+
ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExportService, deps: [{ token: DateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1411
|
+
ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExportService });
|
|
1412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ExportService, decorators: [{
|
|
1249
1413
|
type: Injectable
|
|
1250
1414
|
}], ctorParameters: function () { return [{ type: DateService }]; } });
|
|
1251
1415
|
|
|
@@ -1550,9 +1714,9 @@ class HashingService {
|
|
|
1550
1714
|
return (a + b) & 0xFFFFFFFF;
|
|
1551
1715
|
}
|
|
1552
1716
|
}
|
|
1553
|
-
HashingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1554
|
-
HashingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
1717
|
+
HashingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HashingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1718
|
+
HashingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HashingService });
|
|
1719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HashingService, decorators: [{
|
|
1556
1720
|
type: Injectable
|
|
1557
1721
|
}] });
|
|
1558
1722
|
|
|
@@ -1758,10 +1922,52 @@ class UtilityService {
|
|
|
1758
1922
|
return "string";
|
|
1759
1923
|
}
|
|
1760
1924
|
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Effettua la clonazione profonda di un oggetto in maniera molto più performante che JSON.parse(JSON.stringify()).
|
|
1927
|
+
*
|
|
1928
|
+
* Usare solo per oggetti puri e quantomeno semplici per evitare complicazioni derivanti dalle semplificazioni che questo metodo assume
|
|
1929
|
+
*
|
|
1930
|
+
* @param {any} source Oggetto da clonare
|
|
1931
|
+
*
|
|
1932
|
+
* @return {any} Clone dell'oggetto passato
|
|
1933
|
+
*/
|
|
1934
|
+
deepClone(source) {
|
|
1935
|
+
// Valori semplici
|
|
1936
|
+
if (source == null || typeof source !== 'object')
|
|
1937
|
+
return source;
|
|
1938
|
+
// Pseudo Struct
|
|
1939
|
+
switch (toString.call(source)) {
|
|
1940
|
+
case '[object Boolean]':
|
|
1941
|
+
case '[object Number]':
|
|
1942
|
+
case '[object String]':
|
|
1943
|
+
case '[object Date]':
|
|
1944
|
+
return new source.constructor(source.valueOf());
|
|
1945
|
+
default: break;
|
|
1946
|
+
}
|
|
1947
|
+
// Oggetti Complessi
|
|
1948
|
+
return this.recursiveStep(source, Array.isArray(source) || source instanceof Array ? [] : Object.create(Object.getPrototypeOf(source)));
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* @ignore
|
|
1952
|
+
* Step ricorsivo per la clonatura degli oggetti. Vedere **deepClone**
|
|
1953
|
+
*/
|
|
1954
|
+
recursiveStep(source, destination) {
|
|
1955
|
+
if (Array.isArray(source) || source instanceof Array) {
|
|
1956
|
+
for (var i = 0, ii = source.length; i < ii; i++)
|
|
1957
|
+
destination.push(this.deepClone(source[i]));
|
|
1958
|
+
}
|
|
1959
|
+
else if (source && typeof source.hasOwnProperty === 'function') {
|
|
1960
|
+
for (let key in source) {
|
|
1961
|
+
if (source.hasOwnProperty(key))
|
|
1962
|
+
destination[key] = this.deepClone(source[key]);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
return destination;
|
|
1966
|
+
}
|
|
1761
1967
|
}
|
|
1762
|
-
UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1763
|
-
UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1764
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
1968
|
+
UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UtilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1969
|
+
UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UtilityService });
|
|
1970
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UtilityService, decorators: [{
|
|
1765
1971
|
type: Injectable
|
|
1766
1972
|
}] });
|
|
1767
1973
|
|
|
@@ -1820,9 +2026,9 @@ class InterComService {
|
|
|
1820
2026
|
this.outbounds[key] = new Subject();
|
|
1821
2027
|
}
|
|
1822
2028
|
}
|
|
1823
|
-
InterComService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1824
|
-
InterComService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
2029
|
+
InterComService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: InterComService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2030
|
+
InterComService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: InterComService });
|
|
2031
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: InterComService, decorators: [{
|
|
1826
2032
|
type: Injectable
|
|
1827
2033
|
}] });
|
|
1828
2034
|
|
|
@@ -1859,10 +2065,10 @@ class FullExtensionsModule {
|
|
|
1859
2065
|
};
|
|
1860
2066
|
}
|
|
1861
2067
|
}
|
|
1862
|
-
FullExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1863
|
-
FullExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.
|
|
1864
|
-
FullExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.
|
|
1865
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
2068
|
+
FullExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FullExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2069
|
+
FullExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FullExtensionsModule });
|
|
2070
|
+
FullExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FullExtensionsModule });
|
|
2071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FullExtensionsModule, decorators: [{
|
|
1866
2072
|
type: NgModule
|
|
1867
2073
|
}] });
|
|
1868
2074
|
|