@senior-gestao-empresarial/angular-components 4.22.2 → 4.23.2
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/senior-gestao-empresarial-angular-components.umd.js +244 -99
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/lookups/entities/beneficio-fiscal-lookup.d.ts +8 -0
- package/components/lookups/index.d.ts +1 -0
- package/components/websocket/websocket.service.d.ts +23 -14
- package/esm2015/components/lookups/entities/beneficio-fiscal-lookup.js +73 -0
- package/esm2015/components/lookups/erp-lookups.module.js +4 -2
- package/esm2015/components/lookups/index.js +2 -1
- package/esm2015/components/websocket/websocket.service.js +106 -76
- package/esm5/components/lookups/entities/beneficio-fiscal-lookup.js +76 -0
- package/esm5/components/lookups/erp-lookups.module.js +4 -2
- package/esm5/components/lookups/index.js +2 -1
- package/esm5/components/websocket/websocket.service.js +170 -98
- package/fesm2015/senior-gestao-empresarial-angular-components.js +174 -76
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +241 -98
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('@seniorsistemas/senior-platform-data'), require('@angular/forms'), require('js-cookie'), require('@stomp/stompjs'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', '@seniorsistemas/senior-platform-data', '@angular/forms', 'js-cookie', '@stomp/stompjs', '
|
|
4
|
-
(global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.moment_, global.angularComponents, global.ng.common.http, global.api, global.core$1, global.platformComponents, global.seniorPlatformData, global.ng.forms, global.jsCookie, global.stompjs, global.
|
|
5
|
-
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, moment_, angularComponents, http, api, core$1, platformComponents, seniorPlatformData, forms, jsCookie, stompjs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('@seniorsistemas/senior-platform-data'), require('@angular/forms'), require('js-cookie'), require('@stomp/stompjs'), require('sockjs-client')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', '@seniorsistemas/senior-platform-data', '@angular/forms', 'js-cookie', '@stomp/stompjs', 'sockjs-client'], factory) :
|
|
4
|
+
(global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.moment_, global.angularComponents, global.ng.common.http, global.api, global.core$1, global.platformComponents, global.seniorPlatformData, global.ng.forms, global.jsCookie, global.stompjs, global.SockJS));
|
|
5
|
+
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, moment_, angularComponents, http, api, core$1, platformComponents, seniorPlatformData, forms, jsCookie, stompjs, SockJS) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -5835,6 +5835,75 @@
|
|
|
5835
5835
|
return ParametersLookup;
|
|
5836
5836
|
}(ErpLookups));
|
|
5837
5837
|
|
|
5838
|
+
var BeneficioFiscalLookup = /** @class */ (function (_super) {
|
|
5839
|
+
__extends(BeneficioFiscalLookup, _super);
|
|
5840
|
+
function BeneficioFiscalLookup(lookupService, translate) {
|
|
5841
|
+
var _this = _super.call(this, lookupService, translate, "beneficioFiscal", [
|
|
5842
|
+
{
|
|
5843
|
+
name: "codigo",
|
|
5844
|
+
type: angularComponents.FieldType.String
|
|
5845
|
+
},
|
|
5846
|
+
{
|
|
5847
|
+
name: "descricao",
|
|
5848
|
+
type: angularComponents.FieldType.String
|
|
5849
|
+
},
|
|
5850
|
+
], [
|
|
5851
|
+
{
|
|
5852
|
+
name: "codigo",
|
|
5853
|
+
type: angularComponents.FieldType.String
|
|
5854
|
+
},
|
|
5855
|
+
{
|
|
5856
|
+
name: "descricao",
|
|
5857
|
+
type: angularComponents.FieldType.String
|
|
5858
|
+
},
|
|
5859
|
+
{
|
|
5860
|
+
name: "abreviatura",
|
|
5861
|
+
type: angularComponents.FieldType.String
|
|
5862
|
+
},
|
|
5863
|
+
{
|
|
5864
|
+
name: "vigenciaInicial",
|
|
5865
|
+
type: angularComponents.FieldType.Date
|
|
5866
|
+
},
|
|
5867
|
+
{
|
|
5868
|
+
name: "vigenciaFinal",
|
|
5869
|
+
type: angularComponents.FieldType.Date
|
|
5870
|
+
},
|
|
5871
|
+
], [
|
|
5872
|
+
{
|
|
5873
|
+
name: "codigo",
|
|
5874
|
+
type: angularComponents.FieldType.String
|
|
5875
|
+
},
|
|
5876
|
+
{
|
|
5877
|
+
name: "descricao",
|
|
5878
|
+
type: angularComponents.FieldType.String
|
|
5879
|
+
},
|
|
5880
|
+
{
|
|
5881
|
+
name: "abreviatura",
|
|
5882
|
+
type: angularComponents.FieldType.String
|
|
5883
|
+
},
|
|
5884
|
+
{
|
|
5885
|
+
name: "vigenciaInicial",
|
|
5886
|
+
type: angularComponents.FieldType.Date
|
|
5887
|
+
},
|
|
5888
|
+
{
|
|
5889
|
+
name: "vigenciaFinal",
|
|
5890
|
+
type: angularComponents.FieldType.Date
|
|
5891
|
+
},
|
|
5892
|
+
], "erpx_cpl_imp", "impostos") || this;
|
|
5893
|
+
_this.lookupService = lookupService;
|
|
5894
|
+
_this.translate = translate;
|
|
5895
|
+
return _this;
|
|
5896
|
+
}
|
|
5897
|
+
BeneficioFiscalLookup.ctorParameters = function () { return [
|
|
5898
|
+
{ type: ErpLookupsService },
|
|
5899
|
+
{ type: core$1.TranslateService }
|
|
5900
|
+
]; };
|
|
5901
|
+
BeneficioFiscalLookup = __decorate([
|
|
5902
|
+
core.Injectable()
|
|
5903
|
+
], BeneficioFiscalLookup);
|
|
5904
|
+
return BeneficioFiscalLookup;
|
|
5905
|
+
}(ErpLookups));
|
|
5906
|
+
|
|
5838
5907
|
var ErpLookupsModule = /** @class */ (function () {
|
|
5839
5908
|
function ErpLookupsModule() {
|
|
5840
5909
|
}
|
|
@@ -5939,7 +6008,8 @@
|
|
|
5939
6008
|
CountryLookup,
|
|
5940
6009
|
BankLookup,
|
|
5941
6010
|
TypeTaxesLookup,
|
|
5942
|
-
ParametersLookup
|
|
6011
|
+
ParametersLookup,
|
|
6012
|
+
BeneficioFiscalLookup
|
|
5943
6013
|
],
|
|
5944
6014
|
declarations: [],
|
|
5945
6015
|
exports: [],
|
|
@@ -6609,17 +6679,16 @@
|
|
|
6609
6679
|
}());
|
|
6610
6680
|
|
|
6611
6681
|
var WebsocketService = /** @class */ (function () {
|
|
6612
|
-
function WebsocketService(
|
|
6613
|
-
this.cookieService = cookieService;
|
|
6614
|
-
this.baseUrl = null;
|
|
6615
|
-
this.username = null;
|
|
6682
|
+
function WebsocketService() {
|
|
6616
6683
|
this.focused = true;
|
|
6684
|
+
this.wasConnected = false;
|
|
6617
6685
|
this.connected = false;
|
|
6618
6686
|
this.isConnecting = false;
|
|
6619
|
-
this.stompSubscriptions = new Map();
|
|
6620
6687
|
this.primitiveManagers = new Map();
|
|
6621
|
-
this.disconnectSubject = new rxjs.Subject();
|
|
6622
6688
|
this.connect$ = new rxjs.Subject();
|
|
6689
|
+
this.disconnect$ = new rxjs.Subject();
|
|
6690
|
+
this.reconnect$ = new rxjs.Subject();
|
|
6691
|
+
this.error$ = new rxjs.Subject();
|
|
6623
6692
|
window.onfocus = this.onFocus;
|
|
6624
6693
|
window.onblur = this.onBlur;
|
|
6625
6694
|
this.connect();
|
|
@@ -6633,22 +6702,36 @@
|
|
|
6633
6702
|
var _this = this;
|
|
6634
6703
|
setTimeout(function () {
|
|
6635
6704
|
if (_this.isConnected()) {
|
|
6636
|
-
_this.
|
|
6705
|
+
_this.connect$.next();
|
|
6637
6706
|
}
|
|
6638
6707
|
}, 0);
|
|
6639
|
-
return this.connect$.
|
|
6708
|
+
return this.connect$.pipe(operators.first());
|
|
6640
6709
|
};
|
|
6641
6710
|
/**
|
|
6642
|
-
* Observable responsável por emitir uma notificação quando a conexão é
|
|
6643
|
-
* @return Um `Observable<void>` que emite uma notificação quando a conexão é
|
|
6711
|
+
* Observable responsável por emitir uma notificação quando a conexão é desconectada.
|
|
6712
|
+
* @return Um `Observable<void>` que emite uma notificação quando a conexão é desconectada.
|
|
6644
6713
|
*/
|
|
6645
6714
|
WebsocketService.prototype.onDisconnect = function () {
|
|
6646
|
-
return this.
|
|
6715
|
+
return this.disconnect$.asObservable();
|
|
6716
|
+
};
|
|
6717
|
+
/**
|
|
6718
|
+
* Observable responsável por emitir uma notificação quando a conexão é reconectada.
|
|
6719
|
+
* @return Um `Observable<void>` que emite uma notificação quando a conexão é reconectada.
|
|
6720
|
+
*/
|
|
6721
|
+
WebsocketService.prototype.onReconnect = function () {
|
|
6722
|
+
return this.reconnect$.asObservable();
|
|
6723
|
+
};
|
|
6724
|
+
/**
|
|
6725
|
+
* Observable responsável por emitir uma notificação quando ocorre algum erro.
|
|
6726
|
+
* @return Um `Observable<FrameImpl>` que emite uma notificação quando ocorre algum erro.
|
|
6727
|
+
*/
|
|
6728
|
+
WebsocketService.prototype.onError = function () {
|
|
6729
|
+
return this.error$.asObservable();
|
|
6647
6730
|
};
|
|
6648
6731
|
/**
|
|
6649
6732
|
* Observable responsável por emitir uma notificação quando um evento é publicado.
|
|
6650
6733
|
* @typeParam `<T>` Tipo do objeto que o retorno do `observable` vai devolver.
|
|
6651
|
-
* @param domain Dominio da
|
|
6734
|
+
* @param domain Dominio da primitiva.
|
|
6652
6735
|
* @param service Service da primitiva.
|
|
6653
6736
|
* @param primitive Primitiva que será "observada" pelo client.
|
|
6654
6737
|
* @param identifierPath Caminho até a propriedade considerada o identificador do registro.
|
|
@@ -6660,25 +6743,27 @@
|
|
|
6660
6743
|
return this.primitiveManagers.get(primitive).subject.asObservable();
|
|
6661
6744
|
}
|
|
6662
6745
|
var primitiveManager = {
|
|
6746
|
+
domain: domain,
|
|
6747
|
+
service: service,
|
|
6748
|
+
primitive: primitive,
|
|
6749
|
+
stompSubscriptions: [],
|
|
6663
6750
|
subject: new rxjs.Subject(),
|
|
6664
6751
|
identifierPath: identifierPath,
|
|
6665
6752
|
publishedEvents: [],
|
|
6666
6753
|
};
|
|
6667
6754
|
this.primitiveManagers.set(primitive, primitiveManager);
|
|
6668
6755
|
if (this.isConnected()) {
|
|
6669
|
-
this.createStompSubscriptions(
|
|
6670
|
-
return primitiveManager.subject.
|
|
6756
|
+
this.createStompSubscriptions(primitiveManager);
|
|
6757
|
+
return primitiveManager.subject.pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitive); }));
|
|
6671
6758
|
}
|
|
6672
6759
|
else {
|
|
6673
6760
|
if (!this.isConnecting) {
|
|
6674
6761
|
this.connect();
|
|
6675
6762
|
}
|
|
6676
|
-
this.
|
|
6677
|
-
.
|
|
6678
|
-
.subscribe(function () {
|
|
6679
|
-
_this.createStompSubscriptions(domain, service, primitive, primitiveManager);
|
|
6763
|
+
this.connect$.pipe(operators.first()).subscribe(function () {
|
|
6764
|
+
_this.createStompSubscriptions(primitiveManager);
|
|
6680
6765
|
});
|
|
6681
|
-
return primitiveManager.subject.
|
|
6766
|
+
return primitiveManager.subject.pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitive); }));
|
|
6682
6767
|
}
|
|
6683
6768
|
};
|
|
6684
6769
|
/**
|
|
@@ -6725,12 +6810,12 @@
|
|
|
6725
6810
|
primitiveManager.publishedEvents.push(event);
|
|
6726
6811
|
}
|
|
6727
6812
|
};
|
|
6728
|
-
WebsocketService.prototype.createStompSubscriptions = function (
|
|
6729
|
-
var withTokenUrl = this.getSubscriptionUrlWithToken(domain, service, primitive);
|
|
6813
|
+
WebsocketService.prototype.createStompSubscriptions = function (primitiveManager) {
|
|
6814
|
+
var withTokenUrl = this.getSubscriptionUrlWithToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
6730
6815
|
var stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
|
|
6731
|
-
var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(domain, service, primitive);
|
|
6816
|
+
var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
6732
6817
|
var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
|
|
6733
|
-
|
|
6818
|
+
primitiveManager.stompSubscriptions = [stompSubscriptionWithToken, stompSubscriptionWithoutToken];
|
|
6734
6819
|
};
|
|
6735
6820
|
WebsocketService.prototype.getIdentifierFromEvent = function (identifierPath, event) {
|
|
6736
6821
|
var e_2, _a;
|
|
@@ -6755,19 +6840,24 @@
|
|
|
6755
6840
|
var _this = this;
|
|
6756
6841
|
this.createStompClient();
|
|
6757
6842
|
this.isConnecting = true;
|
|
6843
|
+
this._stompClient.activate();
|
|
6758
6844
|
this._stompClient.connect({}, function () {
|
|
6759
|
-
_this.setConnected(true);
|
|
6760
6845
|
_this.isConnecting = false;
|
|
6761
|
-
_this.
|
|
6762
|
-
|
|
6846
|
+
_this.setConnected(true);
|
|
6847
|
+
if (_this.wasConnected) {
|
|
6848
|
+
_this.reconnectPrimitives();
|
|
6849
|
+
_this.reconnect$.next();
|
|
6850
|
+
}
|
|
6851
|
+
else {
|
|
6852
|
+
_this.wasConnected = true;
|
|
6853
|
+
_this.connect$.next();
|
|
6854
|
+
}
|
|
6855
|
+
}, function (error) {
|
|
6763
6856
|
_this.setConnected(false);
|
|
6764
|
-
|
|
6857
|
+
_this.error$.next(error);
|
|
6858
|
+
_this.reconnect();
|
|
6765
6859
|
});
|
|
6766
6860
|
};
|
|
6767
|
-
WebsocketService.prototype.publishOnConnect = function () {
|
|
6768
|
-
this.connect$.next();
|
|
6769
|
-
this.connect$.observers = [];
|
|
6770
|
-
};
|
|
6771
6861
|
WebsocketService.prototype.onFocus = function () {
|
|
6772
6862
|
this.focused = true;
|
|
6773
6863
|
};
|
|
@@ -6775,59 +6865,55 @@
|
|
|
6775
6865
|
this.focused = false;
|
|
6776
6866
|
};
|
|
6777
6867
|
WebsocketService.prototype.disconnect = function () {
|
|
6778
|
-
var e_3, _a, e_4, _b;
|
|
6779
|
-
var observersCount =
|
|
6868
|
+
var e_3, _a, e_4, _b, e_5, _c;
|
|
6869
|
+
var observersCount = this.getObserversCount();
|
|
6870
|
+
if (observersCount > 0)
|
|
6871
|
+
return;
|
|
6780
6872
|
try {
|
|
6781
|
-
for (var
|
|
6782
|
-
var primitiveManager =
|
|
6783
|
-
observersCount += primitiveManager.subject.observers.length;
|
|
6784
|
-
}
|
|
6785
|
-
}
|
|
6786
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
6787
|
-
finally {
|
|
6788
|
-
try {
|
|
6789
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
6790
|
-
}
|
|
6791
|
-
finally { if (e_3) throw e_3.error; }
|
|
6792
|
-
}
|
|
6793
|
-
if (observersCount === 0) {
|
|
6794
|
-
this.stompSubscriptions.forEach(function (stompSubscriptions) {
|
|
6795
|
-
var e_5, _a;
|
|
6873
|
+
for (var _d = __values(this.primitiveManagers.values()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
6874
|
+
var primitiveManager = _e.value;
|
|
6796
6875
|
try {
|
|
6797
|
-
for (var
|
|
6798
|
-
var stompSubscription =
|
|
6876
|
+
for (var _f = (e_4 = void 0, __values(primitiveManager.stompSubscriptions)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
6877
|
+
var stompSubscription = _g.value;
|
|
6799
6878
|
stompSubscription.unsubscribe();
|
|
6800
6879
|
}
|
|
6801
6880
|
}
|
|
6802
|
-
catch (
|
|
6881
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
6803
6882
|
finally {
|
|
6804
6883
|
try {
|
|
6805
|
-
if (
|
|
6884
|
+
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
6806
6885
|
}
|
|
6807
|
-
finally { if (
|
|
6886
|
+
finally { if (e_4) throw e_4.error; }
|
|
6808
6887
|
}
|
|
6809
|
-
}
|
|
6888
|
+
}
|
|
6889
|
+
}
|
|
6890
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
6891
|
+
finally {
|
|
6810
6892
|
try {
|
|
6811
|
-
|
|
6812
|
-
var primitiveManager = _f.value;
|
|
6813
|
-
primitiveManager.subject.complete();
|
|
6814
|
-
}
|
|
6893
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
6815
6894
|
}
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6895
|
+
finally { if (e_3) throw e_3.error; }
|
|
6896
|
+
}
|
|
6897
|
+
try {
|
|
6898
|
+
for (var _h = __values(this.primitiveManagers.values()), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
6899
|
+
var primitiveManager = _j.value;
|
|
6900
|
+
primitiveManager.subject.complete();
|
|
6822
6901
|
}
|
|
6823
|
-
this.stompSubscriptions.clear();
|
|
6824
|
-
this.primitiveManagers.clear();
|
|
6825
|
-
this._stompClient.disconnect();
|
|
6826
|
-
this._stompClient.deactivate();
|
|
6827
|
-
this.setConnected(false);
|
|
6828
|
-
this.isConnecting = false;
|
|
6829
|
-
this.disconnectSubject.next();
|
|
6830
6902
|
}
|
|
6903
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
6904
|
+
finally {
|
|
6905
|
+
try {
|
|
6906
|
+
if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
|
|
6907
|
+
}
|
|
6908
|
+
finally { if (e_5) throw e_5.error; }
|
|
6909
|
+
}
|
|
6910
|
+
this.primitiveManagers.clear();
|
|
6911
|
+
this._stompClient.disconnect();
|
|
6912
|
+
this._stompClient.deactivate();
|
|
6913
|
+
this.setConnected(false);
|
|
6914
|
+
this.isConnecting = false;
|
|
6915
|
+
this.wasConnected = false;
|
|
6916
|
+
this.disconnect$.next();
|
|
6831
6917
|
};
|
|
6832
6918
|
WebsocketService.prototype.isConnected = function () {
|
|
6833
6919
|
return this.connected;
|
|
@@ -6855,46 +6941,104 @@
|
|
|
6855
6941
|
WebsocketService.prototype.createStompClient = function () {
|
|
6856
6942
|
var ws = new SockJS(WebsocketService_1.WEBSOCKET_URL + "subscription", null, { timeout: WebsocketService_1.CONNECTION_TIMEOUT });
|
|
6857
6943
|
this._stompClient = stompjs.Stomp.over(ws);
|
|
6944
|
+
// this._stompClient.debug = (str) => console.log(new Date().toISOString(), str);
|
|
6858
6945
|
this._stompClient.debug = function () { }; // Para remover os logs.
|
|
6859
6946
|
};
|
|
6860
|
-
WebsocketService.prototype.
|
|
6861
|
-
return this.cookieService.get("com.senior.base.url");
|
|
6862
|
-
};
|
|
6863
|
-
WebsocketService.prototype.getUserName = function () {
|
|
6864
|
-
var token = this.cookieService.get("com.senior.token");
|
|
6865
|
-
return token && JSON.parse(token).username;
|
|
6866
|
-
};
|
|
6867
|
-
WebsocketService.prototype.reconnectWebSocket = function () {
|
|
6947
|
+
WebsocketService.prototype.reconnect = function () {
|
|
6868
6948
|
var _this = this;
|
|
6869
|
-
this.
|
|
6870
|
-
|
|
6871
|
-
if (this.baseUrl !== null && baseUrl != this.baseUrl) {
|
|
6872
|
-
return;
|
|
6873
|
-
}
|
|
6874
|
-
var username = this.getUserName();
|
|
6875
|
-
if (this.username !== null && username != this.username) {
|
|
6876
|
-
return;
|
|
6877
|
-
}
|
|
6949
|
+
if (this.connected)
|
|
6950
|
+
this._stompClient.disconnect();
|
|
6878
6951
|
setTimeout(function () {
|
|
6952
|
+
if (_this.getObserversCount() === 0)
|
|
6953
|
+
return;
|
|
6879
6954
|
if (_this.focused) {
|
|
6880
6955
|
_this.connect();
|
|
6881
6956
|
}
|
|
6882
6957
|
else {
|
|
6883
|
-
_this.
|
|
6958
|
+
_this.reconnect();
|
|
6884
6959
|
}
|
|
6885
6960
|
}, WebsocketService_1.RECONNECT_TIMER);
|
|
6886
6961
|
};
|
|
6962
|
+
WebsocketService.prototype.reconnectPrimitives = function () {
|
|
6963
|
+
var e_6, _a, e_7, _b;
|
|
6964
|
+
try {
|
|
6965
|
+
for (var _c = __values(this.primitiveManagers.values()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
6966
|
+
var primitiveManager = _d.value;
|
|
6967
|
+
try {
|
|
6968
|
+
for (var _e = (e_7 = void 0, __values(primitiveManager.stompSubscriptions)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
6969
|
+
var stompSubscription = _f.value;
|
|
6970
|
+
stompSubscription.unsubscribe();
|
|
6971
|
+
}
|
|
6972
|
+
}
|
|
6973
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
6974
|
+
finally {
|
|
6975
|
+
try {
|
|
6976
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
6977
|
+
}
|
|
6978
|
+
finally { if (e_7) throw e_7.error; }
|
|
6979
|
+
}
|
|
6980
|
+
this.createStompSubscriptions(primitiveManager);
|
|
6981
|
+
}
|
|
6982
|
+
}
|
|
6983
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
6984
|
+
finally {
|
|
6985
|
+
try {
|
|
6986
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
6987
|
+
}
|
|
6988
|
+
finally { if (e_6) throw e_6.error; }
|
|
6989
|
+
}
|
|
6990
|
+
};
|
|
6991
|
+
WebsocketService.prototype.getObserversCount = function () {
|
|
6992
|
+
var e_8, _a;
|
|
6993
|
+
var observersCount = 0;
|
|
6994
|
+
try {
|
|
6995
|
+
for (var _b = __values(this.primitiveManagers.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
6996
|
+
var primitiveManager = _c.value;
|
|
6997
|
+
observersCount += primitiveManager.subject.observers.length;
|
|
6998
|
+
}
|
|
6999
|
+
}
|
|
7000
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
7001
|
+
finally {
|
|
7002
|
+
try {
|
|
7003
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7004
|
+
}
|
|
7005
|
+
finally { if (e_8) throw e_8.error; }
|
|
7006
|
+
}
|
|
7007
|
+
return observersCount;
|
|
7008
|
+
};
|
|
7009
|
+
WebsocketService.prototype.disconnectPrimitiveOnFinalize = function (primitive) {
|
|
7010
|
+
var e_9, _a;
|
|
7011
|
+
var primitiveManager = this.primitiveManagers.get(primitive);
|
|
7012
|
+
if (!primitiveManager)
|
|
7013
|
+
return;
|
|
7014
|
+
// @IMPORTANT: Replace .observers.length with .observed in rxjs 7.0+
|
|
7015
|
+
var hasObservers = !(primitiveManager.subject.observers.length === 1);
|
|
7016
|
+
if (hasObservers)
|
|
7017
|
+
return;
|
|
7018
|
+
try {
|
|
7019
|
+
for (var _b = __values(primitiveManager.stompSubscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7020
|
+
var stompSubscription = _c.value;
|
|
7021
|
+
stompSubscription.unsubscribe();
|
|
7022
|
+
}
|
|
7023
|
+
}
|
|
7024
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
7025
|
+
finally {
|
|
7026
|
+
try {
|
|
7027
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7028
|
+
}
|
|
7029
|
+
finally { if (e_9) throw e_9.error; }
|
|
7030
|
+
}
|
|
7031
|
+
this.primitiveManagers.delete(primitive);
|
|
7032
|
+
this.disconnect();
|
|
7033
|
+
};
|
|
6887
7034
|
var WebsocketService_1;
|
|
6888
7035
|
WebsocketService.RECONNECT_TIMER = 3000;
|
|
6889
|
-
WebsocketService.CONNECTION_TIMEOUT =
|
|
7036
|
+
WebsocketService.CONNECTION_TIMEOUT = 15000;
|
|
6890
7037
|
WebsocketService.BASE_URL_COOKIE = "com.senior.base.url";
|
|
6891
7038
|
WebsocketService.TOKEN_COOKIE = "com.senior.token";
|
|
6892
7039
|
WebsocketService.TOKEN = JSON.parse(jsCookie.get(WebsocketService_1.TOKEN_COOKIE) || "{}");
|
|
6893
7040
|
WebsocketService.WEBSOCKET_URL = jsCookie.get(WebsocketService_1.BASE_URL_COOKIE) + "/websocket/";
|
|
6894
|
-
WebsocketService
|
|
6895
|
-
{ type: ngxCookieService.CookieService }
|
|
6896
|
-
]; };
|
|
6897
|
-
WebsocketService.ɵprov = core.ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(core.ɵɵinject(ngxCookieService.CookieService)); }, token: WebsocketService, providedIn: "root" });
|
|
7041
|
+
WebsocketService.ɵprov = core.ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(); }, token: WebsocketService, providedIn: "root" });
|
|
6898
7042
|
WebsocketService = WebsocketService_1 = __decorate([
|
|
6899
7043
|
core.Injectable({
|
|
6900
7044
|
providedIn: "root",
|
|
@@ -6978,6 +7122,7 @@
|
|
|
6978
7122
|
})(exports.ModulesEnum || (exports.ModulesEnum = {}));
|
|
6979
7123
|
|
|
6980
7124
|
exports.BankLookup = BankLookup;
|
|
7125
|
+
exports.BeneficioFiscalLookup = BeneficioFiscalLookup;
|
|
6981
7126
|
exports.BreadcrumbComponent = BreadcrumbComponent;
|
|
6982
7127
|
exports.BreadcrumbModule = BreadcrumbModule;
|
|
6983
7128
|
exports.Breakpoints = Breakpoints;
|