info-library 2.10.73 → 2.10.74
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/info-library.umd.js +348 -71
- package/bundles/info-library.umd.js.map +1 -1
- package/bundles/info-library.umd.min.js +1 -1
- package/bundles/info-library.umd.min.js.map +1 -1
- package/esm2015/info-library.js +13 -12
- package/esm2015/info-library.module.js +5 -1
- package/esm2015/layouts/main/main.component.js +17 -7
- package/esm2015/layouts/topbar/topbar.component.js +13 -5
- package/esm2015/model/platform.model.js +3 -3
- package/esm2015/service/authentication.service.js +31 -30
- package/esm2015/service/data.service.js +15 -11
- package/esm2015/utils/utilities.js +256 -0
- package/fesm2015/info-library.js +325 -50
- package/fesm2015/info-library.js.map +1 -1
- package/info-library.d.ts +12 -11
- package/info-library.metadata.json +1 -1
- package/layouts/main/main.component.d.ts +3 -1
- package/layouts/topbar/topbar.component.d.ts +3 -1
- package/package.json +1 -1
- package/service/authentication.service.d.ts +3 -3
- package/service/data.service.d.ts +3 -2
- package/utils/utilities.d.ts +24 -0
package/fesm2015/info-library.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Router, ActivatedRoute, NavigationStart, GuardsCheckStart, NavigationEn
|
|
|
5
5
|
import { HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
6
6
|
import { of, Observable } from 'rxjs';
|
|
7
7
|
import { map, catchError, switchMap, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
8
|
+
import { AES, enc } from 'crypto-js';
|
|
8
9
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
9
10
|
import { Title, DomSanitizer } from '@angular/platform-browser';
|
|
10
11
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
|
@@ -524,8 +525,8 @@ if (false) {
|
|
|
524
525
|
*/
|
|
525
526
|
class InfoPlatformModel {
|
|
526
527
|
constructor() {
|
|
527
|
-
this.TokenKey = '
|
|
528
|
-
this.SessionKey = '
|
|
528
|
+
this.TokenKey = 'tk';
|
|
529
|
+
this.SessionKey = 'ss';
|
|
529
530
|
this.ConfigIsNull = true;
|
|
530
531
|
this.Themes = [];
|
|
531
532
|
this.Config = new InfoAppConfigModel();
|
|
@@ -883,6 +884,260 @@ InfoMaskPipe.ctorParameters = () => [];
|
|
|
883
884
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
884
885
|
*/
|
|
885
886
|
|
|
887
|
+
/**
|
|
888
|
+
* @fileoverview added by tsickle
|
|
889
|
+
* Generated from: utils/utilities.ts
|
|
890
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
891
|
+
*/
|
|
892
|
+
class Utilities {
|
|
893
|
+
/**
|
|
894
|
+
* @return {?}
|
|
895
|
+
*/
|
|
896
|
+
getGuid() {
|
|
897
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (/**
|
|
898
|
+
* @param {?} c
|
|
899
|
+
* @return {?}
|
|
900
|
+
*/
|
|
901
|
+
function (c) {
|
|
902
|
+
/** @type {?} */
|
|
903
|
+
const r = Math.random() * 16 | 0;
|
|
904
|
+
/** @type {?} */
|
|
905
|
+
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
906
|
+
return v.toString(16);
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* @return {?}
|
|
911
|
+
*/
|
|
912
|
+
getGuidEmpty() {
|
|
913
|
+
return '00000000-0000-0000-0000-000000000000';
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* @param {?} value
|
|
917
|
+
* @return {?}
|
|
918
|
+
*/
|
|
919
|
+
isGuid(value) {
|
|
920
|
+
return ("" + value).match('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$') !== null;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @param {?} base64
|
|
924
|
+
* @return {?}
|
|
925
|
+
*/
|
|
926
|
+
base64ToArrayBuffer(base64) {
|
|
927
|
+
/** @type {?} */
|
|
928
|
+
var binaryString = window.atob(base64);
|
|
929
|
+
/** @type {?} */
|
|
930
|
+
var binaryLen = binaryString.length;
|
|
931
|
+
/** @type {?} */
|
|
932
|
+
var bytes = new Uint8Array(binaryLen);
|
|
933
|
+
for (var i = 0; i < binaryLen; i++) {
|
|
934
|
+
/** @type {?} */
|
|
935
|
+
var ascii = binaryString.charCodeAt(i);
|
|
936
|
+
bytes[i] = ascii;
|
|
937
|
+
}
|
|
938
|
+
return bytes;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* @param {?} title
|
|
942
|
+
* @param {?} blob
|
|
943
|
+
* @return {?}
|
|
944
|
+
*/
|
|
945
|
+
openOrDownload(title, blob) {
|
|
946
|
+
/** @type {?} */
|
|
947
|
+
let fileURL = URL.createObjectURL(blob);
|
|
948
|
+
if (title.indexOf("pdf") > -1)
|
|
949
|
+
window.open(fileURL, title);
|
|
950
|
+
else {
|
|
951
|
+
/** @type {?} */
|
|
952
|
+
let elementA = (/** @type {?} */ (document.createElement('a')));
|
|
953
|
+
elementA.href = fileURL;
|
|
954
|
+
elementA.download = title;
|
|
955
|
+
document.body.appendChild(elementA);
|
|
956
|
+
elementA.click();
|
|
957
|
+
document.body.removeChild(elementA);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* @param {?} val
|
|
962
|
+
* @return {?}
|
|
963
|
+
*/
|
|
964
|
+
removerAcentos(val) {
|
|
965
|
+
if (val == null)
|
|
966
|
+
return '';
|
|
967
|
+
/** @type {?} */
|
|
968
|
+
var normalizeFunction = String.prototype.normalize ? (/**
|
|
969
|
+
* @param {?} str
|
|
970
|
+
* @return {?}
|
|
971
|
+
*/
|
|
972
|
+
(str) => str.normalize('NFD')) : (/**
|
|
973
|
+
* @param {?} str
|
|
974
|
+
* @return {?}
|
|
975
|
+
*/
|
|
976
|
+
(str) => str);
|
|
977
|
+
return normalizeFunction(val).replace(/[\u0300-\u036f]/g, "");
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* @return {?}
|
|
981
|
+
*/
|
|
982
|
+
getFormatos() {
|
|
983
|
+
return [{ Id: "EXCEL", Nome: "Excel", MimeType: "application/vnd.ms-excel", Extensao: "xls" },
|
|
984
|
+
{ Id: "PDF", Nome: "PDF", MimeType: "application/pdf", Extensao: "pdf" }];
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* @return {?}
|
|
988
|
+
*/
|
|
989
|
+
getFormatosExcel() {
|
|
990
|
+
return [{ Id: 'PP', Nome: 'Excel Português com Separador Decimal [.]' },
|
|
991
|
+
{ Id: 'PV', Nome: 'Excel Português com Separador Decimal [,]' },
|
|
992
|
+
{ Id: 'IP', Nome: 'Excel Inglês com Separador Decimal [.]' },
|
|
993
|
+
{ Id: 'IV', Nome: 'Excel Inglês com Separador Decimal [,]' }];
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* @return {?}
|
|
997
|
+
*/
|
|
998
|
+
getStatus() {
|
|
999
|
+
return [{ Id: "A", Nome: "Ativo" },
|
|
1000
|
+
{ Id: "P", Nome: "Pendente" }];
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* @return {?}
|
|
1004
|
+
*/
|
|
1005
|
+
getStatusCompleto() {
|
|
1006
|
+
return [{ Id: "C", Nome: "Cadastrado", Selecionado: true },
|
|
1007
|
+
{ Id: "F", Nome: "Feito", Selecionado: false },
|
|
1008
|
+
{ Id: "O", Nome: "Conferido", Selecionado: true },
|
|
1009
|
+
{ Id: "R", Nome: "Rejeitado", Selecionado: false },
|
|
1010
|
+
{ Id: "I", Nome: "Inativo", Selecionado: false }];
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* @return {?}
|
|
1014
|
+
*/
|
|
1015
|
+
getStatusProcessamento() {
|
|
1016
|
+
return [{ Id: "A", Nome: "AguardandoProcessamento" },
|
|
1017
|
+
{ Id: "E", Nome: "EmProcessamento" },
|
|
1018
|
+
{ Id: "P", Nome: "Processado" },
|
|
1019
|
+
{ Id: "I", Nome: "Inativo" },
|
|
1020
|
+
{ Id: "Z", Nome: "Erro" }];
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* @return {?}
|
|
1024
|
+
*/
|
|
1025
|
+
getFormatoIdiomas() {
|
|
1026
|
+
return [{ Id: "en", Nome: "English" },
|
|
1027
|
+
{ Id: "pt-BR", Nome: "Português" }];
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* @return {?}
|
|
1031
|
+
*/
|
|
1032
|
+
getGeneros() {
|
|
1033
|
+
return [{ Id: 'M', Nome: 'Masculino' },
|
|
1034
|
+
{ Id: 'F', Nome: 'Feminino' }];
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* @return {?}
|
|
1038
|
+
*/
|
|
1039
|
+
getTiposEvidencia() {
|
|
1040
|
+
return [{ Id: 1, Nome: 'Telefone' },
|
|
1041
|
+
{ Id: 2, Nome: 'Email' },
|
|
1042
|
+
{ Id: 3, Nome: 'Documento' }];
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* @return {?}
|
|
1046
|
+
*/
|
|
1047
|
+
getOrdens() {
|
|
1048
|
+
return [{ Id: "nome-asc", Nome: "NomeCrescente" },
|
|
1049
|
+
{ Id: "nome-desc", Nome: "NomeDecrescente" },
|
|
1050
|
+
{ Id: "valor-asc", Nome: "ValorCrescente" },
|
|
1051
|
+
{ Id: "valor-desc", Nome: "ValorDecrescente" }];
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* @param {?} form
|
|
1055
|
+
* @param {?} value
|
|
1056
|
+
* @param {?} control
|
|
1057
|
+
* @return {?}
|
|
1058
|
+
*/
|
|
1059
|
+
validarEmail(form, value, control) {
|
|
1060
|
+
if (!value)
|
|
1061
|
+
return;
|
|
1062
|
+
/** @type {?} */
|
|
1063
|
+
let pattern = /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/;
|
|
1064
|
+
/** @type {?} */
|
|
1065
|
+
let emails = value.split(';');
|
|
1066
|
+
/** @type {?} */
|
|
1067
|
+
let invalido = emails.some((/**
|
|
1068
|
+
* @param {?} email
|
|
1069
|
+
* @return {?}
|
|
1070
|
+
*/
|
|
1071
|
+
email => email && !pattern.test(email.trim())));
|
|
1072
|
+
if (invalido)
|
|
1073
|
+
form.form.controls[control].setErrors({ 'invalid': true });
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* @param {?} key
|
|
1077
|
+
* @param {?} value
|
|
1078
|
+
* @return {?}
|
|
1079
|
+
*/
|
|
1080
|
+
setLocalStorage(key, value) {
|
|
1081
|
+
localStorage.setItem(key, this.criptografar(value));
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* @param {?} key
|
|
1085
|
+
* @return {?}
|
|
1086
|
+
*/
|
|
1087
|
+
getLocalStorage(key) {
|
|
1088
|
+
/** @type {?} */
|
|
1089
|
+
var data = this.descriptografar(localStorage.getItem(key));
|
|
1090
|
+
if (data == null || data == '')
|
|
1091
|
+
return null;
|
|
1092
|
+
return data;
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* @return {?}
|
|
1096
|
+
*/
|
|
1097
|
+
isIE() {
|
|
1098
|
+
/** @type {?} */
|
|
1099
|
+
var userAgent = navigator.userAgent;
|
|
1100
|
+
return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* @param {?} texto
|
|
1104
|
+
* @return {?}
|
|
1105
|
+
*/
|
|
1106
|
+
retornaTexto(texto) {
|
|
1107
|
+
/** @type {?} */
|
|
1108
|
+
var div = document.createElement("div");
|
|
1109
|
+
div.innerHTML = texto;
|
|
1110
|
+
return div.innerText || div.textContent;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* @param {?} texto
|
|
1114
|
+
* @return {?}
|
|
1115
|
+
*/
|
|
1116
|
+
criptografar(texto) {
|
|
1117
|
+
try {
|
|
1118
|
+
return AES.encrypt(texto, "GKxLtQg2at").toString();
|
|
1119
|
+
}
|
|
1120
|
+
catch (e) {
|
|
1121
|
+
return null;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* @param {?} texto
|
|
1126
|
+
* @return {?}
|
|
1127
|
+
*/
|
|
1128
|
+
descriptografar(texto) {
|
|
1129
|
+
try {
|
|
1130
|
+
return AES.decrypt(texto, "GKxLtQg2at").toString(enc.Utf8);
|
|
1131
|
+
}
|
|
1132
|
+
catch (e) {
|
|
1133
|
+
return null;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
Utilities.decorators = [
|
|
1138
|
+
{ type: Injectable }
|
|
1139
|
+
];
|
|
1140
|
+
|
|
886
1141
|
/**
|
|
887
1142
|
* @fileoverview added by tsickle
|
|
888
1143
|
* Generated from: service/data.service.ts
|
|
@@ -894,19 +1149,20 @@ class InfoDataService {
|
|
|
894
1149
|
* @param {?} _http
|
|
895
1150
|
* @param {?} _router
|
|
896
1151
|
* @param {?} _plataforma
|
|
1152
|
+
* @param {?} _utilities
|
|
897
1153
|
*/
|
|
898
|
-
constructor(_apiController, _http, _router, _plataforma) {
|
|
1154
|
+
constructor(_apiController, _http, _router, _plataforma, _utilities) {
|
|
899
1155
|
this._apiController = _apiController;
|
|
900
1156
|
this._http = _http;
|
|
901
1157
|
this._router = _router;
|
|
902
1158
|
this._plataforma = _plataforma;
|
|
903
|
-
this.
|
|
1159
|
+
this._utilities = _utilities;
|
|
904
1160
|
}
|
|
905
1161
|
/**
|
|
906
1162
|
* @return {?}
|
|
907
1163
|
*/
|
|
908
1164
|
getToken() {
|
|
909
|
-
this.token =
|
|
1165
|
+
this.token = this._utilities.getLocalStorage(this._plataforma.TokenKey);
|
|
910
1166
|
if (this.token == null) {
|
|
911
1167
|
this._router.navigateByUrl('');
|
|
912
1168
|
return '';
|
|
@@ -1122,15 +1378,11 @@ InfoDataService.ctorParameters = () => [
|
|
|
1122
1378
|
{ type: undefined, decorators: [{ type: Inject, args: [APICONTROLLER_CONFIG,] }] },
|
|
1123
1379
|
{ type: HttpClient },
|
|
1124
1380
|
{ type: Router },
|
|
1125
|
-
{ type: InfoPlatformModel }
|
|
1381
|
+
{ type: InfoPlatformModel },
|
|
1382
|
+
{ type: Utilities }
|
|
1126
1383
|
];
|
|
1127
|
-
/** @nocollapse */ InfoDataService.ɵprov = ɵɵdefineInjectable({ factory: function InfoDataService_Factory() { return new InfoDataService(ɵɵinject(APICONTROLLER_CONFIG), ɵɵinject(HttpClient), ɵɵinject(Router), ɵɵinject(InfoPlatformModel)); }, token: InfoDataService, providedIn: "root" });
|
|
1384
|
+
/** @nocollapse */ InfoDataService.ɵprov = ɵɵdefineInjectable({ factory: function InfoDataService_Factory() { return new InfoDataService(ɵɵinject(APICONTROLLER_CONFIG), ɵɵinject(HttpClient), ɵɵinject(Router), ɵɵinject(InfoPlatformModel), ɵɵinject(Utilities)); }, token: InfoDataService, providedIn: "root" });
|
|
1128
1385
|
if (false) {
|
|
1129
|
-
/**
|
|
1130
|
-
* @type {?}
|
|
1131
|
-
* @private
|
|
1132
|
-
*/
|
|
1133
|
-
InfoDataService.prototype._key;
|
|
1134
1386
|
/**
|
|
1135
1387
|
* @type {?}
|
|
1136
1388
|
* @private
|
|
@@ -1156,6 +1408,11 @@ if (false) {
|
|
|
1156
1408
|
* @private
|
|
1157
1409
|
*/
|
|
1158
1410
|
InfoDataService.prototype._plataforma;
|
|
1411
|
+
/**
|
|
1412
|
+
* @type {?}
|
|
1413
|
+
* @private
|
|
1414
|
+
*/
|
|
1415
|
+
InfoDataService.prototype._utilities;
|
|
1159
1416
|
}
|
|
1160
1417
|
|
|
1161
1418
|
/**
|
|
@@ -1171,20 +1428,20 @@ class InfoAuthenticationService {
|
|
|
1171
1428
|
* @param {?} _plataforma
|
|
1172
1429
|
* @param {?} _dataService
|
|
1173
1430
|
* @param {?} _modal
|
|
1431
|
+
* @param {?} _utilities
|
|
1174
1432
|
* @param {?} _translate
|
|
1175
1433
|
* @param {?} _title
|
|
1176
1434
|
*/
|
|
1177
|
-
constructor(_router, _http, _sessao, _plataforma, _dataService, _modal, _translate, _title) {
|
|
1435
|
+
constructor(_router, _http, _sessao, _plataforma, _dataService, _modal, _utilities, _translate, _title) {
|
|
1178
1436
|
this._router = _router;
|
|
1179
1437
|
this._http = _http;
|
|
1180
1438
|
this._sessao = _sessao;
|
|
1181
1439
|
this._plataforma = _plataforma;
|
|
1182
1440
|
this._dataService = _dataService;
|
|
1183
1441
|
this._modal = _modal;
|
|
1442
|
+
this._utilities = _utilities;
|
|
1184
1443
|
this._translate = _translate;
|
|
1185
1444
|
this._title = _title;
|
|
1186
|
-
this._key = 'token';
|
|
1187
|
-
this._keySessao = 'sessao';
|
|
1188
1445
|
this._sessionActive = true;
|
|
1189
1446
|
}
|
|
1190
1447
|
/**
|
|
@@ -1267,7 +1524,7 @@ class InfoAuthenticationService {
|
|
|
1267
1524
|
* @return {?}
|
|
1268
1525
|
*/
|
|
1269
1526
|
isLogged() {
|
|
1270
|
-
return (
|
|
1527
|
+
return (this._utilities.getLocalStorage(this._plataforma.TokenKey) != null);
|
|
1271
1528
|
}
|
|
1272
1529
|
/**
|
|
1273
1530
|
* @return {?}
|
|
@@ -1343,7 +1600,7 @@ class InfoAuthenticationService {
|
|
|
1343
1600
|
*/
|
|
1344
1601
|
(r) => {
|
|
1345
1602
|
if (r.Success && r.Data != null)
|
|
1346
|
-
|
|
1603
|
+
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data.Token);
|
|
1347
1604
|
return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1348
1605
|
})), catchError((/**
|
|
1349
1606
|
* @param {?} e
|
|
@@ -1365,7 +1622,7 @@ class InfoAuthenticationService {
|
|
|
1365
1622
|
*/
|
|
1366
1623
|
(r) => {
|
|
1367
1624
|
if (r.Success && r.Data != null)
|
|
1368
|
-
|
|
1625
|
+
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
|
|
1369
1626
|
return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1370
1627
|
})), catchError((/**
|
|
1371
1628
|
* @param {?} e
|
|
@@ -1386,7 +1643,7 @@ class InfoAuthenticationService {
|
|
|
1386
1643
|
*/
|
|
1387
1644
|
(r) => {
|
|
1388
1645
|
if (r.Success && r.Data != null)
|
|
1389
|
-
|
|
1646
|
+
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
|
|
1390
1647
|
return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1391
1648
|
})), catchError((/**
|
|
1392
1649
|
* @param {?} e
|
|
@@ -1398,13 +1655,18 @@ class InfoAuthenticationService {
|
|
|
1398
1655
|
* @return {?}
|
|
1399
1656
|
*/
|
|
1400
1657
|
logout() {
|
|
1401
|
-
this._http.post(this._plataforma.Config.webapiUrl + 'centrocontrole/usuario/Logout', null, { headers: this._dataService.getHeaderToken() })
|
|
1402
|
-
|
|
1403
|
-
this._router.navigateByUrl('login').then((/**
|
|
1404
|
-
* @param {?} r
|
|
1658
|
+
this._http.post(this._plataforma.Config.webapiUrl + 'centrocontrole/usuario/Logout', null, { headers: this._dataService.getHeaderToken() })
|
|
1659
|
+
.subscribe((/**
|
|
1405
1660
|
* @return {?}
|
|
1406
1661
|
*/
|
|
1407
|
-
|
|
1662
|
+
() => {
|
|
1663
|
+
this.removeSessao();
|
|
1664
|
+
this._router.navigateByUrl('login').then((/**
|
|
1665
|
+
* @param {?} r
|
|
1666
|
+
* @return {?}
|
|
1667
|
+
*/
|
|
1668
|
+
r => { location.reload(); }));
|
|
1669
|
+
}));
|
|
1408
1670
|
}
|
|
1409
1671
|
/**
|
|
1410
1672
|
* @param {?} url
|
|
@@ -1558,8 +1820,6 @@ class InfoAuthenticationService {
|
|
|
1558
1820
|
* @return {?}
|
|
1559
1821
|
*/
|
|
1560
1822
|
ret => {
|
|
1561
|
-
/** @type {?} */
|
|
1562
|
-
let permissao = true;
|
|
1563
1823
|
if (ret.success) {
|
|
1564
1824
|
if (ret.data == null) {
|
|
1565
1825
|
this.logout();
|
|
@@ -1582,9 +1842,9 @@ class InfoAuthenticationService {
|
|
|
1582
1842
|
* @return {?}
|
|
1583
1843
|
*/
|
|
1584
1844
|
s => s.URL == urlGenerica));
|
|
1585
|
-
|
|
1845
|
+
this._utilities.setLocalStorage(this._plataforma.SessionKey, JSON.stringify(this._sessao));
|
|
1586
1846
|
}
|
|
1587
|
-
return
|
|
1847
|
+
return true;
|
|
1588
1848
|
})), catchError((/**
|
|
1589
1849
|
* @param {?} error
|
|
1590
1850
|
* @return {?}
|
|
@@ -1732,21 +1992,12 @@ InfoAuthenticationService.ctorParameters = () => [
|
|
|
1732
1992
|
{ type: InfoPlatformModel },
|
|
1733
1993
|
{ type: InfoDataService },
|
|
1734
1994
|
{ type: MatDialog },
|
|
1995
|
+
{ type: Utilities },
|
|
1735
1996
|
{ type: InfoTranslateService },
|
|
1736
1997
|
{ type: Title }
|
|
1737
1998
|
];
|
|
1738
|
-
/** @nocollapse */ InfoAuthenticationService.ɵprov = ɵɵdefineInjectable({ factory: function InfoAuthenticationService_Factory() { return new InfoAuthenticationService(ɵɵinject(Router), ɵɵinject(HttpClient), ɵɵinject(InfoSessionModel), ɵɵinject(InfoPlatformModel), ɵɵinject(InfoDataService), ɵɵinject(MatDialog), ɵɵinject(InfoTranslateService), ɵɵinject(Title)); }, token: InfoAuthenticationService, providedIn: "root" });
|
|
1999
|
+
/** @nocollapse */ InfoAuthenticationService.ɵprov = ɵɵdefineInjectable({ factory: function InfoAuthenticationService_Factory() { return new InfoAuthenticationService(ɵɵinject(Router), ɵɵinject(HttpClient), ɵɵinject(InfoSessionModel), ɵɵinject(InfoPlatformModel), ɵɵinject(InfoDataService), ɵɵinject(MatDialog), ɵɵinject(Utilities), ɵɵinject(InfoTranslateService), ɵɵinject(Title)); }, token: InfoAuthenticationService, providedIn: "root" });
|
|
1739
2000
|
if (false) {
|
|
1740
|
-
/**
|
|
1741
|
-
* @type {?}
|
|
1742
|
-
* @private
|
|
1743
|
-
*/
|
|
1744
|
-
InfoAuthenticationService.prototype._key;
|
|
1745
|
-
/**
|
|
1746
|
-
* @type {?}
|
|
1747
|
-
* @private
|
|
1748
|
-
*/
|
|
1749
|
-
InfoAuthenticationService.prototype._keySessao;
|
|
1750
2001
|
/**
|
|
1751
2002
|
* @type {?}
|
|
1752
2003
|
* @private
|
|
@@ -1787,6 +2038,11 @@ if (false) {
|
|
|
1787
2038
|
* @private
|
|
1788
2039
|
*/
|
|
1789
2040
|
InfoAuthenticationService.prototype._modal;
|
|
2041
|
+
/**
|
|
2042
|
+
* @type {?}
|
|
2043
|
+
* @private
|
|
2044
|
+
*/
|
|
2045
|
+
InfoAuthenticationService.prototype._utilities;
|
|
1790
2046
|
/**
|
|
1791
2047
|
* @type {?}
|
|
1792
2048
|
* @private
|
|
@@ -6279,8 +6535,9 @@ class InfoTopbarComponent {
|
|
|
6279
6535
|
* @param {?} _modal
|
|
6280
6536
|
* @param {?} _renderer
|
|
6281
6537
|
* @param {?} _element
|
|
6538
|
+
* @param {?} _utilities
|
|
6282
6539
|
*/
|
|
6283
|
-
constructor(_translateService, _authenticationService, _dataService, _themeService, _router, _dialog, _session, _platform, _modal, _renderer, _element) {
|
|
6540
|
+
constructor(_translateService, _authenticationService, _dataService, _themeService, _router, _dialog, _session, _platform, _modal, _renderer, _element, _utilities) {
|
|
6284
6541
|
this._translateService = _translateService;
|
|
6285
6542
|
this._authenticationService = _authenticationService;
|
|
6286
6543
|
this._dataService = _dataService;
|
|
@@ -6292,6 +6549,7 @@ class InfoTopbarComponent {
|
|
|
6292
6549
|
this._modal = _modal;
|
|
6293
6550
|
this._renderer = _renderer;
|
|
6294
6551
|
this._element = _element;
|
|
6552
|
+
this._utilities = _utilities;
|
|
6295
6553
|
this.opened = false;
|
|
6296
6554
|
this.languages = [];
|
|
6297
6555
|
this.themes = [];
|
|
@@ -6348,7 +6606,7 @@ class InfoTopbarComponent {
|
|
|
6348
6606
|
this._session.TemaId = company.TemaId;
|
|
6349
6607
|
this._themeService.setThemeByLoggedCompany();
|
|
6350
6608
|
localStorage.removeItem("Dashboard");
|
|
6351
|
-
|
|
6609
|
+
this._utilities.setLocalStorage(this._platform.SessionKey, JSON.stringify(this._session));
|
|
6352
6610
|
this._router.navigateByUrl('').then((/**
|
|
6353
6611
|
* @param {?} r
|
|
6354
6612
|
* @return {?}
|
|
@@ -6375,7 +6633,6 @@ class InfoTopbarComponent {
|
|
|
6375
6633
|
* @return {?}
|
|
6376
6634
|
*/
|
|
6377
6635
|
setTheme(theme) {
|
|
6378
|
-
//console.log('topbar.setTheme', theme);
|
|
6379
6636
|
this._themeService.setTheme(theme);
|
|
6380
6637
|
}
|
|
6381
6638
|
/**
|
|
@@ -6536,7 +6793,8 @@ InfoTopbarComponent.ctorParameters = () => [
|
|
|
6536
6793
|
{ type: InfoPlatformModel },
|
|
6537
6794
|
{ type: MatDialog },
|
|
6538
6795
|
{ type: Renderer2 },
|
|
6539
|
-
{ type: ElementRef }
|
|
6796
|
+
{ type: ElementRef },
|
|
6797
|
+
{ type: Utilities }
|
|
6540
6798
|
];
|
|
6541
6799
|
InfoTopbarComponent.propDecorators = {
|
|
6542
6800
|
opened: [{ type: Input }],
|
|
@@ -6645,6 +6903,11 @@ if (false) {
|
|
|
6645
6903
|
* @private
|
|
6646
6904
|
*/
|
|
6647
6905
|
InfoTopbarComponent.prototype._element;
|
|
6906
|
+
/**
|
|
6907
|
+
* @type {?}
|
|
6908
|
+
* @private
|
|
6909
|
+
*/
|
|
6910
|
+
InfoTopbarComponent.prototype._utilities;
|
|
6648
6911
|
}
|
|
6649
6912
|
|
|
6650
6913
|
/**
|
|
@@ -6661,8 +6924,9 @@ class InfoMainComponent {
|
|
|
6661
6924
|
* @param {?} _themeService
|
|
6662
6925
|
* @param {?} _renderer
|
|
6663
6926
|
* @param {?} _element
|
|
6927
|
+
* @param {?} _utilities
|
|
6664
6928
|
*/
|
|
6665
|
-
constructor(_platform, _session, _router, _dataAccessService, _themeService, _renderer, _element) {
|
|
6929
|
+
constructor(_platform, _session, _router, _dataAccessService, _themeService, _renderer, _element, _utilities) {
|
|
6666
6930
|
this._platform = _platform;
|
|
6667
6931
|
this._session = _session;
|
|
6668
6932
|
this._router = _router;
|
|
@@ -6670,6 +6934,7 @@ class InfoMainComponent {
|
|
|
6670
6934
|
this._themeService = _themeService;
|
|
6671
6935
|
this._renderer = _renderer;
|
|
6672
6936
|
this._element = _element;
|
|
6937
|
+
this._utilities = _utilities;
|
|
6673
6938
|
this.opened = false;
|
|
6674
6939
|
this.version = null;
|
|
6675
6940
|
this.messages = [];
|
|
@@ -6713,13 +6978,12 @@ class InfoMainComponent {
|
|
|
6713
6978
|
* @return {?}
|
|
6714
6979
|
*/
|
|
6715
6980
|
ngOnInit() {
|
|
6716
|
-
//console.log('info-library.main.ngOnInit');
|
|
6717
6981
|
this._renderer.addClass(this._element.nativeElement, 'uxc' + this._platform.Config.ux);
|
|
6718
6982
|
if (this._platform.Config.topMenu)
|
|
6719
6983
|
this._renderer.addClass(this._element.nativeElement, 'topmenu');
|
|
6720
6984
|
this._platform.Themes = this.themes;
|
|
6721
6985
|
this._platform.ShortcutApi = this.shortcutapi;
|
|
6722
|
-
if (
|
|
6986
|
+
if (this._utilities.getLocalStorage(this._platform.TokenKey) == null)
|
|
6723
6987
|
this._router.navigateByUrl(this.loginurl);
|
|
6724
6988
|
else
|
|
6725
6989
|
this.getLoggedUser();
|
|
@@ -6747,8 +7011,10 @@ class InfoMainComponent {
|
|
|
6747
7011
|
* @return {?}
|
|
6748
7012
|
*/
|
|
6749
7013
|
getLoggedUser() {
|
|
6750
|
-
|
|
6751
|
-
|
|
7014
|
+
/** @type {?} */
|
|
7015
|
+
var cSession = this._utilities.getLocalStorage(this._platform.SessionKey);
|
|
7016
|
+
if (cSession != null)
|
|
7017
|
+
Object.assign(this._session, JSON.parse(cSession));
|
|
6752
7018
|
if (this._session.UsuarioId != null || this.loggeduserapi == null)
|
|
6753
7019
|
return;
|
|
6754
7020
|
this._dataAccessService.get(this.loggeduserapi, this.loggedusermethod).subscribe((/**
|
|
@@ -6821,7 +7087,8 @@ InfoMainComponent.ctorParameters = () => [
|
|
|
6821
7087
|
{ type: InfoDataService },
|
|
6822
7088
|
{ type: InfoThemeService },
|
|
6823
7089
|
{ type: Renderer2 },
|
|
6824
|
-
{ type: ElementRef }
|
|
7090
|
+
{ type: ElementRef },
|
|
7091
|
+
{ type: Utilities }
|
|
6825
7092
|
];
|
|
6826
7093
|
InfoMainComponent.propDecorators = {
|
|
6827
7094
|
opened: [{ type: Input }],
|
|
@@ -6936,6 +7203,11 @@ if (false) {
|
|
|
6936
7203
|
* @private
|
|
6937
7204
|
*/
|
|
6938
7205
|
InfoMainComponent.prototype._element;
|
|
7206
|
+
/**
|
|
7207
|
+
* @type {?}
|
|
7208
|
+
* @private
|
|
7209
|
+
*/
|
|
7210
|
+
InfoMainComponent.prototype._utilities;
|
|
6939
7211
|
}
|
|
6940
7212
|
|
|
6941
7213
|
/**
|
|
@@ -8232,6 +8504,9 @@ InfoLibraryModule.decorators = [
|
|
|
8232
8504
|
InfoDialogComponent,
|
|
8233
8505
|
AtalhoModalComponent,
|
|
8234
8506
|
RefreshSessionTimeModalComponent
|
|
8507
|
+
],
|
|
8508
|
+
providers: [
|
|
8509
|
+
Utilities
|
|
8235
8510
|
]
|
|
8236
8511
|
},] }
|
|
8237
8512
|
];
|
|
@@ -8248,5 +8523,5 @@ InfoLibraryModule.decorators = [
|
|
|
8248
8523
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
8249
8524
|
*/
|
|
8250
8525
|
|
|
8251
|
-
export { APICONTROLLER_CONFIG, DICTIONARIES_CONFIG, InfoAlertComponent, InfoAppConfigModel, InfoAuthenticationService, InfoAutoCompleteComponent, InfoBigCheckboxComponent, InfoCardComponent, InfoCheckboxComponent, InfoChipsComponent, InfoConfigurationService, InfoDataAccessModel, InfoDataService, InfoDateComponent, InfoDateMonthComponent, InfoDialogButtons, InfoDialogComponent, InfoDialogModal, InfoDialogModel, InfoDialogResult, InfoEditorComponent, InfoFormPropModel, InfoGridButtonModel, InfoGridComponent, InfoInputComponent, InfoInputListComponent, InfoLastSearchModel, InfoLibraryModule, InfoListCheckboxComponent, InfoLoadingComponent, InfoLoginModel, InfoMainComponent, InfoMaskPipe, InfoMenuCardComponent, InfoMessageComponent, InfoMethodGridButtonModel, InfoModalAction, InfoModalComponent, InfoMultiSelectComponent, InfoNotificationItemModel, InfoNotificationModel, InfoPageAction, InfoPagebarButtonModel, InfoPagebarComponent, InfoPaginatorComponent, InfoPermissionModel, InfoPlatformModel, InfoSelectComponent, InfoSessionModel, InfoSidebarComponent, InfoThemeService, InfoTimelineComponent, InfoTopMenuComponent, InfoTopbarComponent, InfoTranslatePipe, InfoTranslateService, PT_BR_DATE_FORMATS as ɵa, PT_BR_DATE_MONTH_FORMATS as ɵb, AtalhoModalComponent as ɵc, InfoDataService as ɵd, InfoPlatformModel as ɵe,
|
|
8526
|
+
export { APICONTROLLER_CONFIG, DICTIONARIES_CONFIG, InfoAlertComponent, InfoAppConfigModel, InfoAuthenticationService, InfoAutoCompleteComponent, InfoBigCheckboxComponent, InfoCardComponent, InfoCheckboxComponent, InfoChipsComponent, InfoConfigurationService, InfoDataAccessModel, InfoDataService, InfoDateComponent, InfoDateMonthComponent, InfoDialogButtons, InfoDialogComponent, InfoDialogModal, InfoDialogModel, InfoDialogResult, InfoEditorComponent, InfoFormPropModel, InfoGridButtonModel, InfoGridComponent, InfoInputComponent, InfoInputListComponent, InfoLastSearchModel, InfoLibraryModule, InfoListCheckboxComponent, InfoLoadingComponent, InfoLoginModel, InfoMainComponent, InfoMaskPipe, InfoMenuCardComponent, InfoMessageComponent, InfoMethodGridButtonModel, InfoModalAction, InfoModalComponent, InfoMultiSelectComponent, InfoNotificationItemModel, InfoNotificationModel, InfoPageAction, InfoPagebarButtonModel, InfoPagebarComponent, InfoPaginatorComponent, InfoPermissionModel, InfoPlatformModel, InfoSelectComponent, InfoSessionModel, InfoSidebarComponent, InfoThemeService, InfoTimelineComponent, InfoTopMenuComponent, InfoTopbarComponent, InfoTranslatePipe, InfoTranslateService, PT_BR_DATE_FORMATS as ɵa, PT_BR_DATE_MONTH_FORMATS as ɵb, AtalhoModalComponent as ɵc, InfoDataService as ɵd, InfoPlatformModel as ɵe, Utilities as ɵf, InfoFormPropModel as ɵg, InfoAuthenticationService as ɵh, RefreshSessionTimeModalComponent as ɵi, InfoSessionModel as ɵj, InfoTranslateService as ɵk, InfoLastSearchModel as ɵl, InfoThemeService as ɵm, InfoDialogModel as ɵn, InfoTranslatePipe as ɵo, InfoMaskPipe as ɵp, InfoMaskDirective as ɵq, InfoUnmaskDirective as ɵr };
|
|
8252
8527
|
//# sourceMappingURL=info-library.js.map
|