From 47241013151fecf8de1bb1a65f34bf05600e6cad Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Thu, 17 Oct 2024 20:46:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(input):=20=E4=BF=AE=E5=A4=8D=20type=3D"?= =?UTF-8?q?X"=20=E6=97=B6=E6=9C=80=E5=90=8E=E4=B8=80=E4=BD=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BE=93=E5=85=A5=20X=20=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#3023)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/input/src/utils/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ui/input/src/utils/index.ts b/packages/ui/input/src/utils/index.ts index 2b47084df..5b3995e70 100644 --- a/packages/ui/input/src/utils/index.ts +++ b/packages/ui/input/src/utils/index.ts @@ -21,6 +21,10 @@ export const formatId = (val: string) => { } export const pureId = (val: string) => { + if (/\d{6}\s\d{4}\s\d{4}\s\d{3}X/g.test(val)) { + return val + } + const tmp = val.replace(/[^\d|.]/g, '') return tmp.slice(0, 18) } From ae2dcc989d32779294ec0b288b860dffa6741f57 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Thu, 17 Oct 2024 20:50:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore(input):=20type=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=AD=E5=A2=9E=E5=8A=A0=20number=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/input/src/types.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ui/input/src/types.ts b/packages/ui/input/src/types.ts index 53be8da14..0934f0703 100644 --- a/packages/ui/input/src/types.ts +++ b/packages/ui/input/src/types.ts @@ -2,4 +2,12 @@ import { HiBaseAppearanceEnum } from '@hi-ui/core' export type InputAppearanceEnum = HiBaseAppearanceEnum | 'underline' -export type InputTypeEnum = 'text' | 'id' | 'tel' | 'card' | 'amount' | 'email' | 'password' +export type InputTypeEnum = + | 'text' + | 'id' + | 'tel' + | 'card' + | 'amount' + | 'email' + | 'password' + | 'number' From 390fe5ab5426705a97555f6b1a47f86027df5b0d Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Thu, 17 Oct 2024 20:53:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(input):=20=E5=A2=9E=E5=8A=A0=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/fresh-scissors-complain.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/fresh-scissors-complain.md diff --git a/.changeset/fresh-scissors-complain.md b/.changeset/fresh-scissors-complain.md new file mode 100644 index 000000000..426f1292e --- /dev/null +++ b/.changeset/fresh-scissors-complain.md @@ -0,0 +1,7 @@ +--- +"@hi-ui/input": patch +"@hi-ui/hiui": patch +--- + +fix(input): 修复 type="X" 时最后一位无法输入 X 的问题 (#3023) +chore(input): type 类型中增加 number 类型