@senior-gestao-empresarial/angular-components 6.11.5-f1ae0f56-eaa0-41bd-bf14-efca8153a452 → 6.12.0

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.
Files changed (22) hide show
  1. package/bundles/senior-gestao-empresarial-angular-components.umd.js +69 -0
  2. package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
  4. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
  5. package/components/permissions/index.d.ts +1 -0
  6. package/components/permissions/verify-module-permissions-service.d.ts +18 -0
  7. package/components/permissions/verify-module-permissions.d.ts +16 -0
  8. package/esm2015/components/permissions/index.js +2 -1
  9. package/esm2015/components/permissions/verify-module-permissions-service.js +26 -0
  10. package/esm2015/components/permissions/verify-module-permissions.js +51 -0
  11. package/esm2015/senior-gestao-empresarial-angular-components.js +2 -1
  12. package/esm5/components/permissions/index.js +2 -1
  13. package/esm5/components/permissions/verify-module-permissions-service.js +28 -0
  14. package/esm5/components/permissions/verify-module-permissions.js +53 -0
  15. package/esm5/senior-gestao-empresarial-angular-components.js +2 -1
  16. package/fesm2015/senior-gestao-empresarial-angular-components.js +64 -1
  17. package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
  18. package/fesm5/senior-gestao-empresarial-angular-components.js +68 -1
  19. package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
  20. package/package.json +1 -1
  21. package/senior-gestao-empresarial-angular-components.d.ts +1 -0
  22. package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
@@ -7595,6 +7595,73 @@ var VerifyModulePermission = /** @class */ (function () {
7595
7595
  return VerifyModulePermission;
7596
7596
  }());
7597
7597
 
7598
+ var VerifyModulePermissionsService = /** @class */ (function () {
7599
+ function VerifyModulePermissionsService(http) {
7600
+ this.http = http;
7601
+ }
7602
+ VerifyModulePermissionsService_1 = VerifyModulePermissionsService;
7603
+ VerifyModulePermissionsService.prototype.consultaModulos = function (request) {
7604
+ return this.http.post(VerifyModulePermissionsService_1.QUERY_MODULES_URL, request);
7605
+ };
7606
+ var VerifyModulePermissionsService_1;
7607
+ VerifyModulePermissionsService.QUERY_MODULES_URL = "erpx_fnd/empresa/queries/consultaModulos";
7608
+ VerifyModulePermissionsService.ctorParameters = function () { return [
7609
+ { type: HttpClient }
7610
+ ]; };
7611
+ VerifyModulePermissionsService.ɵprov = ɵɵdefineInjectable({ factory: function VerifyModulePermissionsService_Factory() { return new VerifyModulePermissionsService(ɵɵinject(HttpClient)); }, token: VerifyModulePermissionsService, providedIn: "any" });
7612
+ VerifyModulePermissionsService = VerifyModulePermissionsService_1 = __decorate([
7613
+ Injectable({
7614
+ providedIn: "any"
7615
+ })
7616
+ ], VerifyModulePermissionsService);
7617
+ return VerifyModulePermissionsService;
7618
+ }());
7619
+
7620
+ var VerifyModulePermissions = /** @class */ (function () {
7621
+ function VerifyModulePermissions(verifyModulePermissionsService) {
7622
+ this.verifyModulePermissionsService = verifyModulePermissionsService;
7623
+ }
7624
+ VerifyModulePermissions_1 = VerifyModulePermissions;
7625
+ /**
7626
+ * Method to verify if user has permission on a specific module
7627
+ * @param modules Modules to verify the permission
7628
+ * @param requestPermission Indicative if must be call the primitive
7629
+ * @returns An boolean Observable
7630
+ */
7631
+ VerifyModulePermissions.prototype.hasPermissions = function (modules, requestPermission) {
7632
+ var moduleSubject = VerifyModulePermissions_1.subjectsPerModuleMap.get(modules);
7633
+ if (!moduleSubject || requestPermission) {
7634
+ var newModuleSubject_1 = new ReplaySubject(1);
7635
+ VerifyModulePermissions_1.subjectsPerModuleMap.set(modules, newModuleSubject_1);
7636
+ this.verifyModulePermissionsService
7637
+ .consultaModulos({ modulo: modules, somenteAtivo: true })
7638
+ .pipe(take(1))
7639
+ .subscribe(function (response) {
7640
+ var hasPermissions = (response === null || response === void 0 ? void 0 : response.modulos) || [];
7641
+ newModuleSubject_1.next(hasPermissions);
7642
+ }, function (err) {
7643
+ VerifyModulePermissions_1.subjectsPerModuleMap.delete(modules);
7644
+ newModuleSubject_1.error(err);
7645
+ newModuleSubject_1.unsubscribe();
7646
+ });
7647
+ return newModuleSubject_1.asObservable();
7648
+ }
7649
+ return moduleSubject.asObservable();
7650
+ };
7651
+ var VerifyModulePermissions_1;
7652
+ VerifyModulePermissions.ctorParameters = function () { return [
7653
+ { type: VerifyModulePermissionsService }
7654
+ ]; };
7655
+ VerifyModulePermissions.subjectsPerModuleMap = new Map();
7656
+ VerifyModulePermissions.ɵprov = ɵɵdefineInjectable({ factory: function VerifyModulePermissions_Factory() { return new VerifyModulePermissions(ɵɵinject(VerifyModulePermissionsService)); }, token: VerifyModulePermissions, providedIn: "root" });
7657
+ VerifyModulePermissions = VerifyModulePermissions_1 = __decorate([
7658
+ Injectable({
7659
+ providedIn: "root"
7660
+ })
7661
+ ], VerifyModulePermissions);
7662
+ return VerifyModulePermissions;
7663
+ }());
7664
+
7598
7665
  var ModulesEnum;
7599
7666
  (function (ModulesEnum) {
7600
7667
  ModulesEnum["CONTROLADORIA"] = "CONTROLADORIA";
@@ -7613,5 +7680,5 @@ var ModulesEnum;
7613
7680
  * Generated bundle index. Do not edit.
7614
7681
  */
7615
7682
 
7616
- export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, 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, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, 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, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd, VerifyModulePermissionService as ɵe };
7683
+ export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, 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, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, 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, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd, VerifyModulePermissionService as ɵe, VerifyModulePermissionsService as ɵf };
7617
7684
  //# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map