Commit cc3f31a6 authored by VladBarabash's avatar VladBarabash

Add 'focus' and 'blur' event

parent 3d9d8b50
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
.DS_Store .DS_Store
node_modules/ node_modules/
npm-debug.log npm-debug.log
package-lock.json
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -25,7 +25,9 @@ export default { ...@@ -25,7 +25,9 @@ export default {
focusout: this.focusOut, focusout: this.focusOut,
cut: this.cut, cut: this.cut,
copy: this.copy, copy: this.copy,
paste: this.paste paste: this.paste,
focus: this.focus,
blur: this.blur
} }
}); });
}, },
...@@ -128,6 +130,7 @@ export default { ...@@ -128,6 +130,7 @@ export default {
} }
} }
} }
/* eslint-enable */
}); });
} }
[].concat(_toConsumableArray(this.$refs.input.value)).reduce(function (memo, item) { [].concat(_toConsumableArray(this.$refs.input.value)).reduce(function (memo, item) {
...@@ -305,6 +308,12 @@ export default { ...@@ -305,6 +308,12 @@ export default {
if (this.maskCore === null) return true; if (this.maskCore === null) return true;
return this.maskCore.getValue() === this.maskCore.emptyValue; return this.maskCore.getValue() === this.maskCore.emptyValue;
}, },
focus: function focus(e) {
this.$emit('focus', e);
},
blur: function blur(e) {
this.$emit('blur', e);
},
focusOut: function focusOut() { focusOut: function focusOut() {
if (this.isEmpty()) { if (this.isEmpty()) {
this.$refs.input.value = ''; this.$refs.input.value = '';
......
...@@ -24,6 +24,8 @@ export default { ...@@ -24,6 +24,8 @@ export default {
cut: this.cut, cut: this.cut,
copy: this.copy, copy: this.copy,
paste: this.paste, paste: this.paste,
focus: this.focus,
blur: this.blur
}, },
}); });
}, },
...@@ -281,6 +283,14 @@ export default { ...@@ -281,6 +283,14 @@ export default {
return this.maskCore.getValue() === this.maskCore.emptyValue; return this.maskCore.getValue() === this.maskCore.emptyValue;
}, },
focus(e) {
this.$emit('focus', e);
},
blur(e) {
this.$emit('blur', e);
},
focusOut() { focusOut() {
if (this.isEmpty()) { if (this.isEmpty()) {
this.$refs.input.value = ''; this.$refs.input.value = '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment