@esfaenza/extensions 11.2.10 → 11.2.14
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 +504 -38
- package/bundles/esfaenza-extensions.umd.js.map +1 -1
- package/bundles/esfaenza-extensions.umd.min.js +16 -1
- package/bundles/esfaenza-extensions.umd.min.js.map +1 -1
- package/esfaenza-extensions.d.ts +2 -0
- package/esfaenza-extensions.metadata.json +1 -1
- package/esm2015/esfaenza-extensions.js +3 -1
- package/esm2015/lib/models/ExtensionsModuleConfig.js +1 -1
- package/esm2015/lib/models/providers/base/BaseStorageProvider.js +11 -0
- package/esm2015/lib/models/providers/implementation/DefaultStorageProvider.js +68 -0
- package/esm2015/lib/models/session/base/BaseSessionRetriever.js +6 -0
- package/esm2015/lib/models/session/implementation/DefaultSessionRetriever.js +26 -0
- package/esm2015/lib/modules/extensions.full.module.js +11 -2
- package/esm2015/lib/services/extensions.hashing.service.js +23 -5
- package/esm2015/lib/services/extensions.storage.service.js +42 -30
- package/esm2015/public-api.js +3 -1
- package/fesm2015/esfaenza-extensions.js +174 -35
- package/fesm2015/esfaenza-extensions.js.map +1 -1
- package/lib/models/ExtensionsModuleConfig.d.ts +11 -0
- package/lib/models/providers/base/BaseStorageProvider.d.ts +51 -0
- package/lib/models/providers/implementation/DefaultStorageProvider.d.ts +15 -0
- package/lib/models/session/base/BaseSessionRetriever.d.ts +11 -0
- package/lib/models/session/implementation/DefaultSessionRetriever.d.ts +18 -0
- package/lib/modules/extensions.full.module.d.ts +2 -0
- package/lib/services/extensions.hashing.service.d.ts +10 -2
- package/lib/services/extensions.storage.service.d.ts +20 -9
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -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')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize'], 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));
|
|
5
|
-
}(this, (function (exports, core, ngxToastr, swal, cerialize) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ngx-toastr'), require('sweetalert2'), require('cerialize'), require('rxjs/operators'), require('rxjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize', 'rxjs/operators', '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.operators, global.rxjs));
|
|
5
|
+
}(this, (function (exports, core, ngxToastr, swal, cerialize, operators, rxjs) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -1296,14 +1296,34 @@
|
|
|
1296
1296
|
* @param {number} level Livello di ricorsione nel caso venga effettuato l'hash di un oggetto che contiene altri oggetti
|
|
1297
1297
|
* @param {boolean} navigateFullDepth Indica se navigare l'oggetto per l'intera lunghezza. In caso contrario si ferma al secondo livello
|
|
1298
1298
|
*
|
|
1299
|
-
* @returns {string}
|
|
1299
|
+
* @returns {string} Hash generato per l'oggetto in questione
|
|
1300
1300
|
*/
|
|
1301
|
-
HashingService.prototype.hashObject = function (o, level, navigateFullDepth) {
|
|
1301
|
+
HashingService.prototype.hashObject = function (o, level, navigateFullDepth, precise) {
|
|
1302
1302
|
if (level === void 0) { level = 0; }
|
|
1303
1303
|
if (navigateFullDepth === void 0) { navigateFullDepth = false; }
|
|
1304
|
+
if (precise === void 0) { precise = false; }
|
|
1304
1305
|
var strDef = this.stringify(o, level, navigateFullDepth);
|
|
1305
|
-
var
|
|
1306
|
-
return
|
|
1306
|
+
var hash = precise ? this.md5(strDef) : this.simpleHash(strDef);
|
|
1307
|
+
return hash;
|
|
1308
|
+
};
|
|
1309
|
+
/**
|
|
1310
|
+
* Hash più semplice e più veloce dell'md5, ma meno sicuro
|
|
1311
|
+
*
|
|
1312
|
+
* Vedi https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
|
|
1313
|
+
*
|
|
1314
|
+
* @param {string} str Stringa di cui calcolare l'hash
|
|
1315
|
+
*/
|
|
1316
|
+
HashingService.prototype.simpleHash = function (str, seed) {
|
|
1317
|
+
if (seed === void 0) { seed = 0; }
|
|
1318
|
+
var h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
|
|
1319
|
+
for (var i = 0, ch = void 0; i < str.length; i++) {
|
|
1320
|
+
ch = str.charCodeAt(i);
|
|
1321
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
1322
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
1323
|
+
}
|
|
1324
|
+
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
1325
|
+
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
1326
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString();
|
|
1307
1327
|
};
|
|
1308
1328
|
/**
|
|
1309
1329
|
* Genera una stringa che identifica univocamente l'oggetto in questione
|
|
@@ -1761,9 +1781,32 @@
|
|
|
1761
1781
|
{ type: core.Injectable }
|
|
1762
1782
|
];
|
|
1763
1783
|
|
|
1784
|
+
/**
|
|
1785
|
+
* Classe che gestisce la scrittura delle informazioni nello store locale.
|
|
1786
|
+
* Questo store locale potrebbe essere il localStorage (implementazione di default data dal **DefaultStorageProvider**),
|
|
1787
|
+
* oppure un'implementazione custom facente capo a un DB esterno.
|
|
1788
|
+
*
|
|
1789
|
+
* In questo ultimo caso però sarà necessario implementarsi un proprio **BaseSessionRetriever**
|
|
1790
|
+
* che generi una chiave univoca di sessione su cui tutte le operazioni di questa classe saranno eseguite
|
|
1791
|
+
*/
|
|
1792
|
+
var BaseStorageProvider = /** @class */ (function () {
|
|
1793
|
+
function BaseStorageProvider() {
|
|
1794
|
+
}
|
|
1795
|
+
return BaseStorageProvider;
|
|
1796
|
+
}());
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Classe astratta che si occupa di recuperare l'Id sessione univoco per applicazione ed utente collegato
|
|
1800
|
+
*/
|
|
1801
|
+
var BaseSessionRetriever = /** @class */ (function () {
|
|
1802
|
+
function BaseSessionRetriever() {
|
|
1803
|
+
}
|
|
1804
|
+
return BaseSessionRetriever;
|
|
1805
|
+
}());
|
|
1806
|
+
|
|
1764
1807
|
// Angular
|
|
1765
1808
|
/**
|
|
1766
|
-
* Service che fornisce funzionalità di base per storicizzazione e recupero oggetti
|
|
1809
|
+
* Service che fornisce funzionalità di base per storicizzazione e recupero oggetti dallo Storage Locale
|
|
1767
1810
|
*/
|
|
1768
1811
|
var StorageService = /** @class */ (function () {
|
|
1769
1812
|
/**
|
|
@@ -1771,8 +1814,10 @@
|
|
|
1771
1814
|
*
|
|
1772
1815
|
* @ignore
|
|
1773
1816
|
*/
|
|
1774
|
-
function StorageService(APPSEARCH_PREFIX) {
|
|
1817
|
+
function StorageService(APPSEARCH_PREFIX, _session, _storage) {
|
|
1775
1818
|
this.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
|
|
1819
|
+
this._session = _session;
|
|
1820
|
+
this._storage = _storage;
|
|
1776
1821
|
}
|
|
1777
1822
|
/**
|
|
1778
1823
|
* Inserisce un oggetto che funga da contenitore di oggetti nel local storage, ripulendone gli oggetti (supponendo che sia una view di ricerca) e marcandolo come
|
|
@@ -1782,55 +1827,60 @@
|
|
|
1782
1827
|
* @param {{ items: any[] }} itemsContainer Oggetto da storicizzare
|
|
1783
1828
|
*/
|
|
1784
1829
|
StorageService.prototype.setItem = function (storeName, itemsContainer) {
|
|
1785
|
-
var _a;
|
|
1786
1830
|
//Prima di salvare elimino gli oggetti per non fillare il localStorage di spazzatura
|
|
1787
1831
|
var item = JSON.parse(JSON.stringify(itemsContainer));
|
|
1788
1832
|
item.items = [];
|
|
1789
1833
|
item.savedstate = true;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
}
|
|
1793
|
-
catch (e) {
|
|
1794
|
-
console.warn("Spazio del local Storage insufficiente per salvare la view. Fallback a cleanup e salvataggio");
|
|
1795
|
-
//Pulisco tutte le view con nome che parta per "Hot"
|
|
1796
|
-
for (var key in localStorage) {
|
|
1797
|
-
if (localStorage.hasOwnProperty(key) && key.startsWith((_a = this.APPSEARCH_PREFIX) !== null && _a !== void 0 ? _a : 'Hot'))
|
|
1798
|
-
delete localStorage[key];
|
|
1799
|
-
}
|
|
1800
|
-
try {
|
|
1801
|
-
localStorage.setItem(storeName, JSON.stringify(item));
|
|
1802
|
-
}
|
|
1803
|
-
catch (e) {
|
|
1804
|
-
console.error("Spazio del local Storage insufficiente per salvare i risultati di ricerca con solo filtri. Non salvo nulla");
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1834
|
+
item.savedprefix = this.APPSEARCH_PREFIX || 'Hot';
|
|
1835
|
+
return this.setAny(storeName, item);
|
|
1807
1836
|
};
|
|
1808
1837
|
/**
|
|
1809
|
-
* Inserisce un oggetto
|
|
1838
|
+
* Inserisce un oggetto nello Storage Locale dopo averlo serializzato
|
|
1810
1839
|
*
|
|
1811
1840
|
* @param {string} storeName Chiave del localStorage in cui storicizzare l'oggetto **item**
|
|
1812
1841
|
* @param {any} item Oggetto da storicizzare
|
|
1813
1842
|
*/
|
|
1814
1843
|
StorageService.prototype.setAny = function (storeName, item) {
|
|
1815
|
-
|
|
1844
|
+
return this._storage.setItem(this._session.getSessionKey(), storeName, item).pipe(operators.tap(function (res) {
|
|
1845
|
+
if (res == false) {
|
|
1846
|
+
console.error("Impossibile effettuare il salvataggio dell'oggetto all'interno dello Storage Locale per la chiave " + storeName);
|
|
1847
|
+
}
|
|
1848
|
+
}));
|
|
1816
1849
|
};
|
|
1817
1850
|
/**
|
|
1818
|
-
* Recupera un oggetto
|
|
1851
|
+
* Recupera un oggetto dallo Storage Locale
|
|
1819
1852
|
*
|
|
1820
1853
|
* @param {string} storeName Chiave del localStorage da cui recuperare l'oggetto
|
|
1821
1854
|
*
|
|
1822
1855
|
* @returns {any} Oggetto recuperato e deserializzato
|
|
1823
1856
|
*/
|
|
1824
|
-
StorageService.prototype.
|
|
1825
|
-
return
|
|
1857
|
+
StorageService.prototype.getItem = function (storeName) {
|
|
1858
|
+
return this._storage.getItem(this._session.getSessionKey(), storeName).pipe(operators.tap(function (res) {
|
|
1859
|
+
if (res == null)
|
|
1860
|
+
console.warn("Impossibile ottenere l'oggetto salvato con chiave " + storeName);
|
|
1861
|
+
}));
|
|
1826
1862
|
};
|
|
1827
1863
|
/**
|
|
1828
|
-
* Ripulisce
|
|
1864
|
+
* Ripulisce lo Storage Locale
|
|
1829
1865
|
*
|
|
1830
1866
|
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1831
1867
|
*/
|
|
1832
|
-
StorageService.prototype.
|
|
1833
|
-
|
|
1868
|
+
StorageService.prototype.removeItem = function (storeName) {
|
|
1869
|
+
return this._storage.removeItem(this._session.getSessionKey(), storeName).pipe(operators.tap(function (res) {
|
|
1870
|
+
if (res == false)
|
|
1871
|
+
console.warn("Impossibile rimuovere l'oggetto salvato con chiave " + storeName);
|
|
1872
|
+
}));
|
|
1873
|
+
};
|
|
1874
|
+
/**
|
|
1875
|
+
* Ripulisce lo Storage Locale di ogni cosa salvata
|
|
1876
|
+
*
|
|
1877
|
+
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1878
|
+
*/
|
|
1879
|
+
StorageService.prototype.clear = function () {
|
|
1880
|
+
return this._storage.clear(this._session.getSessionKey()).pipe(operators.tap(function (res) {
|
|
1881
|
+
if (res == false)
|
|
1882
|
+
console.warn("Impossibile ripulire lo Storage Locale");
|
|
1883
|
+
}));
|
|
1834
1884
|
};
|
|
1835
1885
|
return StorageService;
|
|
1836
1886
|
}());
|
|
@@ -1838,9 +1888,417 @@
|
|
|
1838
1888
|
{ type: core.Injectable }
|
|
1839
1889
|
];
|
|
1840
1890
|
StorageService.ctorParameters = function () { return [
|
|
1841
|
-
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [APPSEARCH_PREFIX,] }] }
|
|
1891
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [APPSEARCH_PREFIX,] }] },
|
|
1892
|
+
{ type: BaseSessionRetriever },
|
|
1893
|
+
{ type: BaseStorageProvider }
|
|
1842
1894
|
]; };
|
|
1843
1895
|
|
|
1896
|
+
/*! *****************************************************************************
|
|
1897
|
+
Copyright (c) Microsoft Corporation.
|
|
1898
|
+
|
|
1899
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1900
|
+
purpose with or without fee is hereby granted.
|
|
1901
|
+
|
|
1902
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1903
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1904
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1905
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1906
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1907
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1908
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1909
|
+
***************************************************************************** */
|
|
1910
|
+
/* global Reflect, Promise */
|
|
1911
|
+
var extendStatics = function (d, b) {
|
|
1912
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1913
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1914
|
+
function (d, b) { for (var p in b)
|
|
1915
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
1916
|
+
d[p] = b[p]; };
|
|
1917
|
+
return extendStatics(d, b);
|
|
1918
|
+
};
|
|
1919
|
+
function __extends(d, b) {
|
|
1920
|
+
if (typeof b !== "function" && b !== null)
|
|
1921
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1922
|
+
extendStatics(d, b);
|
|
1923
|
+
function __() { this.constructor = d; }
|
|
1924
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1925
|
+
}
|
|
1926
|
+
var __assign = function () {
|
|
1927
|
+
__assign = Object.assign || function __assign(t) {
|
|
1928
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1929
|
+
s = arguments[i];
|
|
1930
|
+
for (var p in s)
|
|
1931
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1932
|
+
t[p] = s[p];
|
|
1933
|
+
}
|
|
1934
|
+
return t;
|
|
1935
|
+
};
|
|
1936
|
+
return __assign.apply(this, arguments);
|
|
1937
|
+
};
|
|
1938
|
+
function __rest(s, e) {
|
|
1939
|
+
var t = {};
|
|
1940
|
+
for (var p in s)
|
|
1941
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1942
|
+
t[p] = s[p];
|
|
1943
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1944
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1945
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1946
|
+
t[p[i]] = s[p[i]];
|
|
1947
|
+
}
|
|
1948
|
+
return t;
|
|
1949
|
+
}
|
|
1950
|
+
function __decorate(decorators, target, key, desc) {
|
|
1951
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1952
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1953
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1954
|
+
else
|
|
1955
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1956
|
+
if (d = decorators[i])
|
|
1957
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1958
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1959
|
+
}
|
|
1960
|
+
function __param(paramIndex, decorator) {
|
|
1961
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
1962
|
+
}
|
|
1963
|
+
function __metadata(metadataKey, metadataValue) {
|
|
1964
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1965
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1966
|
+
}
|
|
1967
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1968
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1969
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1970
|
+
function fulfilled(value) { try {
|
|
1971
|
+
step(generator.next(value));
|
|
1972
|
+
}
|
|
1973
|
+
catch (e) {
|
|
1974
|
+
reject(e);
|
|
1975
|
+
} }
|
|
1976
|
+
function rejected(value) { try {
|
|
1977
|
+
step(generator["throw"](value));
|
|
1978
|
+
}
|
|
1979
|
+
catch (e) {
|
|
1980
|
+
reject(e);
|
|
1981
|
+
} }
|
|
1982
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1983
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
function __generator(thisArg, body) {
|
|
1987
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
1988
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1989
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
1990
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1991
|
+
function step(op) {
|
|
1992
|
+
if (f)
|
|
1993
|
+
throw new TypeError("Generator is already executing.");
|
|
1994
|
+
while (_)
|
|
1995
|
+
try {
|
|
1996
|
+
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)
|
|
1997
|
+
return t;
|
|
1998
|
+
if (y = 0, t)
|
|
1999
|
+
op = [op[0] & 2, t.value];
|
|
2000
|
+
switch (op[0]) {
|
|
2001
|
+
case 0:
|
|
2002
|
+
case 1:
|
|
2003
|
+
t = op;
|
|
2004
|
+
break;
|
|
2005
|
+
case 4:
|
|
2006
|
+
_.label++;
|
|
2007
|
+
return { value: op[1], done: false };
|
|
2008
|
+
case 5:
|
|
2009
|
+
_.label++;
|
|
2010
|
+
y = op[1];
|
|
2011
|
+
op = [0];
|
|
2012
|
+
continue;
|
|
2013
|
+
case 7:
|
|
2014
|
+
op = _.ops.pop();
|
|
2015
|
+
_.trys.pop();
|
|
2016
|
+
continue;
|
|
2017
|
+
default:
|
|
2018
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
2019
|
+
_ = 0;
|
|
2020
|
+
continue;
|
|
2021
|
+
}
|
|
2022
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
2023
|
+
_.label = op[1];
|
|
2024
|
+
break;
|
|
2025
|
+
}
|
|
2026
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
2027
|
+
_.label = t[1];
|
|
2028
|
+
t = op;
|
|
2029
|
+
break;
|
|
2030
|
+
}
|
|
2031
|
+
if (t && _.label < t[2]) {
|
|
2032
|
+
_.label = t[2];
|
|
2033
|
+
_.ops.push(op);
|
|
2034
|
+
break;
|
|
2035
|
+
}
|
|
2036
|
+
if (t[2])
|
|
2037
|
+
_.ops.pop();
|
|
2038
|
+
_.trys.pop();
|
|
2039
|
+
continue;
|
|
2040
|
+
}
|
|
2041
|
+
op = body.call(thisArg, _);
|
|
2042
|
+
}
|
|
2043
|
+
catch (e) {
|
|
2044
|
+
op = [6, e];
|
|
2045
|
+
y = 0;
|
|
2046
|
+
}
|
|
2047
|
+
finally {
|
|
2048
|
+
f = t = 0;
|
|
2049
|
+
}
|
|
2050
|
+
if (op[0] & 5)
|
|
2051
|
+
throw op[1];
|
|
2052
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
2056
|
+
if (k2 === undefined)
|
|
2057
|
+
k2 = k;
|
|
2058
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
2059
|
+
}) : (function (o, m, k, k2) {
|
|
2060
|
+
if (k2 === undefined)
|
|
2061
|
+
k2 = k;
|
|
2062
|
+
o[k2] = m[k];
|
|
2063
|
+
});
|
|
2064
|
+
function __exportStar(m, o) {
|
|
2065
|
+
for (var p in m)
|
|
2066
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
2067
|
+
__createBinding(o, m, p);
|
|
2068
|
+
}
|
|
2069
|
+
function __values(o) {
|
|
2070
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2071
|
+
if (m)
|
|
2072
|
+
return m.call(o);
|
|
2073
|
+
if (o && typeof o.length === "number")
|
|
2074
|
+
return {
|
|
2075
|
+
next: function () {
|
|
2076
|
+
if (o && i >= o.length)
|
|
2077
|
+
o = void 0;
|
|
2078
|
+
return { value: o && o[i++], done: !o };
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2082
|
+
}
|
|
2083
|
+
function __read(o, n) {
|
|
2084
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2085
|
+
if (!m)
|
|
2086
|
+
return o;
|
|
2087
|
+
var i = m.call(o), r, ar = [], e;
|
|
2088
|
+
try {
|
|
2089
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2090
|
+
ar.push(r.value);
|
|
2091
|
+
}
|
|
2092
|
+
catch (error) {
|
|
2093
|
+
e = { error: error };
|
|
2094
|
+
}
|
|
2095
|
+
finally {
|
|
2096
|
+
try {
|
|
2097
|
+
if (r && !r.done && (m = i["return"]))
|
|
2098
|
+
m.call(i);
|
|
2099
|
+
}
|
|
2100
|
+
finally {
|
|
2101
|
+
if (e)
|
|
2102
|
+
throw e.error;
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
return ar;
|
|
2106
|
+
}
|
|
2107
|
+
/** @deprecated */
|
|
2108
|
+
function __spread() {
|
|
2109
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
2110
|
+
ar = ar.concat(__read(arguments[i]));
|
|
2111
|
+
return ar;
|
|
2112
|
+
}
|
|
2113
|
+
/** @deprecated */
|
|
2114
|
+
function __spreadArrays() {
|
|
2115
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
2116
|
+
s += arguments[i].length;
|
|
2117
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
2118
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
2119
|
+
r[k] = a[j];
|
|
2120
|
+
return r;
|
|
2121
|
+
}
|
|
2122
|
+
function __spreadArray(to, from) {
|
|
2123
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
2124
|
+
to[j] = from[i];
|
|
2125
|
+
return to;
|
|
2126
|
+
}
|
|
2127
|
+
function __await(v) {
|
|
2128
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
2129
|
+
}
|
|
2130
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
2131
|
+
if (!Symbol.asyncIterator)
|
|
2132
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2133
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
2134
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
2135
|
+
function verb(n) { if (g[n])
|
|
2136
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
2137
|
+
function resume(n, v) { try {
|
|
2138
|
+
step(g[n](v));
|
|
2139
|
+
}
|
|
2140
|
+
catch (e) {
|
|
2141
|
+
settle(q[0][3], e);
|
|
2142
|
+
} }
|
|
2143
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
2144
|
+
function fulfill(value) { resume("next", value); }
|
|
2145
|
+
function reject(value) { resume("throw", value); }
|
|
2146
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
2147
|
+
resume(q[0][0], q[0][1]); }
|
|
2148
|
+
}
|
|
2149
|
+
function __asyncDelegator(o) {
|
|
2150
|
+
var i, p;
|
|
2151
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
2152
|
+
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; }
|
|
2153
|
+
}
|
|
2154
|
+
function __asyncValues(o) {
|
|
2155
|
+
if (!Symbol.asyncIterator)
|
|
2156
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2157
|
+
var m = o[Symbol.asyncIterator], i;
|
|
2158
|
+
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);
|
|
2159
|
+
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); }); }; }
|
|
2160
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
2161
|
+
}
|
|
2162
|
+
function __makeTemplateObject(cooked, raw) {
|
|
2163
|
+
if (Object.defineProperty) {
|
|
2164
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
2165
|
+
}
|
|
2166
|
+
else {
|
|
2167
|
+
cooked.raw = raw;
|
|
2168
|
+
}
|
|
2169
|
+
return cooked;
|
|
2170
|
+
}
|
|
2171
|
+
;
|
|
2172
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
2173
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2174
|
+
}) : function (o, v) {
|
|
2175
|
+
o["default"] = v;
|
|
2176
|
+
};
|
|
2177
|
+
function __importStar(mod) {
|
|
2178
|
+
if (mod && mod.__esModule)
|
|
2179
|
+
return mod;
|
|
2180
|
+
var result = {};
|
|
2181
|
+
if (mod != null)
|
|
2182
|
+
for (var k in mod)
|
|
2183
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
2184
|
+
__createBinding(result, mod, k);
|
|
2185
|
+
__setModuleDefault(result, mod);
|
|
2186
|
+
return result;
|
|
2187
|
+
}
|
|
2188
|
+
function __importDefault(mod) {
|
|
2189
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
2190
|
+
}
|
|
2191
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
2192
|
+
if (!privateMap.has(receiver)) {
|
|
2193
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
2194
|
+
}
|
|
2195
|
+
return privateMap.get(receiver);
|
|
2196
|
+
}
|
|
2197
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
2198
|
+
if (!privateMap.has(receiver)) {
|
|
2199
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
2200
|
+
}
|
|
2201
|
+
privateMap.set(receiver, value);
|
|
2202
|
+
return value;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* Implementazione di default per la classe **BaseSessionRetriever**
|
|
2207
|
+
*/
|
|
2208
|
+
var DefaultSessionRetriever = /** @class */ (function (_super) {
|
|
2209
|
+
__extends(DefaultSessionRetriever, _super);
|
|
2210
|
+
/**
|
|
2211
|
+
* Costruttore
|
|
2212
|
+
*
|
|
2213
|
+
* @ignore
|
|
2214
|
+
*/
|
|
2215
|
+
function DefaultSessionRetriever() {
|
|
2216
|
+
return _super.call(this) || this;
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Ottiene un ID sessione
|
|
2220
|
+
*
|
|
2221
|
+
* @returns {string} ID sessione
|
|
2222
|
+
*/
|
|
2223
|
+
DefaultSessionRetriever.prototype.getSessionKey = function () {
|
|
2224
|
+
return "DUMMY_SESSION";
|
|
2225
|
+
};
|
|
2226
|
+
return DefaultSessionRetriever;
|
|
2227
|
+
}(BaseSessionRetriever));
|
|
2228
|
+
DefaultSessionRetriever.decorators = [
|
|
2229
|
+
{ type: core.Injectable }
|
|
2230
|
+
];
|
|
2231
|
+
DefaultSessionRetriever.ctorParameters = function () { return []; };
|
|
2232
|
+
|
|
2233
|
+
/** Implementazione di default per la classe **BaseStorageProvider** */
|
|
2234
|
+
var DefaultStorageProvider = /** @class */ (function (_super) {
|
|
2235
|
+
__extends(DefaultStorageProvider, _super);
|
|
2236
|
+
/** @ignore Costruttore */
|
|
2237
|
+
function DefaultStorageProvider() {
|
|
2238
|
+
return _super.call(this) || this;
|
|
2239
|
+
}
|
|
2240
|
+
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2241
|
+
DefaultStorageProvider.prototype.setItem = function (identity, key, value) {
|
|
2242
|
+
try {
|
|
2243
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
2244
|
+
return rxjs.of(true);
|
|
2245
|
+
}
|
|
2246
|
+
catch (_a) {
|
|
2247
|
+
// 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
|
|
2248
|
+
if (value.savedprefix) {
|
|
2249
|
+
console.warn("Spazio del local Storage insufficiente, prova a ripulirlo e risalvare");
|
|
2250
|
+
//Pulisco tutte le view con nome che parta per "Hot"
|
|
2251
|
+
for (var key_1 in localStorage) {
|
|
2252
|
+
if (localStorage.hasOwnProperty(key_1) && key_1.startsWith(value.savedprefix))
|
|
2253
|
+
delete localStorage[key_1];
|
|
2254
|
+
}
|
|
2255
|
+
try {
|
|
2256
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
2257
|
+
}
|
|
2258
|
+
catch (e) {
|
|
2259
|
+
console.error("Spazio del local Storage insufficiente per salvare i risultati di ricerca con solo filtri. Non salvo nulla");
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
return rxjs.of(false);
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2265
|
+
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2266
|
+
DefaultStorageProvider.prototype.getItem = function (identity, key) {
|
|
2267
|
+
try {
|
|
2268
|
+
var ret = JSON.parse(localStorage.getItem(key));
|
|
2269
|
+
return rxjs.of(ret);
|
|
2270
|
+
}
|
|
2271
|
+
catch (_a) {
|
|
2272
|
+
return rxjs.of(null);
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2276
|
+
DefaultStorageProvider.prototype.removeItem = function (identity, key) {
|
|
2277
|
+
try {
|
|
2278
|
+
localStorage.removeItem(key);
|
|
2279
|
+
return rxjs.of(true);
|
|
2280
|
+
}
|
|
2281
|
+
catch (_a) {
|
|
2282
|
+
return rxjs.of(false);
|
|
2283
|
+
}
|
|
2284
|
+
};
|
|
2285
|
+
/** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
|
|
2286
|
+
DefaultStorageProvider.prototype.clear = function (identity) {
|
|
2287
|
+
try {
|
|
2288
|
+
localStorage.clear();
|
|
2289
|
+
return rxjs.of(true);
|
|
2290
|
+
}
|
|
2291
|
+
catch (_a) {
|
|
2292
|
+
return rxjs.of(false);
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
return DefaultStorageProvider;
|
|
2296
|
+
}(BaseStorageProvider));
|
|
2297
|
+
DefaultStorageProvider.decorators = [
|
|
2298
|
+
{ type: core.Injectable }
|
|
2299
|
+
];
|
|
2300
|
+
DefaultStorageProvider.ctorParameters = function () { return []; };
|
|
2301
|
+
|
|
1844
2302
|
// Angular
|
|
1845
2303
|
/**
|
|
1846
2304
|
* Modulo di estensione che registra autonomamente **TUTTI** i servizi di estensione:
|
|
@@ -1851,6 +2309,8 @@
|
|
|
1851
2309
|
* MessageService,
|
|
1852
2310
|
* UtilityService,
|
|
1853
2311
|
* StorageService,
|
|
2312
|
+
*
|
|
2313
|
+
* con eventuali provider che utilizzano
|
|
1854
2314
|
*/
|
|
1855
2315
|
var FullExtensionsModule = /** @class */ (function () {
|
|
1856
2316
|
function FullExtensionsModule() {
|
|
@@ -1869,7 +2329,9 @@
|
|
|
1869
2329
|
{ provide: EXT_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' },
|
|
1870
2330
|
{ provide: EXT_FANCY_ALERTS, useValue: (config === null || config === void 0 ? void 0 : config.fancy_alerts) || true },
|
|
1871
2331
|
{ provide: APPSEARCH_PREFIX, useValue: (config === null || config === void 0 ? void 0 : config.appsearch_prefix) || 'Hot' },
|
|
1872
|
-
{ 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 }
|
|
2332
|
+
{ 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 },
|
|
2333
|
+
{ provide: BaseSessionRetriever, useClass: (config === null || config === void 0 ? void 0 : config.sessionRetriever) || DefaultSessionRetriever },
|
|
2334
|
+
{ provide: BaseStorageProvider, useClass: (config === null || config === void 0 ? void 0 : config.storageProvider) || DefaultStorageProvider },
|
|
1873
2335
|
]
|
|
1874
2336
|
};
|
|
1875
2337
|
};
|
|
@@ -1915,6 +2377,8 @@
|
|
|
1915
2377
|
*/
|
|
1916
2378
|
|
|
1917
2379
|
exports.APPSEARCH_PREFIX = APPSEARCH_PREFIX;
|
|
2380
|
+
exports.BaseSessionRetriever = BaseSessionRetriever;
|
|
2381
|
+
exports.BaseStorageProvider = BaseStorageProvider;
|
|
1918
2382
|
exports.CallResult = CallResult;
|
|
1919
2383
|
exports.ClipboardService = ClipboardService;
|
|
1920
2384
|
exports.CsvHeaders = CsvHeaders;
|
|
@@ -1934,6 +2398,8 @@
|
|
|
1934
2398
|
exports.MessageService = MessageService;
|
|
1935
2399
|
exports.StorageService = StorageService;
|
|
1936
2400
|
exports.UtilityService = UtilityService;
|
|
2401
|
+
exports.ɵa = DefaultSessionRetriever;
|
|
2402
|
+
exports.ɵb = DefaultStorageProvider;
|
|
1937
2403
|
|
|
1938
2404
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1939
2405
|
|