Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token for static pre-defined masks (like CPF_CNPJ) #1376

Open
GLugano opened this issue Jun 22, 2024 · 0 comments
Open

Token for static pre-defined masks (like CPF_CNPJ) #1376

GLugano opened this issue Jun 22, 2024 · 0 comments

Comments

@GLugano
Copy link

GLugano commented Jun 22, 2024

🚀 feature request

Description

While making a new project, im trying to make things more "default" in the project and tried (without success) to create default patterns that i could reuse between components.

Describe the solution you'd like

By using the angular tokens, its possible to configure patterns to be used in whole app.

Taking CPF_CNPJ for example, it is translated to a mask that depends on the length, but i wanted just CPF or CNPJ and i didn't want to write everytime time those masks.

By providing a token with a key and value, would be possible to verify at position near the code from CPF_CNPJ all the values inside the token (token would be a array or an object) and check if the maskExpression is equal to one of the values and then swap the value with the mask provided. Would be literally swapping the string, nothing crazy and could be configured in the root of the app.

And for other similar situations for different countries, would be easier for people to not be dependent on updates here (as CPF_CNPJ is a brazilian thing, imagine making it for every specific country) and would have freedom to make their own static masks.

I could do it myself, but i have no knowledge about helping packages. :/

Describe alternatives you've considered

Couldn't find any possible ways add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants