@stiunb/unb-lib-components 18.0.23 → 18.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +27 -0
  2. package/esm2022/lib/unb-mensagem/unb-mensagem.component.mjs +18 -26
  3. package/esm2022/lib/unb-mensagem/unb-mensagem.service.mjs +16 -21
  4. package/esm2022/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-form.mjs +60 -29
  5. package/esm2022/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-list.mjs +4 -4
  6. package/esm2022/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-form.mjs +98 -67
  7. package/esm2022/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-list.mjs +4 -4
  8. package/esm2022/lib/unb-pessoa/unb-pessoa-form/unb-pessoa-form.component.mjs +111 -96
  9. package/esm2022/lib/unb-pessoa/unb-pessoa-pesquisar/unb-pessoa-pesquisar.component.mjs +98 -38
  10. package/esm2022/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-form.mjs +57 -29
  11. package/esm2022/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-list.mjs +4 -4
  12. package/esm2022/lib/unb-pessoa/unb-pessoa.service.mjs +141 -45
  13. package/fesm2022/stiunb-unb-lib-components.mjs +556 -321
  14. package/fesm2022/stiunb-unb-lib-components.mjs.map +1 -1
  15. package/lib/unb-mensagem/unb-mensagem.component.d.ts +3 -17
  16. package/lib/unb-mensagem/unb-mensagem.service.d.ts +16 -18
  17. package/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-form.d.ts +6 -2
  18. package/lib/unb-pessoa/unb-pessoa-email-form/unb-pessoa-email-list.d.ts +2 -5
  19. package/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-form.d.ts +6 -3
  20. package/lib/unb-pessoa/unb-pessoa-endereco-form/unb-pessoa-endereco-list.d.ts +2 -5
  21. package/lib/unb-pessoa/unb-pessoa-form/unb-pessoa-form.component.d.ts +16 -10
  22. package/lib/unb-pessoa/unb-pessoa-pesquisar/unb-pessoa-pesquisar.component.d.ts +21 -11
  23. package/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-form.d.ts +6 -4
  24. package/lib/unb-pessoa/unb-pessoa-telefone-form/unb-pessoa-telefone-list.d.ts +2 -5
  25. package/lib/unb-pessoa/unb-pessoa.service.d.ts +9 -13
  26. package/package.json +2 -3
@@ -1,35 +1,21 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { UnbMensagemService } from './unb-mensagem.service';
3
3
  import { UnbMensagemModel } from './unb-message.model';
4
- import { OnDestroy } from '@angular/core';
5
4
  import * as i0 from "@angular/core";
6
5
  export declare class UnbMensagemComponent implements OnInit, OnDestroy {
7
6
  private mensagemService;
8
7
  mensagem: string;
9
8
  tipo: string;
9
+ identificador?: string;
10
10
  alertMessage: UnbMensagemModel;
11
11
  private subscription;
12
12
  constructor(mensagemService: UnbMensagemService);
13
13
  ngOnInit(): void;
14
14
  ngAfterContentInit(): void;
15
- /**
16
- * Esconde o componente de mensagem
17
- */
18
15
  hide(): void;
19
- /**
20
- *
21
- * @param message mensagem que vai aparecer na tela
22
- * @param tipo tipo da mensagem: success, info, warning, danger.
23
- */
24
16
  showMessage(message: string, tipo: number): void;
25
17
  ngOnDestroy(): void;
26
- /**
27
- * Recupera qual o tipo da mensagem.
28
- * O método tenta achar o tipo conforme o valor informado, incluido erros de digitação
29
- *
30
- * @returns o valor correspondente do informa. Caso não encontra, emite um erro e coloca retorna o padrão info como default
31
- */
32
18
  getTipo(): number;
33
19
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbMensagemComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbMensagemComponent, "unb-mensagem", never, { "mensagem": { "alias": "mensagem"; "required": false; }; "tipo": { "alias": "tipo"; "required": false; }; }, {}, never, never, false, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbMensagemComponent, "unb-mensagem", never, { "mensagem": { "alias": "mensagem"; "required": false; }; "tipo": { "alias": "tipo"; "required": false; }; "identificador": { "alias": "identificador"; "required": false; }; }, {}, never, never, false, never>;
35
21
  }
