Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vueform/plugin-mask

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vueform/plugin-mask

Official input mask plugin for Vueform.

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-25.6%
Maintainers
1
Weekly downloads
 
Created
Source
Vueform Logo

Official Input Mask plugin for Vueform

Plugin for Vueform to add input mask to text elements.

Prerequisites

Installation

  1. Install the plugin
npm install @vueform/plugin-mask
  1. Add the plugin in vueform.config.js
// vueform.config.js

import MaskPlugin from '@vueform/plugin-mask'

export default {
  // ...
  plugins: [
    MaskPlugin,
  ]
}

Usage

Pattern
<TextElement
  name="text"
  mask="{+1} (000)-000-0000"
/>
Number
<TextElement
  name="text"
  :mask="{
    mask: 'number',
    min: -10000,
    max: 10000
  }"
/>
Range
<TextElement
  name="text"
  :mask="{
    mask: 'range',
    from: 1,
    to: 90
  }"
/>
Enum
<TextElement
  name="text"
  :mask="{
    mask: 'enum',
    enum: [              
      'January',
      'February',
      'March',
      'April',
      'May',
      'June',
      'July',
      'August',
      'September',
      'October',
      'November',
      'December',
    ],
  }"
/>
Repeat
<TextElement
  name="text"
  :mask="{
    mask: 'VFr',
    blocks: {
      r: {
        repeat: Infinity, // number of times to repeat: Infinity | number | [min, max]
        mask: '-000',
      }
    },
  }"
/>
Regex
<TextElement
  name="text"
  :mask="/^[a-fA-F0-9]{0,6}$/"
/>
Date
<TextElement
  name="text"
  :mask="{
    mask: 'date',
    pattern: 'd.`m.`Y',
  }"
/>
Dynamic
<TextElement
  name="text"
  :mask="[
    {
      mask: 'rgb(RGB,RGB,RGB)',
      eager: true,
      blocks: {
        RGB: {
          mask: 'range',
          from: 0,
          to: 255
        }
      }
    },
    {
      mask: /^#[0-9a-f]{0,6}$/i
    }
  ]"
/>

More info and examples can be found at the official documentation.

License

MIT

FAQs

Package last updated on 14 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc