New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuetify-masked

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuetify-masked

vuetify masked textfield and filter

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108
increased by36.71%
Maintainers
1
Weekly downloads
 
Created
Source

vuetify-masked

Create a masked text field for vuetify 2.x based on v-text-field. Supported are static masks provided by string/object and the masking of float and integer values. Additionally, a filter exists to format a value.

Install

npm install vuetify-masked --save

Global

import Vue from 'vue'
import VuetifyMasked from 'vuetify-masked'

Vue.use(VuetifyMasked)

Local

// use only the component
import { VuetifyMaskedComponent } from 'vuetify-masked'

// use only the filter
import { VuetifyMaskedComponent } from 'vuetify-masked'

export default {
  components: {
    'v-text-field-masked': VuetifyMaskedComponent
  },
  filters: {
    VuetifyMaskedFilter
  }
}

Usage

Once installed, for a simple mask the component can be used in a template as simple as:

<v-text-field-masked
  v-model="text"
  formatMask="ADDD-ul/#####"
  :properties="{
    readonly: false,
    disabled: false,
    outlined: false,
    clearable: true,
  }"
  label="Masked Text"
></v-text-field-masked>

The filter can be used by the following:

{{ text | vuetifyMaskedFilter({ formatMask: "ADDD-ul/#####", type: "text" }) }}

Options (Component Props and Filter Parameters

The following options can be used for component and filter

OptiontypeDefaultComponentFilterDescription
v-modelstring, numbernullyesno
formatMaskstring, object'##########'yesnoUsed to mask the given value. Meaining of characters and usable aatributes for obecjt can be foudn below table
deformatMaskstring, objectnullyesnoMask used to deformat the masked value. If null all characters of the masked will be removed
typestring'text'yesyes5 types exist: text, float, integer, currency, and percentage
maskCharacterarray['-', '.', ',', ' ', '/', '(', ')', '_', '\\', '\'', '~', '*', '&', '"', '?']yesnoCharacters of the mask. Can not be used as input character for the text field. Used for both, formatMask and deformatMask.
emptystringnullyesnoValue returned for an empty text field
precisionnumber2yesyesPrecision used for numbers. Ingored for types text and integer.
lengthnumbernullyesnoMax number of digits (including precision) that can be entered into the text field. Ignored for Type text.
suffixstringnull (text, integer, float)
'%' (percentage)
'USD'(currency)
yesyes
falseCharWildcardstring''yesyesFalse characters of the provided v-model/value will be replaced with this one. By default they will simply be deleted.
hintsobject{
digit: 'The next char is a digit',
alphabetic: 'The next char is alphabetic',
lowerCase: 'The next char is lower case',
upperCase: 'The next char is upper case',
alphanumeric: 'The next char is alphanumeric',
numeric: null,
maxLength: 'Max number of characters reached'
}
yesnoHints will be displayed depending on the cursor position and according to the next possible character that can be entered.

Predefind Mask Characters

CharacterDescription
ACharacter is alphabetical
DCharacter is a digit
lCharacter will be transformed to lower cased
UCharacter will be transformed to upper cased
#Any character is valid

Any other alphabetical character of the mask will be handled as #.

Object Attributes for Mask

In case of an object, the following attributes can be set.

AttributetypeDescription
maskstringCharacter of the mask.
toUpperCasebooleanIf true the character will be transformed to upper case. If not explicity set it will be true if mask is 'U'.
toLowerCasebooleanIf true the character will be transformed to upper case. If not explicity set it will be true if mask is 'l'.
onlyDigitbooleanIf true the character will be transformed to upper case. If not explicity set it will be true if mask is 'D'.
onlyAlphabeticalbooleanIf true the character will be transformed to upper case. If not explicity set it will be true if mask is 'A'.
hintstringHint only used for this character of the mask.

Examples

Examples will be added soon.

Keywords

FAQs

Package last updated on 28 Feb 2021

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