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

input-ip

v1.0.2

Published

An Angular 2 Network (IPv4, IPv6 and mac address) component

Downloads

5

Readme

input-ip

an angular 2 IPv4, IPv6 and MAC ADDRESS input component

input-ip is an IPv4/6 and mac address input component that implements block level IP inputs, each block has it's own input element for better UX control.

This allows highlighting specific blocks with invalid syntax, disabling specific blocks (limit pools, etc...) and more.

input-ip is NOT a mask component, masking is a different approach which uses one input element for the whole IP address.

Install:

npm install input-ip --save or yarn add input-ip --save

Dev:

Download modules: npm i Launch dev server: npm start Build input-ip module (into release folder): npm run release Push to npm: npm publish --access public ./release

DEMO:

https://shlomiassaf.github.io/ng2-ip

Features

  • Supports IPv4, IPv6 and mac address
  • Control if user can type invalid characters
  • Separator behaves like TAB (e.g: in IPv4 pressing dot (.) is like pressing TAB)
  • Support paste (single value or whole address)
  • Support copy block or address
  • Disable specific blocks
  • Highlight invalid blocks (does not replace validation)
  • Themes
  • Implements OnPush
  • Supports AOT

Validation

input-ip performs internal validation at the block level to allow invalid block highlighting.

Block validation does not replace form validation, if you use angular forms you still need to validate the output, as you need with any other control.

Should I use input-ip or mask?

Well, this depends on your requirements, here are some key points:

Copy / Paste

input-ip offers better UX but since it has multiple input elements it has a different copy/paste (CMD/CTRL-C/V) behaviour.

When pasting, input-ip will auto detect the content and handle full address automatically.

When copying, input-ip has 3 copy modes to choose from, these modes fire only if the whole text in a block is selected otherwise copy behavior is native.

  • Block mode: This is similar to the native copy mode, when fired it will copy the content of the block.
  • Address mode: This will copy the whole address.
  • Select mode: Once fired the user will be prompted to select Block or Address copy.
    This mode is not supported in browsers that does not support the document.execCommand('copy'); method (Safari 9), if set in such browser it will fallback to Block mode.

Rendering

input-ip renders more input elements.
This should have no effect on performance, unless you render 1000+ components and if you do you're doing something wrong :)

If these are deal breakers for you you should definitely use a mask component, here are some examples Text Mask, PrimeNG Input Mask, etc...