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