@esfaenza/extensions 15.2.23 → 15.2.25

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.
@@ -312,6 +312,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
312
312
  }]
313
313
  }] });
314
314
 
315
+ // Angular
316
+ /* Classe che contiene tutte le informazioni sull'embedding in un unico contenitore per semplicità */
317
+ class AppEmbeddingExtensions {
318
+ constructor() {
319
+ this.Embedded = false;
320
+ this.EmbeddingLevel = 0;
321
+ this.MainWindow = window;
322
+ while (this.MainWindow.parent != this.MainWindow) {
323
+ this.MainWindow = this.MainWindow.parent;
324
+ this.EmbeddingLevel++;
325
+ this.Embedded = true;
326
+ }
327
+ }
328
+ }
329
+ AppEmbeddingExtensions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
330
+ AppEmbeddingExtensions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, providedIn: "root" });
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, decorators: [{
332
+ type: Injectable,
333
+ args: [{ providedIn: "root" }]
334
+ }], ctorParameters: function () { return []; } });
335
+
336
+ // Angular
337
+ /**
338
+ * Service che fornisce un accesso base in lettura/scrittura sulla clipboard
339
+ */
340
+ class BaseExtensionsService {
341
+ constructor(emb) {
342
+ this.emb = emb;
343
+ this.RedirectMap = {};
344
+ this.RoutesMap = {};
345
+ for (let prop in this.RedirectMap) {
346
+ this.RoutesMap[prop] = { route: null };
347
+ this.RoutesMap[prop].route = (param) => {
348
+ let obj = {};
349
+ obj[this.RedirectMap[prop].params[0]] = param;
350
+ return [(this.emb.Embedded ? "pages_ext/" : "pages/") + this.RedirectMap[prop].url, obj];
351
+ };
352
+ }
353
+ }
354
+ }
355
+ BaseExtensionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, deps: [{ token: AppEmbeddingExtensions }], target: i0.ɵɵFactoryTarget.Injectable });
356
+ BaseExtensionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, providedIn: "root" });
357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, decorators: [{
358
+ type: Injectable,
359
+ args: [{ providedIn: "root" }]
360
+ }], ctorParameters: function () { return [{ type: AppEmbeddingExtensions }]; } });
361
+
315
362
  /**
316
363
  * Suffisso della proprietà da generare in cui salvare il navigatore
317
364
  * utilizzato dal servizio di esportazione per prendere il valore delle proprietà di un oggetto
@@ -374,6 +421,12 @@ var TypeCode;
374
421
  * Service che fornisce metodi di pubblica utilità
375
422
  */
376
423
  class UtilityService {
424
+ constructor() {
425
+ // Funzione di throttling per non spammare richieste in caso di animazioni attivate
426
+ //TODO: spostarla in un metodo di utilit� (esfaenza/extensions)
427
+ /** @ignore */
428
+ this.executionTimers = {};
429
+ }
377
430
  /**
378
431
  * Deseleziona il testo eventualmente selezionato
379
432
  */
@@ -591,6 +644,18 @@ class UtilityService {
591
644
  }
592
645
  return destination;
593
646
  }
647
+ cast(object, clss) {
648
+ let ret = Object.assign(Object.create(clss.prototype), object);
649
+ return ret;
650
+ }
651
+ /** @ignore */
652
+ throttla(id, func, throttleTime) {
653
+ //Se ho la funzione che vuole eseguire ripulisco quel timeout
654
+ if (this.executionTimers[id])
655
+ clearTimeout(this.executionTimers[id]);
656
+ //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
657
+ this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
658
+ }
594
659
  }
595
660
  UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UtilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
596
661
  UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UtilityService, providedIn: "root" });
