JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15005F
  • License ISC

A dynamic jQuery plugin for phone number formatting. Simplify global number input with auto-formatting based on ISO or phone code.

Package Exports

  • maskdial
  • maskdial/format.min.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (maskdial) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MaskDial: Phone Number Masking jQuery Plugin 📞

version-badge license-badge dependency-badge

MaskDial is a sleek, lightweight jQuery plugin crafted for formatting and masking phone numbers with ease. It provides dynamic phone number formatting based on the user's country or phone code. Whether you're building a web app for global users or just want to provide a better UX for phone number inputs, MaskDial is your perfect companion.

🌍 Features

  • Automatic Format Detection: Just provide a country ISO code or phone code, and MaskDial will do the rest.
  • Customizable: Easily extend or customize the masks to suit specific needs.
  • Lightweight: Doesn't bloat your projects; it's as lightweight as plugins come!.

Upcoming

  • Fallback to Manual: Even if no country or phone code is provided, the plugin intelligently guesses the format based on the entered number.

🔧 Installation

Via CDN:

<script src="https://unpkg.com/maskdial@1.0.4/format.min.js"></script>
<script src="format.min.js"></script>

🚀 Usage

  • Ensure you've linked both jQuery and MaskDial.
  • Initialize using the plugin on your desired input field:
$('#your-input-id').maskedFormat({
    iso: 'US' // Or  
    phoneCode: '+1' // supported with or without plus(+) symbol
});

🛠 Configuration Options

iso: The ISO country code. E.g., 'US', 'GB', 'IN', etc.
phoneCode: The phone code, if you want to determine the format using that. E.g., '+1', '+44', '+91', etc.

🧩 Extending the Masks

We welcome and appreciate any contributions that help improve the MaskDial plugin.

📃 License

This project is licensed under the MIT License

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.