GithubHelp home page GithubHelp logo

bissolli / nova-phone-field Goto Github PK

View Code? Open in Web Editor NEW
31.0 31.0 5.0 503 KB

Nova Phone Number field with a dynamic mask based on the country code inserted by the user.

License: MIT License

Vue 56.76% JavaScript 10.98% CSS 0.30% PHP 31.96%

nova-phone-field's People

Contributors

bissolli avatar drsdre avatar nibri10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nova-phone-field's Issues

Suggestion: Can we forbid the number for the first step of number

For example: (+XX) YYY-ZZ-WW
This is the number format.
In my country country and most of the other countries phone codes end with "0".
+70 707 70 70 or +90 909 90 90
But when people calling each other without "+9"
0707 70 70 / 0909 90 90
So my customers cant figure out default country code section and writing one more 0.
writing "+90 090 09 09" instead of "+90 909 90 90".
I hope i could express myself. I can override your code but i can use your package all the time i sure :) And other people may need to this. We need to block 0 for 4. string.
+90 X.... This X can't be 0. Can we do this? Or should i just override?

The problem with validation

Hello. How to validate a value if the value in the field is not specified?

I made a field
->onlyCountries('RU')
Mask : +7 (###) ###-##-##

and added a validation rule:

->rules(['nullable', 'regex:/^(\+7) \(\d{3}\) \d{3}-\d{2}-\d{2}$/'])

If I erase the value from the field and try to save the form, then the value +7 (___) ___-__-__ inevitably comes in the request

It seems to me that you should make it so that the mask is activated only by input / focus ...

Kindly force the direction to be (ltr) for the input style (for rtl layouts)

Hey!
Thank you for amazing work.

Kindly always force the direction to be ltr as styling the input because when the page's direction is rtl for other languages the input mask does not show as expected.

current:
Screenshot 2020-03-26 04 10 07

If direction is ltr:
Screenshot 2020-03-26 04 12 21

and phone numbers are handled left to right for all languages as far as i know

Thanks!

Cannot read property 'replace' of null

if phone field is null then this error in console

TypeError: Cannot read property 'replace' of null
at a.unmaskedValue (nova-phone-field:1)
at Ne.I3G/.Ne.get (vendor.js?id=b30263b2f9d68433c3ce:1)
at Ne.I3G/.Ne.evaluate (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.unmaskedValue (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.render (nova-phone-field:1)
at a.I3G/.t._render (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.n (vendor.js?id=b30263b2f9d68433c3ce:1)
at Ne.I3G/.Ne.get (vendor.js?id=b30263b2f9d68433c3ce:1)
at new Ne (vendor.js?id=b30263b2f9d68433c3ce:1)
at vendor.js?id=b30263b2f9d68433c3ce:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.