@@ -1230,9 +1295,10 @@ class MessageService {
1230
1295
  *
1231
1296
  * @ignore
1232
1297
  */
1233
- constructor(injector, locProvider) {
1298
+ constructor(injector, locProvider, emb) {
1234
1299
  this.injector = injector;
1235
1300
  this.locProvider = locProvider;
1301
+ this.emb = emb;
1236
1302
  /**
1237
1303
  * Oggetto statico in supporto alla localizzazione
1238
1304
  */
@@ -1351,6 +1417,10 @@ class MessageService {
1351
1417
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1352
1418
  */
1353
1419
  simpleSuccess(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1420
+ if (this.emb.Embedded) {
1421
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'success', msg: text }, "*");
1422
+ return;
1423
+ }
1354
1424
  let tos = this.toastrOrSwal(secondaryNotificationType);
1355
1425
  if (tos == "swal")
1356
1426
  this.successSwal.fire("", text);
@@ -1367,6 +1437,10 @@ class MessageService {
1367
1437
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1368
1438
  */
1369
1439
  simpleInfo(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1440
+ if (this.emb.Embedded) {
1441
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'info', msg: text }, "*");
1442
+ return;
1443
+ }
1370
1444
  let tos = this.toastrOrSwal(secondaryNotificationType);
1371
1445
  if (tos == "swal")
1372
1446
  this.infoSwal.fire("", text);
@@ -1383,6 +1457,10 @@ class MessageService {
1383
1457
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1384
1458
  */
1385
1459
  simpleError(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1460
+ if (this.emb.Embedded) {
1461
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'error', msg: text }, "*");
1462
+ return;
1463
+ }
1386
1464
  let tos = this.toastrOrSwal(secondaryNotificationType);
1387
1465
  if (tos == "swal")
1388
1466
  this.errorSwal.fire("", text);
@@ -1399,6 +1477,10 @@ class MessageService {
1399
1477
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1400
1478
  */
1401
1479
  simpleWarning(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1480
+ if (this.emb.Embedded) {
1481
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'warning', msg: text }, "*");
1482
+ return;
1483
+ }
1402
1484
  let tos = this.toastrOrSwal(secondaryNotificationType);
1403
1485
  if (tos == "swal")
1404
1486
  this.warningSwal.fire("", text);
@@ -1575,7 +1657,7 @@ class MessageService {
1575
1657
  }
1576
1658
  }
1577
1659
  }
1578
- MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, deps: [{ token: Injector }, { token: i1.BaseLocalization, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1660
+ MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, deps: [{ token: Injector }, { token: i1.BaseLocalization, optional: true }, { token: AppEmbeddingExtensions }], target: i0.ɵɵFactoryTarget.Injectable });
1579
1661
  MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, providedIn: "root" });
1580
1662
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, decorators: [{
1581
1663
  type: Injectable,
@@ -1585,7 +1667,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1585
1667
  args: [Injector]
1586
1668
  }] }, { type: i1.BaseLocalization, decorators: [{
1587
1669
  type: Optional
1588
- }] }]; } });
1670
+ }] }, { type: AppEmbeddingExtensions }]; } });
1589
1671
 
1590
1672
  // Angular
1591
1673
  /**
@@ -2202,5 +2284,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2202
2284
  * Generated bundle index. Do not edit.
2203
2285
  */
2204
2286
 
2205
- export { APPSEARCH_PREFIX, CallResult, ClipboardService, CsvHeaders, DateService, EXT_ALLOW_UTC, EXT_DEBUG_MODE, Export, ExportAs, ExportDictionary, ExportList, ExportLocalization, ExportService, ExtensionsModule, GenericItem, HashingService, InboundMessageTypes, InterComMessage, InterComService, LocDatePipe, MessageService, UtilityService };
2287
+ export { APPSEARCH_PREFIX, AppEmbeddingExtensions, BaseExtensionsService, CallResult, ClipboardService, CsvHeaders, DateService, EXT_ALLOW_UTC, EXT_DEBUG_MODE, Export, ExportAs, ExportDictionary, ExportList, ExportLocalization, ExportService, ExtensionsModule, GenericItem, HashingService, InboundMessageTypes, InterComMessage, InterComService, LocDatePipe, MessageService, UtilityService };
2206
2288
  //# sourceMappingURL=esfaenza-extensions.mjs.map