ngx-sp-auth 4.1.1 → 4.1.3
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/fesm2022/ngx-sp-auth.mjs +140 -27
- package/fesm2022/ngx-sp-auth.mjs.map +1 -1
- package/lib/components/error-menu-not-allowed/error-menu-not-allowed.component.d.ts +11 -0
- package/lib/components/menu-lateral/menu-services.service.d.ts +4 -0
- package/lib/components/menu-lateral/model/ret-is-menu-allowed.d.ts +6 -0
- package/lib/guards/is-menu-allowed-guard.d.ts +16 -0
- package/lib/widgets/sub-menu/list/list.component.d.ts +4 -6
- package/lib/widgets/sub-menu/nav-tabs/nav-tabs.component.d.ts +7 -4
- package/lib/widgets/sub-menu/sub-menu.component.d.ts +6 -4
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
package/fesm2022/ngx-sp-auth.mjs
CHANGED
|
@@ -1388,6 +1388,23 @@ class MenuServicesService {
|
|
|
1388
1388
|
}));
|
|
1389
1389
|
}
|
|
1390
1390
|
// #endregion Menu: Version
|
|
1391
|
+
// #region Menu: IsMenuAllowed
|
|
1392
|
+
/** Método executado para validar a permissão de acesso a uma opção do menu
|
|
1393
|
+
*/
|
|
1394
|
+
isMenuAllowed(route) {
|
|
1395
|
+
const params = new HttpParams()
|
|
1396
|
+
.set('route', route);
|
|
1397
|
+
const headers = new HttpHeaders().set("Content-Type", "application/json");
|
|
1398
|
+
const url = `${this._BASE_URL}/Menu/IsMenuAllowed`;
|
|
1399
|
+
return this._httpClient
|
|
1400
|
+
.get(url, { 'params': params, headers: headers })
|
|
1401
|
+
.pipe(take(1), tap((response) => {
|
|
1402
|
+
if (response.Error) {
|
|
1403
|
+
throw Error(response.ErrorMessage);
|
|
1404
|
+
}
|
|
1405
|
+
}));
|
|
1406
|
+
}
|
|
1407
|
+
// #endregion Menu: IsMenuAllowed
|
|
1391
1408
|
// #endregion GET
|
|
1392
1409
|
// #region UPDATE
|
|
1393
1410
|
// #region Menu: Usuário
|
|
@@ -1908,7 +1925,7 @@ class LoginComponent {
|
|
|
1908
1925
|
//Incialização de Senha
|
|
1909
1926
|
if (response.InitializePassword) {
|
|
1910
1927
|
let param = btoa(`true$${this.dominio}$${this.usuario}$${response.StatusSenha}`);
|
|
1911
|
-
this._router.navigate([`auth/login
|
|
1928
|
+
this._router.navigate([`auth/login/${param}`]);
|
|
1912
1929
|
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1913
1930
|
}
|
|
1914
1931
|
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
@@ -1954,7 +1971,7 @@ class LoginComponent {
|
|
|
1954
1971
|
//Incialização de Senha
|
|
1955
1972
|
if (response.InitializePassword) {
|
|
1956
1973
|
let param = btoa(`true$${this.dominio}$${this.usuarioAzure}$${response.StatusSenha}`);
|
|
1957
|
-
this._router.navigate([`auth/login
|
|
1974
|
+
this._router.navigate([`auth/login/${param}`]);
|
|
1958
1975
|
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1959
1976
|
}
|
|
1960
1977
|
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
@@ -3311,6 +3328,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3311
3328
|
], preserveWhitespaces: true, template: "<body>\n<div id=\"main-container\">\n\t<!-- #region MAIN CONTENT -->\n\t<div class=\"glb-main-container password-container\">\n\t\t<div class=\"password-info-container\">\n\t\t\t<div class=\"img mb-3\">\n\t\t\t\t<img [src]=\"statusSenha == 2 ? calendarioImg : statusSenha == 1 ? maoImg : statusSenha == 3 ? cadeadoImg : '' \" width=\"125.69\" height=\"122\">\n\t\t\t</div>\n\t\t\t<div class=\"text\">\n\t\t\t\t<h4>{{statusSenha == 2 ? 'Senha expirada' : statusSenha == 1 ? 'Primeiro acesso' : statusSenha == 3 ? 'Esqueceu sua senha?' : ''}}</h4>\n\t\t\t\t<p [innerHTML]=\"statusSenha == 2 ? senhaExpiradaText : statusSenha == 1 ? primeiroAcessoText : statusSenha == 3 ? esqueceuSenhaText : '' \"></p>\n\t\t\t</div>\n\t\t</div>\n\t\t<form [formGroup]=\"form\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputCode\" class=\"form-label\"> C\u00F3digo de valida\u00E7\u00E3o <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"text\" placeholder=\"Insira seu c\u00F3digo aqui...\" id=\"inputCode\" class=\"form-control\" formControlName=\"code\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('code'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('code')\" label=\"C\u00F3digo de valida\u00E7\u00E3o\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputPassword\" class=\"form-label\"> Digite uma nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite sua nova senha...\" id=\"inputPassword\" class=\"form-control\" formControlName=\"password\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('password'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('password')\" label=\"{{ passwordLabel }}\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputConfirmPassword\" class=\"form-label\"> Confirme sua nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite a senha novamente...\" id=\"inputConfirmPassword\" class=\"form-control\" formControlName=\"confirmPassword\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('confirmPassword'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('confirmPassword')\" label=\"Confirme sua Senha\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t\t<div class=\"btns\">\n\t\t\t\t\t<button [libLoading]=\"isLoading\" loadingText=\"Redefinindo...\" [disabled]=\"isLoading\" (click)=\"sendPassword()\" type=\"button\" class=\"btn btn-primary col w-100\">\n\t\t\t\t\t\tRedefinir senha <lib-icon iconName=\"login\" />\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t<a type=\"button\" class=\"fw-bold text-decoration-none text-secondary\" (click)=\"cancelar()\">\n\t\t\t\t\t\t\t<lib-icon iconName=\"p-seta-esquerda\" /> Voltar para a tela de login </a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t</form>\n\t</div>\n\t<!-- #endregion MAIN CONTENT -->\n</div>\n</body>\n", styles: ["body{background-color:#f5f5f5;height:100%!important;margin:0!important;padding:0!important}#main-container{display:flex;align-items:center;justify-content:center;height:100%}.password-container{padding:30px;width:37%;border:none;box-shadow:0 2px -1px #0000001a}.img{width:26%}.text{display:flex;flex-direction:column;align-items:flex-start;margin-left:auto}.text h4{font-weight:700}.text p{text-align:start}.password-info-container{display:flex;gap:15px}.btns{display:flex;flex-direction:column;align-items:center;width:100%}input::placeholder{color:#8d8d8d;font-size:15px}.icon{margin-right:5px;font-weight:700}\n"] }]
|
|
3312
3329
|
}], ctorParameters: () => [{ type: i3$1.FormBuilder }, { type: ProjectUtilservice }, { type: i3.MessageService }, { type: AuthService }, { type: AuthStorageService }, { type: i8.Title }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }] });
|
|
3313
3330
|
|
|
3331
|
+
class ErrorMenuNotAllowed {
|
|
3332
|
+
constructor(router, authStorageService) {
|
|
3333
|
+
this.router = router;
|
|
3334
|
+
this.authStorageService = authStorageService;
|
|
3335
|
+
}
|
|
3336
|
+
onHome() {
|
|
3337
|
+
this.router.navigate(["/home"]);
|
|
3338
|
+
}
|
|
3339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ErrorMenuNotAllowed, deps: [{ token: i1$1.Router }, { token: AuthStorageService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3340
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ErrorMenuNotAllowed, isStandalone: true, selector: "app-menu-not-allowed", ngImport: i0, template: " <div class=\"content\">\n <div class=\"image mb-4\">\n <lib-icon iconName=\"cadeado\" [iconSize]=\"128\" />\n </div>\n <h1 class=\"tittle\">Voc\u00EA n\u00E3o possui permiss\u00E3o para acessar esta tela!</h1>\n <button *ngIf=\"!this.authStorageService.isExternalLogin\" class=\"btn button mt-3\" (click)=\"onHome()\">\n Voltar para a tela inicial\n </button>\n </div>\n", styles: [".content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100vw;height:100vh}.image{text-align:center;display:block}.tittle{font-family:Open Sans;font-style:normal;font-weight:700;font-size:48px;line-height:65px;text-align:center;color:#212529}.sub-tittle{font-family:Open Sans;font-style:normal;font-weight:400;font-size:16px;line-height:22px;width:600px;text-align:center;color:#212529}.button{background:#0d6efd;border-radius:4px;font-family:Open Sans;font-style:normal;font-weight:400;font-size:16px;line-height:22px;color:#fff}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }], preserveWhitespaces: true }); }
|
|
3341
|
+
}
|
|
3342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ErrorMenuNotAllowed, decorators: [{
|
|
3343
|
+
type: Component,
|
|
3344
|
+
args: [{ selector: 'app-menu-not-allowed', preserveWhitespaces: true, imports: [
|
|
3345
|
+
NgIf,
|
|
3346
|
+
InfraModule
|
|
3347
|
+
], template: " <div class=\"content\">\n <div class=\"image mb-4\">\n <lib-icon iconName=\"cadeado\" [iconSize]=\"128\" />\n </div>\n <h1 class=\"tittle\">Voc\u00EA n\u00E3o possui permiss\u00E3o para acessar esta tela!</h1>\n <button *ngIf=\"!this.authStorageService.isExternalLogin\" class=\"btn button mt-3\" (click)=\"onHome()\">\n Voltar para a tela inicial\n </button>\n </div>\n", styles: [".content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100vw;height:100vh}.image{text-align:center;display:block}.tittle{font-family:Open Sans;font-style:normal;font-weight:700;font-size:48px;line-height:65px;text-align:center;color:#212529}.sub-tittle{font-family:Open Sans;font-style:normal;font-weight:400;font-size:16px;line-height:22px;width:600px;text-align:center;color:#212529}.button{background:#0d6efd;border-radius:4px;font-family:Open Sans;font-style:normal;font-weight:400;font-size:16px;line-height:22px;color:#fff}\n"] }]
|
|
3348
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthStorageService }] });
|
|
3349
|
+
|
|
3314
3350
|
class IMenu {
|
|
3315
3351
|
constructor() {
|
|
3316
3352
|
this.ID = 0;
|
|
@@ -3554,6 +3590,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3554
3590
|
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthService }] });
|
|
3555
3591
|
;
|
|
3556
3592
|
|
|
3593
|
+
class IsMenuAllowedlGuard {
|
|
3594
|
+
constructor(router, _menuService) {
|
|
3595
|
+
this.router = router;
|
|
3596
|
+
this._menuService = _menuService;
|
|
3597
|
+
}
|
|
3598
|
+
canActivate(_route, _state) {
|
|
3599
|
+
let route = _route.routeConfig?.path === undefined ? "" : _route.routeConfig?.path;
|
|
3600
|
+
return this.isMenuAllowedGuard(route);
|
|
3601
|
+
}
|
|
3602
|
+
navigateToError() {
|
|
3603
|
+
let notAllowed = this.router.parseUrl("/error-menu-not-allowed");
|
|
3604
|
+
return notAllowed;
|
|
3605
|
+
}
|
|
3606
|
+
// Valida a permissão do Menu
|
|
3607
|
+
async isMenuAllowedGuard(route) {
|
|
3608
|
+
const menuAllowed = await this.handleIsMenuAllowed(route);
|
|
3609
|
+
if (!menuAllowed) {
|
|
3610
|
+
return this.navigateToError();
|
|
3611
|
+
}
|
|
3612
|
+
return menuAllowed;
|
|
3613
|
+
}
|
|
3614
|
+
// Handle para ver se o menu é permitido.
|
|
3615
|
+
async handleIsMenuAllowed(route) {
|
|
3616
|
+
try {
|
|
3617
|
+
let response = false;
|
|
3618
|
+
await this.IsMenuAllowed(route)
|
|
3619
|
+
.then(res => {
|
|
3620
|
+
response = res;
|
|
3621
|
+
return response;
|
|
3622
|
+
})
|
|
3623
|
+
.catch(err => {
|
|
3624
|
+
throw new Error(err);
|
|
3625
|
+
});
|
|
3626
|
+
return response;
|
|
3627
|
+
}
|
|
3628
|
+
catch (error) {
|
|
3629
|
+
return false;
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3632
|
+
// Retorna se o menu é permitido.
|
|
3633
|
+
IsMenuAllowed(route) {
|
|
3634
|
+
return new Promise((resolve, reject) => {
|
|
3635
|
+
this._menuService.isMenuAllowed(route).subscribe({
|
|
3636
|
+
next: response => {
|
|
3637
|
+
resolve(response.IsMenuAllowed);
|
|
3638
|
+
},
|
|
3639
|
+
error: error => {
|
|
3640
|
+
reject(error);
|
|
3641
|
+
}
|
|
3642
|
+
});
|
|
3643
|
+
});
|
|
3644
|
+
}
|
|
3645
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IsMenuAllowedlGuard, deps: [{ token: i1$1.Router }, { token: MenuServicesService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3646
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IsMenuAllowedlGuard, providedIn: 'root' }); }
|
|
3647
|
+
}
|
|
3648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IsMenuAllowedlGuard, decorators: [{
|
|
3649
|
+
type: Injectable,
|
|
3650
|
+
args: [{ providedIn: 'root' }]
|
|
3651
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: MenuServicesService }] });
|
|
3652
|
+
|
|
3557
3653
|
/**
|
|
3558
3654
|
* \brief Intercepta uma chamada HTTP para inserir o usuário logado no header em conjunto
|
|
3559
3655
|
* com o login para uso da API.
|
|
@@ -3711,26 +3807,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3711
3807
|
}] } });
|
|
3712
3808
|
|
|
3713
3809
|
class ListComponent {
|
|
3714
|
-
/**
|
|
3715
|
-
*
|
|
3716
|
-
*/
|
|
3717
3810
|
constructor() {
|
|
3718
3811
|
this.telasItem = [];
|
|
3719
|
-
this.hostName =
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
return `${this.hostName}/${url}`;
|
|
3812
|
+
this.hostName = '';
|
|
3813
|
+
this.onTelaSelecionada = new EventEmitter();
|
|
3814
|
+
this.getExternalUrl = (url) => { return `${this.hostName}/${url}`; };
|
|
3723
3815
|
}
|
|
3724
3816
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3725
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ListComponent, isStandalone: true, selector: "app-list", inputs: { telasItem: "telasItem", hostName: "hostName" }, ngImport: i0, template: "<ul class=\"nav flex-column mt-3\">\n @if(telasItem.length) {\n @for(clickLink of telasItem; track $index) {\n <li class=\"nav-item\">\n <a class=\"nav-link\" [target]=\"clickLink.IsExternal ? '_blank' : '_self'\"\n
|
|
3817
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ListComponent, isStandalone: true, selector: "app-list", inputs: { telasItem: "telasItem", hostName: "hostName" }, outputs: { onTelaSelecionada: "onTelaSelecionada" }, ngImport: i0, template: "<ul class=\"nav flex-column mt-3\">\n @if(telasItem.length) {\n @for(clickLink of telasItem; track $index) {\n <li class=\"nav-item\">\n <a class=\"nav-link\" [target]=\"clickLink.IsExternal ? '_blank' : '_self'\" (click)=\"onTelaSelecionada.emit(clickLink.titulo)\"\n [href]=\"clickLink.IsExternal\n ? getExternalUrl(clickLink.urlPath)\n : '/SisproErpCloud/' + clickLink.urlPath\" >\n {{ clickLink.titulo }}\n </a>\n </li>\n }\n }\n</ul>\n", styles: ["a{color:#3e5154}\n"] }); }
|
|
3726
3818
|
}
|
|
3727
3819
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ListComponent, decorators: [{
|
|
3728
3820
|
type: Component,
|
|
3729
|
-
args: [{ selector: 'app-list', imports: [], standalone: true, template: "<ul class=\"nav flex-column mt-3\">\n @if(telasItem.length) {\n @for(clickLink of telasItem; track $index) {\n <li class=\"nav-item\">\n <a class=\"nav-link\" [target]=\"clickLink.IsExternal ? '_blank' : '_self'\"\n
|
|
3730
|
-
}],
|
|
3821
|
+
args: [{ selector: 'app-list', imports: [], standalone: true, template: "<ul class=\"nav flex-column mt-3\">\n @if(telasItem.length) {\n @for(clickLink of telasItem; track $index) {\n <li class=\"nav-item\">\n <a class=\"nav-link\" [target]=\"clickLink.IsExternal ? '_blank' : '_self'\" (click)=\"onTelaSelecionada.emit(clickLink.titulo)\"\n [href]=\"clickLink.IsExternal\n ? getExternalUrl(clickLink.urlPath)\n : '/SisproErpCloud/' + clickLink.urlPath\" >\n {{ clickLink.titulo }}\n </a>\n </li>\n }\n }\n</ul>\n", styles: ["a{color:#3e5154}\n"] }]
|
|
3822
|
+
}], propDecorators: { telasItem: [{
|
|
3731
3823
|
type: Input
|
|
3732
3824
|
}], hostName: [{
|
|
3733
3825
|
type: Input
|
|
3826
|
+
}], onTelaSelecionada: [{
|
|
3827
|
+
type: Output
|
|
3734
3828
|
}] } });
|
|
3735
3829
|
|
|
3736
3830
|
class NavTabsComponent {
|
|
@@ -3740,38 +3834,51 @@ class NavTabsComponent {
|
|
|
3740
3834
|
// #region ==========> PROPERTIES <==========
|
|
3741
3835
|
// #region PUBLIC
|
|
3742
3836
|
this.subMenus = [];
|
|
3743
|
-
this.hostName =
|
|
3837
|
+
this.hostName = '';
|
|
3838
|
+
this.onTituloSelecionado = new EventEmitter();
|
|
3839
|
+
this.onTelaSelecionada = new EventEmitter();
|
|
3744
3840
|
this.telasItem = [];
|
|
3745
3841
|
this.listaAtiva = '';
|
|
3746
3842
|
}
|
|
3747
3843
|
ngOnInit() {
|
|
3748
3844
|
if (this.subMenus.length != 0) {
|
|
3749
|
-
this.telasItem = this.subMenus[0].telasItem;
|
|
3845
|
+
this.telasItem = this.subMenus.filter(e => e.titulo.includes(this.activeItem ?? ''))[0].telasItem;
|
|
3750
3846
|
this.listaAtiva = this.activeItem ?? this.subMenus[0].titulo;
|
|
3847
|
+
if (this.activeItem && this.activeItem !== '')
|
|
3848
|
+
this.setAbaAtiva(this.activeItem);
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
ngOnChanges(changes) {
|
|
3852
|
+
if (changes['activeItem'].currentValue && changes['activeItem'].currentValue !== "") {
|
|
3853
|
+
this.setAbaAtiva(changes['activeItem'].currentValue);
|
|
3854
|
+
}
|
|
3855
|
+
if ((changes['subMenus'].currentValue && changes['subMenus'].currentValue !== "") && this.activeItem !== '') {
|
|
3856
|
+
this.setAbaAtiva(this.activeItem);
|
|
3751
3857
|
}
|
|
3752
3858
|
}
|
|
3753
3859
|
// #region ==========> UTILS <==========
|
|
3754
|
-
|
|
3755
|
-
const index = this.subMenus.findIndex(submenu =>
|
|
3756
|
-
return submenu.titulo == b;
|
|
3757
|
-
});
|
|
3860
|
+
setAbaAtiva(titulo) {
|
|
3861
|
+
const index = this.subMenus.findIndex(submenu => submenu.titulo == titulo);
|
|
3758
3862
|
this.telasItem = this.subMenus[index].telasItem;
|
|
3759
3863
|
this.listaAtiva = this.subMenus[index].titulo;
|
|
3864
|
+
this.onTituloSelecionado.emit(titulo);
|
|
3760
3865
|
}
|
|
3761
3866
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NavTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3762
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: NavTabsComponent, isStandalone: true, selector: "app-nav-tabs", inputs: { subMenus: "subMenus", hostName: "hostName", activeItem: "activeItem" }, ngImport: i0, template: "<ul class=\"menu my-3\">\n @for(menu of subMenus; track $index) {\n <li class=\"menu-item\" (click)=\"
|
|
3867
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: NavTabsComponent, isStandalone: true, selector: "app-nav-tabs", inputs: { subMenus: "subMenus", hostName: "hostName", activeItem: "activeItem" }, outputs: { onTituloSelecionado: "onTituloSelecionado", onTelaSelecionada: "onTelaSelecionada" }, usesOnChanges: true, ngImport: i0, template: "<ul class=\"menu my-3\">\n @for(menu of subMenus; track $index) {\n <li class=\"menu-item\" (click)=\"setAbaAtiva(menu.titulo)\" [class.active]=\"menu.titulo === listaAtiva\">\n <a class=\"glb-cursor-pointer\" (click)=\"setAbaAtiva(menu.titulo)\" [tabindex]=\"$index\" >\n {{ menu.titulo }}\n </a>\n </li>\n }\n</ul>\n\n@if (telasItem) {\n <app-list [telasItem]=\"telasItem\" [hostName]=\"hostName\" (onTelaSelecionada)=\"onTelaSelecionada.emit($event)\" />\n}\n", styles: ["@charset \"UTF-8\";.menu{list-style:none;padding:0;margin:0;display:flex;gap:20px}.menu-item a{text-align:center;position:relative;display:inline-block;padding-bottom:5px;color:#6c757d;text-decoration:none;transition:color .3s ease,border-bottom-color .3s ease;border-bottom:2px solid #fff;width:calc(100% + 15px)}.menu-item a:hover{color:#213b70;border-bottom:2px solid #213B70}.menu-item.active a:after{content:\"\";position:absolute;bottom:-2px;left:50%;transform:translate(-50%);width:calc(100% + 5px);height:2px;background-color:#213b70}.menu-item.active a{color:#213b70}.menu-item.active a:before{content:\"\";position:absolute;bottom:0;left:50%;transform:translate(-50%);width:0;height:0;opacity:1;transition:all .2s ease-in-out}\n"], dependencies: [{ kind: "component", type: ListComponent, selector: "app-list", inputs: ["telasItem", "hostName"], outputs: ["onTelaSelecionada"] }] }); }
|
|
3763
3868
|
}
|
|
3764
3869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NavTabsComponent, decorators: [{
|
|
3765
3870
|
type: Component,
|
|
3766
|
-
args: [{ selector: 'app-nav-tabs', imports: [
|
|
3767
|
-
ListComponent
|
|
3768
|
-
], template: "<ul class=\"menu my-3\">\n @for(menu of subMenus; track $index) {\n <li class=\"menu-item\" (click)=\"abaActive(menu.titulo)\" [class.active]=\"menu.titulo === listaAtiva\">\n <a class=\"glb-cursor-pointer\" (click)=\"abaActive(menu.titulo)\" [tabindex]=\"$index\">\n {{ menu.titulo }}\n </a>\n </li>\n }\n</ul>\n\n@if (telasItem) {\n <app-list [telasItem]=\"telasItem\" [hostName]=\"hostName\" />\n}\n", styles: ["@charset \"UTF-8\";.menu{list-style:none;padding:0;margin:0;display:flex;gap:20px}.menu-item a{text-align:center;position:relative;display:inline-block;padding-bottom:5px;color:#6c757d;text-decoration:none;transition:color .3s ease,border-bottom-color .3s ease;border-bottom:2px solid #fff;width:calc(100% + 15px)}.menu-item a:hover{color:#213b70;border-bottom:2px solid #213B70}.menu-item.active a:after{content:\"\";position:absolute;bottom:-2px;left:50%;transform:translate(-50%);width:calc(100% + 5px);height:2px;background-color:#213b70}.menu-item.active a{color:#213b70}.menu-item.active a:before{content:\"\";position:absolute;bottom:0;left:50%;transform:translate(-50%);width:0;height:0;opacity:1;transition:all .2s ease-in-out}\n"] }]
|
|
3871
|
+
args: [{ selector: 'app-nav-tabs', imports: [ListComponent], template: "<ul class=\"menu my-3\">\n @for(menu of subMenus; track $index) {\n <li class=\"menu-item\" (click)=\"setAbaAtiva(menu.titulo)\" [class.active]=\"menu.titulo === listaAtiva\">\n <a class=\"glb-cursor-pointer\" (click)=\"setAbaAtiva(menu.titulo)\" [tabindex]=\"$index\" >\n {{ menu.titulo }}\n </a>\n </li>\n }\n</ul>\n\n@if (telasItem) {\n <app-list [telasItem]=\"telasItem\" [hostName]=\"hostName\" (onTelaSelecionada)=\"onTelaSelecionada.emit($event)\" />\n}\n", styles: ["@charset \"UTF-8\";.menu{list-style:none;padding:0;margin:0;display:flex;gap:20px}.menu-item a{text-align:center;position:relative;display:inline-block;padding-bottom:5px;color:#6c757d;text-decoration:none;transition:color .3s ease,border-bottom-color .3s ease;border-bottom:2px solid #fff;width:calc(100% + 15px)}.menu-item a:hover{color:#213b70;border-bottom:2px solid #213B70}.menu-item.active a:after{content:\"\";position:absolute;bottom:-2px;left:50%;transform:translate(-50%);width:calc(100% + 5px);height:2px;background-color:#213b70}.menu-item.active a{color:#213b70}.menu-item.active a:before{content:\"\";position:absolute;bottom:0;left:50%;transform:translate(-50%);width:0;height:0;opacity:1;transition:all .2s ease-in-out}\n"] }]
|
|
3769
3872
|
}], ctorParameters: () => [], propDecorators: { subMenus: [{
|
|
3770
3873
|
type: Input
|
|
3771
3874
|
}], hostName: [{
|
|
3772
3875
|
type: Input
|
|
3773
3876
|
}], activeItem: [{
|
|
3774
3877
|
type: Input
|
|
3878
|
+
}], onTituloSelecionado: [{
|
|
3879
|
+
type: Output
|
|
3880
|
+
}], onTelaSelecionada: [{
|
|
3881
|
+
type: Output
|
|
3775
3882
|
}] } });
|
|
3776
3883
|
|
|
3777
3884
|
class NavSubMenus {
|
|
@@ -3805,11 +3912,13 @@ class SubMenuComponent {
|
|
|
3805
3912
|
this.navSubmenus = [];
|
|
3806
3913
|
this.isProduction = true;
|
|
3807
3914
|
this.hostname = "https://siscandesv6.sispro.com.br";
|
|
3915
|
+
this.onTituloSelecionado = new EventEmitter();
|
|
3916
|
+
this.onTelaSelecionada = new EventEmitter();
|
|
3808
3917
|
this.hostNameOutSystems = "";
|
|
3809
3918
|
this.listaSubMenus = [];
|
|
3810
3919
|
}
|
|
3811
3920
|
ngOnInit() {
|
|
3812
|
-
this.
|
|
3921
|
+
this.getHostName();
|
|
3813
3922
|
if (this.navSubmenus.length > 0 &&
|
|
3814
3923
|
this.navSubmenus[0].subMenuItem &&
|
|
3815
3924
|
this.navSubmenus[0].subMenuItem.length > 0) {
|
|
@@ -3823,14 +3932,14 @@ class SubMenuComponent {
|
|
|
3823
3932
|
this.listaSubMenus.push(...this.navSubmenus[i].subMenuItem);
|
|
3824
3933
|
}
|
|
3825
3934
|
}
|
|
3826
|
-
|
|
3935
|
+
getHostName() {
|
|
3827
3936
|
this._menuService.GetHostServerOutSystems().subscribe({
|
|
3828
3937
|
next: response => this.hostNameOutSystems = response.String,
|
|
3829
3938
|
error: error => this._projectUtil.showHttpError(error)
|
|
3830
3939
|
});
|
|
3831
3940
|
}
|
|
3832
3941
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SubMenuComponent, deps: [{ token: MenuServicesService }, { token: ProjectUtilservice }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3833
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: SubMenuComponent, isStandalone: true, selector: "app-nav-sub-menu", inputs: { navSubmenus: "navSubmenus", isProduction: "isProduction", hostname: "hostname", activeItem: "activeItem" }, ngImport: i0, template: "<lib-container>\n <div class=\"px-5\" innerContent1>\n @for(subMenu of navSubmenus; track $index) {\n <div [class]=\"$first && subMenu.titulo == '' && subMenu.icon == '' ? ' mb-2' : 'mt-4 mb-2'\">\n @if (subMenu.icon != '') {\n <lib-icon class=\"bold engrenagem-ajustada\" iconName=\"{{ subMenu.icon }}\" />\n }\n @if (subMenu.titulo != ''){\n <span class=\"fw-bold fs-4 ms-1\">{{ subMenu.titulo }}</span>\n }\n\n <app-nav-tabs [activeItem]=\"activeItem\" [subMenus]=\"navSubmenus[$index].subMenuItem\" [hostName]=\"hostNameOutSystems\" />\n </div>\n\n @if(!$last){ <hr /> }\n }\n </div>\n</lib-container>\n", styles: [".engrenagem-ajustada{position:relative;top:-4px}\n"], dependencies: [{ kind: "component", type: NavTabsComponent, selector: "app-nav-tabs", inputs: ["subMenus", "hostName", "activeItem"] }, { kind: "component", type: LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: ContentContainerComponent, selector: "lib-container", inputs: ["documentation", "tabs", "advancedTabs", "containerTitle", "useBorder", "currentTab"], outputs: ["onChangeTab"] }] }); }
|
|
3942
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: SubMenuComponent, isStandalone: true, selector: "app-nav-sub-menu", inputs: { navSubmenus: "navSubmenus", isProduction: "isProduction", hostname: "hostname", activeItem: "activeItem" }, outputs: { onTituloSelecionado: "onTituloSelecionado", onTelaSelecionada: "onTelaSelecionada" }, ngImport: i0, template: "<lib-container>\n <div class=\"px-5\" innerContent1>\n @for(subMenu of navSubmenus; track $index) {\n <div [class]=\"$first && subMenu.titulo == '' && subMenu.icon == '' ? ' mb-2' : 'mt-4 mb-2'\">\n @if (subMenu.icon != '') {\n <lib-icon class=\"bold engrenagem-ajustada\" iconName=\"{{ subMenu.icon }}\" />\n }\n @if (subMenu.titulo != ''){\n <span class=\"fw-bold fs-4 ms-1\">{{ subMenu.titulo }}</span>\n }\n\n <app-nav-tabs [activeItem]=\"activeItem\" [subMenus]=\"navSubmenus[$index].subMenuItem\" [hostName]=\"hostNameOutSystems\"\n (onTelaSelecionada)=\"onTelaSelecionada.emit($event)\" (onTituloSelecionado)=\"onTituloSelecionado.emit($event)\" />\n </div>\n\n @if(!$last){ <hr /> }\n }\n </div>\n</lib-container>\n", styles: [".engrenagem-ajustada{position:relative;top:-4px}\n"], dependencies: [{ kind: "component", type: NavTabsComponent, selector: "app-nav-tabs", inputs: ["subMenus", "hostName", "activeItem"], outputs: ["onTituloSelecionado", "onTelaSelecionada"] }, { kind: "component", type: LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: ContentContainerComponent, selector: "lib-container", inputs: ["documentation", "tabs", "advancedTabs", "containerTitle", "useBorder", "currentTab"], outputs: ["onChangeTab"] }] }); }
|
|
3834
3943
|
}
|
|
3835
3944
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SubMenuComponent, decorators: [{
|
|
3836
3945
|
type: Component,
|
|
@@ -3838,7 +3947,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3838
3947
|
NavTabsComponent,
|
|
3839
3948
|
LibIconsComponent,
|
|
3840
3949
|
ContentContainerComponent
|
|
3841
|
-
], standalone: true, template: "<lib-container>\n <div class=\"px-5\" innerContent1>\n @for(subMenu of navSubmenus; track $index) {\n <div [class]=\"$first && subMenu.titulo == '' && subMenu.icon == '' ? ' mb-2' : 'mt-4 mb-2'\">\n @if (subMenu.icon != '') {\n <lib-icon class=\"bold engrenagem-ajustada\" iconName=\"{{ subMenu.icon }}\" />\n }\n @if (subMenu.titulo != ''){\n <span class=\"fw-bold fs-4 ms-1\">{{ subMenu.titulo }}</span>\n }\n\n <app-nav-tabs [activeItem]=\"activeItem\" [subMenus]=\"navSubmenus[$index].subMenuItem\" [hostName]=\"hostNameOutSystems\" />\n </div>\n\n @if(!$last){ <hr /> }\n }\n </div>\n</lib-container>\n", styles: [".engrenagem-ajustada{position:relative;top:-4px}\n"] }]
|
|
3950
|
+
], standalone: true, template: "<lib-container>\n <div class=\"px-5\" innerContent1>\n @for(subMenu of navSubmenus; track $index) {\n <div [class]=\"$first && subMenu.titulo == '' && subMenu.icon == '' ? ' mb-2' : 'mt-4 mb-2'\">\n @if (subMenu.icon != '') {\n <lib-icon class=\"bold engrenagem-ajustada\" iconName=\"{{ subMenu.icon }}\" />\n }\n @if (subMenu.titulo != ''){\n <span class=\"fw-bold fs-4 ms-1\">{{ subMenu.titulo }}</span>\n }\n\n <app-nav-tabs [activeItem]=\"activeItem\" [subMenus]=\"navSubmenus[$index].subMenuItem\" [hostName]=\"hostNameOutSystems\"\n (onTelaSelecionada)=\"onTelaSelecionada.emit($event)\" (onTituloSelecionado)=\"onTituloSelecionado.emit($event)\" />\n </div>\n\n @if(!$last){ <hr /> }\n }\n </div>\n</lib-container>\n", styles: [".engrenagem-ajustada{position:relative;top:-4px}\n"] }]
|
|
3842
3951
|
}], ctorParameters: () => [{ type: MenuServicesService }, { type: ProjectUtilservice }], propDecorators: { navSubmenus: [{
|
|
3843
3952
|
type: Input
|
|
3844
3953
|
}], isProduction: [{
|
|
@@ -3847,6 +3956,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3847
3956
|
type: Input
|
|
3848
3957
|
}], activeItem: [{
|
|
3849
3958
|
type: Input
|
|
3959
|
+
}], onTituloSelecionado: [{
|
|
3960
|
+
type: Output
|
|
3961
|
+
}], onTelaSelecionada: [{
|
|
3962
|
+
type: Output
|
|
3850
3963
|
}] } });
|
|
3851
3964
|
|
|
3852
3965
|
/** Modules */
|
|
@@ -3855,5 +3968,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
3855
3968
|
* Generated bundle index. Do not edit.
|
|
3856
3969
|
*/
|
|
3857
3970
|
|
|
3858
|
-
export { AUTH_ROUTES, AuthAplicInterceptor, AuthGuard, AuthInfraInterceptor, AuthModule, AuthService, AuthStorageService, DynamicMenuComponent, ExternaLoginlGuard, IMenu, InfraUsuarioImg, LIB_CUSTOM_ENVIRONMENT_SERVICE, LIB_CUSTOM_LOGIN_SERVICE, LIB_CUSTOM_MENU_SERVICE, LIB_CUSTOM_STORAGE_SERVICE, LIB_MENU_CONFIG, LibCustomEnvironmentService, LibCustomLoginService, LibCustomMenuService, LibCustomStorageService, LibMenuConfigService, ListComponent, LoginComponent, LoginGuard, LoginOSComponent, LoginOSGuard, LoginProgress, MenuLateralComponent, MenuServicesService, NavSubMenus, NavSubmenuCards, NavSubmenuSearchItem, NavTabsComponent, NotifSubmenuComponent, NovaSenhaComponent, PrimaryDropdownComponent, RetInfraUsuarioImg, RetMenuItemStructure, RetMenuLateral, RetMenuPromise, RetNavSubMenu, RetSubmenuWithCards, SecondaryDropdownComponent, SelecaoEstabelecimentosModalComponent, SituacaoLogin, SubMenuCardComponent, SubMenuComponent, SubMenuItem, TelaItem };
|
|
3971
|
+
export { AUTH_ROUTES, AuthAplicInterceptor, AuthGuard, AuthInfraInterceptor, AuthModule, AuthService, AuthStorageService, DynamicMenuComponent, ErrorMenuNotAllowed, ExternaLoginlGuard, IMenu, InfraUsuarioImg, IsMenuAllowedlGuard, LIB_CUSTOM_ENVIRONMENT_SERVICE, LIB_CUSTOM_LOGIN_SERVICE, LIB_CUSTOM_MENU_SERVICE, LIB_CUSTOM_STORAGE_SERVICE, LIB_MENU_CONFIG, LibCustomEnvironmentService, LibCustomLoginService, LibCustomMenuService, LibCustomStorageService, LibMenuConfigService, ListComponent, LoginComponent, LoginGuard, LoginOSComponent, LoginOSGuard, LoginProgress, MenuLateralComponent, MenuServicesService, NavSubMenus, NavSubmenuCards, NavSubmenuSearchItem, NavTabsComponent, NotifSubmenuComponent, NovaSenhaComponent, PrimaryDropdownComponent, RetInfraUsuarioImg, RetMenuItemStructure, RetMenuLateral, RetMenuPromise, RetNavSubMenu, RetSubmenuWithCards, SecondaryDropdownComponent, SelecaoEstabelecimentosModalComponent, SituacaoLogin, SubMenuCardComponent, SubMenuComponent, SubMenuItem, TelaItem };
|
|
3859
3972
|
//# sourceMappingURL=ngx-sp-auth.mjs.map
|