Browse Source

feat: add closable option for confirm dialog (#798)

pull/800/head
Yuga Sun 6 years ago committed by tangjinzhou
parent
commit
00656b5ce9
  1. 2
      components/modal/ConfirmDialog.jsx
  2. 1
      components/modal/index.en-US.md
  3. 1
      components/modal/index.zh-CN.md
  4. 4
      components/modal/style/confirm.less

2
components/modal/ConfirmDialog.jsx

@ -21,6 +21,7 @@ export default {
maskStyle, maskStyle,
okButtonProps, okButtonProps,
cancelButtonProps, cancelButtonProps,
closable = false,
} = props; } = props;
const iconType = props.iconType || 'question-circle'; const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary'; const okType = props.okType || 'primary';
@ -62,6 +63,7 @@ export default {
wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })} wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })}
onCancel={e => close({ triggerCancel: true }, e)} onCancel={e => close({ triggerCancel: true }, e)}
visible={visible} visible={visible}
closable={closable}
title="" title=""
transitionName="zoom" transitionName="zoom"
footer="" footer=""

1
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` | | autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
| cancelText | Text of the Cancel button | string | `Cancel` | | cancelText | Text of the Cancel button | string | `Cancel` |
| centered | Centered Modal | Boolean | `false` | | 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 | - | | class | class of container | string | - |
| content | Content | string\|vNode | - | | content | Content | string\|vNode | - |
| iconType | Icon `type` of the Icon component | string | `question-circle` | | iconType | Icon `type` of the Icon component | string | `question-circle` |

1
components/modal/index.zh-CN.md

@ -52,6 +52,7 @@
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` | | autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
| cancelText | 取消按钮文字 | string | 取消 | | cancelText | 取消按钮文字 | string | 取消 |
| centered | 垂直居中展示 Modal | Boolean | `false` | | centered | 垂直居中展示 Modal | Boolean | `false` |
| closable | 是否显示右上角的关闭按钮 | boolean | `false` |
| class | 容器类名 | string | - | | class | 容器类名 | string | - |
| content | 内容 | string\|vNode | 无 | | content | 内容 | string\|vNode | 无 |
| iconType | 图标 Icon 类型 | string | question-circle | | iconType | 图标 Icon 类型 | string | question-circle |

4
components/modal/style/confirm.less

@ -7,10 +7,6 @@
display: none; display: none;
} }
.@{ant-prefix}-modal-close {
display: none;
}
.@{ant-prefix}-modal-body { .@{ant-prefix}-modal-body {
padding: 32px 32px 24px; padding: 32px 32px 24px;
} }

Loading…
Cancel
Save