@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.
- package/esm2020/lib/services/extensions.base.mjs +29 -0
- package/esm2020/lib/services/extensions.embedding.service.mjs +23 -0
- package/esm2020/lib/services/extensions.messages.service.mjs +22 -4
- package/esm2020/lib/services/extensions.utilities.service.mjs +19 -1
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/esfaenza-extensions.mjs +86 -4
- package/fesm2015/esfaenza-extensions.mjs.map +1 -1
- package/fesm2020/esfaenza-extensions.mjs +86 -4
- package/fesm2020/esfaenza-extensions.mjs.map +1 -1
- package/lib/services/extensions.base.d.ts +22 -0
- package/lib/services/extensions.embedding.service.d.ts +9 -0
- package/lib/services/extensions.messages.service.d.ts +4 -2
- package/lib/services/extensions.utilities.service.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -316,6 +316,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
316
316
|
}]
|
|
317
317
|
}] });
|
|
318
318
|
|
|
319
|
+
// Angular
|
|
320
|
+
/* Classe che contiene tutte le informazioni sull'embedding in un unico contenitore per semplicità */
|
|
321
|
+
class AppEmbeddingExtensions {
|
|
322
|
+
constructor() {
|
|
323
|
+
this.Embedded = false;
|
|
324
|
+
this.EmbeddingLevel = 0;
|
|
325
|
+
this.MainWindow = window;
|
|
326
|
+
while (this.MainWindow.parent != this.MainWindow) {
|
|
327
|
+
this.MainWindow = this.MainWindow.parent;
|
|
328
|
+
this.EmbeddingLevel++;
|
|
329
|
+
this.Embedded = true;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
AppEmbeddingExtensions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
+
AppEmbeddingExtensions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, providedIn: "root" });
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AppEmbeddingExtensions, decorators: [{
|
|
336
|
+
type: Injectable,
|
|
337
|
+
args: [{ providedIn: "root" }]
|
|
338
|
+
}], ctorParameters: function () { return []; } });
|
|
339
|
+
|
|
340
|
+
// Angular
|
|
341
|
+
/**
|
|
342
|
+
* Service che fornisce un accesso base in lettura/scrittura sulla clipboard
|
|
343
|
+
*/
|
|
344
|
+
class BaseExtensionsService {
|
|
345
|
+
constructor(emb) {
|
|
346
|
+
this.emb = emb;
|
|
347
|
+
this.RedirectMap = {};
|
|
348
|
+
this.RoutesMap = {};
|
|
349
|
+
for (let prop in this.RedirectMap) {
|
|
350
|
+
this.RoutesMap[prop] = { route: null };
|
|
351
|
+
this.RoutesMap[prop].route = (param) => {
|
|
352
|
+
let obj = {};
|
|
353
|
+
obj[this.RedirectMap[prop].params[0]] = param;
|
|
354
|
+
return [(this.emb.Embedded ? "pages_ext/" : "pages/") + this.RedirectMap[prop].url, obj];
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
BaseExtensionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, deps: [{ token: AppEmbeddingExtensions }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
360
|
+
BaseExtensionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, providedIn: "root" });
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseExtensionsService, decorators: [{
|
|
362
|
+
type: Injectable,
|
|
363
|
+
args: [{ providedIn: "root" }]
|
|
364
|
+
}], ctorParameters: function () { return [{ type: AppEmbeddingExtensions }]; } });
|
|
365
|
+
|
|
319
366
|
/**
|
|
320
367
|
* Suffisso della proprietà da generare in cui salvare il navigatore
|
|
321
368
|
* utilizzato dal servizio di esportazione per prendere il valore delle proprietà di un oggetto
|
|
@@ -378,6 +425,12 @@ var TypeCode;
|
|
|
378
425
|
* Service che fornisce metodi di pubblica utilità
|
|
379
426
|
*/
|
|
380
427
|
class UtilityService {
|
|
428
|
+
constructor() {
|
|
429
|
+
// Funzione di throttling per non spammare richieste in caso di animazioni attivate
|
|
430
|
+
//TODO: spostarla in un metodo di utilit� (esfaenza/extensions)
|
|
431
|
+
/** @ignore */
|
|
432
|
+
this.executionTimers = {};
|
|
433
|
+
}
|
|
381
434
|
/**
|
|
382
435
|
* Deseleziona il testo eventualmente selezionato
|
|
383
436
|
*/
|
|
@@ -595,6 +648,18 @@ class UtilityService {
|
|
|
595
648
|
}
|
|
596
649
|
return destination;
|
|
597
650
|
}
|
|
651
|
+
cast(object, clss) {
|
|
652
|
+
let ret = Object.assign(Object.create(clss.prototype), object);
|
|
653
|
+
return ret;
|
|
654
|
+
}
|
|
655
|
+
/** @ignore */
|
|
656
|
+
throttla(id, func, throttleTime) {
|
|
657
|
+
//Se ho la funzione che vuole eseguire ripulisco quel timeout
|
|
658
|
+
if (this.executionTimers[id])
|
|
659
|
+
clearTimeout(this.executionTimers[id]);
|
|
660
|
+
//Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
|
|
661
|
+
this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
|
|
662
|
+
}
|
|
598
663
|
}
|
|
599
664
|
UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UtilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
600
665
|
UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UtilityService, providedIn: "root" });
|
|
@@ -1234,9 +1299,10 @@ class MessageService {
|
|
|
1234
1299
|
*
|
|
1235
1300
|
* @ignore
|
|
1236
1301
|
*/
|
|
1237
|
-
constructor(injector, locProvider) {
|
|
1302
|
+
constructor(injector, locProvider, emb) {
|
|
1238
1303
|
this.injector = injector;
|
|
1239
1304
|
this.locProvider = locProvider;
|
|
1305
|
+
this.emb = emb;
|
|
1240
1306
|
/**
|
|
1241
1307
|
* Oggetto statico in supporto alla localizzazione
|
|
1242
1308
|
*/
|
|
@@ -1357,6 +1423,10 @@ class MessageService {
|
|
|
1357
1423
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
1358
1424
|
*/
|
|
1359
1425
|
simpleSuccess(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
1426
|
+
if (this.emb.Embedded) {
|
|
1427
|
+
this.emb.MainWindow.postMessage({ type: "alert", level: 'success', msg: text }, "*");
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1360
1430
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
1361
1431
|
if (tos == "swal")
|
|
1362
1432
|
this.successSwal.fire("", text);
|
|
@@ -1373,6 +1443,10 @@ class MessageService {
|
|
|
1373
1443
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
1374
1444
|
*/
|
|
1375
1445
|
simpleInfo(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
1446
|
+
if (this.emb.Embedded) {
|
|
1447
|
+
this.emb.MainWindow.postMessage({ type: "alert", level: 'info', msg: text }, "*");
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1376
1450
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
1377
1451
|
if (tos == "swal")
|
|
1378
1452
|
this.infoSwal.fire("", text);
|
|
@@ -1389,6 +1463,10 @@ class MessageService {
|
|
|
1389
1463
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
1390
1464
|
*/
|
|
1391
1465
|
simpleError(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
1466
|
+
if (this.emb.Embedded) {
|
|
1467
|
+
this.emb.MainWindow.postMessage({ type: "alert", level: 'error', msg: text }, "*");
|
|
1468
|
+
return;
|
|
1469
|
+
}
|
|
1392
1470
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
1393
1471
|
if (tos == "swal")
|
|
1394
1472
|
this.errorSwal.fire("", text);
|
|
@@ -1405,6 +1483,10 @@ class MessageService {
|
|
|
1405
1483
|
* @param {"toastr" | "swal" | null} secondaryNotificationType Qualora sia una notifica secondaria, ne indica il tipo
|
|
1406
1484
|
*/
|
|
1407
1485
|
simpleWarning(text, secondaryNotificationType = null, secondaryNotificationTimeout = null) {
|
|
1486
|
+
if (this.emb.Embedded) {
|
|
1487
|
+
this.emb.MainWindow.postMessage({ type: "alert", level: 'warning', msg: text }, "*");
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1408
1490
|
let tos = this.toastrOrSwal(secondaryNotificationType);
|
|
1409
1491
|
if (tos == "swal")
|
|
1410
1492
|
this.warningSwal.fire("", text);
|
|
@@ -1581,7 +1663,7 @@ class MessageService {
|
|
|
1581
1663
|
}
|
|
1582
1664
|
}
|
|
1583
1665
|
}
|
|
1584
|
-
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 });
|
|
1666
|
+
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 });
|
|
1585
1667
|
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, providedIn: "root" });
|
|
1586
1668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MessageService, decorators: [{
|
|
1587
1669
|
type: Injectable,
|
|
@@ -1592,7 +1674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1592
1674
|
args: [Injector]
|
|
1593
1675
|
}] }, { type: i1.BaseLocalization, decorators: [{
|
|
1594
1676
|
type: Optional
|
|
1595
|
-
}] }];
|
|
1677
|
+
}] }, { type: AppEmbeddingExtensions }];
|
|
1596
1678
|
} });
|
|
1597
1679
|
|
|
1598
1680
|
/**
|
|
@@ -2215,5 +2297,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2215
2297
|
* Generated bundle index. Do not edit.
|
|
2216
2298
|
*/
|
|
2217
2299
|
|
|
2218
|
-
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 };
|
|
2300
|
+
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 };
|
|
2219
2301
|
//# sourceMappingURL=esfaenza-extensions.mjs.map
|