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

vue-phone-number-input-built

v0.1.8

Published

A phone number input made with Vue JS && libphonenumber-js

Downloads

6

Readme

vue-phone-number-input

A beautiful text field to format phone numbers made with VueJS

vue-phone-number-input

Demo

Enjoy

Installation

Using yarn

yarn add vue-phone-number-input

Using npm

npm i --save vue-phone-number-input

Usage

ES6 Modules / CommonJS

import VuePhoneNumberInput from 'vue-phone-number-input';
import 'vue-phone-number-input/dist/vue-phone-number-input.css';

Vue.component('vue-phone-number-input', VuePhoneNumberInput);
<VuePhoneNumberInput v-model="yourValue" />

UMD

<VuePhoneNumberInput v-model="yourValue" />

<script src="https://unpkg.com/vue" charset="utf-8"></script>
<script src="./dist/vue-phone-number-input.umd.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="./dist/vue-phone-number-input.css">

<script type="text/javascript">
  Vue.component('vue-phone-number-input', window.VuePhoneNumberInput.default);
</script>

Features List

  • You can set preferred-countries, ignored-countries or have only-countries
  • Validator State : input becomes green (you can modify this color with valid-color option) when the phone number is valid (can be disabled by no-validator-state attr)
  • Use browser locale to set the country calling code (can be disabled & you can use default-country-code option)
  • Phone number formatting while typing
  • You can search your country in list (open countries list & type your country name)
  • Keyboard accessibility (Arrow down, Arrow up : Countries list navigation - Escape : Close countries list)
  • Phone number example for each country in placeholder/label
  • Auto focus phone number input after selecting country
  • Differents size of input (sm or lg)
  • You can disable the flags - no-flags props
  • Dark UI option
  • Disabled option
  • Set your translations

Props API

| Props | Type | Required | Default | |------------|------------|----------|------------| | v-model | String/Int | true | - | | id | String | false | VuePhoneNumberInput | | color | String HEX | no | dogderblue | | valid-color | String HEX | no | yellowgreen | | size | String sm|lg | no | null | | default-country-code (1) | String | no | null | | preferred-countries (2) | Array<string> | no | null | | ignored-countries | Array<string> | no | null | | only-countries | Array<string> | no | null | | no-validator-state | Boolean | no | false | | no-use-browser-locale | Boolean | no | false | | no-flags | Boolean | no | false | | disabled | Boolean | no | false | | dark | Boolean | no | false | | required | Boolean | no | false | | error | Boolean | no | false | | translations (3) | Object | no | null |

(1) Ex : default-country-code="FR"

(2) Ex : preferred-countries="['FR', 'BE', 'DE']" This countries will be at the top of the list

(3) translations comes to replace default texts - Ex :

translations="{
  countrySelectorLabel: 'Code pays',
  countrySelectorError: 'Choisir un pays',
  phoneNumberLabel: 'Numéro de téléphone',
  example: 'Exemple :'
}"

Keyboard accessibility

| Props | Action | |------------|------------| | ArrowDown | Navigation down in countries list | | ArrowUp | Navigation up in countries list | | Escape | Close countries list | | All letters characters | Searching country name in countries list (should be open) |

Contribution

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Lints and fixes files

npm run lint

License

This project is licensed under MIT License