# input-ip

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

Latest version **1.0.2** (published 2017-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install input-ip
pnpm add input-ip
yarn add input-ip
bun add input-ip
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-11-28 |
| First published | 2017-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 4.2.1 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shlomi Assaf |
| Maintainers | kyosuk3 |
| Keywords | angular2, component, ip, ipv4, ipv6 |

## Links

- npm: https://www.npmjs.com/package/input-ip
- Repository: https://github.com/Kyosuk3/input-ip
- Homepage: https://kyosuk3.github.io/input-ip/
- Issues: https://github.com/Kyosuk3/input-ip/issues
- npm.io page: https://npm.io/package/input-ip

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-11-28
- 1.0.1-beta.4 — 2017-09-20
- 1.0.1-beta.3 — 2017-09-20
- 1.0.1-beta.2 — 2017-09-20
- 1.0.1-beta.1 — 2017-09-20
- 1.0.0-beta.5 — 2017-07-25
- 1.0.0-beta.4 — 2017-07-13
- 1.0.0-beta.3 — 2017-07-13
- 1.0.0-beta.1 — 2017-07-12

## 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 <a href="https://github.com/text-mask/text-mask/tree/master/angular2" target="_blank">Text Mask</a>, <a href="http://www.primefaces.org/primeng/#/inputmask" target="_blank">PrimeNG Input Mask</a>, etc...

---
_Source: https://npm.io/package/input-ip · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
