vue-currency-input
Advanced tools
Comparing version 1.15.0 to 1.15.1
/** | ||
* Vue Currency Input 1.15.0 | ||
* Vue Currency Input 1.15.1 | ||
* (c) 2019 Matthias Stiller | ||
@@ -366,14 +366,13 @@ * @license MIT | ||
var format = function (el, value) { | ||
var oldValue = el.$ci.numberValue; | ||
updateInputValue(el, value); | ||
var ref = el.$ci; | ||
var newValue = ref.numberValue; | ||
var numberValue = ref.numberValue; | ||
var currencyFormat = ref.currencyFormat; | ||
var options = ref.options; | ||
var inputEvent = ref.inputEvent; | ||
if (newValue != null) { | ||
newValue = toInteger(newValue, options.valueAsInteger, currencyFormat.maximumFractionDigits); | ||
if (numberValue != null) { | ||
numberValue = toInteger(numberValue, options.valueAsInteger, currencyFormat.maximumFractionDigits); | ||
} | ||
if (inputEvent) { | ||
dispatchEvent(el, inputEvent, { oldValue: oldValue, newValue: newValue }); | ||
dispatchEvent(el, inputEvent, { numberValue: numberValue }); | ||
} | ||
@@ -543,8 +542,6 @@ }; | ||
return Object.assign({}, listeners, | ||
( obj = {}, obj[inputEvent] = function (e) { | ||
var ref = e.detail; | ||
var oldValue = ref.oldValue; | ||
var newValue = ref.newValue; | ||
if (oldValue !== newValue) { | ||
this$1.$emit('input', newValue); | ||
( obj = {}, obj[inputEvent] = function (ref) { | ||
var detail = ref.detail; | ||
if (this$1.value !== detail.numberValue) { | ||
this$1.$emit('input', detail.numberValue); | ||
} | ||
@@ -551,0 +548,0 @@ this$1.formattedValue = this$1.$el.value; |
/** | ||
* Vue Currency Input 1.15.0 | ||
* Vue Currency Input 1.15.1 | ||
* (c) 2019 Matthias Stiller | ||
@@ -372,14 +372,13 @@ * @license MIT | ||
var format = function (el, value) { | ||
var oldValue = el.$ci.numberValue; | ||
updateInputValue(el, value); | ||
var ref = el.$ci; | ||
var newValue = ref.numberValue; | ||
var numberValue = ref.numberValue; | ||
var currencyFormat = ref.currencyFormat; | ||
var options = ref.options; | ||
var inputEvent = ref.inputEvent; | ||
if (newValue != null) { | ||
newValue = toInteger(newValue, options.valueAsInteger, currencyFormat.maximumFractionDigits); | ||
if (numberValue != null) { | ||
numberValue = toInteger(numberValue, options.valueAsInteger, currencyFormat.maximumFractionDigits); | ||
} | ||
if (inputEvent) { | ||
dispatchEvent(el, inputEvent, { oldValue: oldValue, newValue: newValue }); | ||
dispatchEvent(el, inputEvent, { numberValue: numberValue }); | ||
} | ||
@@ -549,8 +548,6 @@ }; | ||
return Object.assign({}, listeners, | ||
( obj = {}, obj[inputEvent] = function (e) { | ||
var ref = e.detail; | ||
var oldValue = ref.oldValue; | ||
var newValue = ref.newValue; | ||
if (oldValue !== newValue) { | ||
this$1.$emit('input', newValue); | ||
( obj = {}, obj[inputEvent] = function (ref) { | ||
var detail = ref.detail; | ||
if (this$1.value !== detail.numberValue) { | ||
this$1.$emit('input', detail.numberValue); | ||
} | ||
@@ -557,0 +554,0 @@ this$1.formattedValue = this$1.$el.value; |
{ | ||
"name": "vue-currency-input", | ||
"description": "Easy input of currency formatted numbers for Vue.js.", | ||
"version": "1.15.0", | ||
"version": "1.15.1", | ||
"license": "MIT", | ||
@@ -41,3 +41,2 @@ "unpkg": "dist/vue-currency-input.umd.js", | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
@@ -47,2 +46,3 @@ "vue": "^2.5" | ||
"devDependencies": { | ||
"@mdi/font": "^4.7.95", | ||
"@vue/cli-plugin-babel": "^4.1.1", | ||
@@ -65,4 +65,5 @@ "@vue/cli-plugin-eslint": "^4.1.1", | ||
"vue-template-compiler": "^2.6.11", | ||
"vuepress": "^1.2.0" | ||
"vuepress": "^1.2.0", | ||
"vuetify": "^2.1.15" | ||
} | ||
} |
[](https://travis-ci.com/dm4t2/vue-currency-input) | ||
[](https://codecov.io/gh/dm4t2/vue-currency-input) | ||
[](https://badge.fury.io/js/vue-currency-input) | ||
 | ||
[](https://www.codacy.com/manual/dm4t2/vue-currency-input) | ||
[](https://www.npmjs.com/package/vue-currency-input) | ||
[](https://bundlephobia.com/result?p=vue-currency-input) | ||
[](https://github.com/dm4t2/vue-currency-input/blob/master/LICENSE) | ||
@@ -9,21 +11,6 @@ # Vue Currency Input | ||
[Read the guide](https://dm4t2.github.io/vue-currency-input/guide/) to getting started or check out the [examples](https://dm4t2.github.io/vue-currency-input/examples/) to see it in action. | ||
[](https://dm4t2.github.io/vue-currency-input) | ||
## Features | ||
[Read the guide](https://dm4t2.github.io/vue-currency-input/guide/) to getting started or check out the [playground](https://dm4t2.github.io/vue-currency-input/playground/) to see it in action. | ||
### Lightweight | ||
Only [~3 kB bundle size](https://bundlephobia.com/result?p=vue-currency-input) (minified + gzipped) and zero dependencies. | ||
### Format as you type | ||
Numbers are formatted immediately during input. | ||
### i18n support | ||
Language-dependent, ISO-compliant currency formatting using the native [Intl.NumberFormat](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat). | ||
### Auto decimal mode | ||
Automatically insert the decimal symbol and use the last inputted digits as decimal digits. | ||
### Distraction free | ||
Automatically hide the formatting and negligible decimal digits on focus. | ||
## Support me | ||
@@ -30,0 +17,0 @@ If you find this plugin helpful or you want to support the development, buy me a coffee: |
@@ -85,6 +85,5 @@ import currencyDirective from './directive' | ||
...listeners, | ||
[inputEvent]: (e) => { | ||
const { oldValue, newValue } = e.detail | ||
if (oldValue !== newValue) { | ||
this.$emit('input', newValue) | ||
[inputEvent]: ({ detail }) => { | ||
if (this.value !== detail.numberValue) { | ||
this.$emit('input', detail.numberValue) | ||
} | ||
@@ -91,0 +90,0 @@ this.formattedValue = this.$el.value |
@@ -91,10 +91,9 @@ import Vue from 'vue' | ||
const format = (el, value) => { | ||
const oldValue = el.$ci.numberValue | ||
updateInputValue(el, value) | ||
let { numberValue: newValue, currencyFormat, options, inputEvent } = el.$ci | ||
if (newValue != null) { | ||
newValue = toInteger(newValue, options.valueAsInteger, currencyFormat.maximumFractionDigits) | ||
let { numberValue, currencyFormat, options, inputEvent } = el.$ci | ||
if (numberValue != null) { | ||
numberValue = toInteger(numberValue, options.valueAsInteger, currencyFormat.maximumFractionDigits) | ||
} | ||
if (inputEvent) { | ||
dispatchEvent(el, inputEvent, { oldValue, newValue }) | ||
dispatchEvent(el, inputEvent, { numberValue }) | ||
} | ||
@@ -101,0 +100,0 @@ } |
72653
20
1706
19