Skip to content

Commit

Permalink
update npm dependencies + rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
titou10titou10 committed Mar 25, 2022
1 parent 88df3f2 commit 2e20903
Show file tree
Hide file tree
Showing 6 changed files with 647 additions and 96 deletions.
14 changes: 7 additions & 7 deletions dist/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function run(el, eventName, config, vnode) {
var position = el.selectionEnd;
// save the character just inserted
var digit = beforeValue[position - 1];
el.value = masker_1["default"](beforeValue, config.mask, config.masked, config.tokens);
el.value = (0, masker_1["default"])(beforeValue, config.mask, config.masked, config.tokens);
// if the digit was changed, increment position until find the digit again
while (position < el.value.length &&
el.value.charAt(position - 1) !== digit) {
Expand All @@ -25,19 +25,19 @@ function run(el, eventName, config, vnode) {
}
// Set unmasked value if required
if (config.unmaskedVar) {
var ut = utils_1.unmaskText(el.value);
var ut = (0, utils_1.unmaskText)(el.value);
if (config.nullIfEmpty && ut.trim().length === 0) {
// Set null instead of empty if required
lodash_1.set(vnode.context, config.unmaskedVar, null);
(0, lodash_1.set)(vnode.context, config.unmaskedVar, null);
}
else {
if (config.number) {
// Convert to number if required
var vNumber = parseFloat(ut);
lodash_1.set(vnode.context, config.unmaskedVar, isNaN(vNumber) ? ut : vNumber);
(0, lodash_1.set)(vnode.context, config.unmaskedVar, isNaN(vNumber) ? ut : vNumber);
}
else {
lodash_1.set(vnode.context, config.unmaskedVar, ut);
(0, lodash_1.set)(vnode.context, config.unmaskedVar, ut);
}
}
}
Expand All @@ -58,7 +58,7 @@ function getInput(el) {
if (el.tagName.toLocaleUpperCase() !== 'INPUT') {
var els = el.getElementsByTagName('input');
if (els.length !== 1) {
throw new Error("v-mask requires 1 input, found " + els.length);
throw new Error("v-mask requires 1 input, found ".concat(els.length));
}
else {
el = els[0];
Expand All @@ -85,7 +85,7 @@ function getConfig(binding) {
var modifiers = binding.modifiers;
config.number = modifiers && modifiers.number;
// Set mask from a predefined one eventually
config.mask = predefined_1["default"](config.mask) || config.mask || '';
config.mask = (0, predefined_1["default"])(config.mask) || config.mask || '';
return config;
}
// -------------------------------
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
exports.__esModule = true;
exports.unmaskText = exports.mask = void 0;
var directive_1 = require("./directive");
exports.mask = directive_1["default"];
var utils_1 = require("./utils");
Expand Down
4 changes: 2 additions & 2 deletions dist/masker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function default_1(value, mask, masked, tokens) {
return value;
}
return Array.isArray(mask)
? dynamic_mask_1["default"](maskit_1["default"], mask, tokens)
: maskit_1["default"](value, mask, masked, tokens);
? (0, dynamic_mask_1["default"])(maskit_1["default"], mask, tokens)
: (0, maskit_1["default"])(value, mask, masked, tokens);
}
exports["default"] = default_1;
1 change: 1 addition & 0 deletions dist/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
exports.__esModule = true;
exports.unmaskText = void 0;
var defaultDelimiters = /[-!$%^&*()_+|~=`{}[\]:";'<>?,.\\ ]/g;
var re = new RegExp(defaultDelimiters);
function unmaskText(text) {
Expand Down
Loading

0 comments on commit 2e20903

Please sign in to comment.