@stiunb/unb-lib-components 18.0.23 → 18.0.24
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/esm2022/lib/unb-mensagem/unb-mensagem.component.mjs +18 -26
- package/esm2022/lib/unb-mensagem/unb-mensagem.service.mjs +16 -21
- package/esm2022/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-form.mjs +60 -29
- package/esm2022/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-list.mjs +4 -4
- package/esm2022/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-form.mjs +98 -67
- package/esm2022/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-list.mjs +4 -4
- package/esm2022/lib/unb-pessoa/unb-pessoa-form/unb-pessoa-form.component.mjs +57 -73
- package/esm2022/lib/unb-pessoa/unb-pessoa-pesquisar/unb-pessoa-pesquisar.component.mjs +49 -36
- package/esm2022/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-form.mjs +57 -29
- package/esm2022/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-list.mjs +4 -4
- package/esm2022/lib/unb-pessoa/unb-pessoa.service.mjs +141 -45
- package/fesm2022/stiunb-unb-lib-components.mjs +467 -309
- package/fesm2022/stiunb-unb-lib-components.mjs.map +1 -1
- package/lib/unb-mensagem/unb-mensagem.component.d.ts +3 -17
- package/lib/unb-mensagem/unb-mensagem.service.d.ts +16 -18
- package/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-form.d.ts +6 -2
- package/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-list.d.ts +2 -5
- package/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-form.d.ts +6 -3
- package/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-list.d.ts +2 -5
- package/lib/unb-pessoa/unb-pessoa-form/unb-pessoa-form.component.d.ts +8 -8
- package/lib/unb-pessoa/unb-pessoa-pesquisar/unb-pessoa-pesquisar.component.d.ts +8 -8
- package/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-form.d.ts +6 -4
- package/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-list.d.ts +2 -5
- package/lib/unb-pessoa/unb-pessoa.service.d.ts +9 -13
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, Input, NgModule, ViewChild, Inject, EventEmitter, Output } from '@angular/core';
|
|
3
|
-
import { Subject, BehaviorSubject,
|
|
3
|
+
import { Subject, BehaviorSubject, throwError, catchError, of, map, forkJoin } from 'rxjs';
|
|
4
4
|
import * as i4 from '@angular/common';
|
|
5
5
|
import { CommonModule, DatePipe, CurrencyPipe } from '@angular/common';
|
|
6
6
|
import * as i5 from '@angular/material/icon';
|
|
@@ -23,39 +23,38 @@ import * as i8 from '@angular/material/tooltip';
|
|
|
23
23
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
24
24
|
import { MatListModule } from '@angular/material/list';
|
|
25
25
|
import { BrowserModule } from '@angular/platform-browser';
|
|
26
|
-
import * as
|
|
26
|
+
import * as i6 from '@angular/forms';
|
|
27
27
|
import { FormsModule } from '@angular/forms';
|
|
28
|
-
import * as
|
|
28
|
+
import * as i12 from '@angular/material/core';
|
|
29
29
|
import { MatNativeDateModule } from '@angular/material/core';
|
|
30
30
|
import * as i14 from '@angular/material/datepicker';
|
|
31
31
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
32
32
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
33
|
-
import * as
|
|
33
|
+
import * as i9 from '@angular/material/form-field';
|
|
34
34
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
35
|
-
import * as
|
|
35
|
+
import * as i10 from '@angular/material/input';
|
|
36
36
|
import { MatInputModule } from '@angular/material/input';
|
|
37
37
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
38
38
|
import * as i13 from '@angular/material/progress-bar';
|
|
39
39
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
40
|
-
import * as
|
|
40
|
+
import * as i11$1 from '@angular/material/progress-spinner';
|
|
41
41
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
42
|
-
import * as
|
|
42
|
+
import * as i12$1 from '@angular/material/radio';
|
|
43
43
|
import { MatRadioModule } from '@angular/material/radio';
|
|
44
|
-
import * as
|
|
44
|
+
import * as i11 from '@angular/material/select';
|
|
45
45
|
import { MatSelectModule } from '@angular/material/select';
|
|
46
46
|
import * as i1$2 from '@angular/material/snack-bar';
|
|
47
47
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
48
|
-
import * as
|
|
48
|
+
import * as i4$2 from '@angular/material/dialog';
|
|
49
49
|
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
50
50
|
import * as i1$1 from '@angular/common/http';
|
|
51
51
|
import { HttpHeaders } from '@angular/common/http';
|
|
52
|
-
import * as i6 from '@angular/cdk/drag-drop';
|
|
52
|
+
import * as i6$1 from '@angular/cdk/drag-drop';
|
|
53
53
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
54
54
|
|
|
55
55
|
class UnbMensagemModel {
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
// faz com que a enum seja uma contagem de 0 a 3
|
|
59
58
|
var UnbTipoMensagemEnum;
|
|
60
59
|
(function (UnbTipoMensagemEnum) {
|
|
61
60
|
UnbTipoMensagemEnum[UnbTipoMensagemEnum["SUCCESS"] = 0] = "SUCCESS";
|
|
@@ -65,8 +64,8 @@ var UnbTipoMensagemEnum;
|
|
|
65
64
|
})(UnbTipoMensagemEnum || (UnbTipoMensagemEnum = {}));
|
|
66
65
|
class UnbMensagemService {
|
|
67
66
|
constructor() {
|
|
67
|
+
// Mudamos o tipo do Subject para aceitar o evento com ID
|
|
68
68
|
this.messageSubject = new Subject();
|
|
69
|
-
// [background_color, font_color, border_color]
|
|
70
69
|
this.cores = [
|
|
71
70
|
['#dff0d8', '#3c763d', '#d6e9c6'], // SUCCESS
|
|
72
71
|
['#d9edf7', '#31708f', '#bce8f1'], // INFO
|
|
@@ -75,30 +74,26 @@ class UnbMensagemService {
|
|
|
75
74
|
];
|
|
76
75
|
}
|
|
77
76
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
showMessage(message, type) {
|
|
83
|
-
this.
|
|
77
|
+
* @param message mensagem que vai aparecer na tela
|
|
78
|
+
* @param tipo tipo da mensagem: success, info, warning, danger.
|
|
79
|
+
* @param id (Opcional) Identificador do componente que deve exibir a mensagem
|
|
80
|
+
*/
|
|
81
|
+
showMessage(message, type, id) {
|
|
82
|
+
const model = this.createAlertMessage(message, ...this.cores[type]);
|
|
83
|
+
// Envia o modelo E o id alvo (se houver)
|
|
84
|
+
this.messageSubject.next({ model: model, targetId: id });
|
|
84
85
|
}
|
|
85
86
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
* Esconde o componente.
|
|
88
|
+
* @param id (Opcional) Se informado, esconde apenas o componente com este ID.
|
|
89
|
+
*/
|
|
90
|
+
hideMessage(id) {
|
|
91
|
+
// Envia modelo vazio para esconder
|
|
92
|
+
this.messageSubject.next({ model: new UnbMensagemModel(), targetId: id });
|
|
90
93
|
}
|
|
91
94
|
getMessageSubject() {
|
|
92
95
|
return this.messageSubject.asObservable();
|
|
93
96
|
}
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @param message Cria a mensagem passando os parametros com base nas cores criadas no construturo
|
|
97
|
-
* @param background_color cor de fundo
|
|
98
|
-
* @param font_color cor da fonte
|
|
99
|
-
* @param border_color cor da borda
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
97
|
createAlertMessage(message, background_color, font_color, border_color) {
|
|
103
98
|
return { message, background_color, font_color, border_color };
|
|
104
99
|
}
|
|
@@ -117,47 +112,39 @@ class UnbMensagemComponent {
|
|
|
117
112
|
this.mensagemService = mensagemService;
|
|
118
113
|
}
|
|
119
114
|
ngOnInit() {
|
|
120
|
-
this.subscription = this.mensagemService.getMessageSubject().subscribe(
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
this.subscription = this.mensagemService.getMessageSubject().subscribe(event => {
|
|
116
|
+
// LÓGICA DE FILTRAGEM:
|
|
117
|
+
// 1. Se a mensagem tem um targetId, mas este componente não tem ID ou o ID não bate: IGNORA
|
|
118
|
+
if (event.targetId && event.targetId !== this.identificador) {
|
|
119
|
+
return;
|
|
123
120
|
}
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
// 2. Se a mensagem tem targetId e bate com o meu ID: ACEITA
|
|
122
|
+
// 3. Se a mensagem NÃO tem targetId (global): ACEITA (comportamento padrão/antigo)
|
|
123
|
+
if (event.model) {
|
|
124
|
+
this.alertMessage = event.model;
|
|
126
125
|
}
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
128
|
ngAfterContentInit() {
|
|
130
129
|
if (this.mensagem != null && this.mensagem != undefined) {
|
|
130
|
+
// Aqui passamos o this.id para garantir que a mensagem inicial fique neste componente
|
|
131
131
|
this.showMessage(this.mensagem, this.getTipo());
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Esconde o componente de mensagem
|
|
136
|
-
*/
|
|
137
134
|
hide() {
|
|
138
|
-
|
|
135
|
+
// Ao fechar pelo X, passamos o próprio ID para não fechar outros componentes sem querer
|
|
136
|
+
this.mensagemService.hideMessage(this.identificador);
|
|
139
137
|
}
|
|
140
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
* @param message mensagem que vai aparecer na tela
|
|
143
|
-
* @param tipo tipo da mensagem: success, info, warning, danger.
|
|
144
|
-
*/
|
|
145
138
|
showMessage(message, tipo) {
|
|
146
|
-
this.mensagemService.showMessage(message, tipo);
|
|
139
|
+
this.mensagemService.showMessage(message, tipo, this.identificador);
|
|
147
140
|
}
|
|
148
141
|
ngOnDestroy() {
|
|
149
|
-
// unsubscribe to ensure no memory leaks
|
|
150
142
|
if (this.subscription) {
|
|
151
143
|
this.subscription.unsubscribe();
|
|
152
144
|
}
|
|
153
145
|
}
|
|
154
|
-
/**
|
|
155
|
-
* Recupera qual o tipo da mensagem.
|
|
156
|
-
* O método tenta achar o tipo conforme o valor informado, incluido erros de digitação
|
|
157
|
-
*
|
|
158
|
-
* @returns o valor correspondente do informa. Caso não encontra, emite um erro e coloca retorna o padrão info como default
|
|
159
|
-
*/
|
|
160
146
|
getTipo() {
|
|
147
|
+
// ... (mesma implementação anterior) ...
|
|
161
148
|
if (this.tipo != null && this.tipo != undefined) {
|
|
162
149
|
let valor = this.tipo.toLowerCase();
|
|
163
150
|
if (valor == 'warning' || valor == 'warn' || valor == 'aviso') {
|
|
@@ -173,12 +160,10 @@ class UnbMensagemComponent {
|
|
|
173
160
|
return UnbTipoMensagemEnum.INFO;
|
|
174
161
|
}
|
|
175
162
|
}
|
|
176
|
-
// o padrao eh o info
|
|
177
|
-
console.log("Erro: Input [tipo] do componente unb-mensagem tem um valor inválido. Utilize: " + UnbTipoMensagemEnum.SUCCESS + " | " + UnbTipoMensagemEnum.INFO + " | " + UnbTipoMensagemEnum.WARNING + " | " + UnbTipoMensagemEnum.DANGER);
|
|
178
163
|
return UnbTipoMensagemEnum.INFO;
|
|
179
164
|
}
|
|
180
165
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbMensagemComponent, deps: [{ token: UnbMensagemService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
181
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: { mensagem: "mensagem", tipo: "tipo" }, ngImport: i0, template: "\r\n<div class=\"alert\" *ngIf=\"alertMessage && alertMessage.message && alertMessage.message.length > 1\" [ngStyle]=\"{background: alertMessage.background_color, 'border-color': alertMessage.border_color}\"> \r\n <div class=\"mensagem\" [ngStyle]=\"{color: alertMessage.font_color}\" [innerHtml]= \"alertMessage.message\"></div>\r\n <a class=\"close\" (click)=\"hide()\" aria-label=\"fechar\" [ngStyle]=\"{color: alertMessage.font_color}\">x</a>\r\n</div> \r\n\r\n", styles: [".alert{display:flex;text-align:center;justify-content:space-between;border-top-color:darken(1px,5%);padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;font-weight:400;border-color:#fff}.mensagem{margin:0 auto}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;cursor:pointer;justify-content:flex-end}.close:hover{opacity:.7}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
166
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: { mensagem: "mensagem", tipo: "tipo", identificador: "identificador" }, ngImport: i0, template: "\r\n<div class=\"alert\" *ngIf=\"alertMessage && alertMessage.message && alertMessage.message.length > 1\" [ngStyle]=\"{background: alertMessage.background_color, 'border-color': alertMessage.border_color}\"> \r\n <div class=\"mensagem\" [ngStyle]=\"{color: alertMessage.font_color}\" [innerHtml]= \"alertMessage.message\"></div>\r\n <a class=\"close\" (click)=\"hide()\" aria-label=\"fechar\" [ngStyle]=\"{color: alertMessage.font_color}\">x</a>\r\n</div> \r\n\r\n", styles: [".alert{display:flex;text-align:center;justify-content:space-between;border-top-color:darken(1px,5%);padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;font-weight:400;border-color:#fff}.mensagem{margin:0 auto}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;cursor:pointer;justify-content:flex-end}.close:hover{opacity:.7}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
182
167
|
}
|
|
183
168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbMensagemComponent, decorators: [{
|
|
184
169
|
type: Component,
|
|
@@ -187,6 +172,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
|
|
|
187
172
|
type: Input
|
|
188
173
|
}], tipo: [{
|
|
189
174
|
type: Input
|
|
175
|
+
}], identificador: [{
|
|
176
|
+
type: Input
|
|
190
177
|
}] } });
|
|
191
178
|
|
|
192
179
|
class UnbMensagemModule {
|
|
@@ -447,54 +434,145 @@ var TipoPessoaEnum;
|
|
|
447
434
|
class UnBPessoaService {
|
|
448
435
|
constructor(http) {
|
|
449
436
|
this.http = http;
|
|
450
|
-
|
|
451
|
-
this.
|
|
437
|
+
// Armazena apenas a string da URL. Inicializa vazio.
|
|
438
|
+
this.backendUrlSubject = new BehaviorSubject('');
|
|
439
|
+
// Exposta como Observable (caso algum componente queira se inscrever)
|
|
440
|
+
this.backendUrl$ = this.backendUrlSubject.asObservable();
|
|
441
|
+
// -------------------------------------------------------------------
|
|
442
|
+
// HANDLE ERROR PADRONIZADO
|
|
443
|
+
// -------------------------------------------------------------------
|
|
444
|
+
this.handleError = (error) => {
|
|
445
|
+
let mensagemSimples = 'Ocorreu um erro ao processar a requisição!';
|
|
446
|
+
let mensagemHtml = '<strong>Ocorreu um erro desconhecido.</strong>';
|
|
447
|
+
// 2. Descobre quem é o corpo do erro
|
|
448
|
+
let errorBody;
|
|
449
|
+
if (error.detalhes || error.codigoStatus) {
|
|
450
|
+
// CASO 1: O Interceptor já desembrulhou o erro (é o JSON puro)
|
|
451
|
+
errorBody = error;
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
// CASO 2: É um HttpErrorResponse padrão (tem a propriedade .error)
|
|
455
|
+
errorBody = error.error || error;
|
|
456
|
+
}
|
|
457
|
+
// 3. Lógica de Limpeza e Parse (se for string suja)
|
|
458
|
+
if (typeof errorBody === 'string') {
|
|
459
|
+
try {
|
|
460
|
+
errorBody = JSON.parse(errorBody);
|
|
461
|
+
}
|
|
462
|
+
catch (e) {
|
|
463
|
+
const start = errorBody.indexOf('{');
|
|
464
|
+
const end = errorBody.lastIndexOf('}');
|
|
465
|
+
if (start > -1 && end > start) {
|
|
466
|
+
try {
|
|
467
|
+
errorBody = JSON.parse(errorBody.substring(start, end + 1));
|
|
468
|
+
}
|
|
469
|
+
catch (e2) {
|
|
470
|
+
// Se falhar o parse, usa o texto como mensagem
|
|
471
|
+
mensagemSimples = errorBody.substring(0, 200);
|
|
472
|
+
mensagemHtml = `<strong>${errorBody}</strong>`;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
// 4. Formatação baseada no JSON identificado
|
|
478
|
+
if (errorBody && typeof errorBody === 'object') {
|
|
479
|
+
// A: Erros de Validação
|
|
480
|
+
if (errorBody.detalhes && Array.isArray(errorBody.detalhes) && errorBody.detalhes.length > 0) {
|
|
481
|
+
mensagemSimples = "O formulário possui erros de validação.";
|
|
482
|
+
const listaErros = errorBody.detalhes.map((d) => `<li><strong>${d.nomeCampo || 'Campo'}:</strong> ${d.critica || d.mensagem}</li>`).join('');
|
|
483
|
+
mensagemHtml = `<strong>Erros de Validação:</strong> <ul>${listaErros}</ul>`;
|
|
484
|
+
}
|
|
485
|
+
// B: Erro Genérico com mensagem
|
|
486
|
+
else {
|
|
487
|
+
const msgBackend = errorBody.mensagem || errorBody.message || errorBody.detail;
|
|
488
|
+
if (msgBackend) {
|
|
489
|
+
mensagemSimples = msgBackend;
|
|
490
|
+
mensagemHtml = `<strong>${msgBackend}</strong>`;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
// 5. Tratamentos de Status HTTP (Se o wrapper original tiver status)
|
|
495
|
+
// Nota: Se o interceptor desembrulhou, 'error.status' pode não existir,
|
|
496
|
+
// mas 'errorBody.codigoStatus' (do Java) pode existir.
|
|
497
|
+
const status = error.status || errorBody?.codigoStatus || 0;
|
|
498
|
+
if (status === 401) {
|
|
499
|
+
mensagemSimples = "Sessão expirada.";
|
|
500
|
+
mensagemHtml = "<strong>Sessão expirada. Faça login novamente.</strong>";
|
|
501
|
+
}
|
|
502
|
+
else if (status === 403) {
|
|
503
|
+
mensagemSimples = "Acesso Negado.";
|
|
504
|
+
mensagemHtml = "<strong>Você não tem permissão para realizar esta ação.</strong>";
|
|
505
|
+
}
|
|
506
|
+
const erroFormatado = {
|
|
507
|
+
status: status,
|
|
508
|
+
mensagemSimples,
|
|
509
|
+
mensagemHtml
|
|
510
|
+
};
|
|
511
|
+
console.warn('[UnBPessoaService] Erro formatado final:', erroFormatado);
|
|
512
|
+
return throwError(() => erroFormatado);
|
|
513
|
+
};
|
|
452
514
|
}
|
|
453
|
-
//
|
|
454
|
-
|
|
455
|
-
|
|
515
|
+
// Setter agora recebe string direta
|
|
516
|
+
setBackendUrl(url) {
|
|
517
|
+
// Tratamento remove barra no final para padronizar
|
|
518
|
+
if (url.endsWith('/')) {
|
|
519
|
+
url = url.slice(0, -1);
|
|
520
|
+
}
|
|
521
|
+
this.backendUrlSubject.next(url);
|
|
456
522
|
}
|
|
457
|
-
//
|
|
458
|
-
|
|
459
|
-
return this.
|
|
523
|
+
// Getter retorna string direta
|
|
524
|
+
getBackendUrl() {
|
|
525
|
+
return this.backendUrlSubject.getValue();
|
|
460
526
|
}
|
|
461
527
|
// Headers padrão
|
|
462
528
|
getHeaders() {
|
|
463
|
-
const { token } = this.getApiConfig();
|
|
464
529
|
return {
|
|
465
530
|
headers: new HttpHeaders({
|
|
466
|
-
'Content-Type': 'application/json'
|
|
467
|
-
Authorization: `Bearer ${token}`
|
|
531
|
+
'Content-Type': 'application/json'
|
|
468
532
|
})
|
|
469
533
|
};
|
|
470
534
|
}
|
|
471
535
|
// Métodos de busca
|
|
472
536
|
findByCpf(cpf) {
|
|
473
|
-
const url = `${this.
|
|
537
|
+
const url = `${this.getBackendUrl()}/pessoa-api/pessoas/fisicas?cpf=${cpf}`;
|
|
474
538
|
return this.http.get(url, this.getHeaders()).pipe(catchError(this.handleError));
|
|
475
539
|
}
|
|
476
540
|
findByCnpj(cnpj) {
|
|
477
|
-
const url = `${this.
|
|
541
|
+
const url = `${this.getBackendUrl()}/pessoa-api/pessoas/juridicas?cnpj=${cnpj}`;
|
|
478
542
|
return this.http.get(url, this.getHeaders()).pipe(catchError(this.handleError));
|
|
479
543
|
}
|
|
480
544
|
findByPassaporte(passaporte) {
|
|
481
|
-
const url = `${this.
|
|
545
|
+
const url = `${this.getBackendUrl()}/pessoa-api/pessoas/fisicas?passaporte=${passaporte}`;
|
|
482
546
|
return this.http.get(url, this.getHeaders()).pipe(catchError(this.handleError));
|
|
483
547
|
}
|
|
484
548
|
findPessoaFisicaById(id) {
|
|
485
|
-
const url = `${this.
|
|
549
|
+
const url = `${this.getBackendUrl()}/pessoa-api/pessoas/fisicas/${id}`;
|
|
486
550
|
return this.http.get(url, this.getHeaders()).pipe(catchError(this.handleError));
|
|
487
551
|
}
|
|
488
552
|
pesquisarCep(cep) {
|
|
489
|
-
const url = `${this.
|
|
553
|
+
const url = `${this.getBackendUrl()}/pessoa-api/public/busca-cep/servico-1/${cep}`;
|
|
490
554
|
return this.http.get(url, this.getHeaders()).pipe(catchError(this.handleError));
|
|
491
555
|
}
|
|
492
556
|
// Salvar (decide fisica ou juridica)
|
|
493
557
|
salvar(payload, tipoPessoa) {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
558
|
+
// (Para o componente conseguir ler .mensagemSimples e .mensagemHtml)
|
|
559
|
+
if (!payload) {
|
|
560
|
+
return throwError(() => ({
|
|
561
|
+
status: 400,
|
|
562
|
+
mensagemSimples: 'Erro interno: Dados para salvamento inválidos (Payload null).',
|
|
563
|
+
mensagemHtml: '<strong>Erro interno:</strong> Tentativa de salvar dados vazios.'
|
|
564
|
+
}));
|
|
565
|
+
}
|
|
566
|
+
if (!tipoPessoa) {
|
|
567
|
+
return throwError(() => ({
|
|
568
|
+
status: 400,
|
|
569
|
+
mensagemSimples: 'Erro interno: Tipo de pessoa não definido.',
|
|
570
|
+
mensagemHtml: '<strong>Erro interno:</strong> O tipo de pessoa é obrigatório para salvar.'
|
|
571
|
+
}));
|
|
572
|
+
}
|
|
573
|
+
// 2. Delegação
|
|
574
|
+
// Como savePessoaFisica e savePessoaJuridica JÁ TÊM o .pipe(catchError),
|
|
575
|
+
// aqui nós apenas retornamos o Observable deles. O erro subirá tratado.
|
|
498
576
|
if (tipoPessoa == TipoPessoaEnum.FISICA || tipoPessoa == TipoPessoaEnum.ESTRANGEIRA) {
|
|
499
577
|
return this.savePessoaFisica(payload);
|
|
500
578
|
}
|
|
@@ -505,41 +583,51 @@ class UnBPessoaService {
|
|
|
505
583
|
}
|
|
506
584
|
// Salvar Pessoa Física
|
|
507
585
|
savePessoaFisica(pessoa) {
|
|
508
|
-
const url = this.
|
|
586
|
+
const url = this.getBackendUrl();
|
|
509
587
|
const httpOptions = this.getHeaders();
|
|
510
588
|
const body = JSON.stringify(pessoa);
|
|
589
|
+
// Variável para armazenar o Observable antes de retornar
|
|
590
|
+
let request$;
|
|
511
591
|
if (pessoa.codigoPessoa == null) {
|
|
512
|
-
|
|
592
|
+
request$ = this.http.post(`${url}/pessoa-api/pessoas/fisicas`, body, httpOptions);
|
|
513
593
|
}
|
|
514
594
|
else {
|
|
515
|
-
|
|
595
|
+
request$ = this.http.put(`${url}/pessoa-api/pessoas/fisicas/${pessoa.codigoPessoa}`, body, httpOptions);
|
|
516
596
|
}
|
|
597
|
+
// Antes de retornar, passamos pelo 'pipe' para tratar o erro se ele ocorrer.
|
|
598
|
+
return request$.pipe(catchError(this.handleError));
|
|
517
599
|
}
|
|
518
600
|
// Salvar Pessoa Jurídica
|
|
519
601
|
savePessoaJuridica(pessoa) {
|
|
520
|
-
const url = this.
|
|
602
|
+
const url = this.getBackendUrl();
|
|
521
603
|
const httpOptions = this.getHeaders();
|
|
522
604
|
const body = JSON.stringify(pessoa);
|
|
605
|
+
let request$;
|
|
523
606
|
if (pessoa.codigoPessoa == null) {
|
|
524
|
-
|
|
607
|
+
request$ = this.http.post(`${url}/pessoa-api/pessoas/juridicas`, body, httpOptions);
|
|
525
608
|
}
|
|
526
609
|
else {
|
|
527
|
-
|
|
610
|
+
request$ = this.http.put(`${url}/pessoa-api/pessoas/juridicas/${pessoa.codigoPessoa}`, body, httpOptions);
|
|
528
611
|
}
|
|
612
|
+
return request$.pipe(catchError(this.handleError));
|
|
529
613
|
}
|
|
530
614
|
// Dados auxiliares públicos
|
|
531
615
|
getEscolaridade() {
|
|
532
|
-
return this.http.get(`${this.
|
|
616
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/public/escolaridades/listagem`).pipe(catchError(this.handleError) // <--- Adicione aqui
|
|
617
|
+
);
|
|
533
618
|
}
|
|
534
619
|
getEstadoCivil() {
|
|
535
|
-
return this.http.get(`${this.
|
|
620
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/public/estados-civis/listagem`).pipe(catchError(this.handleError) // <--- Adicione aqui
|
|
621
|
+
);
|
|
536
622
|
}
|
|
537
623
|
getMunicipios() {
|
|
538
|
-
return this.http.get(`${this.
|
|
624
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/public/municipios/listagem`).pipe(catchError(this.handleError) // <--- Adicione aqui
|
|
625
|
+
);
|
|
539
626
|
}
|
|
540
627
|
getPaises() {
|
|
541
|
-
return this.http.get(`${this.
|
|
628
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/public/paises/listagem?&page=0&size=200&sort=denominacao,asc`).pipe(map(response => {
|
|
542
629
|
return response.content.sort((a, b) => {
|
|
630
|
+
// ... sua lógica de ordenação ...
|
|
543
631
|
const nomeA = a?.denominacao?.toUpperCase() || '';
|
|
544
632
|
const nomeB = b?.denominacao?.toUpperCase() || '';
|
|
545
633
|
if (nomeA === 'BRASIL')
|
|
@@ -548,31 +636,31 @@ class UnBPessoaService {
|
|
|
548
636
|
return 1;
|
|
549
637
|
return nomeA.localeCompare(nomeB);
|
|
550
638
|
});
|
|
551
|
-
}));
|
|
639
|
+
}), catchError(this.handleError));
|
|
552
640
|
}
|
|
553
641
|
getRacaCor() {
|
|
554
|
-
return this.http.get(`${this.
|
|
642
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/public/etnias/listagem`).pipe(map(lista => lista.map((item, index) => ({
|
|
555
643
|
codigo: index, // gera um código numérico sequencial
|
|
556
644
|
denominacao: this.formatarLabel(item) // formata se quiser
|
|
557
|
-
}))));
|
|
645
|
+
}))), catchError(this.handleError));
|
|
558
646
|
}
|
|
559
647
|
getTipoEmail() {
|
|
560
|
-
return this.http.get(`${this.
|
|
648
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/tipos-email/public/listagem`).pipe(map(lista => lista.map((item, index) => ({
|
|
561
649
|
codigo: index, // gera um código numérico sequencial
|
|
562
650
|
denominacao: this.formatarLabel(item) // formata se quiser
|
|
563
|
-
}))));
|
|
651
|
+
}))), catchError(this.handleError));
|
|
564
652
|
}
|
|
565
653
|
getTipoEndereco() {
|
|
566
|
-
return this.http.get(`${this.
|
|
654
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/tipos-endereco/public/listagem`).pipe(map(lista => lista.map((item, index) => ({
|
|
567
655
|
codigo: index, // gera um código numérico sequencial
|
|
568
656
|
denominacao: this.formatarLabel(item) // formata se quiser
|
|
569
|
-
}))));
|
|
657
|
+
}))), catchError(this.handleError));
|
|
570
658
|
}
|
|
571
659
|
getTipoTelefone() {
|
|
572
|
-
return this.http.get(`${this.
|
|
660
|
+
return this.http.get(`${this.getBackendUrl()}/pessoa-api/tipos-telefone/public/listagem`).pipe(map(lista => lista.map((item, index) => ({
|
|
573
661
|
codigo: index, // gera um código numérico sequencial
|
|
574
662
|
denominacao: this.formatarLabel(item) // formata se quiser
|
|
575
|
-
}))));
|
|
663
|
+
}))), catchError(this.handleError));
|
|
576
664
|
}
|
|
577
665
|
formatarLabel(text) {
|
|
578
666
|
return text
|
|
@@ -580,11 +668,6 @@ class UnBPessoaService {
|
|
|
580
668
|
.replace(/_/g, ' ')
|
|
581
669
|
.replace(/\b\w/g, l => l.toUpperCase());
|
|
582
670
|
}
|
|
583
|
-
// Handler de erro padrão
|
|
584
|
-
handleError(error) {
|
|
585
|
-
console.error('[UnBPessoaService] Erro na chamada HTTP:', error);
|
|
586
|
-
return throwError(() => error);
|
|
587
|
-
}
|
|
588
671
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnBPessoaService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
589
672
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnBPessoaService, providedIn: 'root' }); }
|
|
590
673
|
}
|
|
@@ -596,13 +679,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
|
|
|
596
679
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }] });
|
|
597
680
|
|
|
598
681
|
class UnbPessoaEmailFormComponent {
|
|
599
|
-
constructor(snackBar, service, dialogRef, data) {
|
|
682
|
+
constructor(snackBar, service, alertService, dialogRef, data) {
|
|
600
683
|
this.snackBar = snackBar;
|
|
601
684
|
this.service = service;
|
|
685
|
+
this.alertService = alertService;
|
|
602
686
|
this.dialogRef = dialogRef;
|
|
603
687
|
this.data = data;
|
|
604
688
|
this.email = new UnbPessoaEmail();
|
|
605
689
|
this.listaTipoEmail = [];
|
|
690
|
+
this.idMensagemService = "UnbPessoaEmailForm";
|
|
606
691
|
this.email = JSON.parse(JSON.stringify(data.email)); // O e-mail específico para edição
|
|
607
692
|
// Verifique se a lista de e-mails foi passada e atribua-a
|
|
608
693
|
if (data.emailsList) {
|
|
@@ -616,23 +701,27 @@ class UnbPessoaEmailFormComponent {
|
|
|
616
701
|
}
|
|
617
702
|
}
|
|
618
703
|
ngOnInit() {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
704
|
+
// Chamamos o serviço direto. Não guardamos o observable, apenas o resultado.
|
|
705
|
+
this.service.getTipoEmail().subscribe({
|
|
706
|
+
next: (lista) => {
|
|
707
|
+
// 1. Guarda a lista para o HTML usar
|
|
708
|
+
this.listaTipoEmail = lista;
|
|
709
|
+
// 2. Lógica de Seleção Automática (Match)
|
|
710
|
+
if (this.email.tipoEmailCodigo != null) {
|
|
711
|
+
const tipoEncontrado = lista.find(t => t.codigo === this.email.tipoEmailCodigo);
|
|
712
|
+
if (tipoEncontrado) {
|
|
713
|
+
this.email.tipo = tipoEncontrado.denominacao;
|
|
714
|
+
}
|
|
628
715
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
716
|
+
else if (this.email.tipo) {
|
|
717
|
+
const tipoEncontrado = lista.find(t => t.denominacao?.toLowerCase() === this.email.tipo?.toLowerCase());
|
|
718
|
+
if (tipoEncontrado) {
|
|
719
|
+
this.email.tipoEmailCodigo = tipoEncontrado.codigo;
|
|
720
|
+
}
|
|
634
721
|
}
|
|
635
|
-
}
|
|
722
|
+
},
|
|
723
|
+
// 3. Usa seu tratamento de erro novo
|
|
724
|
+
error: (err) => this.handleError(err)
|
|
636
725
|
});
|
|
637
726
|
}
|
|
638
727
|
salvar(form) {
|
|
@@ -710,18 +799,40 @@ class UnbPessoaEmailFormComponent {
|
|
|
710
799
|
salvarclose() {
|
|
711
800
|
this.dialogRef.close(this.emailSalvo);
|
|
712
801
|
}
|
|
802
|
+
handleError(erro) {
|
|
803
|
+
let erroTratado;
|
|
804
|
+
// Converte string local em Objeto Padrão
|
|
805
|
+
if (typeof erro === 'string') {
|
|
806
|
+
erroTratado = {
|
|
807
|
+
status: 400,
|
|
808
|
+
mensagemSimples: erro,
|
|
809
|
+
mensagemHtml: `<strong>${erro}</strong>`
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
erroTratado = erro;
|
|
814
|
+
}
|
|
815
|
+
// 1. SnackBar
|
|
816
|
+
if (erroTratado.mensagemSimples) {
|
|
817
|
+
this.openSnackBar(erroTratado.mensagemSimples);
|
|
818
|
+
}
|
|
819
|
+
// 2. AlertService (Se houver tag <unb-mensagem> no HTML do dialog)
|
|
820
|
+
if (this.alertService && erroTratado.mensagemHtml) {
|
|
821
|
+
this.alertService.showMessage(erroTratado.mensagemHtml, UnbTipoMensagemEnum.DANGER, this.idMensagemService);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
713
824
|
openSnackBar(message) {
|
|
714
825
|
this.snackBar.open(message, 'x', {
|
|
715
826
|
duration: 5000,
|
|
716
827
|
});
|
|
717
828
|
}
|
|
718
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
719
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEmailFormComponent, selector: "lib-unb-pessoa-email-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"email.tipoEmailCodigo\" [compareWith]=\"compararTipos\" name=\"tipoEmailCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: UnbMensagemService }, { token: i4$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
830
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEmailFormComponent, selector: "lib-unb-pessoa-email-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"email.tipoEmailCodigo\" [compareWith]=\"compararTipos\" name=\"tipoEmailCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoEmail\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>E-mail</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"email.email\" name=\"emailValue\" #emailValue=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-60{flex:1 1 60%}.form-70{flex:1 1 70%}.form-80{flex:1 1 80%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo", "identificador"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i12.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] }); }
|
|
720
831
|
}
|
|
721
832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailFormComponent, decorators: [{
|
|
722
833
|
type: Component,
|
|
723
|
-
args: [{ standalone: false, selector: 'lib-unb-pessoa-email-form', template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"email.tipoEmailCodigo\" [compareWith]=\"compararTipos\" name=\"tipoEmailCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
724
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
834
|
+
args: [{ standalone: false, selector: 'lib-unb-pessoa-email-form', template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"email.tipoEmailCodigo\" [compareWith]=\"compararTipos\" name=\"tipoEmailCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoEmail\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>E-mail</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"email.email\" name=\"emailValue\" #emailValue=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-60{flex:1 1 60%}.form-70{flex:1 1 70%}.form-80{flex:1 1 80%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"] }]
|
|
835
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: UnbMensagemService }, { type: i4$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
725
836
|
type: Inject,
|
|
726
837
|
args: [MAT_DIALOG_DATA]
|
|
727
838
|
}] }] });
|
|
@@ -732,14 +843,16 @@ class UnbPessoaEnderecoTipo {
|
|
|
732
843
|
}
|
|
733
844
|
|
|
734
845
|
class UnbPessoaEnderecoFormComponent {
|
|
735
|
-
constructor(snackBar, service, dialogRef, data) {
|
|
846
|
+
constructor(snackBar, service, alertService, dialogRef, data) {
|
|
736
847
|
this.snackBar = snackBar;
|
|
737
848
|
this.service = service;
|
|
849
|
+
this.alertService = alertService;
|
|
738
850
|
this.dialogRef = dialogRef;
|
|
739
851
|
this.data = data;
|
|
740
852
|
this.endereco = new UnbPessoaEndereco();
|
|
741
853
|
this.listaTipoEndereco = [];
|
|
742
854
|
this.listaPaises = [];
|
|
855
|
+
this.idMensagemService = "UnbPessoaEnderecoForm";
|
|
743
856
|
this.endereco = JSON.parse(JSON.stringify(data.endereco)); // O e-mail específico para edição
|
|
744
857
|
// Verifique se a lista de e-mails foi passada e atribua-a
|
|
745
858
|
if (data.enderecosList) {
|
|
@@ -753,56 +866,61 @@ class UnbPessoaEnderecoFormComponent {
|
|
|
753
866
|
}
|
|
754
867
|
}
|
|
755
868
|
ngOnInit() {
|
|
756
|
-
this.tipoEndereco = this.service.getTipoEndereco();
|
|
757
|
-
this.paises = this.service.getPaises(); // Você já tinha isso
|
|
758
869
|
// --- Preenche o Tipos de Endereço ---
|
|
759
|
-
this.
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
870
|
+
this.service.getTipoEndereco().subscribe({
|
|
871
|
+
next: (lista) => {
|
|
872
|
+
this.listaTipoEndereco = lista;
|
|
873
|
+
// Se já tiver tipoEnderecoCodigo, preenche o nome correspondente
|
|
874
|
+
if (this.endereco.tipoEnderecoCodigo != null) {
|
|
875
|
+
const tipoEncontrado = lista.find(t => t.codigo === this.endereco.tipoEnderecoCodigo);
|
|
876
|
+
if (tipoEncontrado) {
|
|
877
|
+
this.endereco.tipo = tipoEncontrado.denominacao;
|
|
878
|
+
}
|
|
766
879
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
880
|
+
else if (this.endereco.tipo) {
|
|
881
|
+
// Se tiver só o nome, preenche o código
|
|
882
|
+
const tipoEncontrado = lista.find(t => t.denominacao?.toLowerCase() === this.endereco.tipo?.toLowerCase());
|
|
883
|
+
if (tipoEncontrado) {
|
|
884
|
+
this.endereco.tipoEnderecoCodigo = tipoEncontrado.codigo;
|
|
885
|
+
}
|
|
773
886
|
}
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}
|
|
887
|
+
// O metodo get retorna uf, mas o put espera ufEndereco
|
|
888
|
+
if (this.endereco.uf) {
|
|
889
|
+
this.endereco.ufEndereco = this.endereco.uf; // Converte uf para ufEndereco
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
// Tratamento de erro no carregamento da lista
|
|
893
|
+
error: (err) => this.handleError(err)
|
|
779
894
|
});
|
|
780
895
|
// --- Preenche o País ---
|
|
781
|
-
this.
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
896
|
+
this.service.getPaises().subscribe({
|
|
897
|
+
next: (listaDePaises) => {
|
|
898
|
+
this.listaPaises = listaDePaises; // Armazena a lista de países
|
|
899
|
+
const CODIGO_BRASIL = 22; // Código padrão para o Brasil
|
|
900
|
+
// Lógica 1: Se o ID do país já existe (ex: 22), encontra o nome (ex: "Brasil")
|
|
901
|
+
if (this.endereco.paisEnderecoCodigo != null) {
|
|
902
|
+
const paisEncontrado = this.listaPaises.find(p => p.codigo === this.endereco.paisEnderecoCodigo);
|
|
903
|
+
if (paisEncontrado) {
|
|
904
|
+
this.endereco.pais = paisEncontrado.denominacao;
|
|
905
|
+
}
|
|
789
906
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
907
|
+
// Lógica 2: Se o nome do país existe (ex: "Brasil"), encontra o ID (ex: 22)
|
|
908
|
+
else if (this.endereco.pais) {
|
|
909
|
+
const paisEncontrado = this.listaPaises.find(p => p.denominacao?.toLowerCase() === this.endereco.pais?.toLowerCase());
|
|
910
|
+
if (paisEncontrado) {
|
|
911
|
+
this.endereco.paisEnderecoCodigo = paisEncontrado.codigo;
|
|
912
|
+
}
|
|
913
|
+
else {
|
|
914
|
+
// Se o nome foi fornecido mas não encontrado na lista, assume Brasil
|
|
915
|
+
this.endereco.paisEnderecoCodigo = CODIGO_BRASIL;
|
|
916
|
+
}
|
|
796
917
|
}
|
|
918
|
+
// Lógica 3: Se nem o ID nem o nome existem, assume Brasil por padrão
|
|
797
919
|
else {
|
|
798
|
-
// Se o nome foi fornecido mas não encontrado na lista, assume Brasil
|
|
799
920
|
this.endereco.paisEnderecoCodigo = CODIGO_BRASIL;
|
|
800
921
|
}
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
else {
|
|
804
|
-
this.endereco.paisEnderecoCodigo = CODIGO_BRASIL;
|
|
805
|
-
}
|
|
922
|
+
},
|
|
923
|
+
error: (err) => this.handleError(err)
|
|
806
924
|
});
|
|
807
925
|
}
|
|
808
926
|
salvar(form) {
|
|
@@ -843,14 +961,13 @@ class UnbPessoaEnderecoFormComponent {
|
|
|
843
961
|
this.endereco.uf = data.uf;
|
|
844
962
|
this.endereco.complemento = data.complemento;
|
|
845
963
|
},
|
|
846
|
-
error: (
|
|
847
|
-
this.
|
|
848
|
-
console.error('Erro ao pesquisar CEP:', error);
|
|
964
|
+
error: (err) => {
|
|
965
|
+
this.handleError(err);
|
|
849
966
|
}
|
|
850
967
|
});
|
|
851
968
|
}
|
|
852
969
|
else {
|
|
853
|
-
this.
|
|
970
|
+
this.handleError('Por favor, insira um CEP válido.');
|
|
854
971
|
}
|
|
855
972
|
}
|
|
856
973
|
getListaEstados() {
|
|
@@ -868,12 +985,12 @@ class UnbPessoaEnderecoFormComponent {
|
|
|
868
985
|
// 1. Validação de tipoEnderecoCodigo (Obrigatório e 0-4)
|
|
869
986
|
// [Java: request.getTipoEnderecoCodigo() == null]
|
|
870
987
|
if (enderecoToValidate.tipoEnderecoCodigo == null) {
|
|
871
|
-
this.
|
|
988
|
+
this.handleError("Tipo de Endereço é um campo obrigatório.");
|
|
872
989
|
return false;
|
|
873
990
|
}
|
|
874
991
|
// [Java: request.getTipoEnderecoCodigo() < (byte) 0 || request.getTipoEnderecoCodigo() > (byte) 4]
|
|
875
992
|
if (enderecoToValidate.tipoEnderecoCodigo < 0 || enderecoToValidate.tipoEnderecoCodigo > 4) {
|
|
876
|
-
this.
|
|
993
|
+
this.handleError("Tipo de Endereço é inválido (deve ser entre 0 e 4).");
|
|
877
994
|
return false;
|
|
878
995
|
}
|
|
879
996
|
// 3. Validação de CEP (8 dígitos, se preenchido)
|
|
@@ -881,39 +998,39 @@ class UnbPessoaEnderecoFormComponent {
|
|
|
881
998
|
if (enderecoToValidate.cep && enderecoToValidate.cep.trim() !== '') {
|
|
882
999
|
const cepLimpo = enderecoToValidate.cep.replace(/\D/g, ''); // Remove não-dígitos
|
|
883
1000
|
if (cepLimpo.length !== 8) {
|
|
884
|
-
this.
|
|
1001
|
+
this.handleError("CEP deve conter 8 dígitos.");
|
|
885
1002
|
return false;
|
|
886
1003
|
}
|
|
887
1004
|
}
|
|
888
1005
|
// 4. Validação de Logradouro (Max 100, se preenchido)
|
|
889
1006
|
// [Java: request.getLogradouro().trim().length() > 100]
|
|
890
1007
|
if (enderecoToValidate.logradouro && enderecoToValidate.logradouro.trim().length > 100) {
|
|
891
|
-
this.
|
|
1008
|
+
this.handleError("Logradouro deve ter no máximo 100 caracteres.");
|
|
892
1009
|
return false;
|
|
893
1010
|
}
|
|
894
1011
|
// 5. Validação de Bairro (Max 100, se preenchido)
|
|
895
1012
|
// [Java: request.getBairro().trim().length() > 100]
|
|
896
1013
|
if (enderecoToValidate.bairro && enderecoToValidate.bairro.trim().length > 100) {
|
|
897
|
-
this.
|
|
1014
|
+
this.handleError("Bairro deve ter no máximo 100 caracteres.");
|
|
898
1015
|
return false;
|
|
899
1016
|
}
|
|
900
1017
|
// 6. Validação de Complemento (Max 100, se preenchido)
|
|
901
1018
|
// [Java: request.getComplemento().trim().length() > 100]
|
|
902
1019
|
if (enderecoToValidate.complemento && enderecoToValidate.complemento.trim().length > 100) {
|
|
903
|
-
this.
|
|
1020
|
+
this.handleError("Complemento deve ter no máximo 100 caracteres.");
|
|
904
1021
|
return false;
|
|
905
1022
|
}
|
|
906
1023
|
// 7. Validação de Caixa Postal (Max 100, se preenchida)
|
|
907
1024
|
// [Java: request.getCaixaPostal().trim().length() > 100]
|
|
908
1025
|
if (enderecoToValidate.caixaPostal && enderecoToValidate.caixaPostal.trim().length > 100) {
|
|
909
|
-
this.
|
|
1026
|
+
this.handleError("Caixa Postal deve ter no máximo 100 caracteres.");
|
|
910
1027
|
return false;
|
|
911
1028
|
}
|
|
912
1029
|
// 8. Validação de UF (2 caracteres, se preenchida)
|
|
913
1030
|
// O form usa 'ufEndereco', o java usa 'uf'. O ngOnInit mapeia uf -> ufEndereco.
|
|
914
1031
|
// [Java: request.getUf().trim().length() != 2]
|
|
915
1032
|
if (enderecoToValidate.ufEndereco && enderecoToValidate.ufEndereco.trim().length !== 2) {
|
|
916
|
-
this.
|
|
1033
|
+
this.handleError("UF deve ter 2 caracteres.");
|
|
917
1034
|
return false;
|
|
918
1035
|
}
|
|
919
1036
|
// --- Validação de Duplicar ---
|
|
@@ -932,18 +1049,40 @@ class UnbPessoaEnderecoFormComponent {
|
|
|
932
1049
|
salvarclose() {
|
|
933
1050
|
this.dialogRef.close(this.enderecoSalvo);
|
|
934
1051
|
}
|
|
1052
|
+
handleError(erro) {
|
|
1053
|
+
let erroTratado;
|
|
1054
|
+
// Converte string local em Objeto Padrão
|
|
1055
|
+
if (typeof erro === 'string') {
|
|
1056
|
+
erroTratado = {
|
|
1057
|
+
status: 400,
|
|
1058
|
+
mensagemSimples: erro,
|
|
1059
|
+
mensagemHtml: `<strong>${erro}</strong>`
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
erroTratado = erro;
|
|
1064
|
+
}
|
|
1065
|
+
// 1. SnackBar
|
|
1066
|
+
if (erroTratado.mensagemSimples) {
|
|
1067
|
+
this.openSnackBar(erroTratado.mensagemSimples);
|
|
1068
|
+
}
|
|
1069
|
+
// 2. AlertService (Se houver tag <unb-mensagem> no HTML do dialog)
|
|
1070
|
+
if (this.alertService && erroTratado.mensagemHtml) {
|
|
1071
|
+
this.alertService.showMessage(erroTratado.mensagemHtml, UnbTipoMensagemEnum.DANGER, this.idMensagemService);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
935
1074
|
openSnackBar(message) {
|
|
936
1075
|
this.snackBar.open(message, 'x', {
|
|
937
1076
|
duration: 5000,
|
|
938
1077
|
});
|
|
939
1078
|
}
|
|
940
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEnderecoFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
941
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEnderecoFormComponent, selector: "lib-unb-pessoa-endereco-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.tipoEnderecoCodigo\" name=\"tipo\" #tipo=\"ngModel\"\r\n (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
1079
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEnderecoFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: UnbMensagemService }, { token: i4$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1080
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEnderecoFormComponent, selector: "lib-unb-pessoa-endereco-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.tipoEnderecoCodigo\" name=\"tipo\" #tipo=\"ngModel\"\r\n (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoEndereco\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs</mat-label>\r\n\r\n <mat-select [(ngModel)]=\"endereco.paisEnderecoCodigo\" name=\"paisEnderecoCodigo\" #paisEnderecoCodigo=\"ngModel\">\r\n\r\n <mat-option *ngFor=\"let paises of listaPaises\" [value]=\"paises.codigo\">\r\n <span *ngIf=\"paises.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paises.denominacao }}</b></span>\r\n <span *ngIf=\"paises.denominacao !== 'BRASIL'\">{{ paises.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>CEP</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.cep\" name=\"cep\" #cep=\"ngModel\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisarCep()\">\r\n <mat-icon style=\"margin-right: 2px;\">search</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Endere\u00E7o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.logradouro\" name=\"logradouro\" #logradouro=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Bairro</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.bairro\" name=\"bairro\" #bairro=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Complemento</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.complemento\" name=\"complemento\" #complemento=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>UF</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.uf\" name=\"uf\" #uf=\"ngModel\">\r\n <mat-option *ngFor=\"let uf of getListaEstados()\" [value]=\"uf\">\r\n {{ uf }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo", "identificador"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i12.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] }); }
|
|
942
1081
|
}
|
|
943
1082
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEnderecoFormComponent, decorators: [{
|
|
944
1083
|
type: Component,
|
|
945
|
-
args: [{ standalone: false, selector: 'lib-unb-pessoa-endereco-form', template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.tipoEnderecoCodigo\" name=\"tipo\" #tipo=\"ngModel\"\r\n (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
946
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
1084
|
+
args: [{ standalone: false, selector: 'lib-unb-pessoa-endereco-form', template: "<h1 mat-dialog-title>Cadastro de E-mail</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.tipoEnderecoCodigo\" name=\"tipo\" #tipo=\"ngModel\"\r\n (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoEndereco\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs</mat-label>\r\n\r\n <mat-select [(ngModel)]=\"endereco.paisEnderecoCodigo\" name=\"paisEnderecoCodigo\" #paisEnderecoCodigo=\"ngModel\">\r\n\r\n <mat-option *ngFor=\"let paises of listaPaises\" [value]=\"paises.codigo\">\r\n <span *ngIf=\"paises.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paises.denominacao }}</b></span>\r\n <span *ngIf=\"paises.denominacao !== 'BRASIL'\">{{ paises.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>CEP</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.cep\" name=\"cep\" #cep=\"ngModel\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisarCep()\">\r\n <mat-icon style=\"margin-right: 2px;\">search</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Endere\u00E7o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.logradouro\" name=\"logradouro\" #logradouro=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Bairro</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.bairro\" name=\"bairro\" #bairro=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Complemento</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"endereco.complemento\" name=\"complemento\" #complemento=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>UF</mat-label>\r\n <mat-select [(ngModel)]=\"endereco.uf\" name=\"uf\" #uf=\"ngModel\">\r\n <mat-option *ngFor=\"let uf of getListaEstados()\" [value]=\"uf\">\r\n {{ uf }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"] }]
|
|
1085
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: UnbMensagemService }, { type: i4$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
947
1086
|
type: Inject,
|
|
948
1087
|
args: [MAT_DIALOG_DATA]
|
|
949
1088
|
}] }] });
|
|
@@ -1062,11 +1201,13 @@ class UnbUtils {
|
|
|
1062
1201
|
}
|
|
1063
1202
|
|
|
1064
1203
|
class UnbPessoaPesquisarComponent {
|
|
1065
|
-
constructor(pessoaService, snackBar) {
|
|
1204
|
+
constructor(pessoaService, snackBar, alertService) {
|
|
1066
1205
|
this.pessoaService = pessoaService;
|
|
1067
1206
|
this.snackBar = snackBar;
|
|
1207
|
+
this.alertService = alertService;
|
|
1068
1208
|
this.isLoading = false;
|
|
1069
|
-
|
|
1209
|
+
// Configuração da API. Exemplo SGI.unb.br/pessoa-api
|
|
1210
|
+
this.backendURL = "";
|
|
1070
1211
|
this.pesquisarPorCPF = true;
|
|
1071
1212
|
this.pesquisarPorCNPJ = true;
|
|
1072
1213
|
this.pesquisarPorEstrangeiro = true;
|
|
@@ -1083,25 +1224,16 @@ class UnbPessoaPesquisarComponent {
|
|
|
1083
1224
|
this.listaTipoEndereco = [];
|
|
1084
1225
|
this.listaTipoTelefone = [];
|
|
1085
1226
|
this.listaTipoEmail = [];
|
|
1227
|
+
this.idMensagemService = "UnbPessoaPesquisar";
|
|
1086
1228
|
}
|
|
1087
1229
|
ngOnInit() {
|
|
1088
|
-
if (this.
|
|
1089
|
-
this.apiPessoaConfig.url = this.apiPessoaConfig.url.slice(0, -1);
|
|
1090
|
-
}
|
|
1091
|
-
if (this.apiPessoaConfig.url == "") {
|
|
1230
|
+
if (this.backendURL == "") {
|
|
1092
1231
|
this.handleErrorPrintConsole("[UnbPessoaPesquisarComponent] ERROR: apiPessoaConfig.url está null. Insira o parâmetro (apiPessoaConfig) com o valor válido!");
|
|
1093
1232
|
return;
|
|
1094
1233
|
}
|
|
1095
|
-
|
|
1096
|
-
this.
|
|
1097
|
-
return;
|
|
1098
|
-
}
|
|
1099
|
-
// se chegar com barra no final, eu retiro. Pra ficar no padrao
|
|
1100
|
-
if (this.apiPessoaConfig.url.endsWith('/')) {
|
|
1101
|
-
this.apiPessoaConfig.url = this.apiPessoaConfig.url.slice(0, -1);
|
|
1234
|
+
else {
|
|
1235
|
+
this.pessoaService.setBackendUrl(this.backendURL);
|
|
1102
1236
|
}
|
|
1103
|
-
// inicializa o serviço com a configuração da API
|
|
1104
|
-
this.pessoaService.setApiConfig(this.apiPessoaConfig);
|
|
1105
1237
|
forkJoin({
|
|
1106
1238
|
tiposEnd: this.pessoaService.getTipoEndereco(),
|
|
1107
1239
|
tiposTel: this.pessoaService.getTipoTelefone(),
|
|
@@ -1174,12 +1306,8 @@ class UnbPessoaPesquisarComponent {
|
|
|
1174
1306
|
}
|
|
1175
1307
|
}
|
|
1176
1308
|
validar() {
|
|
1177
|
-
if (this.
|
|
1178
|
-
this.handleErrorPrintConsole("[UnbPessoaPesquisarComponent] ERROR:
|
|
1179
|
-
return false;
|
|
1180
|
-
}
|
|
1181
|
-
if (this.apiPessoaConfig.token == "") {
|
|
1182
|
-
this.handleErrorPrintConsole("[UnbPessoaPesquisarComponent] ERROR: apiPessoaConfig.token está null. Insira o parâmetro (apiPessoaConfig) com o valor do token da sua aplicação");
|
|
1309
|
+
if (this.backendURL == "") {
|
|
1310
|
+
this.handleErrorPrintConsole("[UnbPessoaPesquisarComponent] ERROR: backendURL.url está null. Insira o parâmetro (backendURL) com o valor da URL do seu Backend!");
|
|
1183
1311
|
return false;
|
|
1184
1312
|
}
|
|
1185
1313
|
if (this.pessoa.tipoPessoa == TipoPessoaEnum.FISICA) {
|
|
@@ -1356,10 +1484,31 @@ class UnbPessoaPesquisarComponent {
|
|
|
1356
1484
|
return null; // Formato inválido
|
|
1357
1485
|
}
|
|
1358
1486
|
handleError(erro) {
|
|
1359
|
-
this.openSnackBar(erro);
|
|
1360
1487
|
this.isLoading = false;
|
|
1361
|
-
// se chegar aki, entao nao encontrou a pessoa. Mas damos a chance de incluir pessoa
|
|
1362
1488
|
this.pessoaEncontrado = false;
|
|
1489
|
+
let erroTratado;
|
|
1490
|
+
// --- ADAPTER: Converte string para o Objeto Padrão ---
|
|
1491
|
+
if (typeof erro === 'string') {
|
|
1492
|
+
erroTratado = {
|
|
1493
|
+
status: 400, // Erro de validação local geralmente é 400
|
|
1494
|
+
mensagemSimples: erro,
|
|
1495
|
+
mensagemHtml: `<strong>${erro}</strong>`
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
else {
|
|
1499
|
+
// Se já veio do Service (ou é um objeto manual), usa direto
|
|
1500
|
+
erroTratado = erro;
|
|
1501
|
+
}
|
|
1502
|
+
// --- LÓGICA DE EXIBIÇÃO ---
|
|
1503
|
+
// 1. SnackBar (Mensagem curta)
|
|
1504
|
+
if (erroTratado.mensagemSimples) {
|
|
1505
|
+
this.openSnackBar(erroTratado.mensagemSimples);
|
|
1506
|
+
}
|
|
1507
|
+
// 2. Componente de Mensagem (Mensagem HTML)
|
|
1508
|
+
if (this.alertService && erroTratado.mensagemHtml) {
|
|
1509
|
+
// Se você tiver a variável idMensagemService definida na classe:
|
|
1510
|
+
this.alertService.showMessage(erroTratado.mensagemHtml, UnbTipoMensagemEnum.DANGER, this.idMensagemService);
|
|
1511
|
+
}
|
|
1363
1512
|
}
|
|
1364
1513
|
handleErrorPrintConsole(erro) {
|
|
1365
1514
|
console.log(erro);
|
|
@@ -1373,13 +1522,13 @@ class UnbPessoaPesquisarComponent {
|
|
|
1373
1522
|
tipoPessoaEnum() {
|
|
1374
1523
|
return TipoPessoaEnum;
|
|
1375
1524
|
}
|
|
1376
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaPesquisarComponent, deps: [{ token: UnBPessoaService }, { token: i1$2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1377
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaPesquisarComponent, selector: "lib-unb-pessoa-pesquisar", inputs: {
|
|
1525
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaPesquisarComponent, deps: [{ token: UnBPessoaService }, { token: i1$2.MatSnackBar }, { token: UnbMensagemService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1526
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaPesquisarComponent, selector: "lib-unb-pessoa-pesquisar", inputs: { backendURL: "backendURL", pesquisarPorCPF: "pesquisarPorCPF", pesquisarPorCNPJ: "pesquisarPorCNPJ", pesquisarPorEstrangeiro: "pesquisarPorEstrangeiro", defaultTipoPessoa: "defaultTipoPessoa", campoPesquisaMaxWidth: "campoPesquisaMaxWidth", pessoa: "pessoa", mostrarPesquisa: "mostrarPesquisa", limparAposPesquisa: "limparAposPesquisa", label: "label", placeholder: "placeholder", hint: "hint" }, outputs: { pessoaEmitted: "pessoaEmitted" }, ngImport: i0, template: "<form #pessoaForm=\"ngForm\" class=\"pesquisa-container\" [ngStyle]=\"{'--tamanho-maximo': campoPesquisaMaxWidth}\" (ngSubmit)=\"pesquisar()\">\r\n <div class=\"mensagem-container\" style=\"width: 100%;\">\r\n <unb-mensagem [identificador]=\"idMensagemService\" class=\"mensagem-form\" ></unb-mensagem>\r\n </div>\r\n \r\n <div class=\"form-wrapper\">\r\n <div *ngIf=\"mostrarTipoPessoa\" class=\"radio-container\">\r\n <mat-radio-group aria-label=\"Tipo de Pessoa\" [(ngModel)]=\"pessoa.tipoPessoa\" #tipoPessoa=\"ngModel\" name=\"tipoPessoa\">\r\n <mat-radio-button *ngIf=\"pesquisarPorCPF\" value=\"{{ tipoPessoaEnum().FISICA}}\">Pessoa F\u00EDsica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorCNPJ\" value=\"{{tipoPessoaEnum().JURIDICA}}\"> Pessoa Jur\u00EDdica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorEstrangeiro\" value=\"{{tipoPessoaEnum().ESTRANGEIRA}}\">Estrangeiro</mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"break\"></div>\r\n \r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().FISICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CPF</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cpf\" name=\"cpf\" #cpf=\"ngModel\" required={{true}}/> \r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" [disabled]=\"isLoading\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CNPJ</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cnpj\" name=\"cnpj\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n</form>", styles: [".pesquisa-container{display:flex;flex-direction:column;align-items:flex-start}.form-wrapper{display:flex;flex-direction:column;width:100%;max-width:var(--tamanho-maximo);gap:5px}.mensagem-form{display:block;width:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo", "identificador"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i11$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i12$1.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i12$1.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }] }); }
|
|
1378
1527
|
}
|
|
1379
1528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaPesquisarComponent, decorators: [{
|
|
1380
1529
|
type: Component,
|
|
1381
|
-
args: [{ selector: 'lib-unb-pessoa-pesquisar', standalone: false, template: "<form #pessoaForm=\"ngForm\" class=\"pesquisa-container\" [ngStyle]=\"{'--tamanho-maximo': campoPesquisaMaxWidth}\" (ngSubmit)=\"pesquisar()\">\r\n <div class=\"form-wrapper\">\r\n <div *ngIf=\"mostrarTipoPessoa\" class=\"radio-container\">\r\n <mat-radio-group aria-label=\"Tipo de Pessoa\" [(ngModel)]=\"pessoa.tipoPessoa\" #tipoPessoa=\"ngModel\" name=\"tipoPessoa\">\r\n <mat-radio-button *ngIf=\"pesquisarPorCPF\" value=\"{{ tipoPessoaEnum().FISICA}}\">Pessoa F\u00EDsica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorCNPJ\" value=\"{{tipoPessoaEnum().JURIDICA}}\"> Pessoa Jur\u00EDdica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorEstrangeiro\" value=\"{{tipoPessoaEnum().ESTRANGEIRA}}\">Estrangeiro</mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"break\"></div>\r\n \r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().FISICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CPF</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cpf\" name=\"cpf\" #cpf=\"ngModel\" required={{true}}/> \r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" [disabled]=\"isLoading\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CNPJ</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cnpj\" name=\"cnpj\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n</form>", styles: [".pesquisa-container{display:flex;
|
|
1382
|
-
}], ctorParameters: () => [{ type: UnBPessoaService }, { type: i1$2.MatSnackBar }], propDecorators: {
|
|
1530
|
+
args: [{ selector: 'lib-unb-pessoa-pesquisar', standalone: false, template: "<form #pessoaForm=\"ngForm\" class=\"pesquisa-container\" [ngStyle]=\"{'--tamanho-maximo': campoPesquisaMaxWidth}\" (ngSubmit)=\"pesquisar()\">\r\n <div class=\"mensagem-container\" style=\"width: 100%;\">\r\n <unb-mensagem [identificador]=\"idMensagemService\" class=\"mensagem-form\" ></unb-mensagem>\r\n </div>\r\n \r\n <div class=\"form-wrapper\">\r\n <div *ngIf=\"mostrarTipoPessoa\" class=\"radio-container\">\r\n <mat-radio-group aria-label=\"Tipo de Pessoa\" [(ngModel)]=\"pessoa.tipoPessoa\" #tipoPessoa=\"ngModel\" name=\"tipoPessoa\">\r\n <mat-radio-button *ngIf=\"pesquisarPorCPF\" value=\"{{ tipoPessoaEnum().FISICA}}\">Pessoa F\u00EDsica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorCNPJ\" value=\"{{tipoPessoaEnum().JURIDICA}}\"> Pessoa Jur\u00EDdica</mat-radio-button>\r\n <mat-radio-button *ngIf=\"pesquisarPorEstrangeiro\" value=\"{{tipoPessoaEnum().ESTRANGEIRA}}\">Estrangeiro</mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"break\"></div>\r\n \r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().FISICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CPF</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cpf\" name=\"cpf\" #cpf=\"ngModel\" required={{true}}/> \r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" [disabled]=\"isLoading\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>CNPJ</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.cnpj\" name=\"cnpj\" required=\"true\" />\r\n <button matSuffix mat-icon-button type=\"button\" aria-label=\"Pesquisar\" (click)=\"pesquisar()\">\r\n <ng-container *ngIf=\"!isLoading; else loadingIcon\">\r\n <mat-icon>search</mat-icon>\r\n </ng-container>\r\n <ng-template #loadingIcon>\r\n <mat-progress-spinner\r\n [diameter]=\"20\"\r\n mode=\"indeterminate\"\r\n color=\"primary\"\r\n class=\"spinner-button\">\r\n </mat-progress-spinner>\r\n </ng-template>\r\n </button>\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n</form>", styles: [".pesquisa-container{display:flex;flex-direction:column;align-items:flex-start}.form-wrapper{display:flex;flex-direction:column;width:100%;max-width:var(--tamanho-maximo);gap:5px}.mensagem-form{display:block;width:100%}\n"] }]
|
|
1531
|
+
}], ctorParameters: () => [{ type: UnBPessoaService }, { type: i1$2.MatSnackBar }, { type: UnbMensagemService }], propDecorators: { backendURL: [{
|
|
1383
1532
|
type: Input
|
|
1384
1533
|
}], pesquisarPorCPF: [{
|
|
1385
1534
|
type: Input
|
|
@@ -1417,13 +1566,15 @@ class UnbPessoaTelefoneTipo {
|
|
|
1417
1566
|
}
|
|
1418
1567
|
|
|
1419
1568
|
class UnbPessoaTelefoneFormComponent {
|
|
1420
|
-
constructor(snackBar, service, dialogRef, data) {
|
|
1569
|
+
constructor(snackBar, service, alertService, dialogRef, data) {
|
|
1421
1570
|
this.snackBar = snackBar;
|
|
1422
1571
|
this.service = service;
|
|
1572
|
+
this.alertService = alertService;
|
|
1423
1573
|
this.dialogRef = dialogRef;
|
|
1424
1574
|
this.data = data;
|
|
1425
1575
|
this.telefone = new UnbPessoaTelefone();
|
|
1426
1576
|
this.listaTipoTelefone = [];
|
|
1577
|
+
this.idMensagemService = "UnbPessoaTelefoneForm";
|
|
1427
1578
|
this.telefone = JSON.parse(JSON.stringify(data.telefone)); // O e-mail específico para edição
|
|
1428
1579
|
// Verifique se a lista de e-mails foi passada e atribua-a
|
|
1429
1580
|
if (data.telefonesList) {
|
|
@@ -1437,23 +1588,24 @@ class UnbPessoaTelefoneFormComponent {
|
|
|
1437
1588
|
}
|
|
1438
1589
|
}
|
|
1439
1590
|
ngOnInit() {
|
|
1440
|
-
this.
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1591
|
+
this.service.getTipoTelefone().subscribe({
|
|
1592
|
+
next: (lista) => {
|
|
1593
|
+
this.listaTipoTelefone = lista;
|
|
1594
|
+
// Se já tiver tipoTelefoneCodigo, preenche o nome correspondente
|
|
1595
|
+
if (this.telefone.tipoTelefoneCodigo != null) {
|
|
1596
|
+
const tipoEncontrado = lista.find(t => t.codigo === this.telefone.tipoTelefoneCodigo);
|
|
1597
|
+
if (tipoEncontrado) {
|
|
1598
|
+
this.telefone.tipo = tipoEncontrado.denominacao;
|
|
1599
|
+
}
|
|
1449
1600
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1601
|
+
else if (this.telefone.tipo) {
|
|
1602
|
+
const tipoEncontrado = lista.find(t => t.denominacao?.toLowerCase() === this.telefone.tipo?.toLowerCase());
|
|
1603
|
+
if (tipoEncontrado) {
|
|
1604
|
+
this.telefone.tipoTelefoneCodigo = tipoEncontrado.codigo;
|
|
1605
|
+
}
|
|
1455
1606
|
}
|
|
1456
|
-
}
|
|
1607
|
+
},
|
|
1608
|
+
error: (err) => this.handleError(err)
|
|
1457
1609
|
});
|
|
1458
1610
|
}
|
|
1459
1611
|
salvar(form) {
|
|
@@ -1542,18 +1694,40 @@ class UnbPessoaTelefoneFormComponent {
|
|
|
1542
1694
|
salvarclose() {
|
|
1543
1695
|
this.dialogRef.close(this.telefoneSalvo);
|
|
1544
1696
|
}
|
|
1697
|
+
handleError(erro) {
|
|
1698
|
+
let erroTratado;
|
|
1699
|
+
// Converte string local em Objeto Padrão
|
|
1700
|
+
if (typeof erro === 'string') {
|
|
1701
|
+
erroTratado = {
|
|
1702
|
+
status: 400,
|
|
1703
|
+
mensagemSimples: erro,
|
|
1704
|
+
mensagemHtml: `<strong>${erro}</strong>`
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
else {
|
|
1708
|
+
erroTratado = erro;
|
|
1709
|
+
}
|
|
1710
|
+
// 1. SnackBar
|
|
1711
|
+
if (erroTratado.mensagemSimples) {
|
|
1712
|
+
this.openSnackBar(erroTratado.mensagemSimples);
|
|
1713
|
+
}
|
|
1714
|
+
// 2. AlertService (Se houver tag <unb-mensagem> no HTML do dialog)
|
|
1715
|
+
if (this.alertService && erroTratado.mensagemHtml) {
|
|
1716
|
+
this.alertService.showMessage(erroTratado.mensagemHtml, UnbTipoMensagemEnum.DANGER, this.idMensagemService);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1545
1719
|
openSnackBar(message) {
|
|
1546
1720
|
this.snackBar.open(message, 'x', {
|
|
1547
1721
|
duration: 5000,
|
|
1548
1722
|
});
|
|
1549
1723
|
}
|
|
1550
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
1551
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaTelefoneFormComponent, selector: "lib-unb-pessoa-telefone-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de Telefone</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"telefone.tipoTelefoneCodigo\" [compareWith]=\"compararTipos\" name=\"tipoTelefoneCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
1724
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneFormComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: UnbMensagemService }, { token: i4$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1725
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaTelefoneFormComponent, selector: "lib-unb-pessoa-telefone-form", ngImport: i0, template: "<h1 mat-dialog-title>Cadastro de Telefone</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"telefone.tipoTelefoneCodigo\" [compareWith]=\"compararTipos\" name=\"tipoTelefoneCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoTelefone\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>DDD</mat-label>\r\n <input type=\"text\" maxlength=\"3\" required matInput [(ngModel)]=\"telefone.ddd\" name=\"dddValue\" #dddValue=\"ngModel\" />\r\n </mat-form-field> \r\n \r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>N\u00FAmero</mat-label>\r\n <input type=\"text\" required maxlength=\"9\" matInput [(ngModel)]=\"telefone.numero\" name=\"telefoneValue\" #telefoneValue=\"ngModel\" />\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo", "identificador"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i12.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] }); }
|
|
1552
1726
|
}
|
|
1553
1727
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneFormComponent, decorators: [{
|
|
1554
1728
|
type: Component,
|
|
1555
|
-
args: [{ standalone: false, selector: 'lib-unb-pessoa-telefone-form', template: "<h1 mat-dialog-title>Cadastro de Telefone</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"telefone.tipoTelefoneCodigo\" [compareWith]=\"compararTipos\" name=\"tipoTelefoneCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of
|
|
1556
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
1729
|
+
args: [{ standalone: false, selector: 'lib-unb-pessoa-telefone-form', template: "<h1 mat-dialog-title>Cadastro de Telefone</h1>\r\n<form (ngSubmit)=\"salvar(form)\" #form=\"ngForm\">\r\n <mat-dialog-content>\r\n <unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n <div class=\"form-container\">\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>Tipo</mat-label>\r\n <mat-select [(ngModel)]=\"telefone.tipoTelefoneCodigo\" [compareWith]=\"compararTipos\" name=\"tipoTelefoneCodigo\" (selectionChange)=\"onTipoSelecionado($event.value)\" required>\r\n <mat-option *ngFor=\"let tipo of listaTipoTelefone\" [value]=\"tipo.codigo\">\r\n {{tipo.denominacao}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>DDD</mat-label>\r\n <input type=\"text\" maxlength=\"3\" required matInput [(ngModel)]=\"telefone.ddd\" name=\"dddValue\" #dddValue=\"ngModel\" />\r\n </mat-form-field> \r\n \r\n <mat-form-field class=\"form-100\" appearance=\"outline\">\r\n <mat-label>N\u00FAmero</mat-label>\r\n <input type=\"text\" required maxlength=\"9\" matInput [(ngModel)]=\"telefone.numero\" name=\"telefoneValue\" #telefoneValue=\"ngModel\" />\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-stroked-button type=\"button\" color=\"warn\" (click)=\"close()\">Fechar</button>\r\n <button mat-flat-button type=\"submit\" color=\"primary\">Salvar</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px;margin:10px}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.botoes-container{display:flex;gap:5px}@media (max-width: 600px){.botoes-container{margin-bottom:10px}.botoes-container button{flex:1;max-width:50%}}\n"] }]
|
|
1730
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: UnbMensagemService }, { type: i4$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
1557
1731
|
type: Inject,
|
|
1558
1732
|
args: [MAT_DIALOG_DATA]
|
|
1559
1733
|
}] }] });
|
|
@@ -1565,7 +1739,7 @@ class UnbPessoaTelefoneListComponent {
|
|
|
1565
1739
|
this.dialog = dialog;
|
|
1566
1740
|
this.podeEditar = true;
|
|
1567
1741
|
this.telefones = [];
|
|
1568
|
-
this.
|
|
1742
|
+
this.backendURL = '';
|
|
1569
1743
|
this.telefonesEmitted = new EventEmitter();
|
|
1570
1744
|
}
|
|
1571
1745
|
ngOnInit() {
|
|
@@ -1701,17 +1875,17 @@ class UnbPessoaTelefoneListComponent {
|
|
|
1701
1875
|
// 6. Finalmente, ordene a lista completa com as ordens agora únicas
|
|
1702
1876
|
this.telefones.sort((a, b) => (a.ordem ?? 0) - (b.ordem ?? 0));
|
|
1703
1877
|
}
|
|
1704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
1705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaTelefoneListComponent, selector: "lib-unb-pessoa-telefone-list", inputs: { podeEditar: "podeEditar", telefones: "telefones",
|
|
1878
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: i4$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1879
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaTelefoneListComponent, selector: "lib-unb-pessoa-telefone-list", inputs: { podeEditar: "podeEditar", telefones: "telefones", backendURL: "backendURL" }, outputs: { telefonesEmitted: "telefonesEmitted" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ telefones?.length === 1 ? 'Telefone Cadastrado' : 'Telefones Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ telefones?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Telefone\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Telefone\r\n </button>\r\n </div>\r\n\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"telefones && telefones.length > 0\" cdkDropList (cdkDropListDropped)=\"moverTelefone($event)\">\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th style=\"width: 20%;\">DDD</th>\r\n <th>N\u00FAmero</th> \r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of telefones; let i = index\" class=\"my-tr\" cdkDrag>\r\n <td style=\"text-align: center;\"> \r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n <td>{{ valor.ddd }}</td> \r\n <td>{{ valor.numero }}</td> \r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n</table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}.actions-container{display:flex;justify-content:flex-end;gap:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i6$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
|
1706
1880
|
}
|
|
1707
1881
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaTelefoneListComponent, decorators: [{
|
|
1708
1882
|
type: Component,
|
|
1709
1883
|
args: [{ standalone: false, selector: 'lib-unb-pessoa-telefone-list', template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ telefones?.length === 1 ? 'Telefone Cadastrado' : 'Telefones Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ telefones?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Telefone\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Telefone\r\n </button>\r\n </div>\r\n\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"telefones && telefones.length > 0\" cdkDropList (cdkDropListDropped)=\"moverTelefone($event)\">\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th style=\"width: 20%;\">DDD</th>\r\n <th>N\u00FAmero</th> \r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of telefones; let i = index\" class=\"my-tr\" cdkDrag>\r\n <td style=\"text-align: center;\"> \r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n <td>{{ valor.ddd }}</td> \r\n <td>{{ valor.numero }}</td> \r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n</table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}.actions-container{display:flex;justify-content:flex-end;gap:4px}\n"] }]
|
|
1710
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
1884
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: i4$2.MatDialog }], propDecorators: { podeEditar: [{
|
|
1711
1885
|
type: Input
|
|
1712
1886
|
}], telefones: [{
|
|
1713
1887
|
type: Input
|
|
1714
|
-
}],
|
|
1888
|
+
}], backendURL: [{
|
|
1715
1889
|
type: Input
|
|
1716
1890
|
}], telefonesEmitted: [{
|
|
1717
1891
|
type: Output
|
|
@@ -1724,7 +1898,7 @@ class UnbPessoaenderecoListComponent {
|
|
|
1724
1898
|
this.dialog = dialog;
|
|
1725
1899
|
this.podeEditar = true;
|
|
1726
1900
|
this.enderecos = [];
|
|
1727
|
-
this.
|
|
1901
|
+
this.backendURL = '';
|
|
1728
1902
|
this.enderecosEmitted = new EventEmitter();
|
|
1729
1903
|
}
|
|
1730
1904
|
ngOnInit() {
|
|
@@ -1845,17 +2019,17 @@ class UnbPessoaenderecoListComponent {
|
|
|
1845
2019
|
// 6. Finalmente, ordene a lista
|
|
1846
2020
|
this.enderecos.sort((a, b) => (a.ordemEndereco ?? 0) - (b.ordemEndereco ?? 0)); //
|
|
1847
2021
|
}
|
|
1848
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaenderecoListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
1849
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaenderecoListComponent, selector: "lib-unb-pessoa-endereco-list", inputs: { podeEditar: "podeEditar", enderecos: "enderecos",
|
|
2022
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaenderecoListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: i4$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2023
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaenderecoListComponent, selector: "lib-unb-pessoa-endereco-list", inputs: { podeEditar: "podeEditar", enderecos: "enderecos", backendURL: "backendURL" }, outputs: { enderecosEmitted: "enderecosEmitted" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ enderecos?.length === 1 ? 'Endere\u00E7o Cadastrado' : 'Endere\u00E7os Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ enderecos?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Endere\u00E7o\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Endere\u00E7o\r\n </button>\r\n </div>\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"enderecos && enderecos.length > 0\" cdkDropList\r\n (cdkDropListDropped)=\"moverLinha($event)\">\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th>Logradouro</th>\r\n <th>Bairro</th>\r\n <th>CEP</th>\r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of enderecos; let i = index\" class=\"my-tr\" cdkDrag>\r\n <td style=\"width: 5%; text-align: center;\">\r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n <td>{{ valor.logradouro }}</td>\r\n <td>{{ valor.bairro }}</td>\r\n <td>{{ valor.cep }}</td>\r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button aria-label=\"Salvar\" color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button aria-label=\"Deletar\" color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.actions-container{display:flex;justify-content:flex-end;gap:4px}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i6$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
|
1850
2024
|
}
|
|
1851
2025
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaenderecoListComponent, decorators: [{
|
|
1852
2026
|
type: Component,
|
|
1853
2027
|
args: [{ standalone: false, selector: 'lib-unb-pessoa-endereco-list', template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ enderecos?.length === 1 ? 'Endere\u00E7o Cadastrado' : 'Endere\u00E7os Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ enderecos?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Endere\u00E7o\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Endere\u00E7o\r\n </button>\r\n </div>\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"enderecos && enderecos.length > 0\" cdkDropList\r\n (cdkDropListDropped)=\"moverLinha($event)\">\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th>Logradouro</th>\r\n <th>Bairro</th>\r\n <th>CEP</th>\r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of enderecos; let i = index\" class=\"my-tr\" cdkDrag>\r\n <td style=\"width: 5%; text-align: center;\">\r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n <td>{{ valor.logradouro }}</td>\r\n <td>{{ valor.bairro }}</td>\r\n <td>{{ valor.cep }}</td>\r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button aria-label=\"Salvar\" color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button aria-label=\"Deletar\" color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.actions-container{display:flex;justify-content:flex-end;gap:4px}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}\n"] }]
|
|
1854
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
2028
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: i4$2.MatDialog }], propDecorators: { podeEditar: [{
|
|
1855
2029
|
type: Input
|
|
1856
2030
|
}], enderecos: [{
|
|
1857
2031
|
type: Input
|
|
1858
|
-
}],
|
|
2032
|
+
}], backendURL: [{
|
|
1859
2033
|
type: Input
|
|
1860
2034
|
}], enderecosEmitted: [{
|
|
1861
2035
|
type: Output
|
|
@@ -1868,7 +2042,7 @@ class UnbPessoaEmailListComponent {
|
|
|
1868
2042
|
this.dialog = dialog;
|
|
1869
2043
|
this.podeEditar = true;
|
|
1870
2044
|
this.emails = [];
|
|
1871
|
-
this.
|
|
2045
|
+
this.backendURL = '';
|
|
1872
2046
|
this.emailsEmitted = new EventEmitter();
|
|
1873
2047
|
}
|
|
1874
2048
|
ngOnInit() {
|
|
@@ -1992,17 +2166,17 @@ class UnbPessoaEmailListComponent {
|
|
|
1992
2166
|
// 6. Finalmente, ordene a lista
|
|
1993
2167
|
this.emails.sort((a, b) => (a.ordem ?? 0) - (b.ordem ?? 0)); // <-- 'ordem'
|
|
1994
2168
|
}
|
|
1995
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token:
|
|
1996
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEmailListComponent, selector: "lib-unb-pessoa-email-list", inputs: { podeEditar: "podeEditar", emails: "emails",
|
|
2169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailListComponent, deps: [{ token: i1$2.MatSnackBar }, { token: UnBPessoaService }, { token: i4$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2170
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaEmailListComponent, selector: "lib-unb-pessoa-email-list", inputs: { podeEditar: "podeEditar", emails: "emails", backendURL: "backendURL" }, outputs: { emailsEmitted: "emailsEmitted" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ emails?.length === 1 ? 'Email Cadastrado' : 'E-mails Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ emails?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Email\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Email\r\n </button>\r\n </div>\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"emails && emails.length > 0\" cdkDropList (cdkDropListDropped)=\"moverLinha($event)\">\r\n\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th>E-mail</th>\r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of emails; let i = index\" class=\"my-tr\" cdkDrag>\r\n\r\n <td style=\"text-align: center;\">\r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n\r\n <td>{{ valor.email }}</td>\r\n\r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button aria-label=\"Salvar\" color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button aria-label=\"Deletar\" color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}.actions-container{display:flex;justify-content:flex-end;gap:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i6$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
|
1997
2171
|
}
|
|
1998
2172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaEmailListComponent, decorators: [{
|
|
1999
2173
|
type: Component,
|
|
2000
2174
|
args: [{ standalone: false, selector: 'lib-unb-pessoa-email-list', template: "<div class=\"mes-container\">\r\n <div class=\"header-container\">\r\n <div class=\"mes-header\">\r\n <span class=\"titulo\">\r\n {{ emails?.length === 1 ? 'Email Cadastrado' : 'E-mails Cadastrados' }}\r\n </span>\r\n <span class=\"titulo\">({{ emails?.length || 0 }})</span>\r\n </div>\r\n\r\n <button type=\"button\" matTooltip=\"Novo Email\" mat-flat-button color=\"primary\" (click)=\"openFormDialog(null)\">\r\n Cadastrar Novo Email\r\n </button>\r\n </div>\r\n\r\n <!-- Exibe a tabela de despesas somente se houver despesas -->\r\n <table class=\"my-table\" *ngIf=\"emails && emails.length > 0\" cdkDropList (cdkDropListDropped)=\"moverLinha($event)\">\r\n\r\n <tr style=\"background-color: #e4e3e3cc;\">\r\n <th style=\"width: 5%; text-align: center;\">Ordem</th>\r\n <th>E-mail</th>\r\n <th>Tipo</th>\r\n <th style=\"width: 1%; text-align: center;\">A\u00E7\u00F5es</th>\r\n </tr>\r\n\r\n <tr *ngFor=\"let valor of emails; let i = index\" class=\"my-tr\" cdkDrag>\r\n\r\n <td style=\"text-align: center;\">\r\n <div class=\"drag-cell\" cdkDragHandle>\r\n <mat-icon>drag_indicator</mat-icon>\r\n <span>{{ i + 1 }}</span>\r\n </div>\r\n </td>\r\n\r\n <td>{{ valor.email }}</td>\r\n\r\n <td>{{ valor.tipo?.toUpperCase() }}</td>\r\n\r\n <td>\r\n <div class=\"actions-container\">\r\n <button type=\"button\" mat-icon-button aria-label=\"Salvar\" color=\"primary\" (click)=\"editar(valor)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button type=\"button\" mat-icon-button aria-label=\"Deletar\" color=\"warn\" (click)=\"excluir(valor)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".mes-container{padding:12px;margin-bottom:2px;border-radius:8px;box-shadow:0 2px 6px #0000001a;transition:background-color .3s ease,box-shadow .3s ease}.mes-container:nth-child(2n){background-color:#f9f9fc}.mes-container:nth-child(odd){background-color:#fff}.mes-container:hover{background-color:#f0f0f5;box-shadow:0 4px 8px #00000026}.header-container{display:flex;align-items:center;margin-bottom:2px}.header-container button{margin-left:auto}.mes-header{display:flex;align-items:center;gap:6px;font-size:1.2rem;font-weight:700;color:#333}.my-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px #0000001a;font-family:Arial,sans-serif}.my-table th,.my-table td{padding:5px;text-align:left;border-bottom:1px solid #ddd}.my-table th{background-color:#005dbb7b;color:#fff;font-weight:700}.my-table tr{transition:background-color .3s ease}.my-table tr:hover{background-color:#f1f1f1}.my-table td{background-color:#fff}.my-table td button{transition:transform .2s ease}.my-table td button:hover{transform:scale(1.1)}.my-table td:last-child{text-align:center}.order-input{width:40px;text-align:center;border:1px solid #ccc;border-radius:4px;padding:2px}.order-input:focus{border-color:#1976d2;outline:none}.drag-cell{display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:grab;-webkit-user-select:none;user-select:none}.drag-cell mat-icon{font-size:18px;line-height:1;vertical-align:middle}.cdk-drag-preview{background:#fff;border-radius:6px;box-shadow:0 4px 12px #0003;display:table;border-collapse:collapse}.cdk-drag-placeholder{opacity:0;display:table-row}.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}table[cdkDropList] tr{border-bottom:1px solid #e0e0e0}table[cdkDropList] td{padding:8px}.actions-container{display:flex;justify-content:flex-end;gap:4px}\n"] }]
|
|
2001
|
-
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type:
|
|
2175
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: UnBPessoaService }, { type: i4$2.MatDialog }], propDecorators: { podeEditar: [{
|
|
2002
2176
|
type: Input
|
|
2003
2177
|
}], emails: [{
|
|
2004
2178
|
type: Input
|
|
2005
|
-
}],
|
|
2179
|
+
}], backendURL: [{
|
|
2006
2180
|
type: Input
|
|
2007
2181
|
}], emailsEmitted: [{
|
|
2008
2182
|
type: Output
|
|
@@ -2023,18 +2197,23 @@ class UnbPessoaFormComponent {
|
|
|
2023
2197
|
// Quando verdadeiro, o formulário e ações ficam desabilitados porque os dados
|
|
2024
2198
|
// devem ser alterados apenas pelo app SouGov (matricula SIAPE presente)
|
|
2025
2199
|
this.isReadonlyFromSiape = false;
|
|
2026
|
-
this.
|
|
2200
|
+
this.backendURL = "";
|
|
2027
2201
|
this.pesquisarPorCPF = true;
|
|
2028
2202
|
this.pesquisarPorCNPJ = true;
|
|
2029
2203
|
this.pesquisarPorEstrangeiro = true;
|
|
2030
2204
|
this.campoPesquisaMaxWidth = '400px';
|
|
2205
|
+
this.pessoaEmitted = new EventEmitter();
|
|
2206
|
+
this.idMensagemService = "unbPessoaForm";
|
|
2031
2207
|
}
|
|
2032
2208
|
ngOnInit() {
|
|
2033
|
-
|
|
2034
|
-
|
|
2209
|
+
this.alertService.hideMessage(this.idMensagemService);
|
|
2210
|
+
if (this.backendURL == "") {
|
|
2211
|
+
this.handleErrorPrintConsole("[UnbPessoaPesquisarComponent] ERROR: apiPessoaConfig.url está null. Insira o parâmetro (apiPessoaConfig) com o valor válido!");
|
|
2212
|
+
return;
|
|
2213
|
+
}
|
|
2214
|
+
else {
|
|
2215
|
+
this.service.setBackendUrl(this.backendURL);
|
|
2035
2216
|
}
|
|
2036
|
-
this.alertService.hideMessage();
|
|
2037
|
-
this.service.setApiConfig(this.apiPessoaConfig);
|
|
2038
2217
|
// atencao, o pessoaRecebida que inicializa esse componente
|
|
2039
2218
|
this.escolaridade = this.service.getEscolaridade();
|
|
2040
2219
|
this.paises = this.service.getPaises();
|
|
@@ -2043,7 +2222,7 @@ class UnbPessoaFormComponent {
|
|
|
2043
2222
|
pessoaRecebida(pessoaRecebida) {
|
|
2044
2223
|
this.buscaRealizada = true;
|
|
2045
2224
|
this.pessoa = pessoaRecebida;
|
|
2046
|
-
this.alertService.hideMessage();
|
|
2225
|
+
this.alertService.hideMessage(this.idMensagemService);
|
|
2047
2226
|
// inicializa pra nao quebrar
|
|
2048
2227
|
if (!this.pessoa.enderecos)
|
|
2049
2228
|
this.pessoa.enderecos = [];
|
|
@@ -2063,34 +2242,31 @@ class UnbPessoaFormComponent {
|
|
|
2063
2242
|
}
|
|
2064
2243
|
}
|
|
2065
2244
|
salvar(form) {
|
|
2066
|
-
this.alertService.hideMessage();
|
|
2245
|
+
this.alertService.hideMessage(this.idMensagemService);
|
|
2246
|
+
// Suas validações
|
|
2067
2247
|
if (!this.validar(form))
|
|
2068
2248
|
return;
|
|
2069
|
-
if (!this.service)
|
|
2070
|
-
return;
|
|
2071
2249
|
this.isLoading = true;
|
|
2072
2250
|
const payload = this.convertPessoaToPayload(this.pessoa);
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
error: (err) => {
|
|
2086
|
-
this.erro(err);
|
|
2251
|
+
// O service já tem o .pipe(catchError) interno, então o erro chega tratado
|
|
2252
|
+
this.service.salvar(payload, this.pessoa.tipoPessoa)
|
|
2253
|
+
.subscribe({
|
|
2254
|
+
next: (resposta) => {
|
|
2255
|
+
this.isLoading = false;
|
|
2256
|
+
// Mensagem de Sucesso
|
|
2257
|
+
this.alertService.showMessage("<strong>Registro salvo com sucesso!</strong>", UnbTipoMensagemEnum.SUCCESS, this.idMensagemService);
|
|
2258
|
+
// Atualiza dados retornados (IDs gerados)
|
|
2259
|
+
if (resposta) {
|
|
2260
|
+
this.pessoa.codigoPessoa = resposta.codigoPessoa || this.pessoa.codigoPessoa;
|
|
2261
|
+
this.pessoa.idPessoa = resposta.idPessoa || this.pessoa.idPessoa;
|
|
2262
|
+
this.pessoaEmitted.emit(this.pessoa);
|
|
2087
2263
|
}
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
}
|
|
2264
|
+
},
|
|
2265
|
+
error: (err) => {
|
|
2266
|
+
// AQUI: O 'err' já chega limpo com { mensagemSimples, mensagemHtml }
|
|
2267
|
+
this.handleError(err);
|
|
2268
|
+
}
|
|
2269
|
+
});
|
|
2094
2270
|
}
|
|
2095
2271
|
validar(form) {
|
|
2096
2272
|
if (!this.pessoa) {
|
|
@@ -2152,45 +2328,6 @@ class UnbPessoaFormComponent {
|
|
|
2152
2328
|
emailsEmitted(emails) {
|
|
2153
2329
|
this.pessoa.emails = emails;
|
|
2154
2330
|
}
|
|
2155
|
-
erro(erro) {
|
|
2156
|
-
this.isLoading = false;
|
|
2157
|
-
const errorResponse = erro.error;
|
|
2158
|
-
// 1. Tratamento para Erros de Validação (que contêm o array 'detalhes')
|
|
2159
|
-
if (errorResponse && errorResponse.detalhes && Array.isArray(errorResponse.detalhes) && errorResponse.detalhes.length > 0) {
|
|
2160
|
-
// Mensagem genérica para o SnackBar
|
|
2161
|
-
this.openSnackBar("O formulário possui erro(s). Por favor, verificar.");
|
|
2162
|
-
// Constrói a mensagem HTML detalhada para o AlertService
|
|
2163
|
-
const criticasHtml = errorResponse.detalhes.map((det) => {
|
|
2164
|
-
// Formata cada erro como um item de lista
|
|
2165
|
-
return `<li><strong>${det.nomeCampo}:</strong> ${det.critica}</li>`;
|
|
2166
|
-
}).join('');
|
|
2167
|
-
// Cria a mensagem final, envolvendo os erros em uma tag <ul>
|
|
2168
|
-
const detailedHtmlMessage = `<strong>Erros de Validação:</strong> <ul>${criticasHtml}</ul>`;
|
|
2169
|
-
// Mostra os detalhes formatados no AlertService
|
|
2170
|
-
this.alertService.showMessage(detailedHtmlMessage, UnbTipoMensagemEnum.DANGER);
|
|
2171
|
-
}
|
|
2172
|
-
// 2. Tratamento para Outros Tipos de Erro (sem o array 'detalhes')
|
|
2173
|
-
else {
|
|
2174
|
-
let errorMessage = 'Ocorreu um erro desconhecido.'; // Mensagem padrão
|
|
2175
|
-
// Tenta extrair a mensagem de erro específica
|
|
2176
|
-
if (errorResponse) {
|
|
2177
|
-
if (errorResponse.mensagem) {
|
|
2178
|
-
errorMessage = errorResponse.mensagem;
|
|
2179
|
-
}
|
|
2180
|
-
else if (errorResponse.detail) {
|
|
2181
|
-
errorMessage = errorResponse.detail;
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
else if (erro.message) {
|
|
2185
|
-
errorMessage = erro.message;
|
|
2186
|
-
}
|
|
2187
|
-
// Mostra uma mensagem genérica no SnackBar
|
|
2188
|
-
this.openSnackBar('Ocorreu um erro ao processar sua solicitação.');
|
|
2189
|
-
// Mostra o erro específico no AlertService, como você sugeriu
|
|
2190
|
-
let erroStrong = "<strong>" + errorMessage + "</strong>";
|
|
2191
|
-
this.alertService.showMessage(erroStrong, UnbTipoMensagemEnum.DANGER);
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
2331
|
openSnackBar(message) {
|
|
2195
2332
|
this.snackBar.open(message, 'x', {
|
|
2196
2333
|
duration: 5000,
|
|
@@ -2313,13 +2450,32 @@ class UnbPessoaFormComponent {
|
|
|
2313
2450
|
return null;
|
|
2314
2451
|
}
|
|
2315
2452
|
}
|
|
2453
|
+
handleErrorPrintConsole(erro) {
|
|
2454
|
+
console.log(erro);
|
|
2455
|
+
this.handleError(erro);
|
|
2456
|
+
}
|
|
2457
|
+
handleError(erro) {
|
|
2458
|
+
this.isLoading = false;
|
|
2459
|
+
// 1. Mostra a mensagem curta/simples no SnackBar (Fundo da tela)
|
|
2460
|
+
// Ex: "O formulário possui erros de validação." ou "Sessão expirada."
|
|
2461
|
+
if (erro.mensagemSimples) {
|
|
2462
|
+
this.openSnackBar(erro.mensagemSimples);
|
|
2463
|
+
}
|
|
2464
|
+
// 2. Mostra a mensagem detalhada HTML no componente <unb-mensagem>
|
|
2465
|
+
// Ex: Lista com <ul><li>Campo Data inválido...</li></ul>
|
|
2466
|
+
if (this.alertService && erro.mensagemHtml) {
|
|
2467
|
+
// Se o seu alertService suportar ID do componente alvo, passe aqui.
|
|
2468
|
+
// Caso contrário, ele mostra no componente padrão.
|
|
2469
|
+
this.alertService.showMessage(erro.mensagemHtml, UnbTipoMensagemEnum.DANGER, this.idMensagemService);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2316
2472
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaFormComponent, deps: [{ token: UnBPessoaService }, { token: i1$2.MatSnackBar }, { token: UnbMensagemService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2317
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaFormComponent, selector: "lib-unb-pessoa-form", inputs: { apiPessoaConfig: "apiPessoaConfig", defaultTipoPessoa: "defaultTipoPessoa", pesquisarPorCPF: "pesquisarPorCPF", pesquisarPorCNPJ: "pesquisarPorCNPJ", pesquisarPorEstrangeiro: "pesquisarPorEstrangeiro", campoPesquisaMaxWidth: "campoPesquisaMaxWidth" }, ngImport: i0, template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\r\n\r\n<div class=\"form-container\">\r\n <lib-unb-pessoa-pesquisar [apiPessoaConfig]=\"apiPessoaConfig\" [defaultTipoPessoa]=\"defaultTipoPessoa\"\r\n [campoPesquisaMaxWidth]=\"campoPesquisaMaxWidth\" (pessoaEmitted)=\"pessoaRecebida($event)\">\r\n </lib-unb-pessoa-pesquisar>\r\n</div>\r\n\r\n<unb-mensagem></unb-mensagem>\r\n\r\n<form #pessoaForm=\"ngForm\" [class.readonly]=\"isReadonlyFromSiape || isLoading\" class=\"form-container mt-2\"\r\n *ngIf=\"buscaRealizada && apiPessoaConfig.url\" (ngSubmit)=\"salvar(pessoaForm)\">\r\n\r\n <!-- Campos Pessoa F\u00EDsica e Estrangeira -->\r\n <ng-container\r\n *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA || pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nome\" name=\"nome\" #nome=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Sexo</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoSexo\" name=\"codigoSexo\" #codigoSexo=\"ngModel\" required>\r\n <mat-option [value]=\"1\">Masculino</mat-option>\r\n <mat-option [value]=\"2\">Feminino</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Data Nascimento</mat-label>\r\n <input matInput [matDatepicker]=\"dataNascimentoPicker\" [(ngModel)]=\"pessoa.dataNascimento\" name=\"dataNascimento\"\r\n #dataNascimento=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataNascimentoPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataNascimentoPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Estado Civil</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoEstadoCivil\" name=\"codigoEstadoCivil\" #codigoEstadoCivil=\"ngModel\">\r\n <mat-option *ngFor=\"let estado of estadosCivil | async\" [value]=\"estado.codigo\">\r\n {{ estado.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <!--\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Naturalidade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.codigo\">\r\n {{ cidade.descricao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n -->\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisNascimento\" name=\"codigoPaisNascimento\" #codigoPaisNascimento=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n <span *ngIf=\"paisNascimento.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paisNascimento.denominacao }}</b></span>\r\n <span *ngIf=\"paisNascimento.denominacao !== 'BRASIL'\">{{ paisNascimento.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\"> <!-- 22 eh Brasil-->\r\n <mat-label>UF Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.ufNascimento\" name=\"ufNascimento\" #ufNascimento=\"ngModel\" required>\r\n <mat-option *ngFor=\"let ufNascimento of getListaEstados()\" [value]=\"ufNascimento.identificador\">\r\n {{ ufNascimento.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\">\r\n <mat-label>Naturalidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\"\r\n required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Escolaridade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.escolaridade\" name=\"codigoEscolaridade\" #codigoEscolaridade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let escolaridade of escolaridade | async\" [value]=\"escolaridade.codigo\">\r\n {{ escolaridade.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeSocial\" name=\"nomeSocial\" #nomeSocial=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome da M\u00E3e</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeMae\" name=\"nomeMae\" #nomeMae=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome do Pai</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomePai\" name=\"nomePai\" #nomePai=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Campos Pessoa Jur\u00EDdica -->\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Raz\u00E3o Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.razaoSocial\" name=\"razaoSocial\" />\r\n </mat-form-field>\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Fantasia</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeFantasia\" name=\"nomeFantasia\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA\">\r\n <b style=\"flex: 1 1 100%; margin-bottom: 10px;\">Documenta\u00E7\u00E3o</b>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Identidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rg\" name=\"rg\" #rg=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>\u00D3rg\u00E3o Emissor</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgOrgao\" name=\"rgOrgao\" #rgOrgao=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Unidade Federativa</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.rgUf\" name=\"rgUf\" #rgUf=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.identificador\">\r\n {{ cidade.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-20\" appearance=\"outline\">\r\n <mat-label>Data de Emiss\u00E3o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgDataEmissao\" name=\"rgDataEmissao\" #rgDataEmissao=\"ngModel\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA \">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Data Chegada Brasil</mat-label>\r\n <input matInput [matDatepicker]=\"dataChegadaBrasilPicker\" [(ngModel)]=\"pessoa.dataChegadaBrasil\"\r\n name=\"dataChegadaBrasil\" #dataChegadaBrasil=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataChegadaBrasilPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataChegadaBrasilPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Passaporte</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisPassaporte\" name=\"codigoPaisPassaporte\" #codigoPaisPassaporte=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n {{ paisNascimento.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>N\u00FAmero Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" #passaporte=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <lib-unb-pessoa-telefone-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\"\r\n [telefones]=\"pessoa.telefones\" (telefonesEmitted)=\"telefonesEmitted($event)\"></lib-unb-pessoa-telefone-list>\r\n\r\n <lib-unb-pessoa-endereco-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\"\r\n [enderecos]=\"pessoa.enderecos\" (enderecosEmitted)=\"enderecosEmitted($event)\"></lib-unb-pessoa-endereco-list>\r\n\r\n <lib-unb-pessoa-email-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\" [emails]=\"pessoa.emails\"\r\n (emailsEmitted)=\"emailsEmitted($event)\"></lib-unb-pessoa-email-list>\r\n\r\n <div *ngIf=\"isReadonlyFromSiape\" style=\"flex:1 1 100%; margin-bottom:10px;\">\r\n <mat-card>\r\n <mat-card-content>\r\n <strong>Servidor com matr\u00EDcula SIAPE deve ter seus dados autalizados pelo aplicativo do sougov</strong>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <mat-card-actions class=\"card-actions-buttons\" *ngIf=\"buscaRealizada\">\r\n <button mat-flat-button [disabled]=\"isLoading || isReadonlyFromSiape\" type=\"submit\" color=\"primary\">\r\n Salvar\r\n </button>\r\n </mat-card-actions>\r\n\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px}:host{display:block}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.readonly{pointer-events:none;opacity:.6}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo"] }, { kind: "component", type: i7$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i7$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i7$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i7$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i8$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i9.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i10.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i13.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i14.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i14.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i14.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: UnbPessoaPesquisarComponent, selector: "lib-unb-pessoa-pesquisar", inputs: ["apiPessoaConfig", "pesquisarPorCPF", "pesquisarPorCNPJ", "pesquisarPorEstrangeiro", "defaultTipoPessoa", "campoPesquisaMaxWidth", "pessoa", "mostrarPesquisa", "limparAposPesquisa", "label", "placeholder", "hint"], outputs: ["pessoaEmitted"] }, { kind: "component", type: UnbPessoaTelefoneListComponent, selector: "lib-unb-pessoa-telefone-list", inputs: ["podeEditar", "telefones", "apiPessoaConfig"], outputs: ["telefonesEmitted"] }, { kind: "component", type: UnbPessoaenderecoListComponent, selector: "lib-unb-pessoa-endereco-list", inputs: ["podeEditar", "enderecos", "apiPessoaConfig"], outputs: ["enderecosEmitted"] }, { kind: "component", type: UnbPessoaEmailListComponent, selector: "lib-unb-pessoa-email-list", inputs: ["podeEditar", "emails", "apiPessoaConfig"], outputs: ["emailsEmitted"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] }); }
|
|
2473
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: UnbPessoaFormComponent, selector: "lib-unb-pessoa-form", inputs: { backendURL: "backendURL", defaultTipoPessoa: "defaultTipoPessoa", pesquisarPorCPF: "pesquisarPorCPF", pesquisarPorCNPJ: "pesquisarPorCNPJ", pesquisarPorEstrangeiro: "pesquisarPorEstrangeiro", campoPesquisaMaxWidth: "campoPesquisaMaxWidth" }, outputs: { pessoaEmitted: "pessoaEmitted" }, ngImport: i0, template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\r\n\r\n<div class=\"form-container\" [class.disabled-wrapper]=\"isLoading\">\r\n <lib-unb-pessoa-pesquisar \r\n [backendURL]=\"backendURL\" \r\n [defaultTipoPessoa]=\"defaultTipoPessoa\"\r\n [pesquisarPorCNPJ]=\"pesquisarPorCNPJ\"\r\n [pesquisarPorCPF]=\"pesquisarPorCPF\"\r\n [pesquisarPorEstrangeiro]=\"pesquisarPorEstrangeiro\"\r\n [campoPesquisaMaxWidth]=\"campoPesquisaMaxWidth\" (pessoaEmitted)=\"pessoaRecebida($event)\">\r\n </lib-unb-pessoa-pesquisar>\r\n</div>\r\n\r\n<unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n\r\n<form #pessoaForm=\"ngForm\" [class.readonly]=\"isReadonlyFromSiape || isLoading\" class=\"form-container mt-2\"\r\n *ngIf=\"buscaRealizada\" (ngSubmit)=\"salvar(pessoaForm)\">\r\n\r\n <!-- Campos Pessoa F\u00EDsica e Estrangeira -->\r\n <ng-container\r\n *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA || pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nome\" name=\"nome\" #nome=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Sexo</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoSexo\" name=\"codigoSexo\" #codigoSexo=\"ngModel\" required>\r\n <mat-option [value]=\"1\">Masculino</mat-option>\r\n <mat-option [value]=\"2\">Feminino</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Data Nascimento</mat-label>\r\n <input matInput [matDatepicker]=\"dataNascimentoPicker\" [(ngModel)]=\"pessoa.dataNascimento\" name=\"dataNascimento\"\r\n #dataNascimento=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataNascimentoPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataNascimentoPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Estado Civil</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoEstadoCivil\" name=\"codigoEstadoCivil\" #codigoEstadoCivil=\"ngModel\">\r\n <mat-option *ngFor=\"let estado of estadosCivil | async\" [value]=\"estado.codigo\">\r\n {{ estado.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <!--\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Naturalidade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.codigo\">\r\n {{ cidade.descricao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n -->\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisNascimento\" name=\"codigoPaisNascimento\" #codigoPaisNascimento=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n <span *ngIf=\"paisNascimento.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paisNascimento.denominacao }}</b></span>\r\n <span *ngIf=\"paisNascimento.denominacao !== 'BRASIL'\">{{ paisNascimento.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\"> <!-- 22 eh Brasil-->\r\n <mat-label>UF Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.ufNascimento\" name=\"ufNascimento\" #ufNascimento=\"ngModel\" required>\r\n <mat-option *ngFor=\"let ufNascimento of getListaEstados()\" [value]=\"ufNascimento.identificador\">\r\n {{ ufNascimento.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\">\r\n <mat-label>Naturalidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\"\r\n required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Escolaridade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.escolaridade\" name=\"codigoEscolaridade\" #codigoEscolaridade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let escolaridade of escolaridade | async\" [value]=\"escolaridade.codigo\">\r\n {{ escolaridade.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeSocial\" name=\"nomeSocial\" #nomeSocial=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome da M\u00E3e</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeMae\" name=\"nomeMae\" #nomeMae=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome do Pai</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomePai\" name=\"nomePai\" #nomePai=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Campos Pessoa Jur\u00EDdica -->\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Raz\u00E3o Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.razaoSocial\" name=\"razaoSocial\" />\r\n </mat-form-field>\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Fantasia</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeFantasia\" name=\"nomeFantasia\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA\">\r\n <b style=\"flex: 1 1 100%; margin-bottom: 10px;\">Documenta\u00E7\u00E3o</b>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Identidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rg\" name=\"rg\" #rg=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>\u00D3rg\u00E3o Emissor</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgOrgao\" name=\"rgOrgao\" #rgOrgao=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Unidade Federativa</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.rgUf\" name=\"rgUf\" #rgUf=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.identificador\">\r\n {{ cidade.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-20\" appearance=\"outline\">\r\n <mat-label>Data de Emiss\u00E3o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgDataEmissao\" name=\"rgDataEmissao\" #rgDataEmissao=\"ngModel\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA \">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Data Chegada Brasil</mat-label>\r\n <input matInput [matDatepicker]=\"dataChegadaBrasilPicker\" [(ngModel)]=\"pessoa.dataChegadaBrasil\"\r\n name=\"dataChegadaBrasil\" #dataChegadaBrasil=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataChegadaBrasilPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataChegadaBrasilPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Passaporte</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisPassaporte\" name=\"codigoPaisPassaporte\" #codigoPaisPassaporte=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n {{ paisNascimento.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>N\u00FAmero Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" #passaporte=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <lib-unb-pessoa-telefone-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\"\r\n [telefones]=\"pessoa.telefones\" (telefonesEmitted)=\"telefonesEmitted($event)\"></lib-unb-pessoa-telefone-list>\r\n\r\n <lib-unb-pessoa-endereco-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\"\r\n [enderecos]=\"pessoa.enderecos\" (enderecosEmitted)=\"enderecosEmitted($event)\"></lib-unb-pessoa-endereco-list>\r\n\r\n <lib-unb-pessoa-email-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\" [emails]=\"pessoa.emails\"\r\n (emailsEmitted)=\"emailsEmitted($event)\"></lib-unb-pessoa-email-list>\r\n\r\n <div *ngIf=\"isReadonlyFromSiape\" style=\"flex:1 1 100%; margin-bottom:10px;\">\r\n <mat-card>\r\n <mat-card-content>\r\n <strong>Servidor com matr\u00EDcula SIAPE deve ter seus dados autalizados pelo aplicativo do sougov</strong>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <mat-card-actions class=\"card-actions-buttons\" *ngIf=\"buscaRealizada\">\r\n <button mat-flat-button [disabled]=\"isLoading || isReadonlyFromSiape\" type=\"submit\" color=\"primary\">\r\n Salvar\r\n </button>\r\n </mat-card-actions>\r\n\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px}:host{display:block}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.readonly{pointer-events:none;opacity:.6}.disabled-wrapper{pointer-events:none;opacity:.6;filter:grayscale(1)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: UnbMensagemComponent, selector: "unb-mensagem", inputs: ["mensagem", "tipo", "identificador"] }, { kind: "component", type: i7$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i7$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i7$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i12.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i13.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i14.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i14.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i14.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: UnbPessoaPesquisarComponent, selector: "lib-unb-pessoa-pesquisar", inputs: ["backendURL", "pesquisarPorCPF", "pesquisarPorCNPJ", "pesquisarPorEstrangeiro", "defaultTipoPessoa", "campoPesquisaMaxWidth", "pessoa", "mostrarPesquisa", "limparAposPesquisa", "label", "placeholder", "hint"], outputs: ["pessoaEmitted"] }, { kind: "component", type: UnbPessoaTelefoneListComponent, selector: "lib-unb-pessoa-telefone-list", inputs: ["podeEditar", "telefones", "backendURL"], outputs: ["telefonesEmitted"] }, { kind: "component", type: UnbPessoaenderecoListComponent, selector: "lib-unb-pessoa-endereco-list", inputs: ["podeEditar", "enderecos", "backendURL"], outputs: ["enderecosEmitted"] }, { kind: "component", type: UnbPessoaEmailListComponent, selector: "lib-unb-pessoa-email-list", inputs: ["podeEditar", "emails", "backendURL"], outputs: ["emailsEmitted"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] }); }
|
|
2318
2474
|
}
|
|
2319
2475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: UnbPessoaFormComponent, decorators: [{
|
|
2320
2476
|
type: Component,
|
|
2321
|
-
args: [{ selector: 'lib-unb-pessoa-form', standalone: false, template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\r\n\r\n<div class=\"form-container\">\r\n <lib-unb-pessoa-pesquisar [apiPessoaConfig]=\"apiPessoaConfig\" [defaultTipoPessoa]=\"defaultTipoPessoa\"\r\n [campoPesquisaMaxWidth]=\"campoPesquisaMaxWidth\" (pessoaEmitted)=\"pessoaRecebida($event)\">\r\n </lib-unb-pessoa-pesquisar>\r\n</div>\r\n\r\n<unb-mensagem></unb-mensagem>\r\n\r\n<form #pessoaForm=\"ngForm\" [class.readonly]=\"isReadonlyFromSiape || isLoading\" class=\"form-container mt-2\"\r\n *ngIf=\"buscaRealizada && apiPessoaConfig.url\" (ngSubmit)=\"salvar(pessoaForm)\">\r\n\r\n <!-- Campos Pessoa F\u00EDsica e Estrangeira -->\r\n <ng-container\r\n *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA || pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nome\" name=\"nome\" #nome=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Sexo</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoSexo\" name=\"codigoSexo\" #codigoSexo=\"ngModel\" required>\r\n <mat-option [value]=\"1\">Masculino</mat-option>\r\n <mat-option [value]=\"2\">Feminino</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Data Nascimento</mat-label>\r\n <input matInput [matDatepicker]=\"dataNascimentoPicker\" [(ngModel)]=\"pessoa.dataNascimento\" name=\"dataNascimento\"\r\n #dataNascimento=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataNascimentoPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataNascimentoPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Estado Civil</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoEstadoCivil\" name=\"codigoEstadoCivil\" #codigoEstadoCivil=\"ngModel\">\r\n <mat-option *ngFor=\"let estado of estadosCivil | async\" [value]=\"estado.codigo\">\r\n {{ estado.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <!--\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Naturalidade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.codigo\">\r\n {{ cidade.descricao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n -->\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisNascimento\" name=\"codigoPaisNascimento\" #codigoPaisNascimento=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n <span *ngIf=\"paisNascimento.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paisNascimento.denominacao }}</b></span>\r\n <span *ngIf=\"paisNascimento.denominacao !== 'BRASIL'\">{{ paisNascimento.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\"> <!-- 22 eh Brasil-->\r\n <mat-label>UF Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.ufNascimento\" name=\"ufNascimento\" #ufNascimento=\"ngModel\" required>\r\n <mat-option *ngFor=\"let ufNascimento of getListaEstados()\" [value]=\"ufNascimento.identificador\">\r\n {{ ufNascimento.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\">\r\n <mat-label>Naturalidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\"\r\n required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Escolaridade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.escolaridade\" name=\"codigoEscolaridade\" #codigoEscolaridade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let escolaridade of escolaridade | async\" [value]=\"escolaridade.codigo\">\r\n {{ escolaridade.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeSocial\" name=\"nomeSocial\" #nomeSocial=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome da M\u00E3e</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeMae\" name=\"nomeMae\" #nomeMae=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome do Pai</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomePai\" name=\"nomePai\" #nomePai=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Campos Pessoa Jur\u00EDdica -->\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Raz\u00E3o Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.razaoSocial\" name=\"razaoSocial\" />\r\n </mat-form-field>\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Fantasia</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeFantasia\" name=\"nomeFantasia\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA\">\r\n <b style=\"flex: 1 1 100%; margin-bottom: 10px;\">Documenta\u00E7\u00E3o</b>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Identidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rg\" name=\"rg\" #rg=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>\u00D3rg\u00E3o Emissor</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgOrgao\" name=\"rgOrgao\" #rgOrgao=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Unidade Federativa</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.rgUf\" name=\"rgUf\" #rgUf=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.identificador\">\r\n {{ cidade.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-20\" appearance=\"outline\">\r\n <mat-label>Data de Emiss\u00E3o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgDataEmissao\" name=\"rgDataEmissao\" #rgDataEmissao=\"ngModel\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA \">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Data Chegada Brasil</mat-label>\r\n <input matInput [matDatepicker]=\"dataChegadaBrasilPicker\" [(ngModel)]=\"pessoa.dataChegadaBrasil\"\r\n name=\"dataChegadaBrasil\" #dataChegadaBrasil=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataChegadaBrasilPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataChegadaBrasilPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Passaporte</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisPassaporte\" name=\"codigoPaisPassaporte\" #codigoPaisPassaporte=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n {{ paisNascimento.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>N\u00FAmero Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" #passaporte=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <lib-unb-pessoa-telefone-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\"\r\n [telefones]=\"pessoa.telefones\" (telefonesEmitted)=\"telefonesEmitted($event)\"></lib-unb-pessoa-telefone-list>\r\n\r\n <lib-unb-pessoa-endereco-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\"\r\n [enderecos]=\"pessoa.enderecos\" (enderecosEmitted)=\"enderecosEmitted($event)\"></lib-unb-pessoa-endereco-list>\r\n\r\n <lib-unb-pessoa-email-list style=\"flex: 1 1 100%;\" [apiPessoaConfig]=\"apiPessoaConfig\" [emails]=\"pessoa.emails\"\r\n (emailsEmitted)=\"emailsEmitted($event)\"></lib-unb-pessoa-email-list>\r\n\r\n <div *ngIf=\"isReadonlyFromSiape\" style=\"flex:1 1 100%; margin-bottom:10px;\">\r\n <mat-card>\r\n <mat-card-content>\r\n <strong>Servidor com matr\u00EDcula SIAPE deve ter seus dados autalizados pelo aplicativo do sougov</strong>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <mat-card-actions class=\"card-actions-buttons\" *ngIf=\"buscaRealizada\">\r\n <button mat-flat-button [disabled]=\"isLoading || isReadonlyFromSiape\" type=\"submit\" color=\"primary\">\r\n Salvar\r\n </button>\r\n </mat-card-actions>\r\n\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px}:host{display:block}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.readonly{pointer-events:none;opacity:.6}\n"] }]
|
|
2322
|
-
}], ctorParameters: () => [{ type: UnBPessoaService }, { type: i1$2.MatSnackBar }, { type: UnbMensagemService }], propDecorators: {
|
|
2477
|
+
args: [{ selector: 'lib-unb-pessoa-form', standalone: false, template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\r\n\r\n<div class=\"form-container\" [class.disabled-wrapper]=\"isLoading\">\r\n <lib-unb-pessoa-pesquisar \r\n [backendURL]=\"backendURL\" \r\n [defaultTipoPessoa]=\"defaultTipoPessoa\"\r\n [pesquisarPorCNPJ]=\"pesquisarPorCNPJ\"\r\n [pesquisarPorCPF]=\"pesquisarPorCPF\"\r\n [pesquisarPorEstrangeiro]=\"pesquisarPorEstrangeiro\"\r\n [campoPesquisaMaxWidth]=\"campoPesquisaMaxWidth\" (pessoaEmitted)=\"pessoaRecebida($event)\">\r\n </lib-unb-pessoa-pesquisar>\r\n</div>\r\n\r\n<unb-mensagem [identificador]=\"idMensagemService\"></unb-mensagem>\r\n\r\n<form #pessoaForm=\"ngForm\" [class.readonly]=\"isReadonlyFromSiape || isLoading\" class=\"form-container mt-2\"\r\n *ngIf=\"buscaRealizada\" (ngSubmit)=\"salvar(pessoaForm)\">\r\n\r\n <!-- Campos Pessoa F\u00EDsica e Estrangeira -->\r\n <ng-container\r\n *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA || pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nome\" name=\"nome\" #nome=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Sexo</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoSexo\" name=\"codigoSexo\" #codigoSexo=\"ngModel\" required>\r\n <mat-option [value]=\"1\">Masculino</mat-option>\r\n <mat-option [value]=\"2\">Feminino</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Data Nascimento</mat-label>\r\n <input matInput [matDatepicker]=\"dataNascimentoPicker\" [(ngModel)]=\"pessoa.dataNascimento\" name=\"dataNascimento\"\r\n #dataNascimento=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataNascimentoPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataNascimentoPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Estado Civil</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoEstadoCivil\" name=\"codigoEstadoCivil\" #codigoEstadoCivil=\"ngModel\">\r\n <mat-option *ngFor=\"let estado of estadosCivil | async\" [value]=\"estado.codigo\">\r\n {{ estado.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <!--\r\n <mat-form-field class=\"form-15\" appearance=\"outline\">\r\n <mat-label>Naturalidade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.codigo\">\r\n {{ cidade.descricao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n -->\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisNascimento\" name=\"codigoPaisNascimento\" #codigoPaisNascimento=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n <span *ngIf=\"paisNascimento.denominacao === 'BRASIL'\">\uD83C\uDDE7\uD83C\uDDF7 <b>{{ paisNascimento.denominacao }}</b></span>\r\n <span *ngIf=\"paisNascimento.denominacao !== 'BRASIL'\">{{ paisNascimento.denominacao }}</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\"> <!-- 22 eh Brasil-->\r\n <mat-label>UF Nascimento</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.ufNascimento\" name=\"ufNascimento\" #ufNascimento=\"ngModel\" required>\r\n <mat-option *ngFor=\"let ufNascimento of getListaEstados()\" [value]=\"ufNascimento.identificador\">\r\n {{ ufNascimento.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-15\" appearance=\"outline\" *ngIf=\"pessoa.codigoPaisNascimento == 22\">\r\n <mat-label>Naturalidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.naturalidade\" name=\"naturalidade\" #naturalidade=\"ngModel\"\r\n required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Escolaridade</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.escolaridade\" name=\"codigoEscolaridade\" #codigoEscolaridade=\"ngModel\" required>\r\n <mat-option *ngFor=\"let escolaridade of escolaridade | async\" [value]=\"escolaridade.codigo\">\r\n {{ escolaridade.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeSocial\" name=\"nomeSocial\" #nomeSocial=\"ngModel\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome da M\u00E3e</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeMae\" name=\"nomeMae\" #nomeMae=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome do Pai</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomePai\" name=\"nomePai\" #nomePai=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Campos Pessoa Jur\u00EDdica -->\r\n <ng-container *ngIf=\"pessoa.tipoPessoa === tipoPessoaEnum().JURIDICA\">\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Raz\u00E3o Social</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.razaoSocial\" name=\"razaoSocial\" />\r\n </mat-form-field>\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Nome Fantasia</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.nomeFantasia\" name=\"nomeFantasia\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().FISICA\">\r\n <b style=\"flex: 1 1 100%; margin-bottom: 10px;\">Documenta\u00E7\u00E3o</b>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Identidade</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rg\" name=\"rg\" #rg=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>\u00D3rg\u00E3o Emissor</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgOrgao\" name=\"rgOrgao\" #rgOrgao=\"ngModel\" required />\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-25\" appearance=\"outline\">\r\n <mat-label>Unidade Federativa</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.rgUf\" name=\"rgUf\" #rgUf=\"ngModel\" required>\r\n <mat-option *ngFor=\"let cidade of getListaEstados()\" [value]=\"cidade.identificador\">\r\n {{ cidade.identificador }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-20\" appearance=\"outline\">\r\n <mat-label>Data de Emiss\u00E3o</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.rgDataEmissao\" name=\"rgDataEmissao\" #rgDataEmissao=\"ngModel\" />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"pessoa.tipoPessoa == tipoPessoaEnum().ESTRANGEIRA \">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Data Chegada Brasil</mat-label>\r\n <input matInput [matDatepicker]=\"dataChegadaBrasilPicker\" [(ngModel)]=\"pessoa.dataChegadaBrasil\"\r\n name=\"dataChegadaBrasil\" #dataChegadaBrasil=\"ngModel\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"dataChegadaBrasilPicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #dataChegadaBrasilPicker></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"form-10\" appearance=\"outline\">\r\n <mat-label>Pa\u00EDs Passaporte</mat-label>\r\n <mat-select [(ngModel)]=\"pessoa.codigoPaisPassaporte\" name=\"codigoPaisPassaporte\" #codigoPaisPassaporte=\"ngModel\"\r\n required>\r\n <mat-option *ngFor=\"let paisNascimento of paises | async\" [value]=\"paisNascimento.codigo\">\r\n {{ paisNascimento.denominacao }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>N\u00FAmero Passaporte</mat-label>\r\n <input type=\"text\" matInput [(ngModel)]=\"pessoa.passaporte\" name=\"passaporte\" #passaporte=\"ngModel\" required />\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <lib-unb-pessoa-telefone-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\"\r\n [telefones]=\"pessoa.telefones\" (telefonesEmitted)=\"telefonesEmitted($event)\"></lib-unb-pessoa-telefone-list>\r\n\r\n <lib-unb-pessoa-endereco-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\"\r\n [enderecos]=\"pessoa.enderecos\" (enderecosEmitted)=\"enderecosEmitted($event)\"></lib-unb-pessoa-endereco-list>\r\n\r\n <lib-unb-pessoa-email-list style=\"flex: 1 1 100%;\" [backendURL]=\"backendURL\" [emails]=\"pessoa.emails\"\r\n (emailsEmitted)=\"emailsEmitted($event)\"></lib-unb-pessoa-email-list>\r\n\r\n <div *ngIf=\"isReadonlyFromSiape\" style=\"flex:1 1 100%; margin-bottom:10px;\">\r\n <mat-card>\r\n <mat-card-content>\r\n <strong>Servidor com matr\u00EDcula SIAPE deve ter seus dados autalizados pelo aplicativo do sougov</strong>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <mat-card-actions class=\"card-actions-buttons\" *ngIf=\"buscaRealizada\">\r\n <button mat-flat-button [disabled]=\"isLoading || isReadonlyFromSiape\" type=\"submit\" color=\"primary\">\r\n Salvar\r\n </button>\r\n </mat-card-actions>\r\n\r\n</form>", styles: [".card-actions-buttons{display:flex;gap:5px;flex-wrap:wrap}.form-container{display:flex;flex-wrap:wrap;column-gap:10px}:host{display:block}@media (max-width: 1000px){.form-container{flex-direction:column;gap:5px}}.break{flex-basis:100%;height:0}.form-5{flex:1 1 5%}.inline-table-container{display:flex;align-items:center;justify-content:space-between;padding:5px}@media (max-width: 600px){.form-5,.form-10,.form-15{flex:1 1 100%}}.form-10{flex:1 1 10%}.form-15{flex:1 1 15%}.form-20{flex:1 1 20%}.form-25{flex:1 1 25%}.form-30{flex:1 1 30%}.form-35{flex:1 1 35%}.form-40{flex:1 1 40%}.form-45{flex:1 1 45%}.form-50{flex:1 1 50%}.form-100{flex:1 1 100%;min-width:250px}.readonly{pointer-events:none;opacity:.6}.disabled-wrapper{pointer-events:none;opacity:.6;filter:grayscale(1)}\n"] }]
|
|
2478
|
+
}], ctorParameters: () => [{ type: UnBPessoaService }, { type: i1$2.MatSnackBar }, { type: UnbMensagemService }], propDecorators: { backendURL: [{
|
|
2323
2479
|
type: Input
|
|
2324
2480
|
}], defaultTipoPessoa: [{
|
|
2325
2481
|
type: Input
|
|
@@ -2331,6 +2487,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
|
|
|
2331
2487
|
type: Input
|
|
2332
2488
|
}], campoPesquisaMaxWidth: [{
|
|
2333
2489
|
type: Input
|
|
2490
|
+
}], pessoaEmitted: [{
|
|
2491
|
+
type: Output
|
|
2334
2492
|
}] } });
|
|
2335
2493
|
|
|
2336
2494
|
class UnbPessoaModule {
|