Browse Source
Merge pull request #28081 from ant-design/feature
chore: merge feature into master, again
pull/28085/head
二货机器人
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
8 additions and
0 deletions
-
components/modal/ConfirmDialog.tsx
-
components/modal/Modal.tsx
-
components/modal/index.en-US.md
-
components/modal/index.zh-CN.md
|
|
@ -36,6 +36,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { |
|
|
|
closable = false, |
|
|
|
closeIcon, |
|
|
|
modalRender, |
|
|
|
focusTriggerAfterClose, |
|
|
|
} = props; |
|
|
|
|
|
|
|
devWarning( |
|
|
@ -101,6 +102,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { |
|
|
|
closable={closable} |
|
|
|
closeIcon={closeIcon} |
|
|
|
modalRender={modalRender} |
|
|
|
focusTriggerAfterClose={focusTriggerAfterClose} |
|
|
|
> |
|
|
|
<div className={`${contentPrefixCls}-body-wrapper`}> |
|
|
|
<ConfigProvider prefixCls={rootPrefixCls}> |
|
|
|
|
|
@ -80,6 +80,7 @@ export interface ModalProps { |
|
|
|
prefixCls?: string; |
|
|
|
closeIcon?: React.ReactNode; |
|
|
|
modalRender?: (node: React.ReactNode) => React.ReactNode; |
|
|
|
focusTriggerAfterClose?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
type getContainerFunc = () => HTMLElement; |
|
|
@ -118,6 +119,7 @@ export interface ModalFuncProps { |
|
|
|
bodyStyle?: React.CSSProperties; |
|
|
|
closeIcon?: React.ReactNode; |
|
|
|
modalRender?: (node: React.ReactNode) => React.ReactNode; |
|
|
|
focusTriggerAfterClose?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
export interface ModalLocale { |
|
|
@ -176,6 +178,7 @@ const Modal: ModalInterface = props => { |
|
|
|
centered, |
|
|
|
getContainer, |
|
|
|
closeIcon, |
|
|
|
focusTriggerAfterClose = true, |
|
|
|
...restProps |
|
|
|
} = props; |
|
|
|
|
|
|
@ -207,6 +210,7 @@ const Modal: ModalInterface = props => { |
|
|
|
mousePosition={mousePosition} |
|
|
|
onClose={handleCancel} |
|
|
|
closeIcon={closeIconToRender} |
|
|
|
focusTriggerAfterClose={focusTriggerAfterClose} |
|
|
|
/> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
@ -26,6 +26,7 @@ When requiring users to interact with the application, but without jumping to a |
|
|
|
| destroyOnClose | Whether to unmount child components on onClose | boolean | false | | |
|
|
|
| footer | Footer content, set as `footer={null}` when you don't need default buttons | ReactNode | (OK and Cancel buttons) | | |
|
|
|
| forceRender | Force render Modal | boolean | false | | |
|
|
|
| focusTriggerAfterClose | Whether need to focus trigger element after dialog is closed | boolean | true | 4.9.0 | |
|
|
|
| getContainer | Return the mount node for Modal | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | | |
|
|
|
| keyboard | Whether support press esc to close | boolean | true | | |
|
|
|
| mask | Whether show mask or not | boolean | true | | |
|
|
|
|
|
@ -29,6 +29,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg |
|
|
|
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | | |
|
|
|
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | ReactNode | (确定取消按钮) | | |
|
|
|
| forceRender | 强制渲染 Modal | boolean | false | | |
|
|
|
| focusTriggerAfterClose | 对话框关闭后是否需要聚焦触发元素 | boolean | true | 4.9.0 | |
|
|
|
| getContainer | 指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | | |
|
|
|
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | | |
|
|
|
| mask | 是否展示遮罩 | boolean | true | | |
|
|
|