@esfaenza/extensions 12.2.13 → 13.1.1

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.
Files changed (55) hide show
  1. package/esfaenza-extensions.d.ts +1 -2
  2. package/esm2020/esfaenza-extensions.mjs +5 -0
  3. package/{esm2015/lib/models/CallResult.js → esm2020/lib/models/CallResult.mjs} +0 -0
  4. package/{esm2015/lib/models/CsvHeaders.js → esm2020/lib/models/CsvHeaders.mjs} +1 -1
  5. package/{esm2015/lib/models/ExportConsts.js → esm2020/lib/models/ExportConsts.mjs} +0 -0
  6. package/{esm2015/lib/models/ExtensionsModuleConfig.js → esm2020/lib/models/ExtensionsModuleConfig.mjs} +0 -0
  7. package/{esm2015/lib/models/GenericItem.js → esm2020/lib/models/GenericItem.mjs} +0 -0
  8. package/{esm2015/lib/models/TypeCode.js → esm2020/lib/models/TypeCode.mjs} +0 -0
  9. package/{esm2015/lib/models/providers/base/BaseStorageProvider.js → esm2020/lib/models/providers/base/BaseStorageProvider.mjs} +0 -0
  10. package/esm2020/lib/models/providers/implementation/DefaultStorageProvider.mjs +79 -0
  11. package/{esm2015/lib/models/session/base/BaseSessionRetriever.js → esm2020/lib/models/session/base/BaseSessionRetriever.mjs} +0 -0
  12. package/esm2020/lib/models/session/implementation/DefaultSessionRetriever.mjs +28 -0
  13. package/esm2020/lib/modules/extensions.full.module.mjs +58 -0
  14. package/esm2020/lib/modules/extensions.module.mjs +28 -0
  15. package/esm2020/lib/services/extensions.clipboard.service.mjs +165 -0
  16. package/esm2020/lib/services/extensions.dates.service.mjs +232 -0
  17. package/{esm2015/lib/services/extensions.exports.service.js → esm2020/lib/services/extensions.exports.service.mjs} +24 -17
  18. package/esm2020/lib/services/extensions.hashing.service.mjs +309 -0
  19. package/esm2020/lib/services/extensions.messages.service.mjs +323 -0
  20. package/esm2020/lib/services/extensions.storage.service.mjs +103 -0
  21. package/esm2020/lib/services/extensions.utilities.service.mjs +188 -0
  22. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
  23. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  24. package/fesm2015/{esfaenza-extensions.js → esfaenza-extensions.mjs} +120 -75
  25. package/fesm2015/esfaenza-extensions.mjs.map +1 -0
  26. package/fesm2020/esfaenza-extensions.mjs +2055 -0
  27. package/fesm2020/esfaenza-extensions.mjs.map +1 -0
  28. package/lib/models/CsvHeaders.d.ts +4 -0
  29. package/lib/models/providers/implementation/DefaultStorageProvider.d.ts +3 -0
  30. package/lib/models/session/implementation/DefaultSessionRetriever.d.ts +3 -0
  31. package/lib/modules/extensions.full.module.d.ts +4 -0
  32. package/lib/modules/extensions.module.d.ts +4 -0
  33. package/lib/services/extensions.clipboard.service.d.ts +3 -0
  34. package/lib/services/extensions.dates.service.d.ts +3 -0
  35. package/lib/services/extensions.exports.service.d.ts +3 -0
  36. package/lib/services/extensions.hashing.service.d.ts +3 -0
  37. package/lib/services/extensions.messages.service.d.ts +3 -0
  38. package/lib/services/extensions.storage.service.d.ts +3 -0
  39. package/lib/services/extensions.utilities.service.d.ts +3 -0
  40. package/package.json +22 -10
  41. package/bundles/esfaenza-extensions.umd.js +0 -2435
  42. package/bundles/esfaenza-extensions.umd.js.map +0 -1
  43. package/esfaenza-extensions.metadata.json +0 -1
  44. package/esm2015/esfaenza-extensions.js +0 -7
  45. package/esm2015/lib/models/providers/implementation/DefaultStorageProvider.js +0 -79
  46. package/esm2015/lib/models/session/implementation/DefaultSessionRetriever.js +0 -26
  47. package/esm2015/lib/modules/extensions.full.module.js +0 -54
  48. package/esm2015/lib/modules/extensions.module.js +0 -24
  49. package/esm2015/lib/services/extensions.clipboard.service.js +0 -165
  50. package/esm2015/lib/services/extensions.dates.service.js +0 -224
  51. package/esm2015/lib/services/extensions.hashing.service.js +0 -306
  52. package/esm2015/lib/services/extensions.messages.service.js +0 -317
  53. package/esm2015/lib/services/extensions.storage.service.js +0 -100
  54. package/esm2015/lib/services/extensions.utilities.service.js +0 -185
  55. package/fesm2015/esfaenza-extensions.js.map +0 -1
