@esfaenza/extensions 15.2.23 → 15.2.24

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.
@@ -1220,6 +1220,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1220
1220
  args: [{ providedIn: "root" }]
1221
1221
  }], ctorParameters: function () { return [{ type: DateService }, { type: UtilityService }, { type: i1.LocalizationService }]; } });
1222
1222
 
1223
+ // Angular
1224
+ /* Classe che contiene tutte le informazioni sull'embedding in un unico contenitore per semplicità */
1225
+ class AppEmbeddingExtensions {
1226
+ constructor() {
1227
+ this.Embedded = false;
1228
+ this.EmbeddingLevel = 0;
1229
+ this.MainWindow = window;
1230
+ while (this.MainWindow.parent != this.MainWindow) {
1231
+ this.MainWindow = this.MainWindow.parent;
1232
+ this.EmbeddingLevel++;
1233
+ this.Embedded = true;
1234
+ }
1235
+ }
1236
+ }
1237
+ AppEmbeddingExtensions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1238
+ AppEmbeddingExtensions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, providedIn: "root" });
1239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, decorators: [{
1240
+ type: Injectable,
1241
+ args: [{ providedIn: "root" }]
1242
+ }], ctorParameters: function () { return []; } });
1243
+
1223
1244
  // Angular
1224
1245
  /**
1225
1246
  * Service che fornisce funzionalità di alert nei tipi fondamentali: success, info, warning e danger
@@ -1230,9 +1251,10 @@ class MessageService {
1230
1251
  *
1231
1252
  * @ignore
1232
1253
  */
1233
- constructor(injector, locProvider) {
1254
+ constructor(injector, locProvider, emb) {
1234
1255
  this.injector = injector;
1235
1256
  this.locProvider = locProvider;
1257
+ this.emb = emb;
1236
1258
  /**
1237
1259
  * Oggetto statico in supporto alla localizzazione
1238
1260
  */
@@ -1351,6 +1373,10 @@ class MessageService {
1351
1373
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1352
1374
  */
1353
1375
  simpleSuccess(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1376
+ if (this.emb.Embedded) {
1377
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'success', msg: text }, "*");
1378
+ return;
1379
+ }
1354
1380
  let tos = this.toastrOrSwal(secondaryNotificationType);
1355
1381
  if (tos == "swal")
1356
1382
  this.successSwal.fire("", text);
@@ -1367,6 +1393,10 @@ class MessageService {
1367
1393
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1368
1394
  */
1369
1395
  simpleInfo(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1396
+ if (this.emb.Embedded) {
1397
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'info', msg: text }, "*");
1398
+ return;
1399
+ }
1370
1400
  let tos = this.toastrOrSwal(secondaryNotificationType);
1371
1401
  if (tos == "swal")
1372
1402
  this.infoSwal.fire("", text);
@@ -1383,6 +1413,10 @@ class MessageService {
1383
1413
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1384
1414
  */
1385
1415
  simpleError(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1416
+ if (this.emb.Embedded) {
1417
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'error', msg: text }, "*");
1418
+ return;
1419
+ }
1386
1420
  let tos = this.toastrOrSwal(secondaryNotificationType);
1387
1421
  if (tos == "swal")
1388
1422
  this.errorSwal.fire("", text);
@@ -1399,6 +1433,10 @@ class MessageService {
1399
1433
  * @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
1400
1434
  */
1401
1435
  simpleWarning(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
1436
+ if (this.emb.Embedded) {
1437
+ this.emb.MainWindow.postMessage({ type: "alert", level: 'warning', msg: text }, "*");
1438
+ return;
1439
+ }
1402
1440
  let tos = this.toastrOrSwal(secondaryNotificationType);
1403
1441
  if (tos == "swal")
1404
1442
  this.warningSwal.fire("", text);
@@ -1575,7 +1613,7 @@ class MessageService {
1575
1613
  }
1576
1614
  }
1577
1615
  }
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 });
1616
+ 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
1617
  MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, providedIn: "root" });
1580
1618
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, decorators: [{
1581
1619
  type: Injectable,
@@ -1585,7 +1623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1585
1623
  args: [Injector]
1586
1624
  }] }, { type: i1.BaseLocalization, decorators: [{
1587
1625
  type: Optional
1588
- }] }]; } });
1626
+ }] }, { type: AppEmbeddingExtensions }]; } });
1589
1627
 
1590
1628
  // Angular
1591
1629
  /**
@@ -2202,5 +2240,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2202
2240
  * Generated bundle index. Do not edit.
2203
2241
  */
2204
2242
 
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 };
2243
+ export { APPSEARCH_PREFIX, AppEmbeddingExtensions, 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
2244
  //# sourceMappingURL=esfaenza-extensions.mjs.map