@@ -7,30 +7,28 @@ export declare enum UnbTipoMensagemEnum {
7
7
  WARNING = 2,
8
8
  DANGER = 3
9
9
  }
10
+ interface UnbMensagemEvent {
11
+ model: UnbMensagemModel;
12
+ targetId?: string;
13
+ }
10
14
  export declare class UnbMensagemService {
11
- messageSubject: Subject<UnbMensagemModel>;
12
- cores: [[string, string, string], [string, string, string], [string, string, string], [string, string, string]];
15
+ messageSubject: Subject<UnbMensagemEvent>;
16
+ cores: [string, string, string][];
13
17
  constructor();
14
18
  /**
15
- *
16
- * @param message mensagem que vai aparecer na tela
17
- * @param tipo tipo da mensagem: success, info, warning, danger.
18
- */
19
- showMessage(message: string, type: number): void;
20
- /**
21
- * Esconde o componente de mensagem passando um valor vazio
22
- */
23
- hideMessage(): void;
24
- getMessageSubject(): Observable<any>;
19
+ * @param message mensagem que vai aparecer na tela
20
+ * @param tipo tipo da mensagem: success, info, warning, danger.
21
+ * @param id (Opcional) Identificador do componente que deve exibir a mensagem
22
+ */
23
+ showMessage(message: string, type: number, id?: string): void;
25
24
  /**
26
- *
27
- * @param message Cria a mensagem passando os parametros com base nas cores criadas no construturo
28
- * @param background_color cor de fundo
29
- * @param font_color cor da fonte
30
- * @param border_color cor da borda
31
- * @returns
25
+ * Esconde o componente.
26
+ * @param id (Opcional) Se informado, esconde apenas o componente com este ID.
32
27
  */
28
+ hideMessage(id?: string): void;
29
+ getMessageSubject(): Observable<UnbMensagemEvent>;
33
30
  private createAlertMessage;
34
31
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbMensagemService, never>;
35
32
  static ɵprov: i0.ɵɵInjectableDeclaration<UnbMensagemService>;
36
33
  }
34
+ export {};
@@ -2,13 +2,15 @@ import { OnInit } from '@angular/core';
2
2
  import { MatSnackBar } from '@angular/material/snack-bar';
3
3
  import { Observable } from 'rxjs';
4
4
  import { UnbPessoaEmail, UnbPessoaEmailTipo } from '../unb-pessoa-models/unb-pessoa-email.model';
5
- import { UnBPessoaService } from '../unb-pessoa.service';
5
+ import { UnbPessoaErroPadrao, UnBPessoaService } from '../unb-pessoa.service';
6
6
  import { MatDialogRef } from '@angular/material/dialog';
7
7
  import { NgForm } from '@angular/forms';