@@ -1,2435 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ngx-toastr'), require('sweetalert2'), require('cerialize'), require('rxjs/operators'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize', 'rxjs/operators', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.extensions = {}), global.ng.core, global.ngxToastr, global.swal, global.cerialize, global.rxjs.operators, global.rxjs));
5
- })(this, (function (exports, core, ngxToastr, swal, cerialize, operators, rxjs) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var swal__default = /*#__PURE__*/_interopDefaultLegacy(swal);
10
-
11
- /**
12
- * Token che identifica il locale da utilizzare per questa libreria, sono supportati i locali 'it-IT' ed 'en-US'
13
- */
14
- var EXT_LOCALE = new core.InjectionToken('EXT_LOCALE');
15
- /**
16
- * Token che indica se la libreria deve utilizzare la libreria 'sweetalerts2' (più graficamente piacevolo) o se limitarsi ad usare 'toastr'
17
- */
18
- var EXT_FANCY_ALERTS = new core.InjectionToken('EXT_FANCY_ALERTS');
19
- /**
20
- * Token che indica il prefisso delle searchView che serve per storicizzarle evitando di tirarsi in memoria anche tutti gli oggetti. Se vuoto viene supposto 'Hot'
21
- */
22
- var APPSEARCH_PREFIX = new core.InjectionToken('APPSEARCH_PREFIX');
23
- /**
24
- * Token che indica se i metodi di estensione che utilizzano le date permettono l'uso di date in utc
25
- */
26
- var EXT_ALLOW_UTC = new core.InjectionToken('EXT_ALLOW_UTC');
27
-
28
- // Angular
29
- /**
30
- * Modulo di estensione che non registra nessun servizio di estensione, dovranno essere dichiarati 1 per 1 dall'applicazione che li utilizza
31
- */
32
- var ExtensionsModule = /** @class */ (function () {
33
- function ExtensionsModule() {
34
- }
35
- ExtensionsModule.forRoot = function (config) {
36
- return {
37
- ngModule: ExtensionsModule,
38
- providers: [
39
- { provide: EXT_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' },
40
- { provide: EXT_FANCY_ALERTS, useValue: (config === null || config === void 0 ? void 0 : config.fancy_alerts) || true },
41
- { provide: APPSEARCH_PREFIX, useValue: (config === null || config === void 0 ? void 0 : config.appsearch_prefix) || 'Hot' },
42
- { provide: EXT_ALLOW_UTC, useValue: (config === null || config === void 0 ? void 0 : config.allow_utc) == null ? false : config === null || config === void 0 ? void 0 : config.allow_utc }
43
- ]
44
- };
45
- };
46
- return ExtensionsModule;
47
- }());
48
- ExtensionsModule.decorators = [
49
- { type: core.NgModule }
50
- ];
51
-
52
- // Angular
53
- /**
54
- * Service che fornisce funzionalità di alert nei tipi fondamentali: success, info, warning e danger
55
- */
56
- var MessageService = /** @class */ (function () {
57
- /**
58
- * Costruttore
59
- *
60
- * @ignore
61
- */
62
- function MessageService(toastr, FANCY_ALERTS, LOCALE) {
63
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
64
- this.toastr = toastr;
65
- this.FANCY_ALERTS = FANCY_ALERTS;
66
- this.LOCALE = LOCALE;
67
- /**
68
- * Oggetto statico in supporto alla localizzazione
69
- */
70
- this.loc = {
71
- 'Confirm': { 'en-US': "Confirm", 'it-IT': "Conferma", },
72
- 'Cancel': { 'en-US': "Cancel", 'it-IT': "Annulla", },
73
- 'Close': { 'en-US': "Close", 'it-IT': "Chiudi", },
74
- 'Error': { 'en-US': "Error", 'it-IT': "Errore", },
75
- 'Info': { 'en-US': "Info", 'it-IT': "Informazione", },
76
- 'Success': { 'en-US': "Success", 'it-IT': "Successo", },
77
- 'Warning': { 'en-US': "Warning", 'it-IT': "Attenzione", }
78
- };
79
- this.expiredSessionSwal = swal__default["default"].mixin({
80
- showCancelButton: false,
81
- confirmButtonText: 'Login',
82
- customClass: {
83
- confirmButton: "btn btn-primary",
84
- container: "app-wrap",
85
- },
86
- buttonsStyling: false,
87
- reverseButtons: false,
88
- allowOutsideClick: false,
89
- icon: "warning"
90
- });
91
- this.warningSwalWithCancel = swal__default["default"].mixin({
92
- title: this.loc["Warning"][(_a = this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT'],
93
- customClass: {
94
- confirmButton: "btn btn-primary",
95
- cancelButton: "btn btn-secondary app-margin-right-10",
96
- container: "app-wrap",
97
- },
98
- buttonsStyling: false,
99
- reverseButtons: true,
100
- showCancelButton: true,
101
- confirmButtonText: this.loc["Confirm"][(_b = this.LOCALE) !== null && _b !== void 0 ? _b : 'it-IT'],
102
- cancelButtonText: this.loc["Cancel"][(_c = this.LOCALE) !== null && _c !== void 0 ? _c : 'it-IT'],
103
- icon: "warning"
104
- });
105
- this.warningSwal = swal__default["default"].mixin({
106
- title: this.loc["Warning"][(_d = this.LOCALE) !== null && _d !== void 0 ? _d : 'it-IT'],
107
- customClass: {
108
- confirmButton: "btn btn-primary",
109
- container: "app-wrap",
110
- },
111
- buttonsStyling: false,
112
- reverseButtons: true,
113
- showCancelButton: false,
114
- confirmButtonText: this.loc["Close"][(_e = this.LOCALE) !== null && _e !== void 0 ? _e : 'it-IT'],
115
- icon: "warning"
116
- });
117
- this.successSwal = swal__default["default"].mixin({
118
- title: this.loc["Success"][(_f = this.LOCALE) !== null && _f !== void 0 ? _f : 'it-IT'],
119
- customClass: {
120
- confirmButton: "btn btn-primary",
121
- container: "app-wrap",
122
- },
123
- buttonsStyling: false,
124
- reverseButtons: true,
125
- showCancelButton: false,
126
- confirmButtonText: this.loc["Close"][(_g = this.LOCALE) !== null && _g !== void 0 ? _g : 'it-IT'],
127
- icon: "success"
128
- });
129
- this.errorSwal = swal__default["default"].mixin({
130
- title: this.loc["Error"][(_h = this.LOCALE) !== null && _h !== void 0 ? _h : 'it-IT'],
131
- customClass: {
132
- confirmButton: "btn btn-primary",
133
- container: "app-wrap",
134
- },
135
- buttonsStyling: false,
136
- reverseButtons: true,
137
- showCancelButton: false,
138
- confirmButtonText: this.loc["Close"][(_j = this.LOCALE) !== null && _j !== void 0 ? _j : 'it-IT'],
139
- icon: "error"
140
- });
141
- this.infoSwal = swal__default["default"].mixin({
142
- title: this.loc["Info"][(_k = this.LOCALE) !== null && _k !== void 0 ? _k : 'it-IT'],
143
- customClass: {
144
- confirmButton: "btn btn-primary",
145
- container: "app-wrap",
146
- },
147
- buttonsStyling: false,
148
- reverseButtons: true,
149
- showCancelButton: false,
150
- confirmButtonText: this.loc["Close"][(_l = this.LOCALE) !== null && _l !== void 0 ? _l : 'it-IT'],
151
- icon: "info"
152
- });
153
- }
154
- /**
155
- * Presentazione di un semplice messaggio di successo
156
- *
157
- * Se viene chiamato con le impostazioni di default e toastr è abilitato, viene mostrato al centro
158
- * Se viene chiamato con override su toastr vuol dire che è una notifica secondaria e appare in alto a destra
159
- *
160
- * @param {string} text Testo da mostrare
161
- * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
162
- */
163
- MessageService.prototype.simpleSuccess = function (text, secondaryNotificationType) {
164
- if (secondaryNotificationType === void 0) { secondaryNotificationType = null; }
165
- var tos = this.toastrOrSwal(secondaryNotificationType);
166
- if (tos == "swal")
167
- this.successSwal.fire("", text);
168
- else
169
- this.toastr.success(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
170
- };
171
- /**
172
- * Presentazione di un semplice messaggio di informazione
173
- *
174
- * Se viene chiamato con le impostazioni di default e toastr è abilitato, viene mostrato al centro
175
- * Se viene chiamato con override su toastr vuol dire che è una notifica secondaria e appare in alto a destra
176
- *
177
- * @param {string} text Testo da mostrare
178
- * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
179
- */
180
- MessageService.prototype.simpleInfo = function (text, secondaryNotificationType) {
181
- if (secondaryNotificationType === void 0) { secondaryNotificationType = null; }
182
- var tos = this.toastrOrSwal(secondaryNotificationType);
183
- if (tos == "swal")
184
- this.infoSwal.fire("", text);
185
- else
186
- this.toastr.info(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
187
- };
188
- /**
189
- * Presentazione di un semplice messaggio di errore
190
- *
191
- * Se viene chiamato con le impostazioni di default e toastr è abilitato, viene mostrato al centro
192
- * Se viene chiamato con override su toastr vuol dire che è una notifica secondaria e appare in alto a destra
193
- *
194
- * @param {string} text Testo da mostrare
195
- * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
196
- */
197
- MessageService.prototype.simpleError = function (text, secondaryNotificationType) {
198
- if (secondaryNotificationType === void 0) { secondaryNotificationType = null; }
199
- var tos = this.toastrOrSwal(secondaryNotificationType);
200
- if (tos == "swal")
201
- this.errorSwal.fire("", text);
202
- else
203
- this.toastr.error(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
204
- };
205
- /**
206
- * Presentazione di un semplice messaggio di avviso
207
- *
208
- * Se viene chiamato con le impostazioni di default e toastr è abilitato, viene mostrato al centro
209
- * Se viene chiamato con override su toastr vuol dire che è una notifica secondaria e appare in alto a destra
210
- *
211
- * @param {string} text Testo da mostrare
212
- * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
213
- */
214
- MessageService.prototype.simpleWarning = function (text, secondaryNotificationType) {
215
- if (secondaryNotificationType === void 0) { secondaryNotificationType = null; }
216
- var tos = this.toastrOrSwal(secondaryNotificationType);
217
- if (tos == "swal")
218
- this.warningSwal.fire("", text);
219
- else
220
- this.toastr.warning(text, null, { positionClass: tos == "toastr" ? "toast-top-right" : "toast-top-center", timeOut: tos == "toastr" ? 0 : 5000, extendedTimeOut: tos == "toastr" ? 0 : 1000 });
221
- };
222
- /**
223
- * Ripulisce tutti i messaggi presenti in un dato momento sullo schermo
224
- */
225
- MessageService.prototype.clearMessages = function () {
226
- this.toastr.clear();
227
- swal__default["default"].close();
228
- };
229
- /**
230
- * Mostra un messaggio di avviso con richiesta di conferma
231
- *
232
- * @param {string} title Titolo del messaggio
233
- * @param {string} text Contenuto del messaggio
234
- *
235
- * @returns {Promise} Restituisce una Promise col risultato scelto dall'utente (conferma o no)
236
- */
237
- MessageService.prototype.promiseWarningWithChoice = function (title, text) {
238
- return this.warningSwalWithCancel.fire(title, text);
239
- };
240
- /**
241
- * In base alla configurazione attuale e all'eventuale override per la chiamata del caso indica se bisogna utilizzare toastr o sweetalert
242
- *
243
- * @param {"toastr" | "swal" | null} providerOverride Override alla modalità configurata
244
- *
245
- * @returns {"toastr" | "swal"} Indicazione su che provider di messaggi di avviso debba essere utilizzato
246
- */
247
- MessageService.prototype.toastrOrSwal = function (providerOverride) {
248
- if (providerOverride != null)
249
- return providerOverride;
250
- return this.FANCY_ALERTS == null ? "swal" : this.FANCY_ALERTS ? "swal" : "toastr";
251
- };
252
- /**
253
- * Mostra un messaggio di avviso con richiesta di conferma e gestisce il risultato chiamato i callback **onsuccess** o **onerror**
254
- *
255
- * @param {string} title Titolo del messaggio
256
- * @param {string} text Contenuto del messaggio
257
- * @param {Function} onsuccess Callback da chimare su conferma
258
- * @param {Function} onerror Callback da chimare su errori
259
- */
260
- MessageService.prototype.simpleWarningWithChoice = function (title, text, onsuccess, onerror) {
261
- if (onsuccess === void 0) { onsuccess = null; }
262
- if (onerror === void 0) { onerror = null; }
263
- this.warningSwalWithCancel.fire(title, text).then(function (result) {
264
- if (result.value && onsuccess)
265
- onsuccess();
266
- else if (onerror)
267
- onerror();
268
- });
269
- };
270
- /**
271
- * Mostra un messaggio di avviso che la sessione corrente è scaduta e propone all'utente di navigare al login. Qualora l'utente decidesse di farlo
272
- * verrà chiamata la funzione di callback **onnavigate
273
- *
274
- * @param {string} title Titolo del messaggio
275
- * @param {string} text Contenuto del messaggio
276
- * @param {Function} onnavigate Callback da chimare su navigazione in corso
277
- */
278
- MessageService.prototype.expiredSessionMessage = function (title, text, onnavigate) {
279
- if (onnavigate === void 0) { onnavigate = null; }
280
- this.expiredSessionSwal.fire(title, text).then(function (result) {
281
- if (result.value && onnavigate)
282
- onnavigate();
283
- });
284
- };
285
- /**
286
- * Metodo helper per gestire in maniera standardizzata una risposta di tipo **CallResult**
287
- *
288
- * @param {CallResult} response Risposta ricevuta dal server
289
- * @param {string} successMsg Messaggio da visualizzare in caso di successo
290
- * @param {string} errorMsg Messaggio da visualizzare in caso di fallimento
291
- * @param {Function} postSuccess Callback da chimare in caso di successo
292
- * @param {Function} postFailure Callback da chimare in caso di fallimento
293
- */
294
- MessageService.prototype.manageCallResultResponse = function (response, successMsg, errorMsg, postSuccess, postFailure) {
295
- if (postSuccess === void 0) { postSuccess = null; }
296
- if (postFailure === void 0) { postFailure = null; }
297
- if (response.success) {
298
- if (successMsg)
299
- this.simpleSuccess(successMsg);
300
- if (postSuccess)
301
- postSuccess();
302
- }
303
- else if (response.haserror) {
304
- this.simpleError((errorMsg ? errorMsg + ": " : "") + response.error);
305
- if (postFailure)
306
- postFailure();
307
- }
308
- else if (response.haswarning) {
309
- this.simpleWarning(response.warning);
310
- }
311
- };
312
- /**
313
- * Metodo helper per gestire in maniera standardizzata una risposta di tipo **string**, considerando che:
314
- *
315
- * Stringa vuota --> Tutto bene
316
- *
317
- * Stringa piena --> Questo è il messaggio d'errore per cui la chiamata è fallita
318
- *
319
- * @param {string} response Risposta ricevuta dal server
320
- * @param {string} successMsg Messaggio da visualizzare in caso di successo
321
- * @param {string} errorMsg Messaggio da visualizzare in caso di fallimento
322
- * @param {Function} postSuccess Callback da chimare in caso di successo
323
- * @param {Function} postFailure Callback da chimare in caso di fallimento
324
- */
325
- MessageService.prototype.manageStringResponse = function (response, successMsg, errorMsg, postSuccess, postFailure) {
326
- if (postSuccess === void 0) { postSuccess = null; }
327
- if (postFailure === void 0) { postFailure = null; }
328
- if (!response) {
329
- if (successMsg)
330
- this.simpleSuccess(successMsg);
331
- if (postSuccess)
332
- postSuccess();
333
- }
334
- else {
335
- if (errorMsg)
336
- this.simpleError(errorMsg + ": " + response);
337
- if (postFailure)
338
- postFailure();
339
- }
340
- };
341
- /**
342
- * Metodo helper per gestire in maniera standardizzata una risposta di tipo **boolean**
343
- *
344
- * @param {string} response Risposta ricevuta dal server
345
- * @param {string} successMsg Messaggio da visualizzare in caso di successo
346
- * @param {string} errorMsg Messaggio da visualizzare in caso di fallimento
347
- * @param {Function} postSuccess Callback da chimare in caso di successo
348
- * @param {Function} postFailure Callback da chimare in caso di fallimento
349
- */
350
- MessageService.prototype.manageStringResponseBool = function (response, successMsg, errorMsg, postSuccess, postFailure) {
351
- if (postSuccess === void 0) { postSuccess = null; }
352
- if (postFailure === void 0) { postFailure = null; }
353
- if (response) {
354
- if (successMsg)
355
- this.simpleSuccess(successMsg);
356
- if (postSuccess)
357
- postSuccess();
358
- }
359
- else {
360
- if (errorMsg)
361
- this.simpleError(errorMsg);
362
- if (postFailure)
363
- postFailure();
364
- }
365
- };
366
- return MessageService;
367
- }());
368
- MessageService.decorators = [
369
- { type: core.Injectable }
370
- ];
371
- MessageService.ctorParameters = function () { return [
372
- { type: ngxToastr.ToastrService },
373
- { type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EXT_FANCY_ALERTS,] }] },
374
- { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EXT_LOCALE,] }] }
375
- ]; };
376
-
377
- // Angular
378
- /**
379
- * Service che fornisce un accesso base in lettura/scrittura sulla clipboard
380
- */
381
- var ClipboardService = /** @class */ (function () {
382
- /**
383
- * Costruttore
384
- *
385
- * @ignore
386
- */
387
- function ClipboardService(msgService, LOCALE) {
388
- this.msgService = msgService;
389
- this.LOCALE = LOCALE;
390
- /**
391
- * Oggetto statico di localizzazione per i messaggi di questa Service
392
- */
393
- this.loc = {
394
- "Unfortunately Firefox doesn't yet support direct Clipboard access if not via extensions, Please use Chrome to do this operation": {
395
- 'en-US': "Unfortunately Firefox doesn't yet support direct Clipboard access if not via extensions, Please use Chrome to do this operation",
396
- 'it-IT': "Mi dispiace ma Firefox non supporta l'accesso diretto alla Clipboard, se non attraverso le estensioni. Si prega di usare Chrome"
397
- },
398
- "Generic error during 'copy' command execution": {
399
- 'en-US': "Generic error during 'copy' command execution",
400
- 'it-IT': "Errore generico durante l'esecuzione del comando 'copy'"
401
- },
402
- "Error during Clipboard content read operation": {
403
- 'en-US': "Error during Clipboard content read operation",
404
- 'it-IT': "Errore nella lettura del contenuto della Clipboard"
405
- },
406
- "Error during Clipboard content copy operation": {
407
- 'en-US': "Error during Clipboard content copy operation",
408
- 'it-IT': "Errore nella scrittura del contenuto nella Clipboard"
409
- }
410
- };
411
- }
412
- /**
413
- * Prende il valore della clipboard.
414
- * Si può specificare se ci si aspetta una lista o una matrice di valori in modo da ricevere già un risultato utilizzabile
415
- *
416
- * @param {'array' | 'matrix'} style Stile dell'output desiderato, se array o matrice
417
- * @param {Function} valueFoundCallback Callback che questa funzione chiamerà una volta ottenuto i valori richiesti dalla clipboard
418
- */
419
- ClipboardService.prototype.getClipboard = function (style, valueFoundCallback) {
420
- var _this = this;
421
- var _a;
422
- if (navigator.userAgent.indexOf("Firefox") != -1) {
423
- //https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText
424
- this.msgService.simpleError(this.loc["Unfortunately Firefox doesn't yet support direct Clipboard access if not via extensions, Please use Chrome to do this operation"][(_a = this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT']);
425
- return;
426
- }
427
- if (window.clipboardData) {
428
- var data = window.clipboardData.getData("Text");
429
- var value = style == "array" ? this.getClipboardLines(data) :
430
- style == "matrix" ? this.getClipboardMatrix(data) : [];
431
- if (valueFoundCallback)
432
- valueFoundCallback(value);
433
- }
434
- else if (window.navigator.clipboard) {
435
- window.navigator.permissions.query({ name: 'clipboard-read' }).then(function (result) {
436
- if (!(result.state === 'granted' || result.state === 'prompt'))
437
- if (valueFoundCallback)
438
- valueFoundCallback([]);
439
- window.navigator.clipboard.readText()
440
- .then(function (t) {
441
- var value = style == "array" ? _this.getClipboardLines(t) :
442
- style == "matrix" ? _this.getClipboardMatrix(t) : [];
443
- if (valueFoundCallback)
444
- valueFoundCallback(value);
445
- })
446
- .catch(function (err) {
447
- var _a;
448
- _this.msgService.simpleError(_this.loc["Error during Clipboard content read operation"][(_a = _this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT'] + ": " + err);
449
- });
450
- });
451
- }
452
- };
453
- /**
454
- * Ottiene il contenuto della clipboard diviso per righe (separate da newline)
455
- *
456
- * @param {string} data contenuto letto dalla clipboard
457
- *
458
- * @returns {string[]} Array contenente il testo preso dalla clipboard diviso per riga
459
- */
460
- ClipboardService.prototype.getClipboardLines = function (data) {
461
- return data.trim().split("\r\n");
462
- };
463
- /**
464
- * Ottiene il contenuto della clipboard diviso per righe (separate da newline) e colonne (separate da tab)
465
- *
466
- * @param {string} data contenuto letto dalla clipboard
467
- *
468
- * @returns {string[][]} Matrice contenente il testo preso dalla clipboard diviso per riga e colonna
469
- */
470
- ClipboardService.prototype.getClipboardMatrix = function (data) {
471
- var ret = [];
472
- var rows = data.split("\r\n");
473
- // A quanto pare ogni valore è separato da un \t... spero che sia uno standard di quando si copia da excel altrimenti ciao
474
- for (var i = 0; i < rows.length; i++)
475
- ret.push(rows[i].split('\t').map(function (t) { return t.trim(); }));
476
- return ret;
477
- };
478
- /**
479
- * Metodo che copia un testo all'interno della clipboard
480
- *
481
- * @param {string} text Testo da inserire nella clipboard
482
- */
483
- ClipboardService.prototype.copyTextToClipboard = function (text) {
484
- var _a, _b;
485
- var textArea = document.createElement("textarea");
486
- //
487
- // *** This styling is an extra step which is likely not required. ***
488
- //
489
- // Why is it here? To ensure:
490
- // 1. the element is able to have focus and selection.
491
- // 2. if element was to flash render it has minimal visual impact.
492
- // 3. less flakyness with selection and copying which **might** occur if
493
- // the textarea element is not visible.
494
- //
495
- // The likelihood is the element won't even render, not even a flash,
496
- // so some of these are just precautions. However in IE the element
497
- // is visible whilst the popup box asking the user for permission for
498
- // the web page to copy to the clipboard.
499
- //
500
- // Place in top-left corner of screen regardless of scroll position.
501
- textArea.style.position = "fixed";
502
- textArea.style.top = "0";
503
- textArea.style.left = "0";
504
- // Ensure it has a small width and height. Setting to 1px / 1em
505
- // doesn't work as this gives a negative w/h on some browsers.
506
- textArea.style.width = "2em";
507
- textArea.style.height = "2em";
508
- // We don't need padding, reducing the size if it does flash render.
509
- textArea.style.padding = "0";
510
- // Clean up any borders.
511
- textArea.style.border = "none";
512
- textArea.style.outline = "none";
513
- textArea.style.boxShadow = "none";
514
- // Avoid flash of white box if rendered for any reason.
515
- textArea.style.background = "transparent";
516
- textArea.value = text;
517
- document.body.appendChild(textArea);
518
- textArea.focus();
519
- textArea.select();
520
- try {
521
- var successful = document.execCommand("copy");
522
- if (!successful)
523
- this.msgService.simpleError(this.loc["Generic error during 'copy' command execution"][(_a = this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT']);
524
- }
525
- catch (err) {
526
- this.msgService.simpleError(this.loc["Error during Clipboard content copy operation"][(_b = this.LOCALE) !== null && _b !== void 0 ? _b : 'it-IT'] + ": " + err);
527
- }
528
- document.body.removeChild(textArea);
529
- };
530
- return ClipboardService;
531
- }());
532
- ClipboardService.decorators = [
533
- { type: core.Injectable }
534
- ];
535
- ClipboardService.ctorParameters = function () { return [
536
- { type: MessageService },
537
- { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EXT_LOCALE,] }] }
538
- ]; };
539
-
540
- // Angular
541
- /**
542
- * Service che fornisce dei metodi di estensione per la gestione/manipolazione delle date
543
- */
544
- var DateService = /** @class */ (function () {
545
- /**
546
- * Costruttore
547
- *
548
- * @ignore
549
- */
550
- function DateService(LOCALE, allowUtc) {
551
- var _a, _b, _c, _d, _e, _f, _g, _h;
552
- this.LOCALE = LOCALE;
553
- this.allowUtc = allowUtc;
554
- /**
555
- * Oggetto statico di localizzazione per i messaggi di questa Service
556
- */
557
- this.loc = {
558
- "SMALL_DATE_FORMAT": { 'en-US': "MM/DD/YYYY", 'it-IT': "DD/MM/YYYY" },
559
- "FULL_DATE_FORMAT": { 'en-US': "MM/DD/YYYY HH:mm:ss", 'it-IT': "DD/MM/YYYY HH:mm:ss" },
560
- "FULL_DATE_FORMAT_NO_SS": { 'en-US': "MM/DD/YYYY HH:mm", 'it-IT': "DD/MM/YYYY HH:mm" },
561
- "SMALL_DATE_DISPLAY_FORMAT": { 'en-US': "DD/MM/YYYY", 'it-IT': "DD/MM/YYYY" },
562
- "SMALL_DATE_DISPLAY_FORMAT_WITH_HOUR": { 'en-US': "DD/MM/YYYY HH", 'it-IT': "DD/MM/YYYY HH" },
563
- "SMALL_DATE_DISPLAY_FORMAT_WITH_MINUTE": { 'en-US': "DD/MM/YYYY HH:mm", 'it-IT': "DD/MM/YYYY HH:mm" },
564
- "FULL_DATE_DISPLAY_FORMAT": { 'en-US': "DD/MM/YYYY HH:mm:ss", 'it-IT': "DD/MM/YYYY HH:mm:ss" },
565
- "FULL_DATE_DISPLAY_FORMAT_NO_SS": { 'en-US': "DD/MM/YYYY HH:mm", 'it-IT': "DD/MM/YYYY HH:mm" }
566
- };
567
- /**
568
- * Oggetto di configurazione per tenere da conto le informazioni sui formati
569
- */
570
- this.cfg = {
571
- fulldate: "",
572
- fulldateDisplay: "",
573
- smallDate: "",
574
- fulldateNoSS: "",
575
- smallDateWithH: "",
576
- smallDateWithM: "",
577
- fulldateDisplayNoSS: ""
578
- };
579
- this.cfg.smallDate = this.loc["SMALL_DATE_FORMAT"][(_a = this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT'];
580
- this.cfg.fulldate = this.loc["FULL_DATE_FORMAT"][(_b = this.LOCALE) !== null && _b !== void 0 ? _b : 'it-IT'];
581
- this.cfg.fulldateNoSS = this.loc["FULL_DATE_FORMAT_NO_SS"][(_c = this.LOCALE) !== null && _c !== void 0 ? _c : 'it-IT'];
582
- this.cfg.fulldateDisplay = this.loc["FULL_DATE_DISPLAY_FORMAT"][(_d = this.LOCALE) !== null && _d !== void 0 ? _d : 'it-IT'];
583
- this.cfg.fulldateDisplayNoSS = this.loc["FULL_DATE_DISPLAY_FORMAT_NO_SS"][(_e = this.LOCALE) !== null && _e !== void 0 ? _e : 'it-IT'];
584
- this.cfg.smallDate = this.loc["SMALL_DATE_DISPLAY_FORMAT"][(_f = this.LOCALE) !== null && _f !== void 0 ? _f : 'it-IT'];
585
- this.cfg.smallDateWithH = this.loc["SMALL_DATE_DISPLAY_FORMAT_WITH_HOUR"][(_g = this.LOCALE) !== null && _g !== void 0 ? _g : 'it-IT'];
586
- this.cfg.smallDateWithM = this.loc["SMALL_DATE_DISPLAY_FORMAT_WITH_MINUTE"][(_h = this.LOCALE) !== null && _h !== void 0 ? _h : 'it-IT'];
587
- }
588
- /**
589
- * Aggiusta una data in "istante finale" in base a qual è la parte di data significativa.
590
- *
591
- * Es. Istante finale delle ore: 05/10/1992 --> 04/10/1992 24:00(:00)
592
- *
593
- * @param {any} date Data qualsiasi (Date, stringa, dayjs...), verrà ricondotta ad un oggetto dayJs
594
- * @param {'day' | 'hour' | 'minute'} timepart Parte significativa della data
595
- * @param {boolean} printSeconds Indica se effettuare la stampa dei secondi o no
596
- */
597
- DateService.prototype.adjustDateToFinalInstant = function (date, timepart, printSeconds) {
598
- if (printSeconds === void 0) { printSeconds = true; }
599
- var mydt = this.getDateConvertion(date);
600
- if (mydt == null)
601
- return "FE: Not a Date";
602
- var isZeroTime = mydt.startOf(timepart).valueOf() === mydt.valueOf();
603
- if (!isZeroTime)
604
- return printSeconds ? mydt.format(this.cfg.fulldateDisplay) : mydt.format(this.cfg.fulldateDisplayNoSS);
605
- var tmpValue = mydt.subtract(1, timepart);
606
- var value = "";
607
- // Istante finale delle ore: 05/10/1992 --> 04/10/1992 24:00(:00)
608
- if (timepart == 'day')
609
- value = tmpValue.format(this.cfg.smallDate) + " 24:00" + (printSeconds ? ':00' : '');
610
- // Istante finale dei minuti: giorno 05/10/1992 04:00:00 --> 05/10/1992 03:60(:00)
611
- else if (timepart == 'hour')
612
- value = tmpValue.format(this.cfg.smallDateWithH) + ":60" + (printSeconds ? ':00' : '');
613
- // Istante finale dei secondi: giorno 05/10/1992 04:10:00 --> 05/10/1992 04:09:60
614
- else if (timepart == 'minute')
615
- value = tmpValue.format(this.cfg.smallDateWithM) + ":60";
616
- return value;
617
- };
618
- /**
619
- * Funzione che effettua l'ordinamento fra 2 date in base alla direzione specificata
620
- *
621
- * @param {any} a Prima data per il confronto
622
- * @param {any} b Seconda data per il confronto
623
- * @param {'asc' | 'desc'} direction Direzione rispetto a cui ordinare le due date
624
- *
625
- * @returns {number} 0 se le date sono uguali, 1 se la data A deve venire logicamente prima della data B, -1 altrimenti
626
- */
627
- DateService.prototype.dateSort = function (a, b, direction) {
628
- if (a < b)
629
- return direction == 'asc' ? 1 : -1;
630
- else if (a > b)
631
- return direction == 'asc' ? -1 : 1;
632
- // con a uguale a b
633
- return 0;
634
- };
635
- /**
636
- * Effettua il trim dei secondi da una data espressa come stringa
637
- *
638
- * @param {string} value Data espressa come stringa
639
- *
640
- * @returns {string} Data senza i secondi
641
- */
642
- DateService.prototype.trimSeconds = function (value) {
643
- //I numeri mangiati da dayjs spesso vengono ricondotti a date vere. Mi assicuro che se ci sono solo numeri proseguo
644
- if (!isNaN(value))
645
- return value;
646
- //Se non ho qualcosa del tipo XX/YY/ZZZZ aa:bb:cc di sicuro non è una data che mi interessa
647
- if (!/^\d\d\/\d\d\/\d\d\d\d \d\d:\d\d:\d\d$/g.test(value))
648
- return value;
649
- //In questo caso mi arrivano valori che devono essere stampati as-is, solo tagliando i secondi
650
- return "'" + value.substr(0, value.length - 3);
651
- };
652
- /**
653
- * Data una lista di date Da e una lista di date A restituisce un oggetto rappresentante il range che include tutte le date passate
654
- *
655
- * @param {any[]} fromDates Lista dei Da
656
- * @param {any[]} toDates Lista dei A
657
- *
658
- * @returns {{ from: any, to: any }} Range di date Da - A che include tutti i valori di **fromDates** e **toDates**
659
- */
660
- DateService.prototype.getMinMaxDatesRange = function (fromDates, toDates) {
661
- var datesFroms = [];
662
- var datesTo = [];
663
- for (var i = 0; i < fromDates.length; i++) {
664
- var d = fromDates[i];
665
- var convertion = this.getDateConvertion(d);
666
- if (convertion)
667
- datesFroms.push(convertion);
668
- }
669
- for (var i = 0; i < toDates.length; i++) {
670
- var d = toDates[i];
671
- var convertion = this.getDateConvertion(d);
672
- if (convertion)
673
- datesTo.push(convertion);
674
- }
675
- return { from: dayjs.min(datesFroms), to: dayjs.max(datesTo) };
676
- };
677
- /**
678
- * Ottiene la conversione di una data in qualsiasi formato al formato standard DayJs
679
- *
680
- * @param {any} date Oggetto rappresentante una data. Potrebbe essere una stringa, un Date o già un DayJs
681
- * @param {boolean} useUtc Indica se usare l'estensione utc di Dayjs per parsare la data o no
682
- *
683
- * @returns {any} Data in modalità DayJs
684
- */
685
- DateService.prototype.getDateConvertion = function (date, useUtc) {
686
- if (useUtc === void 0) { useUtc = false; }
687
- if (!date)
688
- return null;
689
- if (this.isDayJs(date))
690
- return date;
691
- if (this.isJsDate(date))
692
- return useUtc ? dayjs.utc(date) : dayjs(date);
693
- // Se non c'è la proprietà length vuol dire che non è una stringa e a questo punto non ho idea di che minchia sia
694
- var length = date.length;
695
- if (!length)
696
- return null;
697
- if (useUtc && !this.allowUtc)
698
- throw "@esfaenza/extensions: Richiesta data UTC ma da configurazione la libreria non lo supporta";
699
- // Per risparmiare chiamate a tentoni, in base alla lunghezza della stringa chiamo direttamente il metodo giusto,
700
- // controllando poi che mi generi una data come me la aspetto io
701
- var tryThis = null;
702
- var toCall = useUtc ? dayjs.utc : dayjs;
703
- // Se la data contiene la lettera "T" vuol dire che è una data del tipo 2020-10-15T00:00:00, direttamente parsabile dal dayjs col locale corretto.
704
- // Per il resto mi baso sulla lunghezza della stringa
705
- if (date.includes("T"))
706
- tryThis = toCall(date);
707
- else if (length == this.cfg.fulldate.length)
708
- tryThis = toCall(date, this.cfg.fulldate);
709
- else if (length == this.cfg.smallDate.length)
710
- tryThis = toCall(date, this.cfg.smallDate);
711
- else if (length == this.cfg.fulldateNoSS.length)
712
- tryThis = toCall(date, this.cfg.fulldateNoSS);
713
- if (tryThis.isValid())
714
- return tryThis;
715
- // Se niente funziona, null.
716
- // Ricondurre l'Input ad una data non è possibile.
717
- return null;
718
- };
719
- /**
720
- * Helper che restituisce **true** qualora l'oggetto passato fosse una data vera e propria, **false** altrimenti
721
- *
722
- * @param {any} check Oggetto da controllare
723
- *
724
- * @returns {boolean} Indicazione se l'oggetto è un vero Date di Javascript o no
725
- */
726
- DateService.prototype.isJsDate = function (check) {
727
- return check && Object.prototype.toString.call(check) === "[object Date]" && !isNaN(check);
728
- };
729
- /**
730
- * Helper che restituisce **true** qualora l'oggetto passato fosse un DayJs vero e proprio, **false** altrimenti
731
- *
732
- * @param {any} check Oggetto da controllare
733
- * @returns {boolean} Indicazione se l'oggetto è un vero DayJs o no
734
- */
735
- DateService.prototype.isDayJs = function (check) {
736
- // Non uso instanceof perché sarebbe estremamente più lento
737
- // Non uso nemmeno isDayjs() della libreria Dayjs dato che ha lo stesso problema: https://github.com/iamkun/dayjs/blob/06f88f425828b1ce96b737332d25145a95a4ee9d/src/index.js#L9
738
- return check.$D !== undefined && check.$M !== undefined && check.$y !== undefined;
739
- };
740
- /**
741
- * Ottiene la formattazione di una data in base alla versione richiesta "small" o "long" e a se stampare o meno i secondi
742
- *
743
- * @param {any} date Oggetto rappresentante una data. Potrebbe essere una stringa, un Date o già un DayJs
744
- * @param {boolean} small Indica se formattarla con un formato breve (se **true**) o un formato più lungo (se **false**)
745
- *
746
- * @returns {string} Data formattata nel formato richiesto
747
- */
748
- DateService.prototype.getFormatted = function (date, small, seconds) {
749
- var date = this.getDateConvertion(date);
750
- if (!date)
751
- return null;
752
- return date.format(small ? this.cfg.smallDate : seconds ? this.cfg.fulldateDisplay : this.cfg.fulldateDisplayNoSS);
753
- };
754
- return DateService;
755
- }());
756
- DateService.decorators = [
757
- { type: core.Injectable }
758
- ];
759
- DateService.ctorParameters = function () { return [
760
- { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EXT_LOCALE,] }] },
761
- { type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EXT_ALLOW_UTC,] }] }
762
- ]; };
763
-
764
- /**
765
- * Suffisso della proprietà da generare in cui salvare il navigatore
766
- * utilizzato dal servizio di esportazione per prendere il valore delle proprietà di un oggetto
767
- */
768
- var csvValueNavigator = "_csvnav";
769
- /**
770
- * Suffisso della proprietà da generare in cui salvare l'ordine di esportazione
771
- */
772
- var csvOrdPrefix = "_csvord";
773
- /**
774
- * Suffisso della proprietà da generare in cui salvare la visibilità di questa proprietà
775
- */
776
- var csvVisPrefix = "_csvvis";
777
- /**
778
- * Suffisso della proprietà da generare in cui salvare il nome della colonna in cui salvare questa proprietà
779
- */
780
- var csvHdrPrefix = "_csvhdr";
781
- /**
782
- * Suffisso della proprietà da generare in cui salvare il valore da prendere per una proprietà di tipo Lista
783
- */
784
- var listCsvValPrefix = "_listcsvval";
785
- /**
786
- * Suffisso della proprietà da generare in cui salvare l'Header della proprietà di tipo Lista relativo al valore esportato nella proprietà con suffisso **listCsvValPrefix**
787
- */
788
- var listCsvHdrPrefix = "_listcsvhdr";
789
- /**
790
- * Suffisso della proprietà da generare in cui salvare il formato della proprietà di tipo Lista relativo al valore esportato nella proprietà con suffisso **listCsvValPrefix**
791
- */
792
- var listCsvValFormat = "_listcsvvalformat";
793
- /**
794
- * Suffisso della proprietà da generare in cui salvare il valore da prendere per una proprietà di tipo Dizionario
795
- */
796
- var dictionaryCsvValPrefix = "_flatlistcsvval";
797
- /**
798
- * Suffisso della proprietà da generare in cui salvare l'Header della proprietà di un Dizionario relativo al valore esportato nella proprietà con suffisso **dictionaryCsvValPrefix**
799
- */
800
- var dictionaryCsvHdrPrefix = "_flatlistcsvhdr";
801
- /**
802
- * Suffisso della proprietà da generare in cui salvare il formato della proprietà che si sta esportando
803
- */
804
- var csvFormatPrefix = "_csvfmt";
805
-
806
- // Angular
807
- /**
808
- * Decoratore di esportazione utilizzabile su una proprietà singola.
809
- * Verranno generate 3 proprietà che gestiranno l'esportazione: (prop, prop_csvvis, prop_csvhdr).
810
- *
811
- * Ad esempio, da questa configurazione:
812
- *
813
- * @example
814
- * ```
815
- * @Export(true, "MyHeader")
816
- * ciao: string;
817
- * ```
818
- *
819
- * Nasceranno le seguenti proprietà nell'oggetto esportabile:
820
- *
821
- * @example
822
- * ```
823
- * ciao_csvvis: string; => true
824
- * ciao: string;
825
- * ciao_csvhdr: string => "MyHeader"
826
- * ```
827
- *
828
- * @param {number} order Ordine di esportazione. Più piccolo è, prima appare il valore
829
- * @param {string} header Titolo della colonna nel file CSV esportato
830
- * @param {string} format Formato di esportazione. Può essere un formato data per i campi data o 'F' per i campi floating point
831
- */
832
- var Export = function (order, header, format) {
833
- if (format === void 0) { format = null; }
834
- return function (target, propertyKey) {
835
- if (format)
836
- Object.defineProperty(target, propertyKey + csvFormatPrefix, { value: format, writable: false });
837
- Object.defineProperty(target, propertyKey + csvOrdPrefix, { value: order, writable: false });
838
- Object.defineProperty(target, propertyKey + csvVisPrefix, { value: !!header, writable: false });
839
- Object.defineProperty(target, propertyKey + csvHdrPrefix, { value: header, writable: false });
840
- };
841
- };
842
- /**
843
- * Decoratore di esportazione utilizzabile su un oggetto.
844
- * Per ogni proprietà dell'oggetto verranno generate 3 proprietà che gestiranno l'esportazione: (prop, prop_csvvis, prop_csvhdr).
845
- * Per essere esportate, le proprietà dell'oggetto devono essere marcate con i Decoratori di esportazione
846
- *
847
- * Ad esempio, da questa configurazione:
848
- *
849
- * @example
850
- * ```
851
- * MyObj {
852
- * @Export(true, "MyHeader")
853
- * ciao: string;
854
- * }
855
- *
856
- * @ExportObject(true, "MyHeader")
857
- * test: MyObj;
858
- * ```
859
- *
860
- * Nasceranno le seguenti proprietà nell'oggetto esportabile:
861
- *
862
- * @example
863
- * ```
864
- * testciao: string; => Valore di MyObj.ciao
865
- * testciao_csvvis: string; => true
866
- * testciao_csvhdr: string => "MyHeader"
867
- * ```
868
- *
869
- * @param {number} order Ordine di esportazione. Più piccolo è, prima appare il valore
870
- * @param {any} type Tipo da esportare
871
- */
872
- var ExportAs = function (order, type) { return function (target, propertyKey) {
873
- var t = new type();
874
- for (var prop in t) {
875
- //Niente hasownproperty perché le proprietà dell'oggetto interno sono dentro al prototype
876
- if (typeof t[prop + csvVisPrefix] !== "undefined") {
877
- var toEmit = t[prop + csvVisPrefix];
878
- var lbl = t[prop + csvHdrPrefix];
879
- var format = t[prop + csvFormatPrefix];
880
- var orderProp = t[prop + csvOrdPrefix];
881
- if (format)
882
- Object.defineProperty(target, propertyKey + prop + csvFormatPrefix, { value: format, writable: false });
883
- Object.defineProperty(target, propertyKey + prop + csvOrdPrefix, { value: orderProp + order, writable: false });
884
- Object.defineProperty(target, propertyKey + prop, { value: null, writable: true, enumerable: true });
885
- Object.defineProperty(target, propertyKey + prop + csvValueNavigator, { value: propertyKey + "." + prop, writable: false });
886
- Object.defineProperty(target, propertyKey + prop + csvVisPrefix, { value: toEmit, writable: false });
887
- Object.defineProperty(target, propertyKey + prop + csvHdrPrefix, { value: lbl, writable: false });
888
- }
889
- }
890
- }; };
891
- /**
892
- * Decoratore di esportazione utilizzabile su una lista,
893
- * si utilizzano 2 navigator rispettivamente per la valorizzazione dell'Header e del Valore e
894
- * per ogni elemento dell'array verranno generate 3 proprietà che gestiranno l'esportazione: (prop, prop_csvvis, prop_csvhdr)
895
- *
896
- * ATTENZIONE: Gli oggetti esportati in questa modalità non devono presentare altri tag di tipo @Export{...} all'interno. Fa tutto questo decoratore
897
- *
898
- * I navigator hanno questa convenzione:
899
- *
900
- * . --> divide due proprietà da richiamare consecutivamente: "a.b" richiamerà "obj.a.b";
901
- *
902
- * | --> divide più proprietà per le concatenazioni con uno spazio fra una e l'altra: "regdesc|slice.slicename" diventerà obj.regdesc + " " + obj.slice.slicename
903
- *
904
- * @param {number} order Ordine di esportazione. Più piccolo è, prima appare il valore
905
- * @param {string} headernavigator Navigator col compito di selezionare il titolo per la colonna
906
- * @param {string} valuenavigator Navigator col compito di selezionare il valore per la colonna
907
- * @param {string} valueformat Formato di esportazione per i valori selezionati dal **valuenavigator**. Può essere un formato data per i campi data o 'F' per i campi floating point
908
- */
909
- var ExportList = function (order, headernavigator, valuenavigator, valueformat) {
910
- if (valueformat === void 0) { valueformat = null; }
911
- return function (target, propertyKey) {
912
- Object.defineProperty(target, propertyKey + csvOrdPrefix, { value: order, writable: false });
913
- Object.defineProperty(target, propertyKey + listCsvValPrefix, { value: valuenavigator, writable: false });
914
- Object.defineProperty(target, propertyKey + listCsvHdrPrefix, { value: headernavigator, writable: false });
915
- Object.defineProperty(target, propertyKey + listCsvValFormat, { value: valueformat, writable: false });
916
- };
917
- };
918
- /**
919
- * Decoratore di esportazione utilizzabile su un dizionario. Se ad esempio si vogliono generare le colonne
920
- *
921
- * Valore A = 1
922
- *
923
- * Valore B = 2
924
- *
925
- * Valore C = 3
926
- *
927
- * partendo da un oggetto iniziale { Valore { A: 1, B: 2, C: 3 } }
928
- *
929
- * @param {number} order Ordine di esportazione. Più piccolo è, prima appare il valore
930
- * @param {string} headernavigator Navigator col compito di selezionare il titolo per la colonna
931
- * @param {string} valuenavigator Navigator col compito di selezionare il valore per la colonna
932
- */
933
- var ExportDictionary = function (order, headernavigator, valuenavigator) { return function (target, propertyKey) {
934
- Object.defineProperty(target, propertyKey + csvOrdPrefix, { value: order, writable: false });
935
- Object.defineProperty(target, propertyKey + dictionaryCsvValPrefix, { value: valuenavigator, writable: false });
936
- Object.defineProperty(target, propertyKey + dictionaryCsvHdrPrefix, { value: headernavigator, writable: false });
937
- }; };
938
- /**
939
- * Service che si occupa dell'esportazione degli oggetti marcati dai Decoratori **ExportDictionary**, **ExportList**, **ExportAs** o **Export**
940
- */
941
- var ExportService = /** @class */ (function () {
942
- /**
943
- * Costruttore
944
- *
945
- * @ignore
946
- */
947
- function ExportService(dates) {
948
- this.dates = dates;
949
- }
950
- /**
951
- * Data una lista di oggetti genera gli header per l'esportazione e integra ogni oggetto con le proprietà esportabili dalla libreria **@ctrl/ngx-csv**
952
- *
953
- * @param {any[]} objs Oggetti da esportare
954
- *
955
- * @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
956
- */
957
- ExportService.prototype.setupForExport = function (objs) {
958
- var headers = [];
959
- var headersCache = {};
960
- if (!objs || objs.length == 0)
961
- return headers;
962
- // Devo per forza farlo per tutti gli oggetti dato che devo esporre le proprietà che mi servono da esportare
963
- // Gli header li raccolgo tutti poi faccio uan distinct in modo da esportare tutte le proprietà per bene
964
- for (var i = 0; i < objs.length; i++) {
965
- var hds = this.parseAndGetHeaders(objs[i]);
966
- // Aggiungo gli header facendo in modo di non aggiungerne mai due uguali per non dover fare una distinct dopo
967
- // che costerebbe comunque risorse. Utilizzo un dizionario d'appoggio per lookup istantanei
968
- for (var k = 0; k < hds.length; k++) {
969
- if (!headersCache[hds[k].key]) {
970
- headersCache[hds[k].key] = true;
971
- headers.push(hds[k]);
972
- }
973
- }
974
- }
975
- return headers.sort(function (a, b) { return a.order - b.order; });
976
- };
977
- /**
978
- * 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**
979
- *
980
- * @param {GenericItem[]} objs Oggetti generici da esportare
981
- * @param {CsvHeaders[]} columns Colonne richieste dall'esportazione
982
- *
983
- * @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
984
- */
985
- ExportService.prototype.setupForGenericExport = function (objs, columns) {
986
- var _this = this;
987
- var headers = [];
988
- if (!objs || objs.length == 0)
989
- return headers;
990
- // Devo per forza farlo per tutti gli oggetti dato che devo esporre le proprietà che mi servono da esportare
991
- objs.forEach(function (obj, index) {
992
- if (index == 0)
993
- headers = _this.parseAndGetGenericHeaders(obj, columns);
994
- else
995
- _this.parseAndGetGenericHeaders(obj, columns);
996
- });
997
- return headers;
998
- };
999
- /**
1000
- * Dato un oggetto generico genera gli header per l'esportazione e lo integra con le proprietà esportabili dalla libreria **@ctrl/ngx-csv**
1001
- *
1002
- * Metodo interno richiamato da **setupForGenericExport**
1003
- *
1004
- * @param {GenericItem} obj Oggetto generico da esportare
1005
- * @param {CsvColumn[]} columns Colonne richieste dall'esportazione
1006
- *
1007
- * @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
1008
- */
1009
- ExportService.prototype.parseAndGetGenericHeaders = function (obj, columns) {
1010
- if (!obj.properties)
1011
- return null;
1012
- var headers = [];
1013
- //Miracle incoming
1014
- columns.forEach(function (t) {
1015
- var propValue = obj.properties[t.key];
1016
- Object.defineProperty(obj, t.key + "_exp", { value: propValue, writable: false, enumerable: true });
1017
- headers.push({ label: t.label, key: t.key + "_exp", order: t.order });
1018
- });
1019
- //Tirati fuori tutti gli header faccio sort sull'ordinamento
1020
- return headers.sort(function (a, b) { return a.order - b.order; });
1021
- };
1022
- /**
1023
- * Dato un oggetto genera gli header per l'esportazione e lo integra con le proprietà esportabili dalla libreria **@ctrl/ngx-csv**
1024
- *
1025
- * Metodo interno richiamato da **setupForExport**
1026
- *
1027
- * @param {any} obj Oggetto generico da esportare
1028
- *
1029
- * @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
1030
- */
1031
- ExportService.prototype.parseAndGetHeaders = function (obj) {
1032
- var headers = [];
1033
- // Miracle incoming
1034
- for (var prop in obj) {
1035
- var toCall = void 0;
1036
- if (typeof obj[prop + listCsvHdrPrefix] !== "undefined")
1037
- toCall = this.parseList.bind(this);
1038
- else if (typeof obj[prop + dictionaryCsvHdrPrefix] !== "undefined")
1039
- toCall = this.parseDictionary.bind(this);
1040
- else if (typeof obj[prop + csvVisPrefix] !== "undefined") {
1041
- if (typeof obj[prop + csvValueNavigator] !== "undefined")
1042
- toCall = this.parseObject.bind(this);
1043
- else
1044
- toCall = this.parseProperty.bind(this);
1045
- }
1046
- if (toCall)
1047
- toCall(obj, prop, headers);
1048
- }
1049
- return headers;
1050
- };
1051
- /**
1052
- * Setup per l'esportazione di una singola proprietà.
1053
- * Viene generato l'header e la proprietà relativa al valore formattato o no
1054
- *
1055
- * @param {any} obj Oggetto di cui esportare la proprietà **prop**
1056
- * @param {string} prop Proprietà da esportare
1057
- * @param {CsvHeaders} headers Contenitore degli header, verrà riempito da questa funzione
1058
- */
1059
- ExportService.prototype.parseProperty = function (obj, prop, headers) {
1060
- var toEmit = obj[prop + csvVisPrefix];
1061
- var format = obj[prop + csvFormatPrefix];
1062
- var lbl = obj[prop + csvHdrPrefix];
1063
- var order = obj[prop + csvOrdPrefix];
1064
- if (toEmit && lbl !== "undefined") {
1065
- // Se non ho un formato esporto direttamente
1066
- if (!format) {
1067
- // Se è un formato data mi assicuro di non stampare mai una data 00:00:00 altrimenti in esportazione viene uno schifo
1068
- var val = obj[prop] ? this.dates.trimSeconds(obj[prop].toString()) : "";
1069
- Object.defineProperty(obj, prop + "_nofmt", { value: val, writable: false, enumerable: true });
1070
- headers.push({ label: lbl ? lbl : prop + "_nofmt", key: prop + "_nofmt", order: order });
1071
- }
1072
- else {
1073
- // Caso formato numerico
1074
- if (format == "F") {
1075
- // Check considerando la possibilità di zeri
1076
- var val_1 = obj[prop] != null ? obj[prop].toString() : "";
1077
- // Elimino tutte le virgole (indicatori di migliaia per la culture default en-US)
1078
- val_1 = val_1.replace(/,/, "");
1079
- // Il singolo punto che c'è, se presente (separatore decimali) lo trasformo in virgola
1080
- var valConverted = val_1.replace(".", ",");
1081
- Object.defineProperty(obj, prop + "_fmt", { value: valConverted, writable: false, enumerable: true });
1082
- headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order });
1083
- }
1084
- else {
1085
- // Se ho un formato data trasformo in dayjs, formatto ed esporto
1086
- // Per la trasformazione in dayjs provo prima a passargli la stringa di netto, sperando la riconosca
1087
- // Se non funziona provo a definirgli la formattazione standard del metering per quel linguaggio
1088
- var val_2 = this.dates.getFormatted(obj[prop], format.length <= 10, false);
1089
- Object.defineProperty(obj, prop + "_fmt", { value: val_2 !== null && val_2 !== void 0 ? val_2 : "", writable: false, enumerable: true });
1090
- headers.push({ label: lbl ? lbl : prop + "_fmt", key: prop + "_fmt", order: order });
1091
- }
1092
- }
1093
- }
1094
- };
1095
- /**
1096
- * Setup per l'esportazione di una singola proprietà da un oggetto.
1097
- * Viene generato l'header e la proprietà relativa al valore formattato o no.
1098
- *
1099
- * Per ottenere il valore e l'header della proprietà vengono utilizzati i navigatori auto-generati nel decoratore **ExportAs**
1100
- *
1101
- * @param {any} obj Oggetto di cui esportare la proprietà **prop**
1102
- * @param {string} prop Proprietà da esportare
1103
- * @param {CsvHeaders} headers Contenitore degli header, verrà riempito da questa funzione
1104
- */
1105
- ExportService.prototype.parseObject = function (obj, prop, headers) {
1106
- //se questa proprietà ha un navigator significa che deriva da un oggetto interno, recupero il valore in questa fase dato che prima non ce l'ho
1107
- var valuenavigator = obj[prop + csvValueNavigator];
1108
- //Es. di valuenavigator obj.subobj.subsubobj.property
1109
- var jmps = valuenavigator.split(".");
1110
- //Mi clono l'oggetto originale per non uccidergli i riferimenti
1111
- var clone = JSON.parse(JSON.stringify(obj));
1112
- //Salto ricorsivamente su me stesso per arrivare alla proprietà
1113
- //Salto 1 > diventa obj
1114
- //Salto 2 > diventa obj.subobj
1115
- //ecc...
1116
- jmps.forEach(function (pp) { clone = clone[pp]; });
1117
- //Valore finale :D
1118
- var value = clone;
1119
- var lbl = obj[prop + csvHdrPrefix];
1120
- var order = obj[prop + csvOrdPrefix];
1121
- //Se per questa proprietà ho un formato lo applico
1122
- var format = obj[prop + csvFormatPrefix];
1123
- if (format == "F") {
1124
- var val = value.toString();
1125
- val = val.replace(/,/, "");
1126
- value = val.replace(".", ",");
1127
- }
1128
- else if (format) {
1129
- value = this.dates.getFormatted(value, format.length <= 10, false);
1130
- }
1131
- Object.defineProperty(obj, prop, { value: value, writable: false, enumerable: true });
1132
- headers.push({ label: lbl ? lbl : prop, key: prop, order: order });
1133
- };
1134
- /**
1135
- * Setup per l'esportazione di una lista di valori pivottati dinamicamente:
1136
- *
1137
- * => Recupero il valore utilizzando i navigatori
1138
- *
1139
- * => Recupero l'header utilizzando i navigatori
1140
- *
1141
- * => Con il valore ci creo la property
1142
- *
1143
- * => Con l'header e il riferimento alla property appena creata creo un record negli header da esportare
1144
- *
1145
- * @param {any} obj Oggetto di cui esportare la proprietà **prop**
1146
- * @param {string} prop Proprietà da esportare
1147
- * @param {CsvHeaders} headers Contenitore degli header, verrà riempito da questa funzione
1148
- */
1149
- ExportService.prototype.parseList = function (obj, prop, headers) {
1150
- var headernavigator = obj[prop + listCsvHdrPrefix];
1151
- var valuenavigator = obj[prop + listCsvValPrefix];
1152
- var valueformat = obj[prop + listCsvValFormat];
1153
- var order = obj[prop + csvOrdPrefix];
1154
- var jumps, tmpRes;
1155
- var objs = obj[prop];
1156
- var _loop_1 = function (idx) {
1157
- var listitem = objs[idx];
1158
- headersplit = headernavigator.split(" ");
1159
- header = "";
1160
- // Per l'header si considera a se stante ogni pezzo separato da spazio per fare le concatenazioni
1161
- headersplit.forEach(function (pr) {
1162
- jumps = pr.split(".");
1163
- tmpRes = JSON.parse(JSON.stringify(listitem));
1164
- jumps.forEach(function (pp) { tmpRes = tmpRes[pp]; });
1165
- if (!header)
1166
- header = tmpRes;
1167
- else
1168
- header += " " + tmpRes;
1169
- });
1170
- jumps = valuenavigator.split(".");
1171
- tmpRes = JSON.parse(JSON.stringify(listitem));
1172
- jumps.forEach(function (pp) { tmpRes = tmpRes[pp]; });
1173
- var value = tmpRes;
1174
- if (valueformat == "F") {
1175
- var val = value != null ? value.toString() : "";
1176
- val = val.replace(/,/, "");
1177
- value = val.replace(".", ",");
1178
- }
1179
- else if (valueformat)
1180
- value = this_1.dates.getFormatted(obj[prop], valueformat.length <= 10, false);
1181
- Object.defineProperty(obj, prop + idx, { value: value, writable: false });
1182
- headers.push({ label: header, key: prop + idx, order: order + idx });
1183
- };
1184
- var this_1 = this, headersplit, header;
1185
- for (var idx = 0; idx < objs.length; idx++) {
1186
- _loop_1(idx);
1187
- }
1188
- };
1189
- /**
1190
- * Setup per l'esportazione di una lista di valori pivottati dinamicamente:
1191
- *
1192
- * => Recupero il valore utilizzando i navigatori
1193
- *
1194
- * => Recupero l'header utilizzando i navigatori
1195
- *
1196
- * => Con il valore ci creo la property
1197
- *
1198
- * => Con l'header e il riferimento alla property appena creata creo un record negli header da esportare
1199
- *
1200
- * @param {any} obj Oggetto di cui esportare la proprietà **prop**
1201
- * @param {string} prop Proprietà da esportare
1202
- * @param {CsvHeaders} headers Contenitore degli header, verrà riempito da questa funzione
1203
- */
1204
- ExportService.prototype.parseDictionary = function (obj, prop, headers) {
1205
- var headernavigator = obj[prop + dictionaryCsvHdrPrefix];
1206
- var valuenavigator = obj[prop + dictionaryCsvValPrefix];
1207
- var order = obj[prop + csvOrdPrefix];
1208
- var jumps, tmpRes;
1209
- var objs = obj[prop];
1210
- var _loop_2 = function (idx) {
1211
- var listitem = objs[idx];
1212
- headersplit = headernavigator.split(" ");
1213
- header = "";
1214
- headersplit.forEach(function (pr) {
1215
- jumps = pr.split(".");
1216
- tmpRes = JSON.parse(JSON.stringify(listitem));
1217
- jumps.forEach(function (pp) { tmpRes = tmpRes[pp]; });
1218
- if (!header)
1219
- header = tmpRes;
1220
- else
1221
- header += " " + tmpRes;
1222
- });
1223
- valuesplit = valuenavigator.split(",");
1224
- valuesplit.forEach(function (t, idxinternal) {
1225
- var navig = t.split("-")[1];
1226
- var desc = t.split("-")[0];
1227
- jumps = navig.split(".");
1228
- tmpRes = JSON.parse(JSON.stringify(listitem));
1229
- jumps.forEach(function (pp) { tmpRes = tmpRes[pp]; });
1230
- var value = tmpRes;
1231
- var propname = prop + idx.toString() + idxinternal.toString();
1232
- Object.defineProperty(obj, propname, { value: value, writable: false });
1233
- headers.push({ label: header + " " + desc, key: propname, order: order + idx });
1234
- });
1235
- };
1236
- var headersplit, header, valuesplit;
1237
- for (var idx = 0; idx < objs.length; idx++) {
1238
- _loop_2(idx);
1239
- }
1240
- };
1241
- /**
1242
- * Metodo che si occupa della deserializzazione degli oggetti da esportare. Messo a livello di libreria in modo che qualora ci fosse da cambiare libreria
1243
- * tutte le manutenzioni siano concentrate qui
1244
- *
1245
- * @param {any[]} items Oggetti da deserializzare
1246
- * @param {any} type Tipo da usare come prototipo per la deserializzazione
1247
- *
1248
- * @returns {any} Oggetti deserializzati
1249
- */
1250
- ExportService.prototype.deserializeForExport = function (items, type) {
1251
- return cerialize.Deserialize(items, type);
1252
- };
1253
- return ExportService;
1254
- }());
1255
- ExportService.decorators = [
1256
- { type: core.Injectable }
1257
- ];
1258
- ExportService.ctorParameters = function () { return [
1259
- { type: DateService }
1260
- ]; };
1261
-
1262
- // Angular
1263
- /**
1264
- * Service che fornisce alcuni semplici funzioni di Hashing / GUID / ecc...
1265
- */
1266
- var HashingService = /** @class */ (function () {
1267
- function HashingService() {
1268
- /**
1269
- * Blacklist dei tipi da ignorare quando si effettua l'hashing degli oggetti
1270
- */
1271
- this.objBlacklist = {
1272
- "NgForm": true, "ElementRef": true, "ExtensionsService": true, "ToastrService": true, "LocaleService": true, "AppState": true, "Router": true,
1273
- "ActivatedRoute": true, "HTTPService": true, "Location": true, "CanvasComponent": true, "ModalDirective": true, "ChangeDetectorRef": true,
1274
- "DateService": true, "EventEmitter": true, "ViewRef_": true, "Subscriber": true, "ItemLocalization": true
1275
- };
1276
- /**
1277
- * Array dei possibili valori di un simbolo esadecimale
1278
- */
1279
- this.hex_chr = '0123456789abcdef'.split('');
1280
- }
1281
- /**
1282
- * Generazione di un GUID pseudo-univoco
1283
- *
1284
- * @returns {string} il GUID generato
1285
- */
1286
- HashingService.prototype.getGUID = function () {
1287
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
1288
- var r = Math.random() * 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8);
1289
- return v.toString(16);
1290
- });
1291
- };
1292
- /**
1293
- * Calcolo dell'hash su un oggetto
1294
- *
1295
- * @param {any} o Oggetto di cui calcolare l'hash
1296
- * @param {number} level Livello di ricorsione nel caso venga effettuato l'hash di un oggetto che contiene altri oggetti
1297
- * @param {boolean} navigateFullDepth Indica se navigare l'oggetto per l'intera lunghezza. In caso contrario si ferma al secondo livello
1298
- *
1299
- * @returns {string} Hash generato per l'oggetto in questione
1300
- */
1301
- HashingService.prototype.hashObject = function (o, level, navigateFullDepth, precise) {
1302
- if (level === void 0) { level = 0; }
1303
- if (navigateFullDepth === void 0) { navigateFullDepth = false; }
1304
- if (precise === void 0) { precise = false; }
1305
- var strDef = this.stringify(o, level, navigateFullDepth);
1306
- var hash = precise ? this.md5(strDef) : this.simpleHash(strDef);
1307
- return hash;
1308
- };
1309
- /**
1310
- * Hash più semplice e più veloce dell'md5, ma meno sicuro
1311
- *
1312
- * Vedi https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
1313
- *
1314
- * @param {string} str Stringa di cui calcolare l'hash
1315
- */
1316
- HashingService.prototype.simpleHash = function (str, seed) {
1317
- if (seed === void 0) { seed = 0; }
1318
- var h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
1319
- for (var i = 0, ch = void 0; i < str.length; i++) {
1320
- ch = str.charCodeAt(i);
1321
- h1 = Math.imul(h1 ^ ch, 2654435761);
1322
- h2 = Math.imul(h2 ^ ch, 1597334677);
1323
- }
1324
- h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
1325
- h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
1326
- return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString();
1327
- };
1328
- /**
1329
- * Genera una stringa che identifica univocamente l'oggetto in questione
1330
- *
1331
- * @param {any} o Oggetto di cui calcolare la stringa univoca
1332
- * @param {number} level Livello di ricorsione nel caso venga effettuato l'hash di un oggetto che contiene altri oggetti
1333
- * @param {boolean} navigateFullDepth Indica se navigare l'oggetto per l'intera lunghezza. In caso contrario si ferma al secondo livello
1334
- */
1335
- HashingService.prototype.stringify = function (o, level, navigateFullDepth) {
1336
- var i, r;
1337
- if (o === null)
1338
- return "n";
1339
- if (o === true)
1340
- return "t";
1341
- if (o === false)
1342
- return "f";
1343
- if (o instanceof Date)
1344
- return 'd:' + o.valueOf().toString();
1345
- i = typeof o;
1346
- if (i === "string")
1347
- return "s:" + o;
1348
- if (i === "number")
1349
- return "n:" + o;
1350
- if (o instanceof Function)
1351
- return "m:" + o.toString();
1352
- if (o instanceof Array) {
1353
- r = [];
1354
- for (i = 0; i < o.length; i++) {
1355
- var res = this.stringify(o[i], level, navigateFullDepth);
1356
- if (res)
1357
- r.push(res);
1358
- }
1359
- return r.length > 0 ? "a:" + r.join(";") : "";
1360
- }
1361
- r = [];
1362
- //Se è oggetto, escludo tutti quelli di sistema/inutili
1363
- if (o) {
1364
- var name = o.__proto__.constructor.name;
1365
- if (!this.objBlacklist[name]) {
1366
- for (i in o) {
1367
- if (o.hasOwnProperty(i) && (level <= 2 || navigateFullDepth)) {
1368
- var res = this.stringify(o[i], level + 1, navigateFullDepth);
1369
- if (res)
1370
- r.push(i + ":" + res);
1371
- }
1372
- }
1373
- }
1374
- }
1375
- return r.length > 0 ? "o:" + r.join(";") : "";
1376
- };
1377
- /**
1378
- * Data una stringa restituisce l'md5
1379
- *
1380
- * @param {string} s Stringa di cui calcolare l'md5
1381
- * @returns {string} md5 della stringa **s**
1382
- */
1383
- HashingService.prototype.md5 = function (s) {
1384
- return this.hex(this.md51(s));
1385
- };
1386
- /**
1387
- * @ignore
1388
- *
1389
- * Metodo di utilità per il calcolo dell'md5
1390
- */
1391
- HashingService.prototype.md5cycle = function (x, k) {
1392
- var a = x[0], b = x[1], c = x[2], d = x[3];
1393
- a = this.ff(a, b, c, d, k[0], 7, -680876936);
1394
- d = this.ff(d, a, b, c, k[1], 12, -389564586);
1395
- c = this.ff(c, d, a, b, k[2], 17, 606105819);
1396
- b = this.ff(b, c, d, a, k[3], 22, -1044525330);
1397
- a = this.ff(a, b, c, d, k[4], 7, -176418897);
1398
- d = this.ff(d, a, b, c, k[5], 12, 1200080426);
1399
- c = this.ff(c, d, a, b, k[6], 17, -1473231341);
1400
- b = this.ff(b, c, d, a, k[7], 22, -45705983);
1401
- a = this.ff(a, b, c, d, k[8], 7, 1770035416);
1402
- d = this.ff(d, a, b, c, k[9], 12, -1958414417);
1403
- c = this.ff(c, d, a, b, k[10], 17, -42063);
1404
- b = this.ff(b, c, d, a, k[11], 22, -1990404162);
1405
- a = this.ff(a, b, c, d, k[12], 7, 1804603682);
1406
- d = this.ff(d, a, b, c, k[13], 12, -40341101);
1407
- c = this.ff(c, d, a, b, k[14], 17, -1502002290);
1408
- b = this.ff(b, c, d, a, k[15], 22, 1236535329);
1409
- a = this.gg(a, b, c, d, k[1], 5, -165796510);
1410
- d = this.gg(d, a, b, c, k[6], 9, -1069501632);
1411
- c = this.gg(c, d, a, b, k[11], 14, 643717713);
1412
- b = this.gg(b, c, d, a, k[0], 20, -373897302);
1413
- a = this.gg(a, b, c, d, k[5], 5, -701558691);
1414
- d = this.gg(d, a, b, c, k[10], 9, 38016083);
1415
- c = this.gg(c, d, a, b, k[15], 14, -660478335);
1416
- b = this.gg(b, c, d, a, k[4], 20, -405537848);
1417
- a = this.gg(a, b, c, d, k[9], 5, 568446438);
1418
- d = this.gg(d, a, b, c, k[14], 9, -1019803690);
1419
- c = this.gg(c, d, a, b, k[3], 14, -187363961);
1420
- b = this.gg(b, c, d, a, k[8], 20, 1163531501);
1421
- a = this.gg(a, b, c, d, k[13], 5, -1444681467);
1422
- d = this.gg(d, a, b, c, k[2], 9, -51403784);
1423
- c = this.gg(c, d, a, b, k[7], 14, 1735328473);
1424
- b = this.gg(b, c, d, a, k[12], 20, -1926607734);
1425
- a = this.hh(a, b, c, d, k[5], 4, -378558);
1426
- d = this.hh(d, a, b, c, k[8], 11, -2022574463);
1427
- c = this.hh(c, d, a, b, k[11], 16, 1839030562);
1428
- b = this.hh(b, c, d, a, k[14], 23, -35309556);
1429
- a = this.hh(a, b, c, d, k[1], 4, -1530992060);
1430
- d = this.hh(d, a, b, c, k[4], 11, 1272893353);
1431
- c = this.hh(c, d, a, b, k[7], 16, -155497632);
1432
- b = this.hh(b, c, d, a, k[10], 23, -1094730640);
1433
- a = this.hh(a, b, c, d, k[13], 4, 681279174);
1434
- d = this.hh(d, a, b, c, k[0], 11, -358537222);
1435
- c = this.hh(c, d, a, b, k[3], 16, -722521979);
1436
- b = this.hh(b, c, d, a, k[6], 23, 76029189);
1437
- a = this.hh(a, b, c, d, k[9], 4, -640364487);
1438
- d = this.hh(d, a, b, c, k[12], 11, -421815835);
1439
- c = this.hh(c, d, a, b, k[15], 16, 530742520);
1440
- b = this.hh(b, c, d, a, k[2], 23, -995338651);
1441
- a = this.ii(a, b, c, d, k[0], 6, -198630844);
1442
- d = this.ii(d, a, b, c, k[7], 10, 1126891415);
1443
- c = this.ii(c, d, a, b, k[14], 15, -1416354905);
1444
- b = this.ii(b, c, d, a, k[5], 21, -57434055);
1445
- a = this.ii(a, b, c, d, k[12], 6, 1700485571);
1446
- d = this.ii(d, a, b, c, k[3], 10, -1894986606);
1447
- c = this.ii(c, d, a, b, k[10], 15, -1051523);
1448
- b = this.ii(b, c, d, a, k[1], 21, -2054922799);
1449
- a = this.ii(a, b, c, d, k[8], 6, 1873313359);
1450
- d = this.ii(d, a, b, c, k[15], 10, -30611744);
1451
- c = this.ii(c, d, a, b, k[6], 15, -1560198380);
1452
- b = this.ii(b, c, d, a, k[13], 21, 1309151649);
1453
- a = this.ii(a, b, c, d, k[4], 6, -145523070);
1454
- d = this.ii(d, a, b, c, k[11], 10, -1120210379);
1455
- c = this.ii(c, d, a, b, k[2], 15, 718787259);
1456
- b = this.ii(b, c, d, a, k[9], 21, -343485551);
1457
- x[0] = this.add32(a, x[0]);
1458
- x[1] = this.add32(b, x[1]);
1459
- x[2] = this.add32(c, x[2]);
1460
- x[3] = this.add32(d, x[3]);
1461
- };
1462
- /**
1463
- * @ignore
1464
- *
1465
- * Metodo di utilità per il calcolo dell'md5
1466
- */
1467
- HashingService.prototype.cmn = function (q, a, b, x, s, t) {
1468
- a = this.add32(this.add32(a, q), this.add32(x, t));
1469
- return this.add32((a << s) | (a >>> (32 - s)), b);
1470
- };
1471
- /**
1472
- * @ignore
1473
- *
1474
- * Metodo di utilità per il calcolo dell'md5
1475
- */
1476
- HashingService.prototype.ff = function (a, b, c, d, x, s, t) {
1477
- return this.cmn((b & c) | ((~b) & d), a, b, x, s, t);
1478
- };
1479
- /**
1480
- * @ignore
1481
- *
1482
- * Metodo di utilità per il calcolo dell'md5
1483
- */
1484
- HashingService.prototype.gg = function (a, b, c, d, x, s, t) {
1485
- return this.cmn((b & d) | (c & (~d)), a, b, x, s, t);
1486
- };
1487
- /**
1488
- * @ignore
1489
- *
1490
- * Metodo di utilità per il calcolo dell'md5
1491
- */
1492
- HashingService.prototype.hh = function (a, b, c, d, x, s, t) {
1493
- return this.cmn(b ^ c ^ d, a, b, x, s, t);
1494
- };
1495
- /**
1496
- * @ignore
1497
- *
1498
- * Metodo di utilità per il calcolo dell'md5
1499
- */
1500
- HashingService.prototype.ii = function (a, b, c, d, x, s, t) {
1501
- return this.cmn(c ^ (b | (~d)), a, b, x, s, t);
1502
- };
1503
- /**
1504
- * @ignore
1505
- *
1506
- * Metodo di utilità per il calcolo dell'md5
1507
- */
1508
- HashingService.prototype.md51 = function (s) {
1509
- var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i;
1510
- for (i = 64; i <= s.length; i += 64)
1511
- this.md5cycle(state, this.md5blk(s.substring(i - 64, i)));
1512
- s = s.substring(i - 64);
1513
- var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
1514
- for (i = 0; i < s.length; i++)
1515
- tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);
1516
- tail[i >> 2] |= 0x80 << ((i % 4) << 3);
1517
- if (i > 55) {
1518
- this.md5cycle(state, tail);
1519
- for (i = 0; i < 16; i++)
1520
- tail[i] = 0;
1521
- }
1522
- tail[14] = n * 8;
1523
- this.md5cycle(state, tail);
1524
- return state;
1525
- };
1526
- /**
1527
- * @ignore
1528
- *
1529
- * Metodo di utilità per il calcolo dell'md5
1530
- */
1531
- HashingService.prototype.md5blk = function (s) {
1532
- var md5blks = [], i;
1533
- for (i = 0; i < 64; i += 4)
1534
- md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
1535
- return md5blks;
1536
- };
1537
- /**
1538
- * @ignore
1539
- *
1540
- * Metodo di utilità per il calcolo dell'md5
1541
- */
1542
- HashingService.prototype.rhex = function (n) {
1543
- var s = '', j = 0;
1544
- for (; j < 4; j++)
1545
- s += this.hex_chr[(n >> (j * 8 + 4)) & 0x0F] + this.hex_chr[(n >> (j * 8)) & 0x0F];
1546
- return s;
1547
- };
1548
- /**
1549
- * @ignore
1550
- *
1551
- * Metodo di utilità per il calcolo dell'md5
1552
- */
1553
- HashingService.prototype.hex = function (x) {
1554
- for (var i = 0; i < x.length; i++)
1555
- x[i] = this.rhex(x[i]);
1556
- return x.join('');
1557
- };
1558
- /**
1559
- * @ignore
1560
- *
1561
- * Metodo di utilità per il calcolo dell'md5
1562
- */
1563
- HashingService.prototype.add32 = function (a, b) {
1564
- return (a + b) & 0xFFFFFFFF;
1565
- };
1566
- return HashingService;
1567
- }());
1568
- HashingService.decorators = [
1569
- { type: core.Injectable }
1570
- ];
1571
-
1572
- /**
1573
- * Mappatura del TypeCode del C#
1574
- */
1575
- var TypeCode;
1576
- (function (TypeCode) {
1577
- /** @ignore */ TypeCode[TypeCode["Empty"] = 0] = "Empty";
1578
- /** @ignore */ TypeCode[TypeCode["Obj"] = 1] = "Obj";
1579
- /** @ignore */ TypeCode[TypeCode["DBNull"] = 2] = "DBNull";
1580
- /** @ignore */ TypeCode[TypeCode["Boolean"] = 3] = "Boolean";
1581
- /** @ignore */ TypeCode[TypeCode["Char"] = 4] = "Char";
1582
- /** @ignore */ TypeCode[TypeCode["SByte"] = 5] = "SByte";
1583
- /** @ignore */ TypeCode[TypeCode["Byte"] = 6] = "Byte";
1584
- /** @ignore */ TypeCode[TypeCode["Int16"] = 7] = "Int16";
1585
- /** @ignore */ TypeCode[TypeCode["UInt16"] = 8] = "UInt16";
1586
- /** @ignore */ TypeCode[TypeCode["Int32"] = 9] = "Int32";
1587
- /** @ignore */ TypeCode[TypeCode["UInt32"] = 10] = "UInt32";
1588
- /** @ignore */ TypeCode[TypeCode["Int64"] = 11] = "Int64";
1589
- /** @ignore */ TypeCode[TypeCode["UInt64"] = 12] = "UInt64";
1590
- /** @ignore */ TypeCode[TypeCode["Single"] = 13] = "Single";
1591
- /** @ignore */ TypeCode[TypeCode["Double"] = 14] = "Double";
1592
- /** @ignore */ TypeCode[TypeCode["Decimal"] = 15] = "Decimal";
1593
- /** @ignore */ TypeCode[TypeCode["DateTime"] = 16] = "DateTime";
1594
- /** @ignore */ TypeCode[TypeCode["String"] = 18] = "String";
1595
- })(TypeCode || (TypeCode = {}));
1596
-
1597
- // Angular
1598
- /**
1599
- * Service che fornisce metodi di pubblica utilità
1600
- */
1601
- var UtilityService = /** @class */ (function () {
1602
- function UtilityService() {
1603
- }
1604
- /**
1605
- * Deseleziona il testo eventualmente selezionato
1606
- */
1607
- UtilityService.prototype.clearTextSelection = function () {
1608
- if (window.getSelection) {
1609
- if (window.getSelection().empty) // Chrome
1610
- window.getSelection().empty();
1611
- else if (window.getSelection().removeAllRanges) // Firefox
1612
- window.getSelection().removeAllRanges();
1613
- }
1614
- else if (document.selection) // IE?
1615
- document.selection.empty();
1616
- };
1617
- /**
1618
- * Partendo da una lista, dato il nome della proprietà chiave e il valore della chiave selezionata,
1619
- * trova e restituisce l'oggetto desiderato
1620
- *
1621
- * @param {T[]} sourceList Lista di oggetti dentro cui cercare
1622
- * @param {string} sourceItemIdField Nome della proprietà che rappresenta la chiave di un oggetto di tipo T
1623
- * @param {string} selectedValue Valore di chiave selezionato
1624
- *
1625
- * @returns {T} Oggetto la cui proprietà **sourceItemIdField** assume il valore **selectedValue**
1626
- */
1627
- UtilityService.prototype.getSelectedItem = function (sourceList, sourceItemIdField, selectedValue) {
1628
- for (var i = 0; i < sourceList.length; i++) {
1629
- var item = sourceList[i];
1630
- if (item[sourceItemIdField] == selectedValue)
1631
- return item;
1632
- }
1633
- return null;
1634
- };
1635
- /**
1636
- * Effettua il reset di un Form di Angular
1637
- *
1638
- * @param {NgForm} form Form da resettare
1639
- * @param {string} exception1 Campo da non resettare
1640
- * @param {string} exception2 Campo da non resettare
1641
- */
1642
- UtilityService.prototype.cleanForm = function (form, exception1, exception2) {
1643
- if (exception1 === void 0) { exception1 = null; }
1644
- if (exception2 === void 0) { exception2 = null; }
1645
- for (var name in form.controls) {
1646
- if (name && name != exception1 && name != exception1 + "_internal" && name != exception2 && name != exception2 + "_internal") {
1647
- form.controls[name].reset();
1648
- }
1649
- else {
1650
- form.controls[name].markAsPristine();
1651
- form.controls[name].markAsUntouched();
1652
- }
1653
- }
1654
- //Reimposto il submitted
1655
- form.submitted = false;
1656
- };
1657
- /**
1658
- * Helper che permette di scaricare un file dato un URL (Generato da una chiamata ad **window.URL.createObjectURL**)
1659
- *
1660
- * @param {string} url ObjectURL che rappresenta il file da scaricare
1661
- * @param {string} filename Nome del file suggerito in fase di salvataggio
1662
- */
1663
- UtilityService.prototype.fileDownload = function (url, fileName) {
1664
- var a = document.createElement("a");
1665
- document.body.appendChild(a);
1666
- a.className = "ta-display-none";
1667
- a.href = url;
1668
- a.download = fileName;
1669
- a.click();
1670
- window.URL.revokeObjectURL(url);
1671
- document.body.removeChild(a);
1672
- };
1673
- /**
1674
- * Helper per la formattazione di un numero di millisecondi in una stringa più comprensibile per un umano
1675
- *
1676
- * @param {number} duration Tempo espresso in millisecondi
1677
- *
1678
- * @returns {string} Durata formattata
1679
- */
1680
- UtilityService.prototype.msToTime = function (duration) {
1681
- if (!duration)
1682
- return "";
1683
- var milliseconds = parseInt(((duration % 1000) / 100).toString()), seconds = parseInt(((duration / 1000) % 60).toString()), minutes = parseInt(((duration / (1000 * 60)) % 60).toString()), hours = parseInt(((duration / (1000 * 60 * 60)) % 24).toString());
1684
- var st_hours = (hours < 10) ? "0" + hours : hours;
1685
- var st_minutes = (minutes < 10) ? "0" + minutes : minutes;
1686
- var st_seconds = (seconds < 10) ? "0" + seconds : seconds;
1687
- return st_hours + ":" + st_minutes + ":" + st_seconds + "." + milliseconds;
1688
- };
1689
- /**
1690
- * Helper che permette di scaricare un file in Base64
1691
- *
1692
- * @param {string} base64Data Base64 che rappresenta il file da scaricare
1693
- * @param {string} filename Nome del file suggerito in fase di salvataggio
1694
- */
1695
- UtilityService.prototype.saveFile = function (base64Data, filename) {
1696
- var sampleArr = this.base64ToArrayBuffer(base64Data);
1697
- this.saveByteArray(sampleArr, filename);
1698
- };
1699
- /**
1700
- * Trasforma un Base64 in un ArrayBuffer
1701
- *
1702
- * @param {string} base64Data Base64 da trasformare
1703
- *
1704
- * @returns {Uint8Array} Array UTF8
1705
- */
1706
- UtilityService.prototype.base64ToArrayBuffer = function (base64Data) {
1707
- var binaryString = window.atob(base64Data);
1708
- var binaryLen = binaryString.length;
1709
- var bytes = new Uint8Array(binaryLen);
1710
- for (var i = 0; i < binaryLen; i++) {
1711
- var ascii = binaryString.charCodeAt(i);
1712
- bytes[i] = ascii;
1713
- }
1714
- return bytes;
1715
- };
1716
- /**
1717
- * Helper che permette di scaricare un file dato un array di Byte (**Uint8Array**)
1718
- *
1719
- * @param {Uint8Array} byte Rappresentazione del file da scaricare
1720
- * @param {string} filename Nome del file suggerito in fase di salvataggio
1721
- */
1722
- UtilityService.prototype.saveByteArray = function (byte, filename) {
1723
- var blob = new Blob([byte]);
1724
- var link = document.createElement("a");
1725
- document.body.appendChild(link);
1726
- link.href = window.URL.createObjectURL(blob);
1727
- var fileName = filename;
1728
- link.download = fileName;
1729
- link.click();
1730
- document.body.removeChild(link);
1731
- };
1732
- ;
1733
- /**
1734
- * Utility per lo swap di due elementi di un array
1735
- *
1736
- * @param {any[]} array Array di cui invertire due elementi
1737
- * @param {number} x Indice del primo elemento
1738
- * @param {number} y Indice del secondo elemento
1739
- */
1740
- UtilityService.prototype.swap = function (array, x, y) {
1741
- var b = array[x];
1742
- array[x] = array[y];
1743
- array[y] = b;
1744
- };
1745
- /**
1746
- * Helper di trascodifica da tipo c# a tipo Typescript
1747
- *
1748
- * @param {TypeCode} type Tipo da trascodificare
1749
- *
1750
- * @returns {"boolean" | "number" | "string" | "date"} Tipo Typescript corrispondente
1751
- */
1752
- UtilityService.prototype.getJsTypeFromTypeCode = function (type) {
1753
- switch (type) {
1754
- case TypeCode.Boolean:
1755
- return "boolean";
1756
- case TypeCode.Decimal:
1757
- case TypeCode.Double:
1758
- case TypeCode.Single:
1759
- case TypeCode.Int16:
1760
- case TypeCode.Int32:
1761
- case TypeCode.Int64:
1762
- case TypeCode.Byte:
1763
- case TypeCode.SByte:
1764
- case TypeCode.UInt16:
1765
- case TypeCode.UInt32:
1766
- case TypeCode.UInt64:
1767
- return "number";
1768
- case TypeCode.Char:
1769
- case TypeCode.String:
1770
- return "string";
1771
- case TypeCode.DateTime:
1772
- return "date";
1773
- default:
1774
- console.log("Unrecognized input type. Typecode:" + type);
1775
- return "string";
1776
- }
1777
- };
1778
- return UtilityService;
1779
- }());
1780
- UtilityService.decorators = [
1781
- { type: core.Injectable }
1782
- ];
1783
-
1784
- /**
1785
- * Classe che gestisce la scrittura delle informazioni nello store locale.
1786
- * Questo store locale potrebbe essere il localStorage (implementazione di default data dal **DefaultStorageProvider**),
1787
- * oppure un'implementazione custom facente capo a un DB esterno.
1788
- *
1789
- * In questo ultimo caso però sarà necessario implementarsi un proprio **BaseSessionRetriever**
1790
- * che generi una chiave univoca di sessione su cui tutte le operazioni di questa classe saranno eseguite
1791
- */
1792
- var BaseStorageProvider = /** @class */ (function () {
1793
- /** @ignore Costruttore */
1794
- function BaseStorageProvider(session) {
1795
- this.session = session;
1796
- }
1797
- /**
1798
- * Ottiene la chiave "Reale" da utilizzare per la persistenza di una chiave generica
1799
- *
1800
- * @param {string} key Chiave da storicizzare
1801
- *
1802
- * @returns {string} Unione fra l'identificativo della sessione e la chiave specificata
1803
- */
1804
- BaseStorageProvider.prototype.getKey = function (key) {
1805
- return this.session.getSessionKey() + "§" + key + "§";
1806
- };
1807
- return BaseStorageProvider;
1808
- }());
1809
-
1810
- /**
1811
- * Classe astratta che si occupa di recuperare l'Id sessione univoco per applicazione ed utente collegato
1812
- */
1813
- var BaseSessionRetriever = /** @class */ (function () {
1814
- function BaseSessionRetriever() {
1815
- }
1816
- return BaseSessionRetriever;
1817
- }());
1818
-
1819
- // Angular
1820
- /**
1821
- * Service che fornisce funzionalità di base per storicizzazione e recupero oggetti dallo Storage Locale
1822
- *
1823
- * N.B: In ogni chiamata è presente l'operatore rxjs **first()** per far sì che a prescindere dall'implementazione utente/default gli
1824
- * observable effettuino l'unsubscribe automaticamente terminata la prima operazine
1825
- */
1826
- var StorageService = /** @class */ (function () {
1827
- /**
1828
- * Costruttore
1829
- *
1830
- * @ignore
1831
- */
1832
- function StorageService(APPSEARCH_PREFIX, _session, _storage) {
1833
- this.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
1834
- this._session = _session;
1835
- this._storage = _storage;
1836
- }
1837
- /**
1838
- * Inserisce un oggetto che funga da contenitore di oggetti nel local storage, ripulendone gli oggetti (supponendo che sia una view di ricerca) e marcandolo come
1839
- * salvato, in modo che quando viene recuperato il sistema non pensi che sia un oggetto vuoto ma che sappia che gli oggetti son stati ripuliti per risparmiare spazio
1840
- *
1841
- * @param {string} storeName Chiave del localStorage in cui storicizzare l'oggetto **itemsContainer**
1842
- * @param {{ items: any[] }} itemsContainer Oggetto da storicizzare
1843
- */
1844
- StorageService.prototype.setItem = function (storeName, item) {
1845
- var finalItem;
1846
- //Se sto salvando un oggetto con "items" e "page" vuol dire che è un appsearch, la ripulisco
1847
- if (item.items && item.page) {
1848
- finalItem = JSON.parse(JSON.stringify(item));
1849
- finalItem.items = [];
1850
- finalItem.savedstate = true;
1851
- finalItem.savedprefix = this.APPSEARCH_PREFIX || 'Hot';
1852
- }
1853
- else
1854
- finalItem = item;
1855
- return this._storage.setItem(storeName, finalItem).pipe(operators.first(), operators.tap(function (res) {
1856
- if (res == false)
1857
- console.error("Impossibile effettuare il salvataggio dell'oggetto all'interno dello Storage Locale per la chiave " + storeName);
1858
- }));
1859
- };
1860
- /**
1861
- * Recupera un oggetto dallo Storage Locale
1862
- *
1863
- * @param {string} storeName Chiave del localStorage da cui recuperare l'oggetto
1864
- *
1865
- * @returns {any} Oggetto recuperato e deserializzato
1866
- */
1867
- StorageService.prototype.getItem = function (storeName) {
1868
- return this._storage.getItem(storeName).pipe(operators.first(), operators.tap(function (res) {
1869
- if (res == null)
1870
- console.warn("Impossibile ottenere l'oggetto salvato con chiave " + storeName);
1871
- }));
1872
- };
1873
- /**
1874
- * Ripulisce lo Storage Locale
1875
- *
1876
- * @param {string} storeName Chiave del localStorage da ripulire
1877
- */
1878
- StorageService.prototype.removeItem = function (storeName) {
1879
- return this._storage.removeItem(storeName).pipe(operators.first(), operators.tap(function (res) {
1880
- if (res == false)
1881
- console.warn("Impossibile rimuovere l'oggetto salvato con chiave " + storeName);
1882
- }));
1883
- };
1884
- /**
1885
- * Ripulisce lo Storage Locale di ogni cosa salvata
1886
- *
1887
- * @param {string} storeName Chiave del localStorage da ripulire
1888
- */
1889
- StorageService.prototype.clear = function () {
1890
- return this._storage.clear().pipe(operators.first(), operators.tap(function (res) {
1891
- if (res == false)
1892
- console.warn("Impossibile ripulire lo Storage Locale");
1893
- }));
1894
- };
1895
- /**
1896
- * Restituisce tutte le chiavi-valore associate alla sessione corrente
1897
- *
1898
- * @returns {Observable<{ [index: string]: string; }>} Risultato della query
1899
- */
1900
- StorageService.prototype.getAll = function () {
1901
- return this._storage.getAll().pipe(operators.first());
1902
- };
1903
- return StorageService;
1904
- }());
1905
- StorageService.decorators = [
1906
- { type: core.Injectable }
1907
- ];
1908
- StorageService.ctorParameters = function () { return [
1909
- { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [APPSEARCH_PREFIX,] }] },
1910
- { type: BaseSessionRetriever },
1911
- { type: BaseStorageProvider }
1912
- ]; };
1913
-
1914
- /*! *****************************************************************************
1915
- Copyright (c) Microsoft Corporation.
1916
-
1917
- Permission to use, copy, modify, and/or distribute this software for any
1918
- purpose with or without fee is hereby granted.
1919
-
1920
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1921
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1922
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1923
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1924
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1925
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1926
- PERFORMANCE OF THIS SOFTWARE.
1927
- ***************************************************************************** */
1928
- /* global Reflect, Promise */
1929
- var extendStatics = function (d, b) {
1930
- extendStatics = Object.setPrototypeOf ||
1931
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1932
- function (d, b) { for (var p in b)
1933
- if (Object.prototype.hasOwnProperty.call(b, p))
1934
- d[p] = b[p]; };
1935
- return extendStatics(d, b);
1936
- };
1937
- function __extends(d, b) {
1938
- if (typeof b !== "function" && b !== null)
1939
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1940
- extendStatics(d, b);
1941
- function __() { this.constructor = d; }
1942
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1943
- }
1944
- var __assign = function () {
1945
- __assign = Object.assign || function __assign(t) {
1946
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1947
- s = arguments[i];
1948
- for (var p in s)
1949
- if (Object.prototype.hasOwnProperty.call(s, p))
1950
- t[p] = s[p];
1951
- }
1952
- return t;
1953
- };
1954
- return __assign.apply(this, arguments);
1955
- };
1956
- function __rest(s, e) {
1957
- var t = {};
1958
- for (var p in s)
1959
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1960
- t[p] = s[p];
1961
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1962
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1963
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1964
- t[p[i]] = s[p[i]];
1965
- }
1966
- return t;
1967
- }
1968
- function __decorate(decorators, target, key, desc) {
1969
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1970
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1971
- r = Reflect.decorate(decorators, target, key, desc);
1972
- else
1973
- for (var i = decorators.length - 1; i >= 0; i--)
1974
- if (d = decorators[i])
1975
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1976
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1977
- }
1978
- function __param(paramIndex, decorator) {
1979
- return function (target, key) { decorator(target, key, paramIndex); };
1980
- }
1981
- function __metadata(metadataKey, metadataValue) {
1982
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1983
- return Reflect.metadata(metadataKey, metadataValue);
1984
- }
1985
- function __awaiter(thisArg, _arguments, P, generator) {
1986
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1987
- return new (P || (P = Promise))(function (resolve, reject) {
1988
- function fulfilled(value) { try {
1989
- step(generator.next(value));
1990
- }
1991
- catch (e) {
1992
- reject(e);
1993
- } }
1994
- function rejected(value) { try {
1995
- step(generator["throw"](value));
1996
- }
1997
- catch (e) {
1998
- reject(e);
1999
- } }
2000
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2001
- step((generator = generator.apply(thisArg, _arguments || [])).next());
2002
- });
2003
- }
2004
- function __generator(thisArg, body) {
2005
- var _ = { label: 0, sent: function () { if (t[0] & 1)
2006
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
2007
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
2008
- function verb(n) { return function (v) { return step([n, v]); }; }
2009
- function step(op) {
2010
- if (f)
2011
- throw new TypeError("Generator is already executing.");
2012
- while (_)
2013
- try {
2014
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
2015
- return t;
2016
- if (y = 0, t)
2017
- op = [op[0] & 2, t.value];
2018
- switch (op[0]) {
2019
- case 0:
2020
- case 1:
2021
- t = op;
2022
- break;
2023
- case 4:
2024
- _.label++;
2025
- return { value: op[1], done: false };
2026
- case 5:
2027
- _.label++;
2028
- y = op[1];
2029
- op = [0];
2030
- continue;
2031
- case 7:
2032
- op = _.ops.pop();
2033
- _.trys.pop();
2034
- continue;
2035
- default:
2036
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
2037
- _ = 0;
2038
- continue;
2039
- }
2040
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
2041
- _.label = op[1];
2042
- break;
2043
- }
2044
- if (op[0] === 6 && _.label < t[1]) {
2045
- _.label = t[1];
2046
- t = op;
2047
- break;
2048
- }
2049
- if (t && _.label < t[2]) {
2050
- _.label = t[2];
2051
- _.ops.push(op);
2052
- break;
2053
- }
2054
- if (t[2])
2055
- _.ops.pop();
2056
- _.trys.pop();
2057
- continue;
2058
- }
2059
- op = body.call(thisArg, _);
2060
- }
2061
- catch (e) {
2062
- op = [6, e];
2063
- y = 0;
2064
- }
2065
- finally {
2066
- f = t = 0;
2067
- }
2068
- if (op[0] & 5)
2069
- throw op[1];
2070
- return { value: op[0] ? op[1] : void 0, done: true };
2071
- }
2072
- }
2073
- var __createBinding = Object.create ? (function (o, m, k, k2) {
2074
- if (k2 === undefined)
2075
- k2 = k;
2076
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
2077
- }) : (function (o, m, k, k2) {
2078
- if (k2 === undefined)
2079
- k2 = k;
2080
- o[k2] = m[k];
2081
- });
2082
- function __exportStar(m, o) {
2083
- for (var p in m)
2084
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
2085
- __createBinding(o, m, p);
2086
- }
2087
- function __values(o) {
2088
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2089
- if (m)
2090
- return m.call(o);
2091
- if (o && typeof o.length === "number")
2092
- return {
2093
- next: function () {
2094
- if (o && i >= o.length)
2095
- o = void 0;
2096
- return { value: o && o[i++], done: !o };
2097
- }
2098
- };
2099
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2100
- }
2101
- function __read(o, n) {
2102
- var m = typeof Symbol === "function" && o[Symbol.iterator];
2103
- if (!m)
2104
- return o;
2105
- var i = m.call(o), r, ar = [], e;
2106
- try {
2107
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
2108
- ar.push(r.value);
2109
- }
2110
- catch (error) {
2111
- e = { error: error };
2112
- }
2113
- finally {
2114
- try {
2115
- if (r && !r.done && (m = i["return"]))
2116
- m.call(i);
2117
- }
2118
- finally {
2119
- if (e)
2120
- throw e.error;
2121
- }
2122
- }
2123
- return ar;
2124
- }
2125
- /** @deprecated */
2126
- function __spread() {
2127
- for (var ar = [], i = 0; i < arguments.length; i++)
2128
- ar = ar.concat(__read(arguments[i]));
2129
- return ar;
2130
- }
2131
- /** @deprecated */
2132
- function __spreadArrays() {
2133
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
2134
- s += arguments[i].length;
2135
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
2136
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
2137
- r[k] = a[j];
2138
- return r;
2139
- }
2140
- function __spreadArray(to, from) {
2141
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
2142
- to[j] = from[i];
2143
- return to;
2144
- }
2145
- function __await(v) {
2146
- return this instanceof __await ? (this.v = v, this) : new __await(v);
2147
- }
2148
- function __asyncGenerator(thisArg, _arguments, generator) {
2149
- if (!Symbol.asyncIterator)
2150
- throw new TypeError("Symbol.asyncIterator is not defined.");
2151
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
2152
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
2153
- function verb(n) { if (g[n])
2154
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
2155
- function resume(n, v) { try {
2156
- step(g[n](v));
2157
- }
2158
- catch (e) {
2159
- settle(q[0][3], e);
2160
- } }
2161
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2162
- function fulfill(value) { resume("next", value); }
2163
- function reject(value) { resume("throw", value); }
2164
- function settle(f, v) { if (f(v), q.shift(), q.length)
2165
- resume(q[0][0], q[0][1]); }
2166
- }
2167
- function __asyncDelegator(o) {
2168
- var i, p;
2169
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
2170
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
2171
- }
2172
- function __asyncValues(o) {
2173
- if (!Symbol.asyncIterator)
2174
- throw new TypeError("Symbol.asyncIterator is not defined.");
2175
- var m = o[Symbol.asyncIterator], i;
2176
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2177
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2178
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
2179
- }
2180
- function __makeTemplateObject(cooked, raw) {
2181
- if (Object.defineProperty) {
2182
- Object.defineProperty(cooked, "raw", { value: raw });
2183
- }
2184
- else {
2185
- cooked.raw = raw;
2186
- }
2187
- return cooked;
2188
- }
2189
- ;
2190
- var __setModuleDefault = Object.create ? (function (o, v) {
2191
- Object.defineProperty(o, "default", { enumerable: true, value: v });
2192
- }) : function (o, v) {
2193
- o["default"] = v;
2194
- };
2195
- function __importStar(mod) {
2196
- if (mod && mod.__esModule)
2197
- return mod;
2198
- var result = {};
2199
- if (mod != null)
2200
- for (var k in mod)
2201
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
2202
- __createBinding(result, mod, k);
2203
- __setModuleDefault(result, mod);
2204
- return result;
2205
- }
2206
- function __importDefault(mod) {
2207
- return (mod && mod.__esModule) ? mod : { default: mod };
2208
- }
2209
- function __classPrivateFieldGet(receiver, privateMap) {
2210
- if (!privateMap.has(receiver)) {
2211
- throw new TypeError("attempted to get private field on non-instance");
2212
- }
2213
- return privateMap.get(receiver);
2214
- }
2215
- function __classPrivateFieldSet(receiver, privateMap, value) {
2216
- if (!privateMap.has(receiver)) {
2217
- throw new TypeError("attempted to set private field on non-instance");
2218
- }
2219
- privateMap.set(receiver, value);
2220
- return value;
2221
- }
2222
-
2223
- /**
2224
- * Implementazione di default per la classe **BaseSessionRetriever**
2225
- */
2226
- var DefaultSessionRetriever = /** @class */ (function (_super) {
2227
- __extends(DefaultSessionRetriever, _super);
2228
- /**
2229
- * Costruttore
2230
- *
2231
- * @ignore
2232
- */
2233
- function DefaultSessionRetriever() {
2234
- return _super.call(this) || this;
2235
- }
2236
- /**
2237
- * Ottiene un ID sessione
2238
- *
2239
- * @returns {string} ID sessione
2240
- */
2241
- DefaultSessionRetriever.prototype.getSessionKey = function () {
2242
- return "DUMMY_SESSION";
2243
- };
2244
- return DefaultSessionRetriever;
2245
- }(BaseSessionRetriever));
2246
- DefaultSessionRetriever.decorators = [
2247
- { type: core.Injectable }
2248
- ];
2249
- DefaultSessionRetriever.ctorParameters = function () { return []; };
2250
-
2251
- /** Implementazione di default per la classe **BaseStorageProvider** */
2252
- var DefaultStorageProvider = /** @class */ (function (_super) {
2253
- __extends(DefaultStorageProvider, _super);
2254
- /** @ignore Costruttore */
2255
- function DefaultStorageProvider(session) {
2256
- return _super.call(this, session) || this;
2257
- }
2258
- /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2259
- DefaultStorageProvider.prototype.setItem = function (key, value) {
2260
- try {
2261
- localStorage.setItem(key, JSON.stringify(value));
2262
- return rxjs.of(true);
2263
- }
2264
- catch (_a) {
2265
- // Potrebbe arrivarmi un prefisso di salvataggio nella modalità di default. Questo serve per ripulire le stesse cose con quel prefisso e sperare di liberare spazio
2266
- if (value.savedprefix) {
2267
- console.warn("Spazio del local Storage insufficiente, prova a ripulirlo e risalvare");
2268
- //Pulisco tutte le view con nome che parta per "Hot"
2269
- for (var key_1 in localStorage) {
2270
- if (localStorage.hasOwnProperty(key_1) && key_1.startsWith(value.savedprefix))
2271
- delete localStorage[key_1];
2272
- }
2273
- try {
2274
- localStorage.setItem(key, JSON.stringify(value));
2275
- }
2276
- catch (e) {
2277
- console.error("Spazio del local Storage insufficiente per salvare i risultati di ricerca con solo filtri. Non salvo nulla");
2278
- }
2279
- }
2280
- return rxjs.of(false);
2281
- }
2282
- };
2283
- /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2284
- DefaultStorageProvider.prototype.getItem = function (key) {
2285
- try {
2286
- var ret = JSON.parse(localStorage.getItem(key));
2287
- return rxjs.of(ret);
2288
- }
2289
- catch (_a) {
2290
- return rxjs.of(null);
2291
- }
2292
- };
2293
- /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2294
- DefaultStorageProvider.prototype.removeItem = function (key) {
2295
- try {
2296
- localStorage.removeItem(key);
2297
- return rxjs.of(true);
2298
- }
2299
- catch (_a) {
2300
- return rxjs.of(false);
2301
- }
2302
- };
2303
- /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2304
- DefaultStorageProvider.prototype.clear = function () {
2305
- try {
2306
- localStorage.clear();
2307
- return rxjs.of(true);
2308
- }
2309
- catch (_a) {
2310
- return rxjs.of(false);
2311
- }
2312
- };
2313
- /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2314
- DefaultStorageProvider.prototype.getAll = function () {
2315
- var ret = {};
2316
- for (var key in localStorage) {
2317
- ret[key] = localStorage[key];
2318
- }
2319
- return rxjs.of(ret);
2320
- };
2321
- return DefaultStorageProvider;
2322
- }(BaseStorageProvider));
2323
- DefaultStorageProvider.decorators = [
2324
- { type: core.Injectable }
2325
- ];
2326
- DefaultStorageProvider.ctorParameters = function () { return [
2327
- { type: BaseSessionRetriever }
2328
- ]; };
2329
-
2330
- // Angular
2331
- /**
2332
- * Modulo di estensione che registra autonomamente **TUTTI** i servizi di estensione:
2333
- * ClipboardService,
2334
- * DateService,
2335
- * ExportService,
2336
- * HashingService,
2337
- * MessageService,
2338
- * UtilityService,
2339
- * StorageService,
2340
- *
2341
- * con eventuali provider che utilizzano
2342
- */
2343
- var FullExtensionsModule = /** @class */ (function () {
2344
- function FullExtensionsModule() {
2345
- }
2346
- FullExtensionsModule.forRoot = function (config) {
2347
- return {
2348
- ngModule: FullExtensionsModule,
2349
- providers: [
2350
- ClipboardService,
2351
- DateService,
2352
- ExportService,
2353
- HashingService,
2354
- MessageService,
2355
- UtilityService,
2356
- StorageService,
2357
- { provide: EXT_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' },
2358
- { provide: EXT_FANCY_ALERTS, useValue: (config === null || config === void 0 ? void 0 : config.fancy_alerts) || true },
2359
- { provide: APPSEARCH_PREFIX, useValue: (config === null || config === void 0 ? void 0 : config.appsearch_prefix) || 'Hot' },
2360
- { provide: EXT_ALLOW_UTC, useValue: (config === null || config === void 0 ? void 0 : config.allow_utc) == null ? false : config === null || config === void 0 ? void 0 : config.allow_utc },
2361
- { provide: BaseSessionRetriever, useClass: (config === null || config === void 0 ? void 0 : config.sessionRetriever) || DefaultSessionRetriever },
2362
- { provide: BaseStorageProvider, useClass: (config === null || config === void 0 ? void 0 : config.storageProvider) || DefaultStorageProvider },
2363
- ]
2364
- };
2365
- };
2366
- return FullExtensionsModule;
2367
- }());
2368
- FullExtensionsModule.decorators = [
2369
- { type: core.NgModule }
2370
- ];
2371
-
2372
- /**
2373
- * Classe che rappresenta una risposta ricevuta da un Backend
2374
- */
2375
- var CallResult = /** @class */ (function () {
2376
- function CallResult() {
2377
- }
2378
- return CallResult;
2379
- }());
2380
-
2381
- /**
2382
- * Header per il file CSV che sta venendo generato
2383
- */
2384
- var CsvHeaders = /** @class */ (function () {
2385
- function CsvHeaders() {
2386
- }
2387
- return CsvHeaders;
2388
- }());
2389
-
2390
- /**
2391
- * Rappresentazione di un oggetto generico
2392
- */
2393
- var GenericItem = /** @class */ (function () {
2394
- function GenericItem() {
2395
- }
2396
- return GenericItem;
2397
- }());
2398
-
2399
- /*
2400
- * Public API Surface of extensions
2401
- */
2402
-
2403
- /**
2404
- * Generated bundle index. Do not edit.
2405
- */
2406
-
2407
- exports.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
2408
- exports.BaseSessionRetriever = BaseSessionRetriever;
2409
- exports.BaseStorageProvider = BaseStorageProvider;
2410
- exports.CallResult = CallResult;
2411
- exports.ClipboardService = ClipboardService;
2412
- exports.CsvHeaders = CsvHeaders;
2413
- exports.DateService = DateService;
2414
- exports.EXT_ALLOW_UTC = EXT_ALLOW_UTC;
2415
- exports.EXT_FANCY_ALERTS = EXT_FANCY_ALERTS;
2416
- exports.EXT_LOCALE = EXT_LOCALE;
2417
- exports.Export = Export;
2418
- exports.ExportAs = ExportAs;
2419
- exports.ExportDictionary = ExportDictionary;
2420
- exports.ExportList = ExportList;
2421
- exports.ExportService = ExportService;
2422
- exports.ExtensionsModule = ExtensionsModule;
2423
- exports.FullExtensionsModule = FullExtensionsModule;
2424
- exports.GenericItem = GenericItem;
2425
- exports.HashingService = HashingService;
2426
- exports.MessageService = MessageService;
2427
- exports.StorageService = StorageService;
2428
- exports.UtilityService = UtilityService;
2429
- exports["ɵa"] = DefaultSessionRetriever;
2430
- exports["ɵb"] = DefaultStorageProvider;
2431
-
2432
- Object.defineProperty(exports, '__esModule', { value: true });
2433
-
2434
- }));
2435
- //# sourceMappingURL=esfaenza-extensions.umd.js.map