This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/ HTML ATTRIBUTES | |
matInput | |
type="text" | |
[value]=" | |
formGroup.get('')?.value | |
| currency : 'BRL' : 'symbol' : '1.2-2' : 'pt-BR' | |
" | |
(input)="inputChange($event)" | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
HTML | |
<mat-paginator | |
[length]="data?.length" | |
[pageSize]="pageSize" | |
[pageIndex]="pageIndex" | |
[pageSizeOptions]="[5, 10, 25, 100]" | |
(page)="changePage($event)" | |
> | |
</mat-paginator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MatPaginatorIntl } from '@angular/material/paginator'; | |
export class MatPaginatorIntlCustom extends MatPaginatorIntl { | |
override itemsPerPageLabel = 'Itens por páginas'; | |
override nextPageLabel = 'Próxima'; | |
override previousPageLabel = 'Anterior'; | |
override firstPageLabel = 'Primeira página'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ name: 'CNPJ' }) | |
export class CNPJPipe implements PipeTransform { | |
transform(value) { | |
return value.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/g, "\$1.\$2.\$3\/\$4\-\$5") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ name: 'CPF' }) | |
export class CPFPipe implements PipeTransform { | |
transform(value) { | |
return value.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/g, '\$1.\$2.\$3\-\$4'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ name: 'CPFCNPJ' }) | |
export class CPFCNPJPipe implements PipeTransform { | |
transform(value) { | |
if (value.toString().length === 11) { | |
return value.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/g, '\$1.\$2.\$3\-\$4'); | |
} | |
if (value.toString().length === 14) { | |
return value.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/g, "\$1.\$2.\$3\/\$4\-\$5"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ name: 'celular' }) | |
export class CelularPipe implements PipeTransform { | |
transform(value) { | |
if (value != null) { | |
var cell = value.substring(0,0)+'('+value.substring(0,2)+') '+value.substring(2,7)+'-'+value.substring(7); | |
return cell; | |
} else { | |
return value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ name: 'CEP' }) | |
export class CEPPipe implements PipeTransform { | |
transform(cep: number) { | |
var sCep = cep.toString() | |
var fCep = sCep.substring(0,5)+'-'+sCep.substring(5) | |
return fCep; | |
} | |
} |