From d31f1c19e436545cfefa4bccc6debfd28af1237c Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Wed, 3 Jul 2024 11:22:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E7=BB=84=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=B8=AD=E6=98=BE=E7=A4=BA=E5=87=BA=20disabledPortal?= =?UTF-8?q?=20=E5=92=8C=20container=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/giant-mirrors-repair.md | 5 +++++ packages/ui/drawer/src/Drawer.tsx | 3 +-- packages/ui/drawer/stories/basic.stories.tsx | 1 + packages/ui/modal/src/Modal.tsx | 3 +-- packages/ui/modal/stories/basic.stories.tsx | 8 +++++++- packages/ui/number-input/src/NumberInput.tsx | 6 ++++-- packages/ui/preview/package.json | 1 + packages/ui/tooltip/src/Tooltip.tsx | 6 ++---- packages/ui/tooltip/stories/basic.stories.tsx | 2 +- 9 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 .changeset/giant-mirrors-repair.md diff --git a/.changeset/giant-mirrors-repair.md b/.changeset/giant-mirrors-repair.md new file mode 100644 index 000000000..9d802c84a --- /dev/null +++ b/.changeset/giant-mirrors-repair.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/preview": patch +--- + +chore: 添加 @hi-ui/watermark 依赖 diff --git a/packages/ui/drawer/src/Drawer.tsx b/packages/ui/drawer/src/Drawer.tsx index a0431dc87..0d36ecc83 100644 --- a/packages/ui/drawer/src/Drawer.tsx +++ b/packages/ui/drawer/src/Drawer.tsx @@ -210,8 +210,7 @@ export interface DrawerProps extends Omit, 'title'>, UseM */ timeout?: number /** - * 禁用 portal。暂不对外暴露 - * @private + * 禁用 portal */ disabledPortal?: boolean /** diff --git a/packages/ui/drawer/stories/basic.stories.tsx b/packages/ui/drawer/stories/basic.stories.tsx index 5a990be9e..8621a2b4b 100644 --- a/packages/ui/drawer/stories/basic.stories.tsx +++ b/packages/ui/drawer/stories/basic.stories.tsx @@ -16,6 +16,7 @@ export const Basic = () => { setVisible(false)} footer={
diff --git a/packages/ui/modal/src/Modal.tsx b/packages/ui/modal/src/Modal.tsx index af59966fd..b37e21984 100644 --- a/packages/ui/modal/src/Modal.tsx +++ b/packages/ui/modal/src/Modal.tsx @@ -284,8 +284,7 @@ export interface ModalProps extends HiBaseHTMLProps<'div'>, UseModalProps { */ showFooterDivider?: boolean /** - * 禁用 portal。暂不对外暴露 - * @private + * 禁用 portal */ disabledPortal?: boolean /** diff --git a/packages/ui/modal/stories/basic.stories.tsx b/packages/ui/modal/stories/basic.stories.tsx index 91e869f0b..0384fe3bd 100644 --- a/packages/ui/modal/stories/basic.stories.tsx +++ b/packages/ui/modal/stories/basic.stories.tsx @@ -14,7 +14,13 @@ export const Basic = () => {

Basic

- setVisible(false)}> + setVisible(false)} + > 代码如写诗

diff --git a/packages/ui/number-input/src/NumberInput.tsx b/packages/ui/number-input/src/NumberInput.tsx index 730627075..e675785c2 100644 --- a/packages/ui/number-input/src/NumberInput.tsx +++ b/packages/ui/number-input/src/NumberInput.tsx @@ -10,7 +10,7 @@ const _prefix = getPrefixCls('number-input') /** * 数字输入框 */ -export const NumberInput = forwardRef( +export const NumberInput = forwardRef( ({ prefixCls = _prefix, role = _role, prefix, ...rest }, ref) => { const { rootProps, getInputProps, getMinusButtonProps, getPlusButtonProps } = useCounter({ prefixCls, @@ -35,7 +35,9 @@ export const NumberInput = forwardRef( } ) -export interface NumberInputProps extends CounterProps {} +export interface NumberInputProps extends CounterProps { + prefix?: React.ReactNode +} if (__DEV__) { NumberInput.displayName = 'NumberInput' diff --git a/packages/ui/preview/package.json b/packages/ui/preview/package.json index 760d850dd..e1be50695 100644 --- a/packages/ui/preview/package.json +++ b/packages/ui/preview/package.json @@ -49,6 +49,7 @@ "@hi-ui/portal": "^4.0.8", "@hi-ui/use-latest": "^4.0.4", "@hi-ui/use-uncontrolled-state": "^4.0.4", + "@hi-ui/watermark": "^4.0.8", "react-transition-group": "^4.4.2" }, "peerDependencies": { diff --git a/packages/ui/tooltip/src/Tooltip.tsx b/packages/ui/tooltip/src/Tooltip.tsx index eb9b5936f..0ea5ee68b 100644 --- a/packages/ui/tooltip/src/Tooltip.tsx +++ b/packages/ui/tooltip/src/Tooltip.tsx @@ -180,13 +180,11 @@ export interface TooltipProps extends HiBaseHTMLProps<'div'>, UseTooltipProps { */ innerRef?: React.Ref /** - * 指定 portal 的容器。暂不对外暴露 - * @private + * 指定 portal 的容器 */ container?: HTMLElement /** - * 禁用 portal。暂不对外暴露 - * @private + * 禁用 portal */ disabledPortal?: boolean } diff --git a/packages/ui/tooltip/stories/basic.stories.tsx b/packages/ui/tooltip/stories/basic.stories.tsx index 9bba08510..c6e2dd098 100644 --- a/packages/ui/tooltip/stories/basic.stories.tsx +++ b/packages/ui/tooltip/stories/basic.stories.tsx @@ -11,7 +11,7 @@ export const Basic = () => { <>

Basic

- +
From df61e6248fd0eed1c5611ec77c0c7b94aa9f43af Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Wed, 3 Jul 2024 11:31:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E5=8E=BB=E6=8E=89=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/drawer/stories/basic.stories.tsx | 1 - packages/ui/modal/stories/basic.stories.tsx | 8 +------- packages/ui/tooltip/stories/basic.stories.tsx | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/ui/drawer/stories/basic.stories.tsx b/packages/ui/drawer/stories/basic.stories.tsx index 8621a2b4b..5a990be9e 100644 --- a/packages/ui/drawer/stories/basic.stories.tsx +++ b/packages/ui/drawer/stories/basic.stories.tsx @@ -16,7 +16,6 @@ export const Basic = () => { setVisible(false)} footer={
diff --git a/packages/ui/modal/stories/basic.stories.tsx b/packages/ui/modal/stories/basic.stories.tsx index 0384fe3bd..91e869f0b 100644 --- a/packages/ui/modal/stories/basic.stories.tsx +++ b/packages/ui/modal/stories/basic.stories.tsx @@ -14,13 +14,7 @@ export const Basic = () => {

Basic

- setVisible(false)} - > + setVisible(false)}> 代码如写诗

diff --git a/packages/ui/tooltip/stories/basic.stories.tsx b/packages/ui/tooltip/stories/basic.stories.tsx index c6e2dd098..9bba08510 100644 --- a/packages/ui/tooltip/stories/basic.stories.tsx +++ b/packages/ui/tooltip/stories/basic.stories.tsx @@ -11,7 +11,7 @@ export const Basic = () => { <>

Basic

- +