From dcee09a2679eac4d95b77d3d20640dd4d12c047d Mon Sep 17 00:00:00 2001 From: Sudhanshu Yadav Date: Mon, 1 Oct 2018 01:06:00 +0530 Subject: [PATCH] Version bump for PR #228 --- dist/react-number-format.es.js | 4 ++-- dist/react-number-format.js | 4 ++-- dist/react-number-format.min.js | 4 ++-- lib/number_format.js | 2 +- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/react-number-format.es.js b/dist/react-number-format.es.js index 33fc0a32..7d7fbdc0 100644 --- a/dist/react-number-format.es.js +++ b/dist/react-number-format.es.js @@ -1,5 +1,5 @@ /** - * react-number-format - 3.6.0 + * react-number-format - 3.6.1 * Author : Sudhanshu Yadav * Copyright (c) 2016, 2018 to Sudhanshu Yadav, released under the MIT license. * https://github.com/s-yadav/react-number-format @@ -1102,7 +1102,7 @@ function (_React$Component) { var leftBound = !!format ? 0 : prefix.length; var rightBound = lastValue.length - (!!format ? 0 : suffix.length); - if (value.length > lastValue.length || !value.length || start === end || start === 0 && end === lastValue.length || selectionStart === 0 && selectionEnd === lastValue.length || start === leftBound && end === rightBound || selectionStart === leftBound && selectionEnd === rightBound) { + if (value.length > lastValue.length || !value.length || start === end || selectionStart === 0 && selectionEnd === lastValue.length || selectionStart === leftBound && selectionEnd === rightBound) { return value; } //if format got deleted reset the value to last value diff --git a/dist/react-number-format.js b/dist/react-number-format.js index a6857bd3..4aa70547 100644 --- a/dist/react-number-format.js +++ b/dist/react-number-format.js @@ -1,5 +1,5 @@ /** - * react-number-format - 3.6.0 + * react-number-format - 3.6.1 * Author : Sudhanshu Yadav * Copyright (c) 2016, 2018 to Sudhanshu Yadav, released under the MIT license. * https://github.com/s-yadav/react-number-format @@ -1108,7 +1108,7 @@ var leftBound = !!format ? 0 : prefix.length; var rightBound = lastValue.length - (!!format ? 0 : suffix.length); - if (value.length > lastValue.length || !value.length || start === end || start === 0 && end === lastValue.length || selectionStart === 0 && selectionEnd === lastValue.length || start === leftBound && end === rightBound || selectionStart === leftBound && selectionEnd === rightBound) { + if (value.length > lastValue.length || !value.length || start === end || selectionStart === 0 && selectionEnd === lastValue.length || selectionStart === leftBound && selectionEnd === rightBound) { return value; } //if format got deleted reset the value to last value diff --git a/dist/react-number-format.min.js b/dist/react-number-format.min.js index c20ba532..3ac032e3 100644 --- a/dist/react-number-format.min.js +++ b/dist/react-number-format.min.js @@ -1,8 +1,8 @@ /** - * react-number-format - 3.6.0 + * react-number-format - 3.6.1 * Author : Sudhanshu Yadav * Copyright (c) 2016, 2018 to Sudhanshu Yadav, released under the MIT license. * https://github.com/s-yadav/react-number-format */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.NumberFormat=t(e.React)}(this,function(h){"use strict";function o(e,t){for(var r=0;rr?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0]),l=y(u[1]||"",Math.min(t,i.length),r),f=n?".":"";return"".concat(s?"-":"").concat(c).concat(f).concat(l)}(i,r,n)),s?this.formatNumString(i):this.formatInput(i))}},{key:"formatNegation",value:function(){var e=0=t.length-a.length||i&&s&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,r){for(var n=e;nt.length||!r.length||g===m||0===g&&m===t.length||0===f&&p===t.length||g===v&&m===d||f===v&&p===d)return r;if(this.checkIfFormatGotDeleted(g,m,t)&&(r=t),!o){var y=this.removeFormatting(r),b=P(y,i),S=b.beforeDecimal,x=b.afterDecimal,O=b.addNegation,w=er?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0]),l=y(u[1]||"",Math.min(t,i.length),r),f=n?".":"";return"".concat(s?"-":"").concat(c).concat(f).concat(l)}(i,r,n)),s?this.formatNumString(i):this.formatInput(i))}},{key:"formatNegation",value:function(){var e=0=t.length-a.length||i&&s&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,r){for(var n=e;nt.length||!r.length||g===m||0===f&&p===t.length||f===v&&p===d)return r;if(this.checkIfFormatGotDeleted(g,m,t)&&(r=t),!o){var y=this.removeFormatting(r),b=P(y,i),S=b.beforeDecimal,x=b.afterDecimal,O=b.addNegation,w=e lastValue.length || !value.length || start === end || start === 0 && end === lastValue.length || selectionStart === 0 && selectionEnd === lastValue.length || start === leftBound && end === rightBound || selectionStart === leftBound && selectionEnd === rightBound) { + if (value.length > lastValue.length || !value.length || start === end || selectionStart === 0 && selectionEnd === lastValue.length || selectionStart === leftBound && selectionEnd === rightBound) { return value; } //if format got deleted reset the value to last value diff --git a/package.json b/package.json index 3d93aa33..ae372db6 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-number-format", "description": "React component to format number in an input or as a text.", - "version": "3.6.0", + "version": "3.6.1", "main": "lib/number_format.js", "author": "Sudhanshu Yadav", "license": "MIT",