@osovitny/anatoly 2.0.44 → 2.0.46
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/osovitny-anatoly.umd.js +35 -32
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +2 -2
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/core.module.js +5 -2
- package/esm2015/lib/core/services/idle.service.js +31 -22
- package/esm2015/lib/core/services/web-storage.service.js +7 -10
- package/esm2015/lib/data/base/base-api.service.js +1 -7
- package/fesm2015/osovitny-anatoly.js +35 -31
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/services/idle.service.d.ts +9 -6
- package/lib/core/services/web-storage.service.d.ts +0 -1
- package/lib/data/base/base-api.service.d.ts +0 -2
- package/osovitny-anatoly.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1516,12 +1516,6 @@
|
|
|
1516
1516
|
return this.http.delete(url, { responseType: responseType });
|
|
1517
1517
|
};
|
|
1518
1518
|
//gets
|
|
1519
|
-
BaseApiService.prototype.getById = function (id) {
|
|
1520
|
-
return this.get('getById', { id: id });
|
|
1521
|
-
};
|
|
1522
|
-
BaseApiService.prototype.getAll = function (data) {
|
|
1523
|
-
return this.get('getAll', data).pipe(operators.map(function (res) { return res; }));
|
|
1524
|
-
};
|
|
1525
1519
|
BaseApiService.prototype.getExternalTextFile = function (url) {
|
|
1526
1520
|
return this.http.get(url);
|
|
1527
1521
|
};
|
|
@@ -1627,37 +1621,45 @@
|
|
|
1627
1621
|
function IdleService() {
|
|
1628
1622
|
this.expired$ = new rxjs.Subject();
|
|
1629
1623
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
this.
|
|
1624
|
+
//Private
|
|
1625
|
+
IdleService.prototype.resetTimeCounters = function (timeOutSeconds) {
|
|
1626
|
+
this.timeOutSeconds = timeOutSeconds;
|
|
1633
1627
|
this.timeOutMilliSeconds = timeOutSeconds * 1000;
|
|
1634
|
-
this.
|
|
1635
|
-
_this.resetTimer();
|
|
1636
|
-
});
|
|
1637
|
-
this.startTimer();
|
|
1638
|
-
return this.expired$;
|
|
1628
|
+
this.startDate = new Date();
|
|
1639
1629
|
};
|
|
1640
1630
|
IdleService.prototype.startTimer = function () {
|
|
1641
1631
|
var _this = this;
|
|
1642
|
-
this.timer$ = rxjs.timer(this.timeOutMilliSeconds,
|
|
1643
|
-
|
|
1632
|
+
this.timer$ = rxjs.timer(this.timeOutMilliSeconds, 1 * 1000).subscribe(function (res) {
|
|
1633
|
+
var nowDate = new Date();
|
|
1634
|
+
var exiredDate = new Date(_this.startDate.getTime() + _this.timeOutMilliSeconds);
|
|
1635
|
+
if (nowDate.getTime() >= exiredDate.getTime()) {
|
|
1636
|
+
//console.log("nowDate: " + nowDate);
|
|
1637
|
+
//console.log("exiredDate: " + exiredDate);
|
|
1638
|
+
_this.expired$.next(true);
|
|
1639
|
+
}
|
|
1644
1640
|
});
|
|
1645
1641
|
};
|
|
1646
1642
|
IdleService.prototype.resetTimer = function () {
|
|
1647
|
-
this.
|
|
1643
|
+
this.startDate = new Date();
|
|
1644
|
+
};
|
|
1645
|
+
//Public
|
|
1646
|
+
IdleService.prototype.startWatching = function (timeOutSeconds) {
|
|
1647
|
+
var _this = this;
|
|
1648
|
+
this.idle$ = rxjs.merge(rxjs.fromEvent(document, 'mousemove'), rxjs.fromEvent(document, 'click'), rxjs.fromEvent(document, 'mousedown'), rxjs.fromEvent(document, 'keypress'), rxjs.fromEvent(document, 'DOMMouseScroll'), rxjs.fromEvent(document, 'mousewheel'), rxjs.fromEvent(document, 'touchmove'), rxjs.fromEvent(document, 'MSPointerMove'), rxjs.fromEvent(window, 'mousemove'), rxjs.fromEvent(window, 'resize'));
|
|
1649
|
+
this.resetTimeCounters(timeOutSeconds);
|
|
1650
|
+
this.idleSubscription = this.idle$.subscribe(function (res) {
|
|
1651
|
+
_this.resetTimer();
|
|
1652
|
+
});
|
|
1648
1653
|
this.startTimer();
|
|
1654
|
+
return this.expired$;
|
|
1649
1655
|
};
|
|
1650
|
-
IdleService.prototype.
|
|
1656
|
+
IdleService.prototype.stopWatching = function () {
|
|
1651
1657
|
this.timer$.unsubscribe();
|
|
1652
1658
|
this.idleSubscription.unsubscribe();
|
|
1653
1659
|
};
|
|
1654
|
-
IdleService.prototype.restartIdleTimer = function () {
|
|
1655
|
-
var _this = this;
|
|
1660
|
+
IdleService.prototype.restartIdleTimer = function (timeOutSeconds) {
|
|
1656
1661
|
this.timer$.unsubscribe();
|
|
1657
|
-
this.
|
|
1658
|
-
this.idleSubscription = this.idle$.subscribe(function (res) {
|
|
1659
|
-
_this.resetTimer();
|
|
1660
|
-
});
|
|
1662
|
+
this.resetTimeCounters(timeOutSeconds);
|
|
1661
1663
|
this.startTimer();
|
|
1662
1664
|
};
|
|
1663
1665
|
return IdleService;
|
|
@@ -1665,32 +1667,31 @@
|
|
|
1665
1667
|
IdleService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IdleService_Factory() { return new IdleService(); }, token: IdleService, providedIn: "root" });
|
|
1666
1668
|
IdleService.decorators = [
|
|
1667
1669
|
{ type: i0.Injectable, args: [{
|
|
1668
|
-
providedIn:
|
|
1670
|
+
providedIn: 'root'
|
|
1669
1671
|
},] }
|
|
1670
1672
|
];
|
|
1671
1673
|
|
|
1672
1674
|
var WebStorageService = /** @class */ (function () {
|
|
1673
1675
|
function WebStorageService(storage) {
|
|
1674
|
-
this.currentClientKey = AppCoreSettings.SERVICES_CONF.selectedClientID;
|
|
1675
1676
|
this.storage =
|
|
1676
1677
|
storage === 'local' || storage === 'localStorage'
|
|
1677
1678
|
? localStorage
|
|
1678
1679
|
: sessionStorage;
|
|
1679
1680
|
}
|
|
1680
1681
|
WebStorageService.prototype.setItem = function (key, value) {
|
|
1681
|
-
this.storage.setItem(
|
|
1682
|
+
this.storage.setItem(key, value);
|
|
1682
1683
|
};
|
|
1683
1684
|
WebStorageService.prototype.setObject = function (key, value) {
|
|
1684
|
-
this.storage.setItem(
|
|
1685
|
+
this.storage.setItem(key, JSON.stringify(value));
|
|
1685
1686
|
};
|
|
1686
1687
|
WebStorageService.prototype.getItem = function (key) {
|
|
1687
|
-
return this.storage.getItem(
|
|
1688
|
+
return this.storage.getItem(key);
|
|
1688
1689
|
};
|
|
1689
1690
|
WebStorageService.prototype.getObject = function (key) {
|
|
1690
|
-
return JSON.parse(this.storage.getItem(
|
|
1691
|
+
return JSON.parse(this.storage.getItem(key) || '{}');
|
|
1691
1692
|
};
|
|
1692
1693
|
WebStorageService.prototype.remove = function (key) {
|
|
1693
|
-
this.storage.removeItem(
|
|
1694
|
+
this.storage.removeItem(key);
|
|
1694
1695
|
};
|
|
1695
1696
|
return WebStorageService;
|
|
1696
1697
|
}());
|
|
@@ -1855,7 +1856,9 @@
|
|
|
1855
1856
|
AppContextService,
|
|
1856
1857
|
LoadingService,
|
|
1857
1858
|
DigitalMarketingService,
|
|
1858
|
-
GoogleAnalyticsService
|
|
1859
|
+
GoogleAnalyticsService,
|
|
1860
|
+
LocalStorageService,
|
|
1861
|
+
SessionStorageService
|
|
1859
1862
|
],
|
|
1860
1863
|
},] }
|
|
1861
1864
|
];
|