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
parent
commit
6bb9701e23
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/modal/ConfirmDialog.tsx
  2. 4
      components/modal/Modal.tsx
  3. 1
      components/modal/index.en-US.md
  4. 1
      components/modal/index.zh-CN.md

2
components/modal/ConfirmDialog.tsx

@ -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}>

4
components/modal/Modal.tsx

@ -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}
/>
);
};

1
components/modal/index.en-US.md

@ -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 | |

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

@ -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 | |

Loading…
Cancel
Save