From 00656b5ce93925f0be37187e1976af09e450dfcd Mon Sep 17 00:00:00 2001 From: Yuga Sun Date: Thu, 23 May 2019 22:09:49 +0800 Subject: [PATCH] feat: add closable option for confirm dialog (#798) --- components/modal/ConfirmDialog.jsx | 2 ++ components/modal/index.en-US.md | 1 + components/modal/index.zh-CN.md | 1 + components/modal/style/confirm.less | 4 ---- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/modal/ConfirmDialog.jsx b/components/modal/ConfirmDialog.jsx index 3f4cfee23..32576cef9 100644 --- a/components/modal/ConfirmDialog.jsx +++ b/components/modal/ConfirmDialog.jsx @@ -21,6 +21,7 @@ export default { maskStyle, okButtonProps, cancelButtonProps, + closable = false, } = props; const iconType = props.iconType || 'question-circle'; const okType = props.okType || 'primary'; @@ -62,6 +63,7 @@ export default { wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })} onCancel={e => close({ triggerCancel: true }, e)} visible={visible} + closable={closable} title="" transitionName="zoom" footer="" diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index 88b717a1b..33893ff51 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -53,6 +53,7 @@ The properties of the object are follows: | autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` | | cancelText | Text of the Cancel button | string | `Cancel` | | centered | Centered Modal | Boolean | `false` | +| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `false` | | class | class of container | string | - | | content | Content | string\|vNode | - | | iconType | Icon `type` of the Icon component | string | `question-circle` | diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index 28b87d4be..616b755be 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -52,6 +52,7 @@ | autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` | | cancelText | 取消按钮文字 | string | 取消 | | centered | 垂直居中展示 Modal | Boolean | `false` | +| closable | 是否显示右上角的关闭按钮 | boolean | `false` | | class | 容器类名 | string | - | | content | 内容 | string\|vNode | 无 | | iconType | 图标 Icon 类型 | string | question-circle | diff --git a/components/modal/style/confirm.less b/components/modal/style/confirm.less index 87dec63df..26c1b74c2 100644 --- a/components/modal/style/confirm.less +++ b/components/modal/style/confirm.less @@ -7,10 +7,6 @@ display: none; } - .@{ant-prefix}-modal-close { - display: none; - } - .@{ant-prefix}-modal-body { padding: 32px 32px 24px; }