@fluxhub/fluxhub-lib 1.0.291 → 1.0.292
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/fluxhub-fluxhub-lib.umd.js +35 -52
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/docs/coverage.html +1 -1
- package/docs/injectables/LocalDBService.html +1 -64
- package/docs/js/search/search_index.js +2 -2
- package/esm2015/lib/services/localstorage.service.js +34 -65
- package/esm5/lib/services/localstorage.service.js +34 -66
- package/fesm2015/fluxhub-fluxhub-lib.js +33 -52
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/fesm5/fluxhub-fluxhub-lib.js +33 -53
- package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
- package/fluxhub-fluxhub-lib.metadata.json +1 -1
- package/lib/services/localstorage.service.d.ts +1 -5
- package/package.json +1 -2
|
@@ -26,7 +26,7 @@ import { MyDatePickerModule } from 'mydatepicker';
|
|
|
26
26
|
import { AgmCoreModule } from '@agm/core';
|
|
27
27
|
import 'ag-grid-enterprise';
|
|
28
28
|
import { CdkTableModule } from '@angular/cdk/table';
|
|
29
|
-
import {
|
|
29
|
+
import { NgForage } from 'ngforage';
|
|
30
30
|
import { TranslateModule } from '@ngx-translate/core';
|
|
31
31
|
import { DragulaService, DragulaModule } from 'ng2-dragula';
|
|
32
32
|
import { __read, __assign, __extends } from 'tslib';
|
|
@@ -34,7 +34,7 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|
|
34
34
|
import { NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
35
35
|
import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_LOCALE, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatPaginatorModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSortModule, MatSlideToggleModule, MatSnackBarModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatFormFieldModule, MatExpansionModule, MatStepperModule, MatDialogModule, MatNativeDateModule } from '@angular/material';
|
|
36
36
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
37
|
-
import { Injectable, Component, Directive, Pipe, Inject, PLATFORM_ID, Input,
|
|
37
|
+
import { Injectable, Component, Directive, Pipe, Inject, PLATFORM_ID, Input, Output, EventEmitter, ViewChild, forwardRef, ViewContainerRef, ElementRef, Optional, HostListener, defineInjectable, inject, NgModule } from '@angular/core';
|
|
38
38
|
import { Http } from '@angular/http';
|
|
39
39
|
import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
|
|
40
40
|
import { ToastrService } from 'ngx-toastr';
|
|
@@ -13031,13 +13031,9 @@ var FSResult = /** @class */ (function () {
|
|
|
13031
13031
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
13032
13032
|
*/
|
|
13033
13033
|
var LocalDBService = /** @class */ (function () {
|
|
13034
|
-
function LocalDBService(
|
|
13035
|
-
this.ngf = ngf;
|
|
13036
|
-
this.cache = cache;
|
|
13034
|
+
function LocalDBService(uti, app) {
|
|
13037
13035
|
this.uti = uti;
|
|
13038
13036
|
this.app = app;
|
|
13039
|
-
this.ngf.name = 'Fluxhub_' + this.app.COMPANY_KEY;
|
|
13040
|
-
this.ngf.driver = [Driver.INDEXED_DB, Driver.LOCAL_STORAGE];
|
|
13041
13037
|
}
|
|
13042
13038
|
/**
|
|
13043
13039
|
* @template T
|
|
@@ -13057,41 +13053,37 @@ var LocalDBService = /** @class */ (function () {
|
|
|
13057
13053
|
var _this = this;
|
|
13058
13054
|
if (crypt === void 0) { crypt = true; }
|
|
13059
13055
|
if (json_format === void 0) { json_format = true; }
|
|
13060
|
-
return
|
|
13061
|
-
|
|
13062
|
-
* @param {?} r
|
|
13056
|
+
return new Promise((/**
|
|
13057
|
+
* @param {?} resolve
|
|
13063
13058
|
* @return {?}
|
|
13064
13059
|
*/
|
|
13065
|
-
function (
|
|
13066
|
-
if (
|
|
13067
|
-
|
|
13060
|
+
function (resolve) {
|
|
13061
|
+
if (localStorage.getItem(key) == null) {
|
|
13062
|
+
resolve(null);
|
|
13063
|
+
return;
|
|
13068
13064
|
}
|
|
13069
13065
|
if (crypt) {
|
|
13070
|
-
if (json_format)
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13066
|
+
if (json_format) {
|
|
13067
|
+
resolve(JSON.parse(_this.uti.decrypt_v2(localStorage.getItem(key))));
|
|
13068
|
+
return;
|
|
13069
|
+
}
|
|
13070
|
+
else {
|
|
13071
|
+
resolve(_this.uti.decrypt_v2(localStorage.getItem(key)));
|
|
13072
|
+
return;
|
|
13073
|
+
}
|
|
13074
13074
|
}
|
|
13075
13075
|
else {
|
|
13076
|
-
if (json_format)
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13076
|
+
if (json_format) {
|
|
13077
|
+
resolve(JSON.parse('' + localStorage.getItem(key)));
|
|
13078
|
+
return;
|
|
13079
|
+
}
|
|
13080
|
+
else {
|
|
13081
|
+
resolve((localStorage.getItem(key)));
|
|
13082
|
+
return;
|
|
13083
|
+
}
|
|
13080
13084
|
}
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
/**
|
|
13084
|
-
* @return {?}
|
|
13085
|
-
*/
|
|
13086
|
-
LocalDBService.prototype.list_keys = /**
|
|
13087
|
-
* @return {?}
|
|
13088
|
-
*/
|
|
13089
|
-
function () {
|
|
13090
|
-
this.ngf.keys().then((/**
|
|
13091
|
-
* @param {?} arr
|
|
13092
|
-
* @return {?}
|
|
13093
|
-
*/
|
|
13094
|
-
function (arr) {
|
|
13085
|
+
resolve(null);
|
|
13086
|
+
return;
|
|
13095
13087
|
}));
|
|
13096
13088
|
};
|
|
13097
13089
|
/**
|
|
@@ -13113,25 +13105,15 @@ var LocalDBService = /** @class */ (function () {
|
|
|
13113
13105
|
if (json_format === void 0) { json_format = true; }
|
|
13114
13106
|
if (crypt) {
|
|
13115
13107
|
if (json_format)
|
|
13116
|
-
|
|
13117
|
-
* @param {?} dt
|
|
13118
|
-
* @return {?}
|
|
13119
|
-
*/
|
|
13120
|
-
function (dt) {
|
|
13121
|
-
}));
|
|
13108
|
+
localStorage.setItem(k, this.uti.encrypt_v2((JSON.stringify(obj))));
|
|
13122
13109
|
else
|
|
13123
|
-
|
|
13124
|
-
* @param {?} dt
|
|
13125
|
-
* @return {?}
|
|
13126
|
-
*/
|
|
13127
|
-
function (dt) {
|
|
13128
|
-
}));
|
|
13110
|
+
localStorage.setItem(k, this.uti.encrypt_v2((obj)));
|
|
13129
13111
|
}
|
|
13130
13112
|
else {
|
|
13131
13113
|
if (json_format)
|
|
13132
|
-
|
|
13114
|
+
localStorage.setItem(k, (JSON.stringify(obj)));
|
|
13133
13115
|
else
|
|
13134
|
-
|
|
13116
|
+
localStorage.setItem(k, (obj));
|
|
13135
13117
|
}
|
|
13136
13118
|
};
|
|
13137
13119
|
/**
|
|
@@ -13143,7 +13125,7 @@ var LocalDBService = /** @class */ (function () {
|
|
|
13143
13125
|
* @return {?}
|
|
13144
13126
|
*/
|
|
13145
13127
|
function (k) {
|
|
13146
|
-
|
|
13128
|
+
localStorage.removeItem(k);
|
|
13147
13129
|
};
|
|
13148
13130
|
LocalDBService.decorators = [
|
|
13149
13131
|
{ type: Injectable, args: [{
|
|
@@ -13152,12 +13134,10 @@ var LocalDBService = /** @class */ (function () {
|
|
|
13152
13134
|
];
|
|
13153
13135
|
/** @nocollapse */
|
|
13154
13136
|
LocalDBService.ctorParameters = function () { return [
|
|
13155
|
-
{ type: NgForage },
|
|
13156
|
-
{ type: NgForageCache },
|
|
13157
13137
|
{ type: UtilityService },
|
|
13158
13138
|
{ type: AppService }
|
|
13159
13139
|
]; };
|
|
13160
|
-
/** @nocollapse */ LocalDBService.ngInjectableDef = defineInjectable({ factory: function LocalDBService_Factory() { return new LocalDBService(inject(
|
|
13140
|
+
/** @nocollapse */ LocalDBService.ngInjectableDef = defineInjectable({ factory: function LocalDBService_Factory() { return new LocalDBService(inject(UtilityService), inject(AppService)); }, token: LocalDBService, providedIn: "root" });
|
|
13161
13141
|
return LocalDBService;
|
|
13162
13142
|
}());
|
|
13163
13143
|
|