Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@verifiedinternational/vue-phone-number-input
Advanced tools
Readme
A beautiful text field to format phone numbers made with VueJS
The new version of VuePhoneNumberInput is now on my new library Maz-UI
See doc/demo page of MazPhoneNumberInput
Some options may change, check the props documentation with the top right button
In this new library, you can enjoy lot of others components in the same style. You can just install the component you want (and not the whole library), for this Read the Get started page
If you have any problem or question, do no hesitate to ask me !
yarn add vue-phone-number-input
npm i --save vue-phone-number-input
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" />
<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>
preferred-countries
, ignored-countries
or have only-countries
valid-color
option) when the phone number is valid (can be disabled by no-validator-state
attr)no-use-browser-locale
) or you can use fetch-country
to get the country code via https://ip2c.org/s (network needed) - you can use default-country-code
option instead to set oneno-flags
propssize="sm|lg"
disabled
prop)dark
prop)clearable
(cf: VueInputUi options)loader
(cf: VueInputUi options)Props | Type | Required | Default |
---|---|---|---|
v-model | String/Int | true | - |
id | String | false | VuePhoneNumberInput |
color | String HEX | no | dogderblue |
valid-color | String HEX | no | yellowgreen |
error-color | String HEX | no | orangered |
size | String `sm | lg` | no |
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-flags | Boolean | no | false |
disabled | Boolean | no | false |
dark | Boolean | no | false |
dark-color | String (hex) | no | #424242 |
required | Boolean | no | false |
error | Boolean | no | false |
clearable | Boolean | no | false |
loader (3) | Boolean | no | false |
translations (4) | Object | no | null |
countries-height (5) | Number | no | 30 |
no-use-browser-locale (6) | Boolean | no | false |
fetch-country (7) | Boolean | no | false |
no-country-selector (8) | Boolean | no | false |
border-radius | Number | no | 4 |
show-code-on-list | Boolean | no | false |
no-example | Boolean | no | false |
(1) Ex : default-country-code="FR"
(2) Ex : preferred-countries="['FR', 'BE', 'DE']"
This countries will be at the top of the list
(3) Loader progress bar has the input color (color
props)
(4) translations comes to replace default texts - Ex :
translations="{
countrySelectorLabel: 'Code pays',
countrySelectorError: 'Choisir un pays',
phoneNumberLabel: 'Numéro de téléphone',
example: 'Exemple :'
}"
(5) height in px of the rows included in the dropdown. Ex: countries-height: 40
(6) By default the component get country code via browser - No network needed but not work on SSR with NuxtJS (disable it with no-use-browser-locale
)
(7) Fetch country code via https://ip2c.org/s - Network needed - (Do not use it with default-country-code
options)
(8) The country selector is not shown, you can validate your phone number with the country code set
Event | Return |
---|---|
phone-number-focused | - (emit when phone number input is focused) |
phone-number-blur | - (emit when phone number input is blur) |
input | AsYouType value (emit when new value is enter on phone number input && when a country is choosed) |
update | All values (cf values in table on demo) (emit when new value is enter on phone number input && when a country is choosed) |
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) |
Slot | Action |
---|---|
arrow | Override the default arrow character for toggling the list of countries |
npm install
npm run serve
npm run lint
This project is licensed under MIT License
FAQs
A phone number input made with Vue JS && libphonenumber-js
The npm package @verifiedinternational/vue-phone-number-input receives a total of 40 weekly downloads. As such, @verifiedinternational/vue-phone-number-input popularity was classified as not popular.
We found that @verifiedinternational/vue-phone-number-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.