onedionys-formatted-input-fields

5.0.0 • Public • Published

Welcome to One Dionys - Formatted Input Fields! 👋

Components that allow the use of input with specific formats such as date, currency, or phone number with automatic validation. 💖

💾 Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax

const { formatInput } = require('formatted-input-fields');

// Example usage
const formatted = formatInput('1234567890', 'XXX-XX-XXXX');
console.log(formatted); // Output: '123-45-6789'

Explanation

  • This package provides a function formatInput to format input based on the provided mask. The function takes two parameters: the input string and the mask string. The mask string specifies the desired format of the input. The function replaces 'X' characters in the mask with corresponding characters from the input string.

Return Value

  • The formatInput function returns the formatted input string according to the specified mask.

📆 Release Date

  • v1.0.0 : 17 March 2024
  • v1.0.1 : 18 March 2024
  • v1.0.2 : 23 March 2024
  • v5.0.0 : 31 March 2024

🧑 Author

📝 License

  • Copyright © 2024 One Dionys
  • One Dionys - Formatted Input Fields is an open source project licensed under the MIT license

☕️ Suppport & Donation

Love One Dionys - Formatted Input Fields? Support this project by donating or sharing with others in need.

Made with ❤️ One Dionys

Package Sidebar

Install

npm i onedionys-formatted-input-fields

Weekly Downloads

9

Version

5.0.0

License

ISC

Unpacked Size

12.5 kB

Total Files

6

Last publish

Collaborators

  • onedionys