@senior-gestao-empresarial/angular-components 6.9.0 → 6.9.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 +99 -32
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/lookups/entities/xt-integration/entity-person-product-lookup.d.ts +8 -0
- package/components/websocket/websocket.service.d.ts +5 -9
- package/esm2015/components/lookups/entities/xt-integration/entity-person-product-lookup.js +49 -0
- package/esm2015/components/lookups/erp-lookups.module.js +4 -2
- package/esm2015/components/websocket/websocket.service.js +49 -34
- package/esm2015/senior-gestao-empresarial-angular-components.js +4 -3
- package/esm5/components/lookups/entities/xt-integration/entity-person-product-lookup.js +52 -0
- package/esm5/components/lookups/erp-lookups.module.js +4 -2
- package/esm5/components/websocket/websocket.service.js +56 -36
- package/esm5/senior-gestao-empresarial-angular-components.js +4 -3
- package/fesm2015/senior-gestao-empresarial-angular-components.js +88 -30
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +98 -32
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.d.ts +3 -2
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -3,7 +3,7 @@ import { Input, Component, NgModule, Injectable, Inject, ɵɵdefineInjectable,
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, throwError, interval, of, timer, iif, fromEvent,
|
|
6
|
+
import { Subject, throwError, interval, of, race, timer, iif, fromEvent, ReplaySubject } from 'rxjs';
|
|
7
7
|
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize, first } from 'rxjs/operators';
|
|
8
8
|
import * as moment_ from 'moment';
|
|
9
9
|
import { FormField, FieldType } from '@seniorsistemas/angular-components';
|
|
@@ -5780,6 +5780,48 @@ SegmentoLookup = __decorate([
|
|
|
5780
5780
|
Injectable()
|
|
5781
5781
|
], SegmentoLookup);
|
|
5782
5782
|
|
|
5783
|
+
let EntityPersonProductLookup = class EntityPersonProductLookup extends ErpLookups {
|
|
5784
|
+
constructor(lookupService, translate) {
|
|
5785
|
+
super(lookupService, translate, "entityFacade", [
|
|
5786
|
+
{
|
|
5787
|
+
name: "entityCode",
|
|
5788
|
+
type: FieldType.String
|
|
5789
|
+
},
|
|
5790
|
+
{
|
|
5791
|
+
name: "entityDesc",
|
|
5792
|
+
type: FieldType.String
|
|
5793
|
+
},
|
|
5794
|
+
], [
|
|
5795
|
+
{
|
|
5796
|
+
name: "entityCode",
|
|
5797
|
+
type: FieldType.String
|
|
5798
|
+
},
|
|
5799
|
+
{
|
|
5800
|
+
name: "entityDesc",
|
|
5801
|
+
type: FieldType.String
|
|
5802
|
+
},
|
|
5803
|
+
], [
|
|
5804
|
+
{
|
|
5805
|
+
name: "entityCode",
|
|
5806
|
+
type: FieldType.String
|
|
5807
|
+
},
|
|
5808
|
+
{
|
|
5809
|
+
name: "entityDesc",
|
|
5810
|
+
type: FieldType.String
|
|
5811
|
+
},
|
|
5812
|
+
], "erpx_cpl_xt", "integration");
|
|
5813
|
+
this.lookupService = lookupService;
|
|
5814
|
+
this.translate = translate;
|
|
5815
|
+
}
|
|
5816
|
+
};
|
|
5817
|
+
EntityPersonProductLookup.ctorParameters = () => [
|
|
5818
|
+
{ type: ErpLookupsService },
|
|
5819
|
+
{ type: TranslateService }
|
|
5820
|
+
];
|
|
5821
|
+
EntityPersonProductLookup = __decorate([
|
|
5822
|
+
Injectable()
|
|
5823
|
+
], EntityPersonProductLookup);
|
|
5824
|
+
|
|
5783
5825
|
let ErpLookupsModule = class ErpLookupsModule {
|
|
5784
5826
|
};
|
|
5785
5827
|
ErpLookupsModule = __decorate([
|
|
@@ -5893,7 +5935,8 @@ ErpLookupsModule = __decorate([
|
|
|
5893
5935
|
E501TcpLookup,
|
|
5894
5936
|
AgreementLookup,
|
|
5895
5937
|
NotaFiscalEntradaLookup,
|
|
5896
|
-
SegmentoLookup
|
|
5938
|
+
SegmentoLookup,
|
|
5939
|
+
EntityPersonProductLookup
|
|
5897
5940
|
],
|
|
5898
5941
|
declarations: [],
|
|
5899
5942
|
exports: [],
|
|
@@ -6561,8 +6604,6 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6561
6604
|
/** @private */
|
|
6562
6605
|
this.isConnecting = false;
|
|
6563
6606
|
/** @private */
|
|
6564
|
-
this.isReconnecting = false;
|
|
6565
|
-
/** @private */
|
|
6566
6607
|
this.primitiveManagers = new Map();
|
|
6567
6608
|
/** @private */
|
|
6568
6609
|
this.connect$ = new Subject();
|
|
@@ -6605,9 +6646,10 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6605
6646
|
*/
|
|
6606
6647
|
onSubscribe({ domain, service, primitive }) {
|
|
6607
6648
|
const key = this.getPrimitiveManagerKey(domain, service, primitive);
|
|
6608
|
-
return this.onConnect().pipe(switchMap(() => this.primitiveManagers.has(key) &&
|
|
6649
|
+
return this.onConnect().pipe(switchMap(() => this.primitiveManagers.has(key) &&
|
|
6650
|
+
this.primitiveManagers.get(key).isSubscribed
|
|
6609
6651
|
? of(void 0).pipe(take(1))
|
|
6610
|
-
: this.subscribe$.pipe(filter(primitiveManager => this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key), take(1),
|
|
6652
|
+
: this.subscribe$.pipe(filter((primitiveManager) => this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key), take(1), map(() => void 0))));
|
|
6611
6653
|
}
|
|
6612
6654
|
/**
|
|
6613
6655
|
* Observable responsável por emitir uma notificação quando ocorre algum erro.
|
|
@@ -6636,21 +6678,25 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6636
6678
|
primitive: primitive,
|
|
6637
6679
|
stompSubscriptions: [],
|
|
6638
6680
|
event$: new Subject(),
|
|
6639
|
-
isSubscribed: false
|
|
6681
|
+
isSubscribed: false
|
|
6640
6682
|
};
|
|
6641
6683
|
this.primitiveManagers.set(key, primitiveManager);
|
|
6642
6684
|
if (this.isConnected) {
|
|
6643
6685
|
this.createStompSubscriptions(primitiveManager);
|
|
6644
|
-
return primitiveManager.event
|
|
6686
|
+
return primitiveManager.event$
|
|
6687
|
+
.asObservable()
|
|
6688
|
+
.pipe(finalize(() => this.disconnectPrimitiveOnFinalize(primitiveManager)));
|
|
6645
6689
|
}
|
|
6646
6690
|
else {
|
|
6647
|
-
if (!this.
|
|
6691
|
+
if (!this.isConnecting) {
|
|
6648
6692
|
this.connect();
|
|
6649
6693
|
}
|
|
6650
6694
|
this.connect$.pipe(first()).subscribe(() => {
|
|
6651
6695
|
this.createStompSubscriptions(primitiveManager);
|
|
6652
6696
|
});
|
|
6653
|
-
return primitiveManager.event
|
|
6697
|
+
return primitiveManager.event$
|
|
6698
|
+
.asObservable()
|
|
6699
|
+
.pipe(finalize(() => this.disconnectPrimitiveOnFinalize(primitiveManager)));
|
|
6654
6700
|
}
|
|
6655
6701
|
}
|
|
6656
6702
|
/** @private */
|
|
@@ -6659,7 +6705,10 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6659
6705
|
const stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
|
|
6660
6706
|
const withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
6661
6707
|
const stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
|
|
6662
|
-
primitiveManager.stompSubscriptions = [
|
|
6708
|
+
primitiveManager.stompSubscriptions = [
|
|
6709
|
+
stompSubscriptionWithToken,
|
|
6710
|
+
stompSubscriptionWithoutToken
|
|
6711
|
+
];
|
|
6663
6712
|
primitiveManager.isSubscribed = true;
|
|
6664
6713
|
this.subscribe$.next(primitiveManager);
|
|
6665
6714
|
}
|
|
@@ -6669,7 +6718,6 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6669
6718
|
this.isConnecting = true;
|
|
6670
6719
|
this._stompClient.connect({}, () => {
|
|
6671
6720
|
this.isConnecting = false;
|
|
6672
|
-
this.isReconnecting = false;
|
|
6673
6721
|
this.isConnected = true;
|
|
6674
6722
|
if (this.wasConnected) {
|
|
6675
6723
|
this.reconnectPrimitives();
|
|
@@ -6683,16 +6731,22 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6683
6731
|
}, (error) => {
|
|
6684
6732
|
this.isConnected = false;
|
|
6685
6733
|
this.error$.next(error);
|
|
6686
|
-
this.
|
|
6687
|
-
|
|
6688
|
-
.
|
|
6689
|
-
|
|
6734
|
+
race(this.disconnect$.pipe(take(1), map(() => ({ wasDisconnected: true }))), timer(WebsocketService_1.RECONNECT_INTERVAL).pipe(take(1), switchMap(() => iif(() => document.hidden, fromEvent(document, 'visibilitychange').pipe(first()), of(void 0))), map(() => ({ wasDisconnected: false }))))
|
|
6735
|
+
.pipe(take(1))
|
|
6736
|
+
.subscribe({
|
|
6737
|
+
next: ({ wasDisconnected }) => {
|
|
6738
|
+
if (!wasDisconnected &&
|
|
6739
|
+
!(this.isConnected || this.isConnecting)) {
|
|
6740
|
+
this.connect();
|
|
6741
|
+
}
|
|
6742
|
+
}
|
|
6743
|
+
});
|
|
6690
6744
|
});
|
|
6691
6745
|
}
|
|
6692
6746
|
disconnect() {
|
|
6693
|
-
|
|
6694
|
-
if (observersCount > 0)
|
|
6747
|
+
if (this.getObserversCount() > 0) {
|
|
6695
6748
|
return;
|
|
6749
|
+
}
|
|
6696
6750
|
for (const primitiveManager of this.primitiveManagers.values()) {
|
|
6697
6751
|
for (const stompSubscription of primitiveManager.stompSubscriptions) {
|
|
6698
6752
|
stompSubscription.unsubscribe();
|
|
@@ -6711,19 +6765,25 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6711
6765
|
}
|
|
6712
6766
|
/** @private */
|
|
6713
6767
|
getSubscriptionUrlWithToken(domain, service, primitive) {
|
|
6714
|
-
const tenant = WebsocketService_1.TOKEN
|
|
6715
|
-
|
|
6768
|
+
const tenant = WebsocketService_1.TOKEN
|
|
6769
|
+
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
6770
|
+
: null;
|
|
6771
|
+
const token = WebsocketService_1.TOKEN
|
|
6772
|
+
? WebsocketService_1.TOKEN.access_token
|
|
6773
|
+
: null;
|
|
6716
6774
|
return `/topic/${tenant}/${token}/${domain}/${service}/${primitive}`;
|
|
6717
6775
|
}
|
|
6718
6776
|
/** @private */
|
|
6719
6777
|
getSubscriptionUrlWithoutToken(domain, service, primitive) {
|
|
6720
|
-
const tenant = WebsocketService_1.TOKEN
|
|
6778
|
+
const tenant = WebsocketService_1.TOKEN
|
|
6779
|
+
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
6780
|
+
: null;
|
|
6721
6781
|
return `/topic/${tenant}/${domain}/${service}/${primitive}`;
|
|
6722
6782
|
}
|
|
6723
6783
|
/** @private */
|
|
6724
6784
|
createStompSubscription(destination, primitiveManager) {
|
|
6725
6785
|
return this._stompClient.subscribe(destination, (message) => {
|
|
6726
|
-
const event = JSON.parse(message.body ||
|
|
6786
|
+
const event = JSON.parse(message.body || '{}');
|
|
6727
6787
|
primitiveManager.event$.next(event);
|
|
6728
6788
|
});
|
|
6729
6789
|
}
|
|
@@ -6766,22 +6826,20 @@ let WebsocketService = WebsocketService_1 = class WebsocketService {
|
|
|
6766
6826
|
return `${domain}/${service}/${primitive}`;
|
|
6767
6827
|
}
|
|
6768
6828
|
};
|
|
6769
|
-
/** @private */
|
|
6770
6829
|
WebsocketService.RECONNECT_INTERVAL = 3000;
|
|
6771
|
-
/** @private */
|
|
6772
6830
|
WebsocketService.CONNECTION_TIMEOUT = 15000;
|
|
6773
6831
|
/** @private */
|
|
6774
|
-
WebsocketService.BASE_URL_COOKIE =
|
|
6832
|
+
WebsocketService.BASE_URL_COOKIE = 'com.senior.base.url';
|
|
6775
6833
|
/** @private */
|
|
6776
|
-
WebsocketService.TOKEN_COOKIE =
|
|
6834
|
+
WebsocketService.TOKEN_COOKIE = 'com.senior.token';
|
|
6777
6835
|
/** @private */
|
|
6778
|
-
WebsocketService.TOKEN = JSON.parse(get(WebsocketService_1.TOKEN_COOKIE) ||
|
|
6836
|
+
WebsocketService.TOKEN = JSON.parse(get(WebsocketService_1.TOKEN_COOKIE) || '{}');
|
|
6779
6837
|
/** @private */
|
|
6780
|
-
WebsocketService.WEBSOCKET_URL = get(WebsocketService_1.BASE_URL_COOKIE) +
|
|
6838
|
+
WebsocketService.WEBSOCKET_URL = get(WebsocketService_1.BASE_URL_COOKIE) + '/websocket/';
|
|
6781
6839
|
WebsocketService.ɵprov = ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(); }, token: WebsocketService, providedIn: "root" });
|
|
6782
6840
|
WebsocketService = WebsocketService_1 = __decorate([
|
|
6783
6841
|
Injectable({
|
|
6784
|
-
providedIn:
|
|
6842
|
+
providedIn: 'root'
|
|
6785
6843
|
})
|
|
6786
6844
|
], WebsocketService);
|
|
6787
6845
|
|
|
@@ -6859,5 +6917,5 @@ var ModulesEnum;
|
|
|
6859
6917
|
* Generated bundle index. Do not edit.
|
|
6860
6918
|
*/
|
|
6861
6919
|
|
|
6862
|
-
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa,
|
|
6920
|
+
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EntityPersonProductLookup as ɵb, StorageService as ɵc, VerifyModulePermissionService as ɵd };
|
|
6863
6921
|
//# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map
|