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