From d8e7308f5ab898795a284141d618a1253d218d9d Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Wed, 15 Nov 2023 19:42:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(modal):=20=E8=A1=A5=E5=85=85=20api=20?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E4=B8=AD=E7=9A=84=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=A3=B0=E6=98=8E=20(#2665)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/afraid-falcons-decide.md | 5 +++++ .changeset/heavy-panthers-care.md | 5 +++++ packages/ui/modal/hi-docs.config.mdx | 5 ++++- packages/ui/modal/src/with-api.tsx | 3 +++ packages/ui/modal/stories/with-api.stories.tsx | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .changeset/afraid-falcons-decide.md create mode 100644 .changeset/heavy-panthers-care.md diff --git a/.changeset/afraid-falcons-decide.md b/.changeset/afraid-falcons-decide.md new file mode 100644 index 000000000..b7dc892e5 --- /dev/null +++ b/.changeset/afraid-falcons-decide.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +Modal fix: 补充 api 调用中的参数类型声明 diff --git a/.changeset/heavy-panthers-care.md b/.changeset/heavy-panthers-care.md new file mode 100644 index 000000000..d5ab9bb72 --- /dev/null +++ b/.changeset/heavy-panthers-care.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/modal": patch +--- + +fix: 补充 api 调用中的参数类型声明 diff --git a/packages/ui/modal/hi-docs.config.mdx b/packages/ui/modal/hi-docs.config.mdx index bc7e7e28b..ae8776847 100644 --- a/packages/ui/modal/hi-docs.config.mdx +++ b/packages/ui/modal/hi-docs.config.mdx @@ -25,7 +25,10 @@ | onConfirm | 确认事件触发时的回调 | () => void | - | - | | onCancel | 取消事件触发时的回调 | () => void | - | - | | title | 确认弹窗的标题 | string | - | string | -| content | 确认弹窗的内容 | string | - | - | +| content | 确认弹窗的内容 | ReactNode | - | - | | type | confirm 的类型 | string | 'default' \| 'success' \| 'error' \| 'warning' \| 'info' | 'default' | | cancelText | 取消按钮文案 | string | - | '取消' | | confirmText | 确认按钮文案 | string | - | '确定' | +| showHeaderDivider | 展示 header 与内容的分割线 | boolean | - | - | +| closeOnEsc | 开启 Esc 快捷键关闭 | boolean | - | true | +| maskClosable | 开启点击蒙层时关闭 | boolean | - | true | diff --git a/packages/ui/modal/src/with-api.tsx b/packages/ui/modal/src/with-api.tsx index 1a1ab7326..1cea28e6f 100644 --- a/packages/ui/modal/src/with-api.tsx +++ b/packages/ui/modal/src/with-api.tsx @@ -61,6 +61,9 @@ export interface ModalApiProps | 'type' | 'closeable' | 'showMask' + | 'showHeaderDivider' + | 'closeOnEsc' + | 'maskClosable' > { /** * confirm 的内容 diff --git a/packages/ui/modal/stories/with-api.stories.tsx b/packages/ui/modal/stories/with-api.stories.tsx index 6f8bb82d5..d3e6402e1 100644 --- a/packages/ui/modal/stories/with-api.stories.tsx +++ b/packages/ui/modal/stories/with-api.stories.tsx @@ -34,6 +34,8 @@ export const WithAPI = () => { content: '执行该操作后将无法撤销,是否确定继续?', cancelText: null, confirmText: '确定', + closeOnEsc: false, + maskClosable: false, }) } >