@esfaenza/extensions 13.1.5 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/models/InboundMessageTypes.mjs +7 -0
- package/esm2020/lib/models/InterComMessage.mjs +14 -0
- package/esm2020/lib/modules/extensions.full.module.mjs +8 -5
- package/esm2020/lib/modules/extensions.module.mjs +4 -4
- package/esm2020/lib/services/extensions.clipboard.service.mjs +3 -3
- package/esm2020/lib/services/extensions.dates.service.mjs +5 -5
- package/esm2020/lib/services/extensions.exports.service.mjs +3 -3
- package/esm2020/lib/services/extensions.hashing.service.mjs +3 -3
- package/esm2020/lib/services/extensions.intercom.service.mjs +53 -0
- package/esm2020/lib/services/extensions.messages.service.mjs +3 -3
- package/esm2020/lib/services/extensions.utilities.service.mjs +3 -3
- package/esm2020/public-api.mjs +5 -1
- package/fesm2015/esfaenza-extensions.mjs +99 -28
- package/fesm2015/esfaenza-extensions.mjs.map +1 -1
- package/fesm2020/esfaenza-extensions.mjs +99 -28
- package/fesm2020/esfaenza-extensions.mjs.map +1 -1
- package/lib/models/InboundMessageTypes.d.ts +5 -0
- package/lib/models/InterComMessage.d.ts +12 -0
- package/lib/modules/extensions.full.module.d.ts +1 -0
- package/lib/services/extensions.intercom.service.d.ts +28 -0
- package/package.json +6 -6
- package/public-api.d.ts +4 -0
|
@@ -3,6 +3,7 @@ import { InjectionToken, NgModule, Injectable, Optional, Inject } from '@angular
|
|
|
3
3
|
import swal from 'sweetalert2';
|
|
4
4
|
import * as i1 from 'ngx-toastr';
|
|
5
5
|
import { Deserialize } from 'cerialize';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Token che identifica il locale da utilizzare per questa libreria, sono supportati i locali 'it-IT' ed 'en-US'
|
|
@@ -38,10 +39,10 @@ class ExtensionsModule {
|
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
ExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
42
|
-
ExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
43
|
-
ExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
42
|
+
ExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
43
|
+
ExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExtensionsModule });
|
|
44
|
+
ExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExtensionsModule });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExtensionsModule, decorators: [{
|
|
45
46
|
type: NgModule
|
|
46
47
|
}] });
|
|
47
48
|
|
|
@@ -346,9 +347,9 @@ class MessageService {
|
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
}
|
|
349
|
-
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
350
|
-
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
350
|
+
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MessageService, deps: [{ token: i1.ToastrService }, { token: EXT_FANCY_ALERTS, optional: true }, { token: EXT_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
351
|
+
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MessageService });
|
|
352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MessageService, decorators: [{
|
|
352
353
|
type: Injectable
|
|
353
354
|
}], ctorParameters: function () { return [{ type: i1.ToastrService }, { type: undefined, decorators: [{
|
|
354
355
|
type: Optional
|
|
@@ -512,9 +513,9 @@ class ClipboardService {
|
|
|
512
513
|
document.body.removeChild(textArea);
|
|
513
514
|
}
|
|
514
515
|
}
|
|
515
|
-
ClipboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
516
|
-
ClipboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
517
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
516
|
+
ClipboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ClipboardService, deps: [{ token: MessageService }, { token: EXT_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
517
|
+
ClipboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ClipboardService });
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ClipboardService, decorators: [{
|
|
518
519
|
type: Injectable
|
|
519
520
|
}], ctorParameters: function () { return [{ type: MessageService }, { type: undefined, decorators: [{
|
|
520
521
|
type: Optional
|
|
@@ -693,7 +694,7 @@ class DateService {
|
|
|
693
694
|
tryThis = toCall(date, this.cfg.smallDate);
|
|
694
695
|
else if (length == this.cfg.fulldateNoSS.length)
|
|
695
696
|
tryThis = toCall(date, this.cfg.fulldateNoSS);
|
|
696
|
-
if (tryThis.isValid())
|
|
697
|
+
if (tryThis && tryThis.isValid())
|
|
697
698
|
return tryThis;
|
|
698
699
|
// Se niente funziona, null.
|
|
699
700
|
// Ricondurre l'Input ad una data non è possibile.
|
|
@@ -735,9 +736,9 @@ class DateService {
|
|
|
735
736
|
return date.format(small ? this.cfg.smallDate : seconds ? this.cfg.fulldateDisplay : this.cfg.fulldateDisplayNoSS);
|
|
736
737
|
}
|
|
737
738
|
}
|
|
738
|
-
DateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
739
|
-
DateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
740
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
739
|
+
DateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: DateService, deps: [{ token: EXT_LOCALE, optional: true }, { token: EXT_ALLOW_UTC, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
740
|
+
DateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: DateService });
|
|
741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: DateService, decorators: [{
|
|
741
742
|
type: Injectable
|
|
742
743
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
743
744
|
type: Optional
|
|
@@ -1233,9 +1234,9 @@ class ExportService {
|
|
|
1233
1234
|
return Deserialize(items, type);
|
|
1234
1235
|
}
|
|
1235
1236
|
}
|
|
1236
|
-
ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
1237
|
-
ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
1238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
1237
|
+
ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExportService, deps: [{ token: DateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1238
|
+
ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExportService });
|
|
1239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ExportService, decorators: [{
|
|
1239
1240
|
type: Injectable
|
|
1240
1241
|
}], ctorParameters: function () { return [{ type: DateService }]; } });
|
|
1241
1242
|
|
|
@@ -1540,9 +1541,9 @@ class HashingService {
|
|
|
1540
1541
|
return (a + b) & 0xFFFFFFFF;
|
|
1541
1542
|
}
|
|
1542
1543
|
}
|
|
1543
|
-
HashingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
1544
|
-
HashingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
1545
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
1544
|
+
HashingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HashingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1545
|
+
HashingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HashingService });
|
|
1546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HashingService, decorators: [{
|
|
1546
1547
|
type: Injectable
|
|
1547
1548
|
}] });
|
|
1548
1549
|
|
|
@@ -1749,9 +1750,70 @@ class UtilityService {
|
|
|
1749
1750
|
}
|
|
1750
1751
|
}
|
|
1751
1752
|
}
|
|
1752
|
-
UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
1753
|
-
UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
1754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
1753
|
+
UtilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UtilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1754
|
+
UtilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UtilityService });
|
|
1755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UtilityService, decorators: [{
|
|
1756
|
+
type: Injectable
|
|
1757
|
+
}] });
|
|
1758
|
+
|
|
1759
|
+
/** Classe che rappresenta un generico messaggio scambiato fra applicazione e moduli */
|
|
1760
|
+
class InterComMessage {
|
|
1761
|
+
/**
|
|
1762
|
+
* Costruttore
|
|
1763
|
+
*
|
|
1764
|
+
* @param type Tipo di messaggio
|
|
1765
|
+
* @param message Contenuto del messaggio
|
|
1766
|
+
*/
|
|
1767
|
+
constructor(type, message) {
|
|
1768
|
+
this.type = type;
|
|
1769
|
+
this.message = message;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
// Angular
|
|
1774
|
+
/** Service che si occupa di gestire la comunicazione fra i moduli interni ed esterni dell'applicativo */
|
|
1775
|
+
class InterComService {
|
|
1776
|
+
constructor() {
|
|
1777
|
+
/** Messaggi in uscita, uno per ogni recipient registratosi dall'entrypoint **register** */
|
|
1778
|
+
this.outbounds = {};
|
|
1779
|
+
/** Messaggi in entrata, unico per applicazione principale */
|
|
1780
|
+
this.inbounds = new Subject();
|
|
1781
|
+
}
|
|
1782
|
+
/**
|
|
1783
|
+
* Metodo che permette di inviare un messaggio dall'applicazione ad un modulo esterno o viceversa
|
|
1784
|
+
*
|
|
1785
|
+
* @param {any} messageType Tipologia di messaggio. Sarà di tipo **InboundMessageTypes** per tutti i messaggi inbound, dinamico per tutti i mesaggi outbound (il tipo dipenderà dagli enum dei messaggi dei moduli esterni)
|
|
1786
|
+
* @param {any} message Messaggio da inviare che può essere un dto in casi complessi ma dovrà essere gestito a dovere lato implementativo
|
|
1787
|
+
* @param {string} recipient Destinatario del messaggio. Per i messaggi inbound dev'essere lasciato vuoto, per i messaggi outbound sarà valorizzato alla chiave del modulo a cui si vuole inviare il messaggio
|
|
1788
|
+
*/
|
|
1789
|
+
send(messageType, message, recipient) {
|
|
1790
|
+
let msg = new InterComMessage(messageType, message);
|
|
1791
|
+
// Se non c'è un recipient significa che è un modulo esterno che invia messaggi al modulo main (quindi messaggio in entrata - inbound)
|
|
1792
|
+
// Altrimenti significa che è il modulo main ad inviare messaggi ai moduli esterni (messaggio in uscita - outbound)
|
|
1793
|
+
if (!recipient) {
|
|
1794
|
+
this.inbounds.next(msg);
|
|
1795
|
+
}
|
|
1796
|
+
else {
|
|
1797
|
+
if (!this.outbounds[recipient])
|
|
1798
|
+
console.warn("@esfaenza/extensions - InterComService: Impossibile inviare il messaggio al recipient " + recipient + " assicurarsi che il modulo sia caricato e che effettui la chiamata al metodo 'regisster'");
|
|
1799
|
+
else
|
|
1800
|
+
this.outbounds[recipient].next(msg);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Permette di registrare un modulo esterno alla lista dei moduli in listening sulla coda di messaggi
|
|
1805
|
+
*
|
|
1806
|
+
* @param {string} key Chiave del modulo da registrare. Tutti i messaggi inbound saranno inviati dall'applicazione principale su questa chiave
|
|
1807
|
+
*/
|
|
1808
|
+
register(key) {
|
|
1809
|
+
if (this.outbounds[key])
|
|
1810
|
+
throw "@esfaenza/extensions - InterComService: Impossibile registrare più volte lo stesso modulo";
|
|
1811
|
+
this.outbounds[key] = new Subject();
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
InterComService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: InterComService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1815
|
+
InterComService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: InterComService });
|
|
1816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: InterComService, decorators: [{
|
|
1755
1817
|
type: Injectable
|
|
1756
1818
|
}] });
|
|
1757
1819
|
|
|
@@ -1764,6 +1826,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
1764
1826
|
* HashingService,
|
|
1765
1827
|
* MessageService,
|
|
1766
1828
|
* UtilityService
|
|
1829
|
+
* InterComService
|
|
1767
1830
|
*
|
|
1768
1831
|
* con eventuali provider che utilizzano
|
|
1769
1832
|
*/
|
|
@@ -1778,6 +1841,7 @@ class FullExtensionsModule {
|
|
|
1778
1841
|
HashingService,
|
|
1779
1842
|
MessageService,
|
|
1780
1843
|
UtilityService,
|
|
1844
|
+
InterComService,
|
|
1781
1845
|
{ provide: EXT_LOCALE, useValue: config?.locale || 'it-IT' },
|
|
1782
1846
|
{ provide: EXT_FANCY_ALERTS, useValue: config?.fancy_alerts || true },
|
|
1783
1847
|
{ provide: APPSEARCH_PREFIX, useValue: config?.appsearch_prefix || 'Hot' },
|
|
@@ -1786,10 +1850,10 @@ class FullExtensionsModule {
|
|
|
1786
1850
|
};
|
|
1787
1851
|
}
|
|
1788
1852
|
}
|
|
1789
|
-
FullExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
1790
|
-
FullExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
1791
|
-
FullExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
1792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
1853
|
+
FullExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: FullExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1854
|
+
FullExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: FullExtensionsModule });
|
|
1855
|
+
FullExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: FullExtensionsModule });
|
|
1856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: FullExtensionsModule, decorators: [{
|
|
1793
1857
|
type: NgModule
|
|
1794
1858
|
}] });
|
|
1795
1859
|
|
|
@@ -1811,6 +1875,13 @@ class CsvHeaders {
|
|
|
1811
1875
|
class GenericItem {
|
|
1812
1876
|
}
|
|
1813
1877
|
|
|
1878
|
+
/** Enumeratore dei tipi di messaggio che i moduli esterni possono contattare sull'applicazione principale */
|
|
1879
|
+
var InboundMessageTypes;
|
|
1880
|
+
(function (InboundMessageTypes) {
|
|
1881
|
+
/** Evento di navigazione */
|
|
1882
|
+
InboundMessageTypes[InboundMessageTypes["Navigation"] = 0] = "Navigation";
|
|
1883
|
+
})(InboundMessageTypes || (InboundMessageTypes = {}));
|
|
1884
|
+
|
|
1814
1885
|
/*
|
|
1815
1886
|
* Public API Surface of extensions
|
|
1816
1887
|
*/
|
|
@@ -1819,5 +1890,5 @@ class GenericItem {
|
|
|
1819
1890
|
* Generated bundle index. Do not edit.
|
|
1820
1891
|
*/
|
|
1821
1892
|
|
|
1822
|
-
export { APPSEARCH_PREFIX, CallResult, ClipboardService, CsvHeaders, DateService, EXT_ALLOW_UTC, EXT_FANCY_ALERTS, EXT_LOCALE, Export, ExportAs, ExportDictionary, ExportList, ExportService, ExtensionsModule, FullExtensionsModule, GenericItem, HashingService, MessageService, UtilityService };
|
|
1893
|
+
export { APPSEARCH_PREFIX, CallResult, ClipboardService, CsvHeaders, DateService, EXT_ALLOW_UTC, EXT_FANCY_ALERTS, EXT_LOCALE, Export, ExportAs, ExportDictionary, ExportList, ExportService, ExtensionsModule, FullExtensionsModule, GenericItem, HashingService, InboundMessageTypes, InterComMessage, InterComService, MessageService, UtilityService };
|
|
1823
1894
|
//# sourceMappingURL=esfaenza-extensions.mjs.map
|