Skip to content

Commit

Permalink
feat(Dialog): add wrapperClassName to Dialog v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon authored and lakerswgq committed Aug 4, 2022
1 parent 8d49599 commit ddb7bc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/dialog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ API变化:
| closeIcon | [v2] 定制关闭按钮 icon | ReactNode | - | 1.25 |
| centered | [v2] 弹窗居中对齐 | Boolean | false | 1.25 |
| overflowScroll | [v2] 对话框高度超过浏览器视口高度时,对话框是否展示滚动条。关闭此功后对话框会随高度撑开页面 | Boolean | true | 1.25 |
| wrapperClassName | [v2] 弹窗最外包裹层 classname | String | - | |
| closeable | [废弃]同closeMode, 控制对话框关闭的方式,值可以为字符串或者布尔值,其中字符串是由以下值组成:<br/>**close** 表示点击关闭按钮可以关闭对话框<br/>**mask** 表示点击遮罩区域可以关闭对话框<br/>**esc** 表示按下 esc 键可以关闭对话框<br/>如 'close' 或 'close,esc,mask'<br/>如果设置为 true,则以上关闭方式全部生效<br/>如果设置为 false,则以上关闭方式全部失效 | String/Boolean | 'esc,close' | |
| onClose | 点击对话框关闭按钮时触发的回调函数<br/><br/>**签名**:<br/>Function(trigger: String, event: Object) => void<br/>**参数**:<br/>_trigger_: {String} 关闭触发行为的描述字符串<br/>_event_: {Object} 关闭时事件对象 | Function | () => {} | |
| align | [v2废弃] 对话框对齐方式, 具体见Overlay文档 | String/Boolean | 'cc cc' | |
Expand Down
2 changes: 2 additions & 0 deletions src/dialog/dialog-v2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const Dialog = props => {
animation = { in: 'fadeInUp', out: 'fadeOutUp' },
cache,
wrapperStyle,
wrapperClassName,
popupContainer = document.body,
dialogRender,
centered,
Expand Down Expand Up @@ -238,6 +239,7 @@ const Dialog = props => {

const wrapperCls = classNames({
[`${prefix}overlay-wrapper`]: true,
[wrapperClassName]: !!wrapperClassName,
opened: visible,
});
const dialogCls = classNames({
Expand Down
4 changes: 4 additions & 0 deletions src/dialog/dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export default class Dialog extends Component {
* @version 1.25
*/
overflowScroll: PropTypes.bool,
/**
* [v2] 弹窗最外包裹层 classname
*/
wrapperClassName: PropTypes.string,
/**
* [废弃]同closeMode, 控制对话框关闭的方式,值可以为字符串或者布尔值,其中字符串是由以下值组成:
* **close** 表示点击关闭按钮可以关闭对话框
Expand Down

0 comments on commit ddb7bc2

Please sign in to comment.