@coders-tm/vue-number-format
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -12,3 +12,3 @@ /** | ||
var options = { | ||
var options$1 = { | ||
prefix: '', | ||
@@ -31,4 +31,4 @@ suffix: '', | ||
*/ | ||
function NumberFormat(config = options) { | ||
this.options = Object.assign(options, config); | ||
function NumberFormat(config = options$1) { | ||
this.options = Object.assign(options$1, config); | ||
this.input = ""; | ||
@@ -176,2 +176,9 @@ this.number = ""; | ||
/** | ||
* Creates a fuction to clone the objcet | ||
*/ | ||
function cloneDeep(data) { | ||
return JSON.parse(JSON.stringify(data)) | ||
} | ||
/** | ||
* Creates a CustomEvent('input') with detail = { facade: true } | ||
@@ -344,3 +351,3 @@ * used as a way to identify our own input event | ||
el = getInputElement(el); | ||
const config = Object.assign({}, options, value, modifiers); | ||
const config = Object.assign({}, cloneDeep(options$1), value, modifiers); | ||
el[CONFIG_KEY] = { config }; | ||
@@ -380,3 +387,3 @@ // set initial value | ||
el.setRangeText(config.decimal); | ||
el.dispatchEvent(new Event('input')); | ||
updateValue(el, null, { emit: true }); | ||
updateCursor(el, el.value.indexOf(config.decimal) + 1); | ||
@@ -429,2 +436,4 @@ } else if ( | ||
const options = cloneDeep(options$1); | ||
var script = { | ||
@@ -551,3 +560,3 @@ name: 'Number', | ||
if (config) { | ||
Object.assign(options, config); | ||
Object.assign(options$1, config); | ||
} | ||
@@ -562,3 +571,3 @@ app.directive('number', vNumber); | ||
exports.number = script; | ||
exports.options = options; | ||
exports.options = options$1; | ||
exports.vNumber = vNumber; |
@@ -8,3 +8,3 @@ /** | ||
var options = { | ||
var options$1 = { | ||
prefix: '', | ||
@@ -27,4 +27,4 @@ suffix: '', | ||
*/ | ||
function NumberFormat(config = options) { | ||
this.options = Object.assign(options, config); | ||
function NumberFormat(config = options$1) { | ||
this.options = Object.assign(options$1, config); | ||
this.input = ""; | ||
@@ -172,2 +172,9 @@ this.number = ""; | ||
/** | ||
* Creates a fuction to clone the objcet | ||
*/ | ||
function cloneDeep(data) { | ||
return JSON.parse(JSON.stringify(data)) | ||
} | ||
/** | ||
* Creates a CustomEvent('input') with detail = { facade: true } | ||
@@ -340,3 +347,3 @@ * used as a way to identify our own input event | ||
el = getInputElement(el); | ||
const config = Object.assign({}, options, value, modifiers); | ||
const config = Object.assign({}, cloneDeep(options$1), value, modifiers); | ||
el[CONFIG_KEY] = { config }; | ||
@@ -376,3 +383,3 @@ // set initial value | ||
el.setRangeText(config.decimal); | ||
el.dispatchEvent(new Event('input')); | ||
updateValue(el, null, { emit: true }); | ||
updateCursor(el, el.value.indexOf(config.decimal) + 1); | ||
@@ -425,2 +432,4 @@ } else if ( | ||
const options = cloneDeep(options$1); | ||
var script = { | ||
@@ -547,3 +556,3 @@ name: 'Number', | ||
if (config) { | ||
Object.assign(options, config); | ||
Object.assign(options$1, config); | ||
} | ||
@@ -555,2 +564,2 @@ app.directive('number', vNumber); | ||
export { NumberFormat, index as default, script as number, options, vNumber }; | ||
export { NumberFormat, index as default, script as number, options$1 as options, vNumber }; |
{ | ||
"name": "@coders-tm/vue-number-format", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Easy formatted numbers, currency and percentage with input/directive mask for Vue.js", |
[](https://www.npmjs.com/package/@coders-tm/vue-number-format) | ||
[](https://www.npmjs.com/package/@coders-tm/vue-number-format) | ||
[](https://www.npmjs.com/package/@coders-tm/vue-number-format) | ||
[](https://github.com/coders-tm/vue-number-format) | ||
[](https://bundlephobia.com/result?p=@coders-tm/vue-number-format) | ||
@@ -5,0 +5,0 @@ [](https://github.com/coders-tm/vue-number-format/blob/master/LICENSE) |
Sorry, the diff of this file is not supported yet
38329
984