GithubHelp home page GithubHelp logo

nbfontana / ngx-br Goto Github PK

View Code? Open in Web Editor NEW
48.0 5.0 15.0 225 KB

📦 The brazilian module for Angular

Home Page: https://nbfontana.github.io/ngx-br

License: MIT License

TypeScript 80.48% HTML 15.75% JavaScript 3.37% CSS 0.41%
angular typescript angular4 components cpf cnpj cep telefone dinheiro peso

ngx-br's Introduction

@nbfontana/ngx-br

I'm the brazilian module for angular

Build Status npm version codecov

There're many repositories covering Brazilian needs for software development. NgxBr is here to concentrate almost everything that you need to build a functional pt-br software with Angular. We give you a full set of components (inputs, select, etc) covering fields like CEP, CPF, CNPJ, ESTADOS, etc. Beside that, we make available everything we use to build our components for the user, like Pipes and Directives (masks).

Feel free to use the entire NgxBrModule if it's your need, but you can always import components or pipes separatedly. Use it the way you want to.

Contents

Usage

Install as a dependency:

$ npm install --save @nbfontana/ngx-br

Then, you need to include NgxBrModule in your app:

import { Component, NgModule } from '@angular/core';
import { NgxBrModule } from '@nbfontana/ngx-br';

@NgModule({
  imports: [
    NgxBrModule.forRoot()
  ]
})
export class MyModule {}

And use it:

import { Component } from '@angular/core';

@Component({
  template: '<cpf formControlName="cpf" [(ngModel)]="model.cpf"></cpf>'
})
export class MyComponent {}

FAQ

How do the inputs look like? bootstrap, material?

NgxBr is using Bootstrap classes for now, so, if you override the bootstrap style for .form-control, it'll be applied to all inputs as well. But we'll work to let it more flexible, all ideas are welcome! Open an Issue (you can write it in Portuguese).

Help needed

Maybe you could help me define the way that components may be stylized?

Wich components should be added?

What kind of utilities may also be added and helpfull to be used within and outside ngx-br?

MIT @ Neri Bez Fontana

ngx-br's People

Contributors

alexandredavi avatar alissonjr avatar nbfontana avatar vincequeiroz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ngx-br's Issues

Create a fixed phone component

Today we have a Telefone component that handles both, cell phone and fixed phone number, but we should have a simple one only with a fixed phone mask.

The feature should include a pipe and a mask as well.

Create a cell phone component

Today we have a Telefone component that handles both, cell phone and fixed phone number, but we should have a simple one only with a cell phone mask.

The feature should include a pipe and a mask as well.

Add 'required' attribute

Expected Behavior

<cpf .... required></cpf> inject 'required' into <input cpfMask....

BTW, this could be the default behavior of any attribute, by-pass them to component.

Actual Behavior

It ignores the 'required' attribute.

Suggested changes

Suggested changes

The input cpf, cnpj, tel and cep change to type = "tel".

Improves typing on mobile

Provide formated value for fields.

Expected Behavior

The model value has the unformatted field value, but on error handling the formatted value typed could be used in user feedbacks, i.e. 'O CPF '000.111.222-33' é inválido.'

Actual Behavior

Could not find the formatted value on formcontrol. I´ll have to use vanilla to format my customized error or use some sort of feature to recover ElementRef to get nativeValue, with this 'feature' it would not be required.

cálculo da aposentadoria

Expected Behavior

Estava pensando em incluir o módulo de cálculo de aposentadoria no ngx-br.

Actual Behavior

Pensei em perguntar se há ou não necessidade disso, do que fazer um código e ele ser rejeitado.

Steps to Reproduce the Problem

  1. Existem aposentadoria atual que é o tempo de idade e o tempo de serviço, isso geralmente é para funcionário público
  2. existem outros tipos de aposentadoria(que vai além de ser funcionário público), como a aposentadoria para alguma classe política

Specifications

  • Version: última versão
  • Platform: debian
  • Subsystem: linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.