From b969bb4df5178b6504e940896da729d9d941e6f9 Mon Sep 17 00:00:00 2001 From: Tom Xu Date: Thu, 22 Oct 2020 11:24:49 +0800 Subject: [PATCH] feat: Modal method add bodyStyle (#27292) --- components/modal/ConfirmDialog.tsx | 3 ++- components/modal/Modal.tsx | 1 + components/modal/index.en-US.md | 1 + components/modal/index.zh-CN.md | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index f580336380..004730e218 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -31,6 +31,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { direction, prefixCls, rootPrefixCls, + bodyStyle, } = props; devWarning( @@ -95,7 +96,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { getContainer={getContainer} >
-
+
{icon} {props.title === undefined ? null : ( {props.title} diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 36be0bdd98..3acf6abebe 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -114,6 +114,7 @@ export interface ModalFuncProps { transitionName?: string; maskTransitionName?: string; direction?: string; + bodyStyle?: React.CSSProperties; } export interface ModalLocale { diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index d6b7493150..1f9cb7ef6c 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -65,6 +65,7 @@ The items listed above are all functions, expecting a settings object as paramet | Property | Description | Type | Default | Version | | --- | --- | --- | --- | --- | | autoFocusButton | Specify which button to autofocus | null \| `ok` \| `cancel` | `ok` | | +| bodyStyle | Body style for modal body element. Such as height, padding etc | CSSProperties | | | | cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - | | | cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` | | | centered | Centered Modal | boolean | false | | diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index 45b5882805..60c97289d6 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -68,6 +68,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | | autoFocusButton | 指定自动获得焦点的按钮 | null \| `ok` \| `cancel` | `ok` | | +| bodyStyle | Modal body 样式 | CSSProperties | | 4.8.0 | | cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | | | cancelText | 设置 Modal.confirm 取消按钮文字 | string | `取消` | | | centered | 垂直居中展示 Modal | boolean | false | |