awesome-mask
Advanced tools
Comparing version 1.0.2 to 1.0.3
34
index.js
@@ -1,22 +0,30 @@ | ||
'use strict' | ||
'use strict'; | ||
import VMasker from 'vanilla-masker' | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
let mask = {}; | ||
var _vanillaMasker = require('vanilla-masker'); | ||
let inputHandler = (ev) => { | ||
ev.target.value = mask ? VMasker.toPattern(ev.target.value, mask) : ev.target.value | ||
} | ||
var _vanillaMasker2 = _interopRequireDefault(_vanillaMasker); | ||
export default { | ||
bind (el, binding) { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var mask = {}; | ||
var inputHandler = function inputHandler(ev) { | ||
ev.target.value = mask ? _vanillaMasker2.default.toPattern(ev.target.value, mask) : ev.target.value; | ||
}; | ||
exports.default = { | ||
bind: function bind(el, binding) { | ||
mask = binding.expression; | ||
el.addEventListener('input', inputHandler) | ||
el.addEventListener('input', inputHandler); | ||
}, | ||
update (el, binding) { | ||
update: function update(el, binding) { | ||
mask = binding.expression; | ||
}, | ||
unbind(el) { | ||
el.addEventListener('input', inputHandler) | ||
unbind: function unbind(el) { | ||
el.addEventListener('input', inputHandler); | ||
} | ||
} | ||
}; |
{ | ||
"name": "awesome-mask", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An awesome mask directive for Vue.js using vanilla-masker from `https://github.com/BankFacil/vanilla-masker`", | ||
"main": "N", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "babel src --presets babel-preset-es2015 --out-dir . " | ||
}, | ||
@@ -29,3 +30,6 @@ "dependencies": { | ||
], | ||
"main": "index.js" | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-preset-es2015": "^6.18.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2581
22
2