From f5a52be857b150d5233968cd309c82816fd9a512 Mon Sep 17 00:00:00 2001 From: jearyt <90509675+jearyt@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:42:11 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5389f0a32..94a7e688e 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,5 @@ If you want to contribute us or in case you are haiving any doubt. [MIT](http://opensource.org/licenses/MIT) Copyright (c) 2016-present, ViewDesign + + From d97ba5e77cd556d854178e22e6305ae20d6b04f7 Mon Sep 17 00:00:00 2001 From: zzh <275447453@qq.com> Date: Fri, 3 Nov 2023 17:51:40 +0800 Subject: [PATCH 2/2] fit InputNumber --- package-lock.json | 9 +---- src/components/input-number/input-number.vue | 42 ++++++++++---------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f882314a..af2ab172b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "view-ui-plus", - "version": "1.3.1", + "version": "1.3.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "view-ui-plus", - "version": "1.3.1", + "version": "1.3.14", "license": "MIT", "dependencies": { "async-validator": "^3.3.0", @@ -69,11 +69,6 @@ "vue-router": "^4.0.14", "vue-style-loader": "^4.1.3", "vue-template-compiler": "^2.6.14" - }, - "engines": { - "node": ">=16.14.2", - "npm": ">=8.5.0", - "yarn": ">=1.3.2" } }, "node_modules/@ampproject/remapping": { diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index fe86b5834..6f08c79f8 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -298,26 +298,7 @@ this.focused = true; this.$emit('on-focus', event); }, - blur () { - this.focused = false; - this.$emit('on-blur'); - if (!findComponentUpward(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) { - this.handleFormItemChange('blur', this.currentValue); - } - }, - keyDown (e) { - if (e.keyCode === 38) { - e.preventDefault(); - this.up(e); - } else if (e.keyCode === 40) { - e.preventDefault(); - this.down(e); - } - }, - change (event) { - if (event.type === 'change' && this.activeChange) return; - - if (event.type === 'input' && !this.activeChange) return; + blur (event) { let val = event.target.value.trim(); if (this.parser) { val = this.parser(val); @@ -338,6 +319,27 @@ } else { event.target.value = this.currentValue; } + + this.focused = false; + this.$emit('on-blur'); + if (!findComponentUpward(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) { + this.handleFormItemChange('blur', this.currentValue); + } + }, + keyDown (e) { + if (e.keyCode === 38) { + e.preventDefault(); + this.up(e); + } else if (e.keyCode === 40) { + e.preventDefault(); + this.down(e); + } + }, + change (event) { + if (event.type === 'change' && this.activeChange) return; + + if (event.type === 'input' && !this.activeChange) return; + }, changeVal (val) { val = Number(val);