@esfaenza/extensions 11.2.21 → 11.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.
- package/bundles/esfaenza-extensions.umd.js +61 -546
- package/bundles/esfaenza-extensions.umd.js.map +1 -1
- package/bundles/esfaenza-extensions.umd.min.js +1 -16
- package/bundles/esfaenza-extensions.umd.min.js.map +1 -1
- package/esfaenza-extensions.d.ts +0 -2
- package/esfaenza-extensions.metadata.json +1 -1
- package/esm2015/esfaenza-extensions.js +1 -3
- package/esm2015/lib/models/ExtensionsModuleConfig.js +1 -1
- package/esm2015/lib/models/InboundMessageTypes.js +7 -0
- package/esm2015/lib/models/InterComMessage.js +14 -0
- package/esm2015/lib/modules/extensions.full.module.js +6 -13
- package/esm2015/lib/services/extensions.dates.service.js +2 -2
- package/esm2015/lib/services/extensions.intercom.service.js +50 -0
- package/esm2015/public-api.js +5 -4
- package/fesm2015/esfaenza-extensions.js +54 -217
- package/fesm2015/esfaenza-extensions.js.map +1 -1
- package/lib/models/ExtensionsModuleConfig.d.ts +0 -11
- package/lib/models/InboundMessageTypes.d.ts +5 -0
- package/lib/models/InterComMessage.d.ts +12 -0
- package/lib/modules/extensions.full.module.d.ts +2 -2
- package/lib/services/extensions.intercom.service.d.ts +25 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -3
- package/esm2015/lib/models/providers/base/BaseStorageProvider.js +0 -25
- package/esm2015/lib/models/providers/implementation/DefaultStorageProvider.js +0 -79
- package/esm2015/lib/models/session/base/BaseSessionRetriever.js +0 -6
- package/esm2015/lib/models/session/implementation/DefaultSessionRetriever.js +0 -26
- package/esm2015/lib/services/extensions.storage.service.js +0 -102
- package/lib/models/providers/base/BaseStorageProvider.d.ts +0 -65
- package/lib/models/providers/implementation/DefaultStorageProvider.d.ts +0 -20
- package/lib/models/session/base/BaseSessionRetriever.d.ts +0 -11
- package/lib/models/session/implementation/DefaultSessionRetriever.d.ts +0 -18
- package/lib/services/extensions.storage.service.d.ts +0 -58
|
@@ -1,8 +1,8 @@
|
|
|
1
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
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize', 'rxjs
|
|
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
|
|
5
|
-
}(this, (function (exports, core, ngxToastr, swal, cerialize,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ngx-toastr'), require('sweetalert2'), require('cerialize'), require('rxjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize', '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));
|
|
5
|
+
}(this, (function (exports, core, ngxToastr, swal, cerialize, rxjs) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -710,7 +710,7 @@
|
|
|
710
710
|
tryThis = toCall(date, this.cfg.smallDate);
|
|
711
711
|
else if (length == this.cfg.fulldateNoSS.length)
|
|
712
712
|
tryThis = toCall(date, this.cfg.fulldateNoSS);
|
|
713
|
-
if (tryThis.isValid())
|
|
713
|
+
if (tryThis && tryThis.isValid())
|
|
714
714
|
return tryThis;
|
|
715
715
|
// Se niente funziona, null.
|
|
716
716
|
// Ricondurre l'Input ad una data non è possibile.
|
|
@@ -1788,553 +1788,66 @@
|
|
|
1788
1788
|
{ type: core.Injectable }
|
|
1789
1789
|
];
|
|
1790
1790
|
|
|
1791
|
-
/**
|
|
1792
|
-
|
|
1793
|
-
* Questo store locale potrebbe essere il localStorage (implementazione di default data dal **DefaultStorageProvider**),
|
|
1794
|
-
* oppure un'implementazione custom facente capo a un DB esterno.
|
|
1795
|
-
*
|
|
1796
|
-
* In questo ultimo caso però sarà necessario implementarsi un proprio **BaseSessionRetriever**
|
|
1797
|
-
* che generi una chiave univoca di sessione su cui tutte le operazioni di questa classe saranno eseguite
|
|
1798
|
-
*/
|
|
1799
|
-
var BaseStorageProvider = /** @class */ (function () {
|
|
1800
|
-
/** @ignore Costruttore */
|
|
1801
|
-
function BaseStorageProvider(session) {
|
|
1802
|
-
this.session = session;
|
|
1803
|
-
}
|
|
1791
|
+
/** Classe che rappresenta un generico messaggio scambiato fra applicazione e moduli */
|
|
1792
|
+
var InterComMessage = /** @class */ (function () {
|
|
1804
1793
|
/**
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
};
|
|
1814
|
-
return BaseStorageProvider;
|
|
1815
|
-
}());
|
|
1816
|
-
|
|
1817
|
-
/**
|
|
1818
|
-
* Classe astratta che si occupa di recuperare l'Id sessione univoco per applicazione ed utente collegato
|
|
1819
|
-
*/
|
|
1820
|
-
var BaseSessionRetriever = /** @class */ (function () {
|
|
1821
|
-
function BaseSessionRetriever() {
|
|
1794
|
+
* Costruttore
|
|
1795
|
+
*
|
|
1796
|
+
* @param type Tipo di messaggio
|
|
1797
|
+
* @param message Contenuto del messaggio
|
|
1798
|
+
*/
|
|
1799
|
+
function InterComMessage(type, message) {
|
|
1800
|
+
this.type = type;
|
|
1801
|
+
this.message = message;
|
|
1822
1802
|
}
|
|
1823
|
-
return
|
|
1803
|
+
return InterComMessage;
|
|
1824
1804
|
}());
|
|
1825
1805
|
|
|
1826
1806
|
// Angular
|
|
1827
|
-
/**
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
*/
|
|
1835
|
-
var StorageService = /** @class */ (function () {
|
|
1836
|
-
/**
|
|
1837
|
-
* Costruttore
|
|
1838
|
-
*
|
|
1839
|
-
* @ignore
|
|
1840
|
-
*/
|
|
1841
|
-
function StorageService(APPSEARCH_PREFIX, _session, _storage) {
|
|
1842
|
-
this.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
|
|
1843
|
-
this._session = _session;
|
|
1844
|
-
this._storage = _storage;
|
|
1807
|
+
/** Service che si occupa di gestire la comunicazione fra i moduli interni ed esterni dell'applicativo */
|
|
1808
|
+
var InterComService = /** @class */ (function () {
|
|
1809
|
+
function InterComService() {
|
|
1810
|
+
/** Messaggi in uscita, uno per ogni recipient registratosi dall'entrypoint **register** */
|
|
1811
|
+
this.outbounds = {};
|
|
1812
|
+
/** Messaggi in entrata, unico per applicazione principale */
|
|
1813
|
+
this.inbounds = new rxjs.Subject();
|
|
1845
1814
|
}
|
|
1846
1815
|
/**
|
|
1847
|
-
*
|
|
1848
|
-
* 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
|
|
1816
|
+
* Metodo che permette di inviare un messaggio dall'applicazione ad un modulo esterno o viceversa
|
|
1849
1817
|
*
|
|
1850
|
-
* @param {
|
|
1851
|
-
* @param {
|
|
1818
|
+
* @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)
|
|
1819
|
+
* @param {any} message Messaggio da inviare che può essere un dto in casi complessi ma dovrà essere gestito a dovere lato implementativo
|
|
1820
|
+
* @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
|
|
1852
1821
|
*/
|
|
1853
|
-
|
|
1854
|
-
var
|
|
1855
|
-
//Se
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
finalItem.savedstate = true;
|
|
1860
|
-
finalItem.savedprefix = this.APPSEARCH_PREFIX || 'Hot';
|
|
1822
|
+
InterComService.prototype.send = function (messageType, message, recipient) {
|
|
1823
|
+
var msg = new InterComMessage(messageType, message);
|
|
1824
|
+
// Se non c'è un recipient significa che è un modulo esterno che invia messaggi al modulo main (quindi messaggio in entrata - inbound)
|
|
1825
|
+
// Altrimenti significa che è il modulo main ad inviare messaggi ai moduli esterni (messaggio in uscita - outbound)
|
|
1826
|
+
if (!recipient) {
|
|
1827
|
+
this.inbounds.next(msg);
|
|
1861
1828
|
}
|
|
1862
|
-
else
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
}));
|
|
1868
|
-
};
|
|
1869
|
-
/**
|
|
1870
|
-
* Recupera un oggetto dallo Storage Locale
|
|
1871
|
-
*
|
|
1872
|
-
* @param {string} storeName Chiave del localStorage da cui recuperare l'oggetto
|
|
1873
|
-
*
|
|
1874
|
-
* @returns {any} Oggetto recuperato e deserializzato
|
|
1875
|
-
*/
|
|
1876
|
-
StorageService.prototype.getItem = function (storeName) {
|
|
1877
|
-
return this._storage.getItem(storeName).pipe(operators.first(), operators.tap(function (res) {
|
|
1878
|
-
if (res == null)
|
|
1879
|
-
console.warn("Impossibile ottenere l'oggetto salvato con chiave " + storeName);
|
|
1880
|
-
}));
|
|
1881
|
-
};
|
|
1882
|
-
/**
|
|
1883
|
-
* Ripulisce lo Storage Locale
|
|
1884
|
-
*
|
|
1885
|
-
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1886
|
-
*/
|
|
1887
|
-
StorageService.prototype.removeItem = function (storeName) {
|
|
1888
|
-
return this._storage.removeItem(storeName).pipe(operators.first(), operators.tap(function (res) {
|
|
1889
|
-
if (res == false)
|
|
1890
|
-
console.warn("Impossibile rimuovere l'oggetto salvato con chiave " + storeName);
|
|
1891
|
-
}));
|
|
1892
|
-
};
|
|
1893
|
-
/**
|
|
1894
|
-
* Ripulisce lo Storage Locale di ogni cosa salvata
|
|
1895
|
-
*
|
|
1896
|
-
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1897
|
-
*/
|
|
1898
|
-
StorageService.prototype.clear = function () {
|
|
1899
|
-
return this._storage.clear().pipe(operators.first(), operators.tap(function (res) {
|
|
1900
|
-
if (res == false)
|
|
1901
|
-
console.warn("Impossibile ripulire lo Storage Locale");
|
|
1902
|
-
}));
|
|
1903
|
-
};
|
|
1904
|
-
/**
|
|
1905
|
-
* Restituisce tutte le chiavi-valore associate alla sessione corrente
|
|
1906
|
-
*
|
|
1907
|
-
* @returns {Observable<{ [index: string]: string; }>} Risultato della query
|
|
1908
|
-
*/
|
|
1909
|
-
StorageService.prototype.getAll = function () {
|
|
1910
|
-
return this._storage.getAll().pipe(operators.first());
|
|
1911
|
-
};
|
|
1912
|
-
return StorageService;
|
|
1913
|
-
}());
|
|
1914
|
-
StorageService.decorators = [
|
|
1915
|
-
{ type: core.Injectable }
|
|
1916
|
-
];
|
|
1917
|
-
StorageService.ctorParameters = function () { return [
|
|
1918
|
-
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [APPSEARCH_PREFIX,] }] },
|
|
1919
|
-
{ type: BaseSessionRetriever },
|
|
1920
|
-
{ type: BaseStorageProvider }
|
|
1921
|
-
]; };
|
|
1922
|
-
|
|
1923
|
-
/*! *****************************************************************************
|
|
1924
|
-
Copyright (c) Microsoft Corporation.
|
|
1925
|
-
|
|
1926
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1927
|
-
purpose with or without fee is hereby granted.
|
|
1928
|
-
|
|
1929
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1930
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1931
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1932
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1933
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1934
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1935
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1936
|
-
***************************************************************************** */
|
|
1937
|
-
/* global Reflect, Promise */
|
|
1938
|
-
var extendStatics = function (d, b) {
|
|
1939
|
-
extendStatics = Object.setPrototypeOf ||
|
|
1940
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1941
|
-
function (d, b) { for (var p in b)
|
|
1942
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
1943
|
-
d[p] = b[p]; };
|
|
1944
|
-
return extendStatics(d, b);
|
|
1945
|
-
};
|
|
1946
|
-
function __extends(d, b) {
|
|
1947
|
-
if (typeof b !== "function" && b !== null)
|
|
1948
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1949
|
-
extendStatics(d, b);
|
|
1950
|
-
function __() { this.constructor = d; }
|
|
1951
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1952
|
-
}
|
|
1953
|
-
var __assign = function () {
|
|
1954
|
-
__assign = Object.assign || function __assign(t) {
|
|
1955
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1956
|
-
s = arguments[i];
|
|
1957
|
-
for (var p in s)
|
|
1958
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1959
|
-
t[p] = s[p];
|
|
1829
|
+
else {
|
|
1830
|
+
if (!this.outbounds[recipient])
|
|
1831
|
+
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'");
|
|
1832
|
+
else
|
|
1833
|
+
this.outbounds[recipient].next(msg);
|
|
1960
1834
|
}
|
|
1961
|
-
return t;
|
|
1962
1835
|
};
|
|
1963
|
-
return __assign.apply(this, arguments);
|
|
1964
|
-
};
|
|
1965
|
-
function __rest(s, e) {
|
|
1966
|
-
var t = {};
|
|
1967
|
-
for (var p in s)
|
|
1968
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1969
|
-
t[p] = s[p];
|
|
1970
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1971
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1972
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1973
|
-
t[p[i]] = s[p[i]];
|
|
1974
|
-
}
|
|
1975
|
-
return t;
|
|
1976
|
-
}
|
|
1977
|
-
function __decorate(decorators, target, key, desc) {
|
|
1978
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1979
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1980
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
1981
|
-
else
|
|
1982
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1983
|
-
if (d = decorators[i])
|
|
1984
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1985
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1986
|
-
}
|
|
1987
|
-
function __param(paramIndex, decorator) {
|
|
1988
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
1989
|
-
}
|
|
1990
|
-
function __metadata(metadataKey, metadataValue) {
|
|
1991
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1992
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
1993
|
-
}
|
|
1994
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1995
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1996
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1997
|
-
function fulfilled(value) { try {
|
|
1998
|
-
step(generator.next(value));
|
|
1999
|
-
}
|
|
2000
|
-
catch (e) {
|
|
2001
|
-
reject(e);
|
|
2002
|
-
} }
|
|
2003
|
-
function rejected(value) { try {
|
|
2004
|
-
step(generator["throw"](value));
|
|
2005
|
-
}
|
|
2006
|
-
catch (e) {
|
|
2007
|
-
reject(e);
|
|
2008
|
-
} }
|
|
2009
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2010
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2011
|
-
});
|
|
2012
|
-
}
|
|
2013
|
-
function __generator(thisArg, body) {
|
|
2014
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
2015
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
2016
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
2017
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
2018
|
-
function step(op) {
|
|
2019
|
-
if (f)
|
|
2020
|
-
throw new TypeError("Generator is already executing.");
|
|
2021
|
-
while (_)
|
|
2022
|
-
try {
|
|
2023
|
-
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)
|
|
2024
|
-
return t;
|
|
2025
|
-
if (y = 0, t)
|
|
2026
|
-
op = [op[0] & 2, t.value];
|
|
2027
|
-
switch (op[0]) {
|
|
2028
|
-
case 0:
|
|
2029
|
-
case 1:
|
|
2030
|
-
t = op;
|
|
2031
|
-
break;
|
|
2032
|
-
case 4:
|
|
2033
|
-
_.label++;
|
|
2034
|
-
return { value: op[1], done: false };
|
|
2035
|
-
case 5:
|
|
2036
|
-
_.label++;
|
|
2037
|
-
y = op[1];
|
|
2038
|
-
op = [0];
|
|
2039
|
-
continue;
|
|
2040
|
-
case 7:
|
|
2041
|
-
op = _.ops.pop();
|
|
2042
|
-
_.trys.pop();
|
|
2043
|
-
continue;
|
|
2044
|
-
default:
|
|
2045
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
2046
|
-
_ = 0;
|
|
2047
|
-
continue;
|
|
2048
|
-
}
|
|
2049
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
2050
|
-
_.label = op[1];
|
|
2051
|
-
break;
|
|
2052
|
-
}
|
|
2053
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
2054
|
-
_.label = t[1];
|
|
2055
|
-
t = op;
|
|
2056
|
-
break;
|
|
2057
|
-
}
|
|
2058
|
-
if (t && _.label < t[2]) {
|
|
2059
|
-
_.label = t[2];
|
|
2060
|
-
_.ops.push(op);
|
|
2061
|
-
break;
|
|
2062
|
-
}
|
|
2063
|
-
if (t[2])
|
|
2064
|
-
_.ops.pop();
|
|
2065
|
-
_.trys.pop();
|
|
2066
|
-
continue;
|
|
2067
|
-
}
|
|
2068
|
-
op = body.call(thisArg, _);
|
|
2069
|
-
}
|
|
2070
|
-
catch (e) {
|
|
2071
|
-
op = [6, e];
|
|
2072
|
-
y = 0;
|
|
2073
|
-
}
|
|
2074
|
-
finally {
|
|
2075
|
-
f = t = 0;
|
|
2076
|
-
}
|
|
2077
|
-
if (op[0] & 5)
|
|
2078
|
-
throw op[1];
|
|
2079
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
2083
|
-
if (k2 === undefined)
|
|
2084
|
-
k2 = k;
|
|
2085
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
2086
|
-
}) : (function (o, m, k, k2) {
|
|
2087
|
-
if (k2 === undefined)
|
|
2088
|
-
k2 = k;
|
|
2089
|
-
o[k2] = m[k];
|
|
2090
|
-
});
|
|
2091
|
-
function __exportStar(m, o) {
|
|
2092
|
-
for (var p in m)
|
|
2093
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
2094
|
-
__createBinding(o, m, p);
|
|
2095
|
-
}
|
|
2096
|
-
function __values(o) {
|
|
2097
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2098
|
-
if (m)
|
|
2099
|
-
return m.call(o);
|
|
2100
|
-
if (o && typeof o.length === "number")
|
|
2101
|
-
return {
|
|
2102
|
-
next: function () {
|
|
2103
|
-
if (o && i >= o.length)
|
|
2104
|
-
o = void 0;
|
|
2105
|
-
return { value: o && o[i++], done: !o };
|
|
2106
|
-
}
|
|
2107
|
-
};
|
|
2108
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2109
|
-
}
|
|
2110
|
-
function __read(o, n) {
|
|
2111
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2112
|
-
if (!m)
|
|
2113
|
-
return o;
|
|
2114
|
-
var i = m.call(o), r, ar = [], e;
|
|
2115
|
-
try {
|
|
2116
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2117
|
-
ar.push(r.value);
|
|
2118
|
-
}
|
|
2119
|
-
catch (error) {
|
|
2120
|
-
e = { error: error };
|
|
2121
|
-
}
|
|
2122
|
-
finally {
|
|
2123
|
-
try {
|
|
2124
|
-
if (r && !r.done && (m = i["return"]))
|
|
2125
|
-
m.call(i);
|
|
2126
|
-
}
|
|
2127
|
-
finally {
|
|
2128
|
-
if (e)
|
|
2129
|
-
throw e.error;
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
return ar;
|
|
2133
|
-
}
|
|
2134
|
-
/** @deprecated */
|
|
2135
|
-
function __spread() {
|
|
2136
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
2137
|
-
ar = ar.concat(__read(arguments[i]));
|
|
2138
|
-
return ar;
|
|
2139
|
-
}
|
|
2140
|
-
/** @deprecated */
|
|
2141
|
-
function __spreadArrays() {
|
|
2142
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
2143
|
-
s += arguments[i].length;
|
|
2144
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
2145
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
2146
|
-
r[k] = a[j];
|
|
2147
|
-
return r;
|
|
2148
|
-
}
|
|
2149
|
-
function __spreadArray(to, from) {
|
|
2150
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
2151
|
-
to[j] = from[i];
|
|
2152
|
-
return to;
|
|
2153
|
-
}
|
|
2154
|
-
function __await(v) {
|
|
2155
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
2156
|
-
}
|
|
2157
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
2158
|
-
if (!Symbol.asyncIterator)
|
|
2159
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2160
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
2161
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
2162
|
-
function verb(n) { if (g[n])
|
|
2163
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
2164
|
-
function resume(n, v) { try {
|
|
2165
|
-
step(g[n](v));
|
|
2166
|
-
}
|
|
2167
|
-
catch (e) {
|
|
2168
|
-
settle(q[0][3], e);
|
|
2169
|
-
} }
|
|
2170
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
2171
|
-
function fulfill(value) { resume("next", value); }
|
|
2172
|
-
function reject(value) { resume("throw", value); }
|
|
2173
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
2174
|
-
resume(q[0][0], q[0][1]); }
|
|
2175
|
-
}
|
|
2176
|
-
function __asyncDelegator(o) {
|
|
2177
|
-
var i, p;
|
|
2178
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
2179
|
-
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; }
|
|
2180
|
-
}
|
|
2181
|
-
function __asyncValues(o) {
|
|
2182
|
-
if (!Symbol.asyncIterator)
|
|
2183
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2184
|
-
var m = o[Symbol.asyncIterator], i;
|
|
2185
|
-
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);
|
|
2186
|
-
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); }); }; }
|
|
2187
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
2188
|
-
}
|
|
2189
|
-
function __makeTemplateObject(cooked, raw) {
|
|
2190
|
-
if (Object.defineProperty) {
|
|
2191
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
2192
|
-
}
|
|
2193
|
-
else {
|
|
2194
|
-
cooked.raw = raw;
|
|
2195
|
-
}
|
|
2196
|
-
return cooked;
|
|
2197
|
-
}
|
|
2198
|
-
;
|
|
2199
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
2200
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2201
|
-
}) : function (o, v) {
|
|
2202
|
-
o["default"] = v;
|
|
2203
|
-
};
|
|
2204
|
-
function __importStar(mod) {
|
|
2205
|
-
if (mod && mod.__esModule)
|
|
2206
|
-
return mod;
|
|
2207
|
-
var result = {};
|
|
2208
|
-
if (mod != null)
|
|
2209
|
-
for (var k in mod)
|
|
2210
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
2211
|
-
__createBinding(result, mod, k);
|
|
2212
|
-
__setModuleDefault(result, mod);
|
|
2213
|
-
return result;
|
|
2214
|
-
}
|
|
2215
|
-
function __importDefault(mod) {
|
|
2216
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
2217
|
-
}
|
|
2218
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
2219
|
-
if (!privateMap.has(receiver)) {
|
|
2220
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
2221
|
-
}
|
|
2222
|
-
return privateMap.get(receiver);
|
|
2223
|
-
}
|
|
2224
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
2225
|
-
if (!privateMap.has(receiver)) {
|
|
2226
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
2227
|
-
}
|
|
2228
|
-
privateMap.set(receiver, value);
|
|
2229
|
-
return value;
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
/**
|
|
2233
|
-
* Implementazione di default per la classe **BaseSessionRetriever**
|
|
2234
|
-
*/
|
|
2235
|
-
var DefaultSessionRetriever = /** @class */ (function (_super) {
|
|
2236
|
-
__extends(DefaultSessionRetriever, _super);
|
|
2237
|
-
/**
|
|
2238
|
-
* Costruttore
|
|
2239
|
-
*
|
|
2240
|
-
* @ignore
|
|
2241
|
-
*/
|
|
2242
|
-
function DefaultSessionRetriever() {
|
|
2243
|
-
return _super.call(this) || this;
|
|
2244
|
-
}
|
|
2245
1836
|
/**
|
|
2246
|
-
*
|
|
1837
|
+
* Permette di registrare un modulo esterno alla lista dei moduli in listening sulla coda di messaggi
|
|
2247
1838
|
*
|
|
2248
|
-
* @
|
|
1839
|
+
* @param {string} key Chiave del modulo da registrare. Tutti i messaggi inbound saranno inviati dall'applicazione principale su questa chiave
|
|
2249
1840
|
*/
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
}(BaseSessionRetriever));
|
|
2255
|
-
DefaultSessionRetriever.decorators = [
|
|
2256
|
-
{ type: core.Injectable }
|
|
2257
|
-
];
|
|
2258
|
-
DefaultSessionRetriever.ctorParameters = function () { return []; };
|
|
2259
|
-
|
|
2260
|
-
/** Implementazione di default per la classe **BaseStorageProvider** */
|
|
2261
|
-
var DefaultStorageProvider = /** @class */ (function (_super) {
|
|
2262
|
-
__extends(DefaultStorageProvider, _super);
|
|
2263
|
-
/** @ignore Costruttore */
|
|
2264
|
-
function DefaultStorageProvider(session) {
|
|
2265
|
-
return _super.call(this, session) || this;
|
|
2266
|
-
}
|
|
2267
|
-
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2268
|
-
DefaultStorageProvider.prototype.setItem = function (key, value) {
|
|
2269
|
-
try {
|
|
2270
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
2271
|
-
return rxjs.of(true);
|
|
2272
|
-
}
|
|
2273
|
-
catch (_a) {
|
|
2274
|
-
// 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
|
|
2275
|
-
if (value.savedprefix) {
|
|
2276
|
-
console.warn("Spazio del local Storage insufficiente, prova a ripulirlo e risalvare");
|
|
2277
|
-
//Pulisco tutte le view con nome che parta per "Hot"
|
|
2278
|
-
for (var key_1 in localStorage) {
|
|
2279
|
-
if (localStorage.hasOwnProperty(key_1) && key_1.startsWith(value.savedprefix))
|
|
2280
|
-
delete localStorage[key_1];
|
|
2281
|
-
}
|
|
2282
|
-
try {
|
|
2283
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
2284
|
-
}
|
|
2285
|
-
catch (e) {
|
|
2286
|
-
console.error("Spazio del local Storage insufficiente per salvare i risultati di ricerca con solo filtri. Non salvo nulla");
|
|
2287
|
-
}
|
|
2288
|
-
}
|
|
2289
|
-
return rxjs.of(false);
|
|
2290
|
-
}
|
|
2291
|
-
};
|
|
2292
|
-
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2293
|
-
DefaultStorageProvider.prototype.getItem = function (key) {
|
|
2294
|
-
try {
|
|
2295
|
-
var ret = JSON.parse(localStorage.getItem(key));
|
|
2296
|
-
return rxjs.of(ret);
|
|
2297
|
-
}
|
|
2298
|
-
catch (_a) {
|
|
2299
|
-
return rxjs.of(null);
|
|
2300
|
-
}
|
|
2301
|
-
};
|
|
2302
|
-
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2303
|
-
DefaultStorageProvider.prototype.removeItem = function (key) {
|
|
2304
|
-
try {
|
|
2305
|
-
localStorage.removeItem(key);
|
|
2306
|
-
return rxjs.of(true);
|
|
2307
|
-
}
|
|
2308
|
-
catch (_a) {
|
|
2309
|
-
return rxjs.of(false);
|
|
2310
|
-
}
|
|
2311
|
-
};
|
|
2312
|
-
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2313
|
-
DefaultStorageProvider.prototype.clear = function () {
|
|
2314
|
-
try {
|
|
2315
|
-
localStorage.clear();
|
|
2316
|
-
return rxjs.of(true);
|
|
2317
|
-
}
|
|
2318
|
-
catch (_a) {
|
|
2319
|
-
return rxjs.of(false);
|
|
2320
|
-
}
|
|
2321
|
-
};
|
|
2322
|
-
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2323
|
-
DefaultStorageProvider.prototype.getAll = function () {
|
|
2324
|
-
var ret = {};
|
|
2325
|
-
for (var key in localStorage) {
|
|
2326
|
-
ret[key] = localStorage[key];
|
|
2327
|
-
}
|
|
2328
|
-
return rxjs.of(ret);
|
|
1841
|
+
InterComService.prototype.register = function (key) {
|
|
1842
|
+
if (this.outbounds[key])
|
|
1843
|
+
throw "@esfaenza/extensions - InterComService: Impossibile registrare più volte lo stesso modulo";
|
|
1844
|
+
this.outbounds[key] = new rxjs.Subject();
|
|
2329
1845
|
};
|
|
2330
|
-
return
|
|
2331
|
-
}(
|
|
2332
|
-
|
|
1846
|
+
return InterComService;
|
|
1847
|
+
}());
|
|
1848
|
+
InterComService.decorators = [
|
|
2333
1849
|
{ type: core.Injectable }
|
|
2334
|
-
];
|
|
2335
|
-
DefaultStorageProvider.ctorParameters = function () { return [
|
|
2336
|
-
{ type: BaseSessionRetriever }
|
|
2337
|
-
]; };
|
|
1850
|
+
];
|
|
2338
1851
|
|
|
2339
1852
|
// Angular
|
|
2340
1853
|
/**
|
|
@@ -2344,8 +1857,8 @@
|
|
|
2344
1857
|
* ExportService,
|
|
2345
1858
|
* HashingService,
|
|
2346
1859
|
* MessageService,
|
|
2347
|
-
* UtilityService
|
|
2348
|
-
*
|
|
1860
|
+
* UtilityService
|
|
1861
|
+
* InterComService
|
|
2349
1862
|
*
|
|
2350
1863
|
* con eventuali provider che utilizzano
|
|
2351
1864
|
*/
|
|
@@ -2362,13 +1875,11 @@
|
|
|
2362
1875
|
HashingService,
|
|
2363
1876
|
MessageService,
|
|
2364
1877
|
UtilityService,
|
|
2365
|
-
|
|
1878
|
+
InterComService,
|
|
2366
1879
|
{ provide: EXT_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' },
|
|
2367
1880
|
{ provide: EXT_FANCY_ALERTS, useValue: (config === null || config === void 0 ? void 0 : config.fancy_alerts) || true },
|
|
2368
1881
|
{ provide: APPSEARCH_PREFIX, useValue: (config === null || config === void 0 ? void 0 : config.appsearch_prefix) || 'Hot' },
|
|
2369
|
-
{ 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 }
|
|
2370
|
-
{ provide: BaseSessionRetriever, useClass: (config === null || config === void 0 ? void 0 : config.sessionRetriever) || DefaultSessionRetriever },
|
|
2371
|
-
{ provide: BaseStorageProvider, useClass: (config === null || config === void 0 ? void 0 : config.storageProvider) || DefaultStorageProvider },
|
|
1882
|
+
{ 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 }
|
|
2372
1883
|
]
|
|
2373
1884
|
};
|
|
2374
1885
|
};
|
|
@@ -2405,6 +1916,13 @@
|
|
|
2405
1916
|
return GenericItem;
|
|
2406
1917
|
}());
|
|
2407
1918
|
|
|
1919
|
+
/** Enumeratore dei tipi di messaggio che i moduli esterni possono contattare sull'applicazione principale */
|
|
1920
|
+
exports.InboundMessageTypes = void 0;
|
|
1921
|
+
(function (InboundMessageTypes) {
|
|
1922
|
+
/** Evento di navigazione */
|
|
1923
|
+
InboundMessageTypes[InboundMessageTypes["Navigation"] = 0] = "Navigation";
|
|
1924
|
+
})(exports.InboundMessageTypes || (exports.InboundMessageTypes = {}));
|
|
1925
|
+
|
|
2408
1926
|
/*
|
|
2409
1927
|
* Public API Surface of extensions
|
|
2410
1928
|
*/
|
|
@@ -2414,8 +1932,6 @@
|
|
|
2414
1932
|
*/
|
|
2415
1933
|
|
|
2416
1934
|
exports.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
|
|
2417
|
-
exports.BaseSessionRetriever = BaseSessionRetriever;
|
|
2418
|
-
exports.BaseStorageProvider = BaseStorageProvider;
|
|
2419
1935
|
exports.CallResult = CallResult;
|
|
2420
1936
|
exports.ClipboardService = ClipboardService;
|
|
2421
1937
|
exports.CsvHeaders = CsvHeaders;
|
|
@@ -2432,11 +1948,10 @@
|
|
|
2432
1948
|
exports.FullExtensionsModule = FullExtensionsModule;
|
|
2433
1949
|
exports.GenericItem = GenericItem;
|
|
2434
1950
|
exports.HashingService = HashingService;
|
|
1951
|
+
exports.InterComMessage = InterComMessage;
|
|
1952
|
+
exports.InterComService = InterComService;
|
|
2435
1953
|
exports.MessageService = MessageService;
|
|
2436
|
-
exports.StorageService = StorageService;
|
|
2437
1954
|
exports.UtilityService = UtilityService;
|
|
2438
|
-
exports.ɵa = DefaultSessionRetriever;
|
|
2439
|
-
exports.ɵb = DefaultStorageProvider;
|
|
2440
1955
|
|
|
2441
1956
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2442
1957
|
|