From 8d3e4a986c6527f14410ff45d710fe6e89f51023 Mon Sep 17 00:00:00 2001 From: yang-x20 <67466496+yang-x20@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:40:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(number-input):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E5=90=8E=E7=BC=80=E5=86=85=E5=AE=B9=E6=89=A9?= =?UTF-8?q?=E5=B1=95(#2906)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(number-input): 新增前缀后缀内容扩展(#2906) * chore: 生成变更记录文件 * fix(number-input): 修改前缀样式(#2906) * fix(number-input): 修改前缀左边距(#2906) --------- Co-authored-by: yangxuexue --- .changeset/dull-carrots-shout.md | 5 ++++ .changeset/soft-actors-perform.md | 5 ++++ packages/ui/number-input/src/NumberInput.tsx | 3 ++- .../number-input/src/styles/number-input.scss | 16 +++++++++---- .../ui/number-input/stories/addon.stories.tsx | 24 +++++++++++++++++++ .../ui/number-input/stories/index.stories.tsx | 1 + 6 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 .changeset/dull-carrots-shout.md create mode 100644 .changeset/soft-actors-perform.md create mode 100644 packages/ui/number-input/stories/addon.stories.tsx diff --git a/.changeset/dull-carrots-shout.md b/.changeset/dull-carrots-shout.md new file mode 100644 index 000000000..aad80f05a --- /dev/null +++ b/.changeset/dull-carrots-shout.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(number-input): 新增前缀后缀内容扩展 diff --git a/.changeset/soft-actors-perform.md b/.changeset/soft-actors-perform.md new file mode 100644 index 000000000..f4a5a78c2 --- /dev/null +++ b/.changeset/soft-actors-perform.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/number-input": minor +--- + +feat: 新增前缀后缀内容扩展 diff --git a/packages/ui/number-input/src/NumberInput.tsx b/packages/ui/number-input/src/NumberInput.tsx index 5184e6990..730627075 100644 --- a/packages/ui/number-input/src/NumberInput.tsx +++ b/packages/ui/number-input/src/NumberInput.tsx @@ -11,7 +11,7 @@ const _prefix = getPrefixCls('number-input') * 数字输入框 */ export const NumberInput = forwardRef( - ({ prefixCls = _prefix, role = _role, ...rest }, ref) => { + ({ prefixCls = _prefix, role = _role, prefix, ...rest }, ref) => { const { rootProps, getInputProps, getMinusButtonProps, getPlusButtonProps } = useCounter({ prefixCls, role, @@ -20,6 +20,7 @@ export const NumberInput = forwardRef( return (
+ {prefix ? {prefix} : null}