@senior-gestao-empresarial/angular-components 4.20.4 → 4.22.0-c6f90211-2bfd-46c1-b41f-98ce3aba88b5
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 +175 -36
- 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/apuracao-foundation/parameters-lookup.d.ts +8 -0
- package/components/lookups/entities/apuracao-foundation/type-taxes-lookup.d.ts +8 -0
- package/components/lookups/index.d.ts +2 -0
- package/components/permissions/protocols/query-module.d.ts +1 -0
- package/components/permissions/verify-module-permission.d.ts +2 -1
- package/components/websocket/websocket.service.d.ts +6 -4
- package/esm2015/components/lookups/entities/apuracao-foundation/parameters-lookup.js +76 -0
- package/esm2015/components/lookups/entities/apuracao-foundation/type-taxes-lookup.js +52 -0
- package/esm2015/components/lookups/erp-lookups.module.js +6 -2
- package/esm2015/components/lookups/index.js +3 -1
- package/esm2015/components/permissions/protocols/query-module.js +1 -1
- package/esm2015/components/permissions/verify-module-permission.js +7 -5
- package/esm2015/components/websocket/websocket.service.js +33 -30
- package/esm5/components/lookups/entities/apuracao-foundation/parameters-lookup.js +79 -0
- package/esm5/components/lookups/entities/apuracao-foundation/type-taxes-lookup.js +55 -0
- package/esm5/components/lookups/erp-lookups.module.js +6 -2
- package/esm5/components/lookups/index.js +3 -1
- package/esm5/components/permissions/protocols/query-module.js +1 -1
- package/esm5/components/permissions/verify-module-permission.js +7 -5
- package/esm5/components/websocket/websocket.service.js +46 -33
- package/fesm2015/senior-gestao-empresarial-angular-components.js +156 -35
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +175 -38
- 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
|
@@ -5715,6 +5715,126 @@
|
|
|
5715
5715
|
return BankLookup;
|
|
5716
5716
|
}(ErpLookups));
|
|
5717
5717
|
|
|
5718
|
+
var TypeTaxesLookup = /** @class */ (function (_super) {
|
|
5719
|
+
__extends(TypeTaxesLookup, _super);
|
|
5720
|
+
function TypeTaxesLookup(lookupService, translate) {
|
|
5721
|
+
var _this = _super.call(this, lookupService, translate, "impostoTipo", [
|
|
5722
|
+
{
|
|
5723
|
+
name: "codigo",
|
|
5724
|
+
type: angularComponents.FieldType.Integer
|
|
5725
|
+
}, {
|
|
5726
|
+
name: "descricao",
|
|
5727
|
+
type: angularComponents.FieldType.String
|
|
5728
|
+
},
|
|
5729
|
+
], [
|
|
5730
|
+
{
|
|
5731
|
+
name: "codigo",
|
|
5732
|
+
type: angularComponents.FieldType.Integer
|
|
5733
|
+
}, {
|
|
5734
|
+
name: "descricao",
|
|
5735
|
+
type: angularComponents.FieldType.String
|
|
5736
|
+
}, {
|
|
5737
|
+
name: "chave",
|
|
5738
|
+
type: angularComponents.FieldType.String
|
|
5739
|
+
},
|
|
5740
|
+
], [
|
|
5741
|
+
{
|
|
5742
|
+
name: "codigo",
|
|
5743
|
+
type: angularComponents.FieldType.Integer
|
|
5744
|
+
}, {
|
|
5745
|
+
name: "descricao",
|
|
5746
|
+
type: angularComponents.FieldType.String
|
|
5747
|
+
}, {
|
|
5748
|
+
name: "chave",
|
|
5749
|
+
type: angularComponents.FieldType.String
|
|
5750
|
+
},
|
|
5751
|
+
], "erpx_cpl_tri", "apuracao_foundation") || this;
|
|
5752
|
+
_this.lookupService = lookupService;
|
|
5753
|
+
_this.translate = translate;
|
|
5754
|
+
return _this;
|
|
5755
|
+
}
|
|
5756
|
+
TypeTaxesLookup.ctorParameters = function () { return [
|
|
5757
|
+
{ type: ErpLookupsService },
|
|
5758
|
+
{ type: core$1.TranslateService }
|
|
5759
|
+
]; };
|
|
5760
|
+
TypeTaxesLookup = __decorate([
|
|
5761
|
+
core.Injectable()
|
|
5762
|
+
], TypeTaxesLookup);
|
|
5763
|
+
return TypeTaxesLookup;
|
|
5764
|
+
}(ErpLookups));
|
|
5765
|
+
|
|
5766
|
+
var ParametersLookup = /** @class */ (function (_super) {
|
|
5767
|
+
__extends(ParametersLookup, _super);
|
|
5768
|
+
function ParametersLookup(lookupService, translate) {
|
|
5769
|
+
var _this = _super.call(this, lookupService, translate, "parametros", [
|
|
5770
|
+
{
|
|
5771
|
+
name: "codigo",
|
|
5772
|
+
type: angularComponents.FieldType.Integer
|
|
5773
|
+
}, {
|
|
5774
|
+
name: "imposto",
|
|
5775
|
+
type: angularComponents.FieldType.Enum
|
|
5776
|
+
},
|
|
5777
|
+
], [
|
|
5778
|
+
{
|
|
5779
|
+
name: "codigo",
|
|
5780
|
+
type: angularComponents.FieldType.Integer
|
|
5781
|
+
}, {
|
|
5782
|
+
name: "imposto",
|
|
5783
|
+
type: angularComponents.FieldType.Enum,
|
|
5784
|
+
}, {
|
|
5785
|
+
name: "codigoArrecadacao",
|
|
5786
|
+
type: angularComponents.FieldType.String
|
|
5787
|
+
}, {
|
|
5788
|
+
name: "regimeControleRetencao",
|
|
5789
|
+
type: angularComponents.FieldType.Enum
|
|
5790
|
+
}, {
|
|
5791
|
+
name: "fornecedor",
|
|
5792
|
+
type: angularComponents.FieldType.String
|
|
5793
|
+
}, {
|
|
5794
|
+
name: "extIntSts",
|
|
5795
|
+
type: angularComponents.FieldType.String
|
|
5796
|
+
}, {
|
|
5797
|
+
name: "extIntMsg",
|
|
5798
|
+
type: angularComponents.FieldType.String
|
|
5799
|
+
},
|
|
5800
|
+
], [
|
|
5801
|
+
{
|
|
5802
|
+
name: "codigo",
|
|
5803
|
+
type: angularComponents.FieldType.Integer
|
|
5804
|
+
}, {
|
|
5805
|
+
name: "imposto",
|
|
5806
|
+
type: angularComponents.FieldType.Enum,
|
|
5807
|
+
}, {
|
|
5808
|
+
name: "codigoArrecadacao",
|
|
5809
|
+
type: angularComponents.FieldType.String
|
|
5810
|
+
}, {
|
|
5811
|
+
name: "regimeControleRetencao",
|
|
5812
|
+
type: angularComponents.FieldType.Enum
|
|
5813
|
+
}, {
|
|
5814
|
+
name: "fornecedor",
|
|
5815
|
+
type: angularComponents.FieldType.String
|
|
5816
|
+
}, {
|
|
5817
|
+
name: "extIntSts",
|
|
5818
|
+
type: angularComponents.FieldType.String
|
|
5819
|
+
}, {
|
|
5820
|
+
name: "extIntMsg",
|
|
5821
|
+
type: angularComponents.FieldType.String
|
|
5822
|
+
},
|
|
5823
|
+
], "erpx_cpl_imp", "guias_impostos") || this;
|
|
5824
|
+
_this.lookupService = lookupService;
|
|
5825
|
+
_this.translate = translate;
|
|
5826
|
+
return _this;
|
|
5827
|
+
}
|
|
5828
|
+
ParametersLookup.ctorParameters = function () { return [
|
|
5829
|
+
{ type: ErpLookupsService },
|
|
5830
|
+
{ type: core$1.TranslateService }
|
|
5831
|
+
]; };
|
|
5832
|
+
ParametersLookup = __decorate([
|
|
5833
|
+
core.Injectable()
|
|
5834
|
+
], ParametersLookup);
|
|
5835
|
+
return ParametersLookup;
|
|
5836
|
+
}(ErpLookups));
|
|
5837
|
+
|
|
5718
5838
|
var ErpLookupsModule = /** @class */ (function () {
|
|
5719
5839
|
function ErpLookupsModule() {
|
|
5720
5840
|
}
|
|
@@ -5817,7 +5937,9 @@
|
|
|
5817
5937
|
E048SfcLookup,
|
|
5818
5938
|
CurrencyLookup,
|
|
5819
5939
|
CountryLookup,
|
|
5820
|
-
BankLookup
|
|
5940
|
+
BankLookup,
|
|
5941
|
+
TypeTaxesLookup,
|
|
5942
|
+
ParametersLookup
|
|
5821
5943
|
],
|
|
5822
5944
|
declarations: [],
|
|
5823
5945
|
exports: [],
|
|
@@ -6495,7 +6617,6 @@
|
|
|
6495
6617
|
this.connected = false;
|
|
6496
6618
|
this.isConnecting = false;
|
|
6497
6619
|
this.stompSubscriptions = new Map();
|
|
6498
|
-
// private primitiveSubjects: Map<string, Subject<any>> = new Map<string, Subject<any>>();
|
|
6499
6620
|
this.primitiveManagers = new Map();
|
|
6500
6621
|
this.disconnectSubject = new rxjs.Subject();
|
|
6501
6622
|
this.connect$ = new rxjs.Subject();
|
|
@@ -6505,7 +6626,7 @@
|
|
|
6505
6626
|
}
|
|
6506
6627
|
WebsocketService_1 = WebsocketService;
|
|
6507
6628
|
/**
|
|
6508
|
-
* Observable
|
|
6629
|
+
* Observable responsável por emitir uma notificação quando a conexão websocket é estabelecida.
|
|
6509
6630
|
* @return Um `Observable<void>` que emite uma notificação quando a conexão websocket é estabelecida ou já está em andamento.
|
|
6510
6631
|
*/
|
|
6511
6632
|
WebsocketService.prototype.onConnect = function () {
|
|
@@ -6518,7 +6639,7 @@
|
|
|
6518
6639
|
return this.connect$.asObservable();
|
|
6519
6640
|
};
|
|
6520
6641
|
/**
|
|
6521
|
-
* Observable
|
|
6642
|
+
* Observable responsável por emitir uma notificação quando a conexão é finalizada.
|
|
6522
6643
|
* @return Um `Observable<void>` que emite uma notificação quando a conexão é finalizada.
|
|
6523
6644
|
*/
|
|
6524
6645
|
WebsocketService.prototype.onDisconnect = function () {
|
|
@@ -6545,14 +6666,7 @@
|
|
|
6545
6666
|
publishedEvents: [],
|
|
6546
6667
|
};
|
|
6547
6668
|
if (this.isConnected()) {
|
|
6548
|
-
|
|
6549
|
-
this.primitiveManagers.set(primitive, primitiveManager);
|
|
6550
|
-
var stompSubscription = this._stompClient.subscribe(url, function (message) {
|
|
6551
|
-
var event = JSON.parse(message.body || "{}");
|
|
6552
|
-
_this.addPublishedEvent(primitiveManager, event);
|
|
6553
|
-
primitiveManager.subject.next(event);
|
|
6554
|
-
});
|
|
6555
|
-
this.stompSubscriptions.set(primitive, stompSubscription);
|
|
6669
|
+
this.createStompSubscriptions(domain, service, primitive, primitiveManager);
|
|
6556
6670
|
return primitiveManager.subject.asObservable();
|
|
6557
6671
|
}
|
|
6558
6672
|
else {
|
|
@@ -6560,22 +6674,15 @@
|
|
|
6560
6674
|
this.connect();
|
|
6561
6675
|
}
|
|
6562
6676
|
this.onConnect()
|
|
6563
|
-
.pipe(operators.
|
|
6677
|
+
.pipe(operators.first())
|
|
6564
6678
|
.subscribe(function () {
|
|
6565
|
-
|
|
6566
|
-
_this.primitiveManagers.set(primitive, primitiveManager);
|
|
6567
|
-
var stompSubscription = _this._stompClient.subscribe(url, function (message) {
|
|
6568
|
-
var event = JSON.parse(message.body || "{}");
|
|
6569
|
-
_this.addPublishedEvent(primitiveManager, event);
|
|
6570
|
-
primitiveManager.subject.next(event);
|
|
6571
|
-
});
|
|
6572
|
-
_this.stompSubscriptions.set(primitive, stompSubscription);
|
|
6679
|
+
_this.createStompSubscriptions(domain, service, primitive, primitiveManager);
|
|
6573
6680
|
});
|
|
6574
6681
|
return primitiveManager.subject.asObservable();
|
|
6575
6682
|
}
|
|
6576
6683
|
};
|
|
6577
6684
|
/**
|
|
6578
|
-
* Retorna todos os eventos ouvidos
|
|
6685
|
+
* Retorna todos os eventos ouvidos pela primitiva com os respectivos identificadores.
|
|
6579
6686
|
* @typeParam `<T>` Tipo do evento retornado pela primitiva.
|
|
6580
6687
|
* @param primitive Primitiva que será "observada" pelo client.
|
|
6581
6688
|
* @param identifiers Array com os indentificadores interessados.
|
|
@@ -6610,9 +6717,7 @@
|
|
|
6610
6717
|
WebsocketService.prototype.addPublishedEvent = function (primitiveManager, event) {
|
|
6611
6718
|
var _this = this;
|
|
6612
6719
|
var identifier = this.getIdentifierFromEvent(primitiveManager.identifierPath, event);
|
|
6613
|
-
var eventIndex = primitiveManager.publishedEvents.findIndex(function (x) {
|
|
6614
|
-
return _this.getIdentifierFromEvent(primitiveManager.identifierPath, x) === identifier;
|
|
6615
|
-
});
|
|
6720
|
+
var eventIndex = primitiveManager.publishedEvents.findIndex(function (x) { return _this.getIdentifierFromEvent(primitiveManager.identifierPath, x) === identifier; });
|
|
6616
6721
|
if (eventIndex !== -1) {
|
|
6617
6722
|
primitiveManager.publishedEvents[eventIndex] = __assign(__assign({}, primitiveManager.publishedEvents[eventIndex]), event);
|
|
6618
6723
|
}
|
|
@@ -6620,6 +6725,23 @@
|
|
|
6620
6725
|
primitiveManager.publishedEvents.push(event);
|
|
6621
6726
|
}
|
|
6622
6727
|
};
|
|
6728
|
+
WebsocketService.prototype.createStompSubscriptions = function (domain, service, primitive, primitiveManager) {
|
|
6729
|
+
var _this = this;
|
|
6730
|
+
var withUserUrl = this.getSubscriptionWithUserUrl(domain, service, primitive);
|
|
6731
|
+
this.primitiveManagers.set(primitive, primitiveManager);
|
|
6732
|
+
var stompSubscriptionWithUser = this._stompClient.subscribe(withUserUrl, function (message) {
|
|
6733
|
+
var event = JSON.parse(message.body || "{}");
|
|
6734
|
+
_this.addPublishedEvent(primitiveManager, event);
|
|
6735
|
+
primitiveManager.subject.next(event);
|
|
6736
|
+
});
|
|
6737
|
+
var withoutUserUrl = this.getSubscriptionWithoutUserUrl(domain, service, primitive);
|
|
6738
|
+
var stompSubscriptionWithoutUser = this._stompClient.subscribe(withoutUserUrl, function (message) {
|
|
6739
|
+
var event = JSON.parse(message.body || "{}");
|
|
6740
|
+
_this.addPublishedEvent(primitiveManager, event);
|
|
6741
|
+
primitiveManager.subject.next(event);
|
|
6742
|
+
});
|
|
6743
|
+
this.stompSubscriptions.set(primitive, [stompSubscriptionWithUser, stompSubscriptionWithoutUser]);
|
|
6744
|
+
};
|
|
6623
6745
|
WebsocketService.prototype.getIdentifierFromEvent = function (identifierPath, event) {
|
|
6624
6746
|
var e_2, _a;
|
|
6625
6747
|
var properties = identifierPath.split(".");
|
|
@@ -6645,9 +6767,7 @@
|
|
|
6645
6767
|
this.isConnecting = true;
|
|
6646
6768
|
this._stompClient.connect({}, function () {
|
|
6647
6769
|
_this.setConnected(true);
|
|
6648
|
-
// console.log('setou false isConnecting');
|
|
6649
6770
|
_this.isConnecting = false;
|
|
6650
|
-
// console.log('connectou dentro do connect cb');
|
|
6651
6771
|
_this.publishOnConnect();
|
|
6652
6772
|
}, function () {
|
|
6653
6773
|
_this.setConnected(false);
|
|
@@ -6681,8 +6801,21 @@
|
|
|
6681
6801
|
finally { if (e_3) throw e_3.error; }
|
|
6682
6802
|
}
|
|
6683
6803
|
if (observersCount === 0) {
|
|
6684
|
-
this.stompSubscriptions.forEach(function (
|
|
6685
|
-
|
|
6804
|
+
this.stompSubscriptions.forEach(function (stompSubscriptions) {
|
|
6805
|
+
var e_5, _a;
|
|
6806
|
+
try {
|
|
6807
|
+
for (var stompSubscriptions_1 = __values(stompSubscriptions), stompSubscriptions_1_1 = stompSubscriptions_1.next(); !stompSubscriptions_1_1.done; stompSubscriptions_1_1 = stompSubscriptions_1.next()) {
|
|
6808
|
+
var stompSubscription = stompSubscriptions_1_1.value;
|
|
6809
|
+
stompSubscription.unsubscribe();
|
|
6810
|
+
}
|
|
6811
|
+
}
|
|
6812
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
6813
|
+
finally {
|
|
6814
|
+
try {
|
|
6815
|
+
if (stompSubscriptions_1_1 && !stompSubscriptions_1_1.done && (_a = stompSubscriptions_1.return)) _a.call(stompSubscriptions_1);
|
|
6816
|
+
}
|
|
6817
|
+
finally { if (e_5) throw e_5.error; }
|
|
6818
|
+
}
|
|
6686
6819
|
});
|
|
6687
6820
|
try {
|
|
6688
6821
|
for (var _e = __values(this.primitiveManagers.values()), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
@@ -6712,11 +6845,15 @@
|
|
|
6712
6845
|
WebsocketService.prototype.setConnected = function (connected) {
|
|
6713
6846
|
this.connected = connected;
|
|
6714
6847
|
};
|
|
6715
|
-
WebsocketService.prototype.
|
|
6848
|
+
WebsocketService.prototype.getSubscriptionWithUserUrl = function (domain, service, primitive) {
|
|
6716
6849
|
var tenant = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.username.split("@")[1] : null;
|
|
6717
6850
|
var token = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.access_token : null;
|
|
6718
6851
|
return "/topic/" + tenant + "/" + token + "/" + domain + "/" + service + "/" + primitive;
|
|
6719
6852
|
};
|
|
6853
|
+
WebsocketService.prototype.getSubscriptionWithoutUserUrl = function (domain, service, primitive) {
|
|
6854
|
+
var tenant = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.username.split("@")[1] : null;
|
|
6855
|
+
return "/topic/" + tenant + "/" + domain + "/" + service + "/" + primitive;
|
|
6856
|
+
};
|
|
6720
6857
|
WebsocketService.prototype.createStompClient = function () {
|
|
6721
6858
|
var ws = new SockJS(WebsocketService_1.WEBSOCKET_URL + "subscription", null, { timeout: WebsocketService_1.CONNECTION_TIMEOUT });
|
|
6722
6859
|
this._stompClient = stompjs.Stomp.over(ws);
|
|
@@ -6734,12 +6871,10 @@
|
|
|
6734
6871
|
this._stompClient.disconnect();
|
|
6735
6872
|
var baseUrl = this.getBaseUrl();
|
|
6736
6873
|
if (this.baseUrl !== null && baseUrl != this.baseUrl) {
|
|
6737
|
-
// //console.log('ws disconnected: base url changed', this.baseUrl, ' -> ', baseUrl || 'null');
|
|
6738
6874
|
return;
|
|
6739
6875
|
}
|
|
6740
6876
|
var username = this.getUserName();
|
|
6741
6877
|
if (this.username !== null && username != this.username) {
|
|
6742
|
-
// //console.log('ws disconnected: username changed', this.username, ' -> ', username || 'null');
|
|
6743
6878
|
return;
|
|
6744
6879
|
}
|
|
6745
6880
|
setTimeout(function () {
|
|
@@ -6800,18 +6935,20 @@
|
|
|
6800
6935
|
/**
|
|
6801
6936
|
* Method to verify if user has permission on a specific module
|
|
6802
6937
|
* @param module Module to verify the permission
|
|
6938
|
+
* @param requestPermission Indicative if must be call the primitive
|
|
6803
6939
|
* @returns An boolean Observable
|
|
6804
6940
|
*/
|
|
6805
|
-
VerifyModulePermission.prototype.hasPermission = function (module) {
|
|
6941
|
+
VerifyModulePermission.prototype.hasPermission = function (module, requestPermission) {
|
|
6806
6942
|
var moduleSubject = VerifyModulePermission_1.subjectsPerModuleMap.get(module);
|
|
6807
|
-
if (!moduleSubject) {
|
|
6943
|
+
if (!moduleSubject || requestPermission) {
|
|
6808
6944
|
var newModuleSubject_1 = new rxjs.ReplaySubject(1);
|
|
6809
6945
|
VerifyModulePermission_1.subjectsPerModuleMap.set(module, newModuleSubject_1);
|
|
6810
6946
|
this.verifyModulePermissionService
|
|
6811
|
-
.queryModule({ modulo: module })
|
|
6947
|
+
.queryModule({ modulo: module, somenteAtivo: true })
|
|
6812
6948
|
.pipe(operators.take(1))
|
|
6813
6949
|
.subscribe(function (response) {
|
|
6814
|
-
var
|
|
6950
|
+
var _a;
|
|
6951
|
+
var hasPermission = ((_a = response === null || response === void 0 ? void 0 : response.modulos) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
6815
6952
|
newModuleSubject_1.next(hasPermission);
|
|
6816
6953
|
}, function (err) {
|
|
6817
6954
|
VerifyModulePermission_1.subjectsPerModuleMap.delete(module);
|
|
@@ -6940,9 +7077,11 @@
|
|
|
6940
7077
|
exports.LookupValidationUtils = LookupValidationUtils;
|
|
6941
7078
|
exports.NcmLookup = NcmLookup;
|
|
6942
7079
|
exports.NpsService = NpsService;
|
|
7080
|
+
exports.ParametersLookup = ParametersLookup;
|
|
6943
7081
|
exports.ProdutoServicoLookup = ProdutoServicoLookup;
|
|
6944
7082
|
exports.QuantidadeDisponivelDemandaLookup = QuantidadeDisponivelDemandaLookup;
|
|
6945
7083
|
exports.RequisicaoLookup = RequisicaoLookup;
|
|
7084
|
+
exports.TypeTaxesLookup = TypeTaxesLookup;
|
|
6946
7085
|
exports.UnidadeMedidaLookup = UnidadeMedidaLookup;
|
|
6947
7086
|
exports.UtilsModule = UtilsModule;
|
|
6948
7087
|
exports.VerifyModulePermission = VerifyModulePermission;
|