vuetify-masked
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "vuetify-masked", | ||
"description": "vuetify masked textfield and filter", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Kim Mannstedt <k.mannstedt+dev@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -118,3 +118,3 @@ # vuetify-masked | ||
|locale |string |``'en-EN'`` |yes |yes |Used to determine the decimal and thousands seperator. | | ||
|maskCharacter |array |``['-', '.', ',', ' ', '/', '(', ')', '_', '\\', '\'', '~', '*', '&', '"', '?']``|yes|no|Characters of the mask. Can not be used as input character for the text field. Used for both, formatMask and deformatMask.| | ||
|maskCharacter |array |``['-', '.', ',', ' ', '/', '(', ')', '_', '\\', '\'', '~', '*', '&', '"', '?']``|yes|yes|Characters of the mask. Can not be used as input character for the text field. Used for both, formatMask and deformatMask.| | ||
|precision |number |``2`` |yes |yes |Precision used for numbers. Ingored for types text and integer.| | ||
@@ -121,0 +121,0 @@ |properties |object |``null`` |yes |no |Properties for the v-text-field used by vuetify-masked| |
@@ -33,3 +33,3 @@ import { formatFloat, formatText } from "./utils/formatter"; | ||
let o = prepareMask(c, {}, cmpMaskCharacter()) //TODO use a function that removes | ||
let o = prepareMask(c, {}, cmpMaskCharacter()) | ||
@@ -88,3 +88,3 @@ m.push(o) | ||
if(typeIsText()) { | ||
result = formatText(value, formatMask(), [], '') | ||
result = formatText(value, formatMask(), cmpMaskCharacter(), '') | ||
} else if (typeIsFloat()) { | ||
@@ -91,0 +91,0 @@ result = formatFloat(value, globalOptions.locale, cmpPrecision()) |
@@ -9,2 +9,3 @@ import { clearValue } from './preparator' | ||
let count = 0 | ||
let maskSuffix = '' | ||
if(value) { | ||
@@ -30,2 +31,9 @@ let arrayValue = value.toString().split("") | ||
} | ||
} else { | ||
if(mask[i].partOfMask) { | ||
maskSuffix += mask[i].mask | ||
} else { | ||
maskSuffix = '' | ||
break | ||
} | ||
} | ||
@@ -35,2 +43,4 @@ } | ||
result += maskSuffix | ||
return result | ||
@@ -37,0 +47,0 @@ } |
@@ -72,3 +72,3 @@ export function clearValue(value, charsToClear) { | ||
o.replace = maskChar.hasOwnProperty('replace') ? maskChar.replace : false | ||
o.partOfMask = maskCharacters.includes(maskChar) | ||
o.partOfMask = maskCharacters.includes(maskChar.mask) | ||
o.toUpperCase = maskChar.hasOwnProperty('toUpperCase') ? maskChar.toUpperCase : maskChar.mask === 'U' | ||
@@ -78,3 +78,3 @@ o.toLowerCase = maskChar.hasOwnProperty('toLowerCase') ? maskChar.toLowerCase : maskChar.mask === 'l' | ||
o.onlyAlphabetical = maskChar.hasOwnProperty('onlyAlphabetical') ? maskChar.onlyAlphabetical : maskChar.mask === 'A' | ||
o.hint = maskChar.hasOwnProperty('hint') ? maskChar.hint : hint | ||
o.hint = maskChar.hasOwnProperty('hint') ? maskChar.hint.toString() : hint | ||
} | ||
@@ -81,0 +81,0 @@ |
Sorry, the diff of this file is not supported yet
36238
109
230