npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-utilitys

v0.0.4

Published

Useful utilitys for Angular

Downloads

8

Readme

Install

npm install ngx-utilitys --save

You can add each module separately

Importing all directives using NgxDirectivesModule
import { NgxDirectivesModule } from 'ngx-utilitys';

@NgModule({
    ...
  imports: [ NgxDirectivesModule ]
    ...
})
class AppModule {}
Importing all pipes using NgxPipesModule
import { NgxPipesModule } from 'ngx-utilitys';

@NgModule({
    ...
  imports: [ NgxPipesModule ]
    ...
})
class AppModule {}
Or add all in one, importing the NgxUtilitysModule
import { NgxUtilitysModule } from 'ngx-utilitys';

@NgModule({
    ...
  imports: [ NgxUtilitysModule ]
    ...
})
class AppModule {}

Directives

Each directive can be imported separately or just use NgxDirectivesModule

OnlyNumber

An angular directive that allows only numerical input in a form field, blocking non-numerical keypresses and pasted text.

<input type="text" OnlyNumber>

onlyLetters

Allows only letters (upper and lower case) and some special characters (such as accent marks and spaces) in input fields.

<input type="text" onlyLetters>

cpfCnpjMask

An angular directive that allows only numerical input in a form field, blocking non-numerical keypresses and pasted text.

<input type="text" cpfCnpjMask [cpfCnpjMask]="maskType" [(ngModel)]="myValue" />

In this example, maskType is a string property in your component that should be set to either 'cpf' or 'cnpj' depending on which mask you want to apply.

cepMask

Formats a Brazilian postal code input field with a mask. It listens to keyup and blur events to apply the mask and it can be customized with an input parameter to use different mask patterns.

<input type="text" cepMask>

cpfCnpjValid

An Angular directive that provides validation and masks for Brazilian CPF and CNPJ numbers.

<form>
  <input type="text" name="cpfCnpj" cpfCnpjValid [(ngModel)]="cpfCnpjValue">
</form>

cpfMask

Provides a mask for Brazilian CPF numbers and validates their format using the CpfValidator class

<input type="text" formControlName="cpf" cpfMask>

DateMask

Creates a date input mask to format a date

<input type="text" DateMask dateMask="MM/DD/YYYY">

financialMaskAlign

Allows aligning the cursor at the end of a financial mask input field when the user clicks or types

<input type="text" financialMaskAlign>

moveNextByMaxLength

Allows moving to the next input field when the maximum length of the current field is reached

<input type="text" maxlength="10" moveNextByMaxLength>
<input type="text" maxlength="5" moveNextByMaxLength>

NameCharacters

An Angular directive that restricts input to only accept alphabetical characters, spaces, apostrophes, hyphens and some accented letters.

<input type="text" NameCharacters>

NumberCharecters

Allows numeric input in the associated input field.

<input type="text" NumberCharecters>

phoneMask

Applies a mask to a phone number input field, allowing users to input phone numbers

<input type="text" phoneMask>

<input type="text" phoneMask="(99) 9999-9999">

phoneMaskValidator

A custom validator directive that is used to validate phone numbers that are entered in an input field.

<input type="text" phoneMaskValidator>

License

MIT


GitHub @MatheusMunizera  ·