8
+ import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class UnbPessoaEmailFormComponent implements OnInit {
10
11
  private snackBar;
11
12
  private service;
13
+ private alertService;
12
14
  dialogRef: MatDialogRef<UnbPessoaEmailFormComponent>;
13
15
  data: any;
14
16
  emailSalvo: UnbPessoaEmail;
@@ -16,7 +18,8 @@ export declare class UnbPessoaEmailFormComponent implements OnInit {
16
18
  emailsList: UnbPessoaEmail[];
17
19
  tipoEmail: Observable<UnbPessoaEmailTipo[]>;
18
20
  listaTipoEmail: UnbPessoaEmailTipo[];
19
- constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialogRef: MatDialogRef<UnbPessoaEmailFormComponent>, data: any);
21
+ idMensagemService: string;
22
+ constructor(snackBar: MatSnackBar, service: UnBPessoaService, alertService: UnbMensagemService, dialogRef: MatDialogRef<UnbPessoaEmailFormComponent>, data: any);
20
23
  ngOnInit(): void;
21
24
  salvar(form: NgForm): void;
22
25
  compararTipos(t1: any, t2: any): boolean;
@@ -28,6 +31,7 @@ export declare class UnbPessoaEmailFormComponent implements OnInit {
28
31
  validar(emailToValidate: UnbPessoaEmail): boolean;
29
32
  close(): void;
30
33
  salvarclose(): void;
34
+ handleError(erro: UnbPessoaErroPadrao | string): void;
31
35
  openSnackBar(message: string): void;
32
36
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaEmailFormComponent, never>;
33
37
  static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaEmailFormComponent, "lib-unb-pessoa-email-form", never, {}, {}, never, never, false, never>;
@@ -12,10 +12,7 @@ export declare class UnbPessoaEmailListComponent implements OnInit, OnChanges {
12
12
  dialog: MatDialog;
13
13
  podeEditar: boolean;
14
14
  emails: any;
15
- apiPessoaConfig: {
16
- url: string;
17
- token: string;
18
- };
15
+ backendURL: string;
19
16
  emailsEmitted: EventEmitter<UnbPessoaEmail[]>;
20
17
  tipoEmail: Observable<UnbPessoaEmailTipo[]>;
21
18
  constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialog: MatDialog);
@@ -28,5 +25,5 @@ export declare class UnbPessoaEmailListComponent implements OnInit, OnChanges {
28
25
  moverLinha(event: CdkDragDrop<any[]>): void;
29
26
  private sortAndAssignOrder;
30
27
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaEmailListComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaEmailListComponent, "lib-unb-pessoa-email-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "emails": { "alias": "emails"; "required": false; }; "apiPessoaConfig": { "alias": "apiPessoaConfig"; "required": false; }; }, { "emailsEmitted": "emailsEmitted"; }, never, never, false, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaEmailListComponent, "lib-unb-pessoa-email-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "emails": { "alias": "emails"; "required": false; }; "backendURL": { "alias": "backendURL"; "required": false; }; }, { "emailsEmitted": "emailsEmitted"; }, never, never, false, never>;
32
29
  }
@@ -2,24 +2,26 @@ import { OnInit } from '@angular/core';
2
2
  import { MatSnackBar } from '@angular/material/snack-bar';
3
3
  import { Observable } from 'rxjs';
4
4
  import { UnbPessoaEndereco, UnbPessoaEnderecoTipo } from '../unb-pessoa-models/unb-pessoa-endereco.model';
5
- import { UnBPessoaService } from '../unb-pessoa.service';
5
+ import { UnbPessoaErroPadrao, UnBPessoaService } from '../unb-pessoa.service';
6
6
  import { MatDialogRef } from '@angular/material/dialog';
7
7
  import { NgForm } from '@angular/forms';
8
8
  import { UnbPessoaPais } from '../unb-pessoa-models/unb-pessoa-pais';
9
+ import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class UnbPessoaEnderecoFormComponent implements OnInit {
11
12
  private snackBar;
12
13
  private service;
14
+ private alertService;
13
15
  dialogRef: MatDialogRef<UnbPessoaEnderecoFormComponent>;
14
16
  data: any;
15
17
  enderecoSalvo: UnbPessoaEndereco;
16
18
  endereco: UnbPessoaEndereco;
17
19
  enderecosList: UnbPessoaEndereco[];
18
- tipoEndereco: Observable<UnbPessoaEnderecoTipo[]>;
19
20
  listaTipoEndereco: UnbPessoaEnderecoTipo[];
20
21
  listaPaises: UnbPessoaPais[];
21
22
  paises: Observable<UnbPessoaPais[]>;
22
- constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialogRef: MatDialogRef<UnbPessoaEnderecoFormComponent>, data: any);
23
+ idMensagemService: string;
24
+ constructor(snackBar: MatSnackBar, service: UnBPessoaService, alertService: UnbMensagemService, dialogRef: MatDialogRef<UnbPessoaEnderecoFormComponent>, data: any);
23
25
  ngOnInit(): void;
24
26
  salvar(form: NgForm): void;
25
27
  compararTipos(t1: any, t2: any): boolean;
@@ -33,6 +35,7 @@ export declare class UnbPessoaEnderecoFormComponent implements OnInit {
33
35
  validar(enderecoToValidate: UnbPessoaEndereco): boolean;
34
36
  close(): void;
35
37
  salvarclose(): void;
38
+ handleError(erro: UnbPessoaErroPadrao | string): void;
36
39
  openSnackBar(message: string): void;
37
40
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaEnderecoFormComponent, never>;
38
41
  static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaEnderecoFormComponent, "lib-unb-pessoa-endereco-form", never, {}, {}, never, never, false, never>;
@@ -11,10 +11,7 @@ export declare class UnbPessoaenderecoListComponent implements OnInit, OnChanges
11
11
  dialog: MatDialog;
12
12
  podeEditar: boolean;
13
13
  enderecos: any;
14
- apiPessoaConfig: {
15
- url: string;
16
- token: string;
17
- };
14
+ backendURL: string;
18
15
  enderecosEmitted: EventEmitter<UnbPessoaEndereco[]>;
19
16
  constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialog: MatDialog);
20
17
  ngOnInit(): void;
@@ -26,5 +23,5 @@ export declare class UnbPessoaenderecoListComponent implements OnInit, OnChanges
26
23
  moverLinha(event: CdkDragDrop<any[]>): void;
27
24
  private sortAndAssignOrder;
28
25
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaenderecoListComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaenderecoListComponent, "lib-unb-pessoa-endereco-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "enderecos": { "alias": "enderecos"; "required": false; }; "apiPessoaConfig": { "alias": "apiPessoaConfig"; "required": false; }; }, { "enderecosEmitted": "enderecosEmitted"; }, never, never, false, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaenderecoListComponent, "lib-unb-pessoa-endereco-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "enderecos": { "alias": "enderecos"; "required": false; }; "backendURL": { "alias": "backendURL"; "required": false; }; }, { "enderecosEmitted": "enderecosEmitted"; }, never, never, false, never>;
30
27
  }
@@ -1,6 +1,8 @@
1
- import { OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { NgForm } from '@angular/forms';
2
3
  import { MatSnackBar } from '@angular/material/snack-bar';
3
4
  import { Observable } from 'rxjs';
5
+ import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
4
6
  import { UnbPessoaEmail } from '../unb-pessoa-models/unb-pessoa-email.model';
5
7
  import { UnbPessoaEndereco } from '../unb-pessoa-models/unb-pessoa-endereco.model';
6
8
  import { UnbPessoaEscolaridade } from '../unb-pessoa-models/unb-pessoa-escolaridade.model';
@@ -8,10 +10,8 @@ import { UnbPessoaEstadoCivil } from '../unb-pessoa-models/unb-pessoa-estado-civ
8
10
  import { UnbPessoaPais } from '../unb-pessoa-models/unb-pessoa-pais';
9
11
  import { UnbPessoaTelefone } from '../unb-pessoa-models/unb-pessoa-telefone.model';
10
12
  import { UnbPessoaModel } from '../unb-pessoa-models/unb-pessoa.model';
11
- import { UnBPessoaService } from '../unb-pessoa.service';
13
+ import { UnBPessoaService, UnbPessoaErroPadrao } from '../unb-pessoa.service';
12
14
  import { TipoPessoaEnum } from '../unb-tipo-pessoa.enum';
13
- import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
14
- import { NgForm } from '@angular/forms';
15
15
  import * as i0 from "@angular/core";
16
16
  export declare class UnbPessoaFormComponent implements OnInit {
17
17
  private service;
@@ -27,19 +27,23 @@ export declare class UnbPessoaFormComponent implements OnInit {
27
27
  [key: string]: any;
28
28
  };
29
29
  isReadonlyFromSiape: boolean;
30
- apiPessoaConfig: {
31
- url: string;
32
- token: string;
33
- };
30
+ pessoaForm: NgForm;
31
+ backendURL: string;
34
32
  defaultTipoPessoa: TipoPessoaEnum;
35
33
  pesquisarPorCPF: boolean;
36
34
  pesquisarPorCNPJ: boolean;
37
35
  pesquisarPorEstrangeiro: boolean;
38
36
  campoPesquisaMaxWidth: string;
37
+ pessoaEmitted: EventEmitter<UnbPessoaModel>;
38
+ isLoadingChange: EventEmitter<boolean>;
39
39
  constructor(service: UnBPessoaService, snackBar: MatSnackBar, alertService: UnbMensagemService);
40
40
  escolaridade: Observable<UnbPessoaEscolaridade[]>;
41
41
  paises: Observable<UnbPessoaPais[]>;
42
42
  estadosCivil: Observable<UnbPessoaEstadoCivil[]>;
43
+ idMensagemService: string;
44
+ documentoPesquisado: string;
45
+ incluindoNovaPessoa: boolean;
46
+ editandoPessoa: boolean;
43
47
  ngOnInit(): void;
44
48
  pessoaRecebida(pessoaRecebida: UnbPessoaModel): void;
45
49
  salvar(form: NgForm): void;
@@ -47,7 +51,6 @@ export declare class UnbPessoaFormComponent implements OnInit {
47
51
  telefonesEmitted(telefones: UnbPessoaTelefone[]): void;
48
52
  enderecosEmitted(enderecos: UnbPessoaEndereco[]): void;
49
53
  emailsEmitted(emails: UnbPessoaEmail[]): void;
50
- private erro;
51
54
  openSnackBar(message: string): void;
52
55
  tipoPessoaEnum(): typeof TipoPessoaEnum;
53
56
  getListaEstados(): {
@@ -63,6 +66,9 @@ export declare class UnbPessoaFormComponent implements OnInit {
63
66
  * Formata a data no padrão DD/MM/YYYY para o backend.
64
67
  */
65
68
  private formatarDataParaBackend;
69
+ handleErrorPrintConsole(erro: any): void;
70
+ handleError(erro: UnbPessoaErroPadrao): void;
71
+ getLabelDocumento(): string;
66
72
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaFormComponent, never>;
67
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaFormComponent, "lib-unb-pessoa-form", never, { "apiPessoaConfig": { "alias": "apiPessoaConfig"; "required": false; }; "defaultTipoPessoa": { "alias": "defaultTipoPessoa"; "required": false; }; "pesquisarPorCPF": { "alias": "pesquisarPorCPF"; "required": false; }; "pesquisarPorCNPJ": { "alias": "pesquisarPorCNPJ"; "required": false; }; "pesquisarPorEstrangeiro": { "alias": "pesquisarPorEstrangeiro"; "required": false; }; "campoPesquisaMaxWidth": { "alias": "campoPesquisaMaxWidth"; "required": false; }; }, {}, never, never, false, never>;
73
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaFormComponent, "lib-unb-pessoa-form", never, { "backendURL": { "alias": "backendURL"; "required": false; }; "defaultTipoPessoa": { "alias": "defaultTipoPessoa"; "required": false; }; "pesquisarPorCPF": { "alias": "pesquisarPorCPF"; "required": false; }; "pesquisarPorCNPJ": { "alias": "pesquisarPorCNPJ"; "required": false; }; "pesquisarPorEstrangeiro": { "alias": "pesquisarPorEstrangeiro"; "required": false; }; "campoPesquisaMaxWidth": { "alias": "campoPesquisaMaxWidth"; "required": false; }; }, { "pessoaEmitted": "pessoaEmitted"; "isLoadingChange": "isLoadingChange"; }, never, never, false, never>;
68
74
  }
@@ -1,39 +1,41 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { MatSnackBar } from '@angular/material/snack-bar';
3
- import { UnbPessoaModel } from '../unb-pessoa-models/unb-pessoa.model';
4
- import { UnBPessoaService } from '../unb-pessoa.service';
5
- import { TipoPessoaEnum } from '../unb-tipo-pessoa.enum';
3
+ import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
4
+ import { UnbPessoaEmailTipo } from '../unb-pessoa-models/unb-pessoa-email.model';
6
5
  import { UnbPessoaEnderecoTipo } from '../unb-pessoa-models/unb-pessoa-endereco.model';
7
6
  import { UnbPessoaTelefoneTipo } from '../unb-pessoa-models/unb-pessoa-telefone.model';
8
- import { UnbPessoaEmailTipo } from '../unb-pessoa-models/unb-pessoa-email.model';
7
+ import { UnbPessoaModel } from '../unb-pessoa-models/unb-pessoa.model';
8
+ import { UnbPessoaErroPadrao, UnBPessoaService } from '../unb-pessoa.service';
9
+ import { TipoPessoaEnum } from '../unb-tipo-pessoa.enum';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class UnbPessoaPesquisarComponent implements OnInit {
11
12
  private pessoaService;
12
13
  private snackBar;
14
+ private alertService;
13
15
  isLoading: boolean;
14
- apiPessoaConfig: {
15
- url: string;
16
- token: string;
17
- };
16
+ backendURL: string;
18
17
  pesquisarPorCPF: boolean;
19
18
  pesquisarPorCNPJ: boolean;
20
19
  pesquisarPorEstrangeiro: boolean;
21
20
  defaultTipoPessoa: TipoPessoaEnum;
22
21
  campoPesquisaMaxWidth: string;
23
22
  pessoaEmitted: EventEmitter<UnbPessoaModel>;
23
+ isLoadingChange: EventEmitter<boolean>;
24
24
  pessoa: UnbPessoaModel;
25
25
  mostrarPesquisa: boolean;
26
26
  limparAposPesquisa: boolean;
27
27
  label: string;
28
28
  placeholder: string;
29
29
  hint: string;
30
- constructor(pessoaService: UnBPessoaService, snackBar: MatSnackBar);
30
+ constructor(pessoaService: UnBPessoaService, snackBar: MatSnackBar, alertService: UnbMensagemService);
31
31
  pessoaEncontrado: Boolean | null;
32
32
  mostrarTipoPessoa: boolean;
33
33
  listaTipoEndereco: UnbPessoaEnderecoTipo[];
34
34
  listaTipoTelefone: UnbPessoaTelefoneTipo[];
35
35
  listaTipoEmail: UnbPessoaEmailTipo[];
36
+ idMensagemService: string;
36
37
  ngOnInit(): void;
38
+ onTipoPessoaChange(): void;
37
39
  pesquisar(): void;
38
40
  validar(): boolean;
39
41
  hadleResult(resultado: UnbPessoaModel): void;
@@ -43,10 +45,18 @@ export declare class UnbPessoaPesquisarComponent implements OnInit {
43
45
  * Retorna null se o formato for inválido.
44
46
  */
45
47
  private parseData;
46
- handleError(erro: any): void;
48
+ handleError(erro: UnbPessoaErroPadrao | string): void;
47
49
  handleErrorPrintConsole(erro: any): void;
48
50
  openSnackBar(message: string): void;
49
51
  tipoPessoaEnum(): typeof TipoPessoaEnum;
52
+ /**
53
+ * Formata o CPF enquanto o usuário digita
54
+ */
55
+ formatarCpf(event: any): void;
56
+ /**
57
+ * Formata o CNPJ enquanto o usuário digita
58
+ */
59
+ formatarCnpj(event: any): void;
50
60
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaPesquisarComponent, never>;
51
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaPesquisarComponent, "lib-unb-pessoa-pesquisar", never, { "apiPessoaConfig": { "alias": "apiPessoaConfig"; "required": false; }; "pesquisarPorCPF": { "alias": "pesquisarPorCPF"; "required": false; }; "pesquisarPorCNPJ": { "alias": "pesquisarPorCNPJ"; "required": false; }; "pesquisarPorEstrangeiro": { "alias": "pesquisarPorEstrangeiro"; "required": false; }; "defaultTipoPessoa": { "alias": "defaultTipoPessoa"; "required": false; }; "campoPesquisaMaxWidth": { "alias": "campoPesquisaMaxWidth"; "required": false; }; "pessoa": { "alias": "pessoa"; "required": false; }; "mostrarPesquisa": { "alias": "mostrarPesquisa"; "required": false; }; "limparAposPesquisa": { "alias": "limparAposPesquisa"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, { "pessoaEmitted": "pessoaEmitted"; }, never, never, false, never>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaPesquisarComponent, "lib-unb-pessoa-pesquisar", never, { "backendURL": { "alias": "backendURL"; "required": false; }; "pesquisarPorCPF": { "alias": "pesquisarPorCPF"; "required": false; }; "pesquisarPorCNPJ": { "alias": "pesquisarPorCNPJ"; "required": false; }; "pesquisarPorEstrangeiro": { "alias": "pesquisarPorEstrangeiro"; "required": false; }; "defaultTipoPessoa": { "alias": "defaultTipoPessoa"; "required": false; }; "campoPesquisaMaxWidth": { "alias": "campoPesquisaMaxWidth"; "required": false; }; "pessoa": { "alias": "pessoa"; "required": false; }; "mostrarPesquisa": { "alias": "mostrarPesquisa"; "required": false; }; "limparAposPesquisa": { "alias": "limparAposPesquisa"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, { "pessoaEmitted": "pessoaEmitted"; "isLoadingChange": "isLoadingChange"; }, never, never, false, never>;
52
62
  }
@@ -1,22 +1,23 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { MatSnackBar } from '@angular/material/snack-bar';
3
- import { Observable } from 'rxjs';
4
3
  import { UnbPessoaTelefone, UnbPessoaTelefoneTipo } from '../unb-pessoa-models/unb-pessoa-telefone.model';
5
- import { UnBPessoaService } from '../unb-pessoa.service';
4
+ import { UnbPessoaErroPadrao, UnBPessoaService } from '../unb-pessoa.service';
6
5
  import { MatDialogRef } from '@angular/material/dialog';
7
6
  import { NgForm } from '@angular/forms';
7
+ import { UnbMensagemService } from '../../unb-mensagem/unb-mensagem.service';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class UnbPessoaTelefoneFormComponent implements OnInit {
10
10
  private snackBar;
11
11
  private service;
12
+ private alertService;
12
13
  dialogRef: MatDialogRef<UnbPessoaTelefoneFormComponent>;
13
14
  data: any;
14
15
  telefoneSalvo: UnbPessoaTelefone;
15
16
  telefone: UnbPessoaTelefone;
16
17
  telefonesList: UnbPessoaTelefone[];
17
- tipoTelefone: Observable<UnbPessoaTelefoneTipo[]>;
18
18
  listaTipoTelefone: UnbPessoaTelefoneTipo[];
19
- constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialogRef: MatDialogRef<UnbPessoaTelefoneFormComponent>, data: any);
19
+ idMensagemService: string;
20
+ constructor(snackBar: MatSnackBar, service: UnBPessoaService, alertService: UnbMensagemService, dialogRef: MatDialogRef<UnbPessoaTelefoneFormComponent>, data: any);
20
21
  ngOnInit(): void;
21
22
  salvar(form: NgForm): void;
22
23
  compararTipos(t1: any, t2: any): boolean;
@@ -28,6 +29,7 @@ export declare class UnbPessoaTelefoneFormComponent implements OnInit {
28
29
  validar(telefoneToValidate: UnbPessoaTelefone): boolean;
29
30
  close(): void;
30
31
  salvarclose(): void;
32
+ handleError(erro: UnbPessoaErroPadrao | string): void;
31
33
  openSnackBar(message: string): void;
32
34
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaTelefoneFormComponent, never>;
33
35
  static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaTelefoneFormComponent, "lib-unb-pessoa-telefone-form", never, {}, {}, never, never, false, never>;
@@ -12,10 +12,7 @@ export declare class UnbPessoaTelefoneListComponent implements OnInit, OnChanges
12
12
  dialog: MatDialog;
13
13
  podeEditar: boolean;
14
14
  telefones: any;
15
- apiPessoaConfig: {
16
- url: string;
17
- token: string;
18
- };
15
+ backendURL: string;
19
16
  telefonesEmitted: EventEmitter<UnbPessoaTelefone[]>;
20
17
  tipoTelefone: Observable<UnbPessoaTelefoneTipo[]>;
21
18
  constructor(snackBar: MatSnackBar, service: UnBPessoaService, dialog: MatDialog);
@@ -28,5 +25,5 @@ export declare class UnbPessoaTelefoneListComponent implements OnInit, OnChanges
28
25
  moverTelefone(event: CdkDragDrop<any[]>): void;
29
26
  private sortAndAssignOrder;
30
27
  static ɵfac: i0.ɵɵFactoryDeclaration<UnbPessoaTelefoneListComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaTelefoneListComponent, "lib-unb-pessoa-telefone-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "telefones": { "alias": "telefones"; "required": false; }; "apiPessoaConfig": { "alias": "apiPessoaConfig"; "required": false; }; }, { "telefonesEmitted": "telefonesEmitted"; }, never, never, false, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnbPessoaTelefoneListComponent, "lib-unb-pessoa-telefone-list", never, { "podeEditar": { "alias": "podeEditar"; "required": false; }; "telefones": { "alias": "telefones"; "required": false; }; "backendURL": { "alias": "backendURL"; "required": false; }; }, { "telefonesEmitted": "telefonesEmitted"; }, never, never, false, never>;
32
29
  }
@@ -8,22 +8,18 @@ import { UnbPessoaPais } from './unb-pessoa-models/unb-pessoa-pais';
8
8
  import { UnbPessoaMunincipio } from './unb-pessoa-models/unb-pessoa-municipio';
9
9
  import { UnbPessoaEstadoCivil } from './unb-pessoa-models/unb-pessoa-estado-civil.model';
10
10
  import * as i0 from "@angular/core";
11
+ export interface UnbPessoaErroPadrao {
12
+ status: number;
13
+ mensagemSimples: string;
14
+ mensagemHtml: string;
15
+ }
11
16
  export declare class UnBPessoaService {
12
17
  private http;
13
- private apiConfigSubject;
14
- apiConfig$: Observable<{
15
- url: string;
16
- token: string;
17
- }>;
18
+ private backendUrlSubject;
19
+ backendUrl$: Observable<string>;
18
20
  constructor(http: HttpClient);
19
- setApiConfig(config: {
20
- url: string;
21
- token: string;
22
- }): void;
23
- getApiConfig(): {
24
- url: string;
25
- token: string;
26
- };
21
+ setBackendUrl(url: string): void;
22
+ getBackendUrl(): string;
27
23
  private getHeaders;
28
24
  findByCpf(cpf: string | undefined): Observable<UnbPessoaModel>;
29
25
  findByCnpj(cnpj: string | undefined): Observable<UnbPessoaModel>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stiunb/unb-lib-components",
3
- "version": "18.0.23",
3
+ "version": "18.0.25",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.1.2",
6
6
  "@angular/core": "^18.1.2",
@@ -8,8 +8,7 @@
8
8
  "angular-auth-oidc-client": "^18.0.1"
9
9
  },
10
10
  "dependencies": {
11
- "tslib": "^2.3.0",
12
- "unb-lib-components": "file:"
11
+ "tslib": "^2.3.0"
13
12
  },
14
13
  "module": "fesm2022/stiunb-unb-lib-components.mjs",
15
14
  "typings": "index.d.ts",