@@ -18,6 +18,7 @@ export default class Dialog extends Component {
18
18
static propTypes = {
19
19
prefix : PropTypes . string ,
20
20
pure : PropTypes . bool ,
21
+ rtl : PropTypes . bool ,
21
22
className : PropTypes . string ,
22
23
/**
23
24
* 是否显示
@@ -282,7 +283,12 @@ export default class Dialog extends Component {
282
283
}
283
284
284
285
renderInner ( closeable ) {
285
- const { prefix, className, title, children, footer, footerAlign, footerActions, onOk, onCancel, okProps, cancelProps, onClose, locale, visible } = this . props ;
286
+ const {
287
+ prefix, className, title,
288
+ children, footer, footerAlign,
289
+ footerActions, onOk, onCancel,
290
+ okProps, cancelProps, onClose,
291
+ locale, visible, rtl } = this . props ;
286
292
const others = pickOthers ( Object . keys ( Dialog . propTypes ) , this . props ) ;
287
293
288
294
return (
@@ -298,6 +304,7 @@ export default class Dialog extends Component {
298
304
cancelProps = { cancelProps }
299
305
locale = { locale }
300
306
closeable = { closeable }
307
+ rtl = { rtl }
301
308
onClose = { onClose . bind ( this , 'closeClick' ) }
302
309
{ ...others } >
303
310
{ children }
@@ -307,7 +314,10 @@ export default class Dialog extends Component {
307
314
308
315
render ( ) {
309
316
const {
310
- prefix, visible, hasMask, animation, autoFocus, closeable, onClose, afterClose, shouldUpdatePosition, align, overlayProps
317
+ prefix, visible, hasMask,
318
+ animation, autoFocus, closeable,
319
+ onClose, afterClose, shouldUpdatePosition,
320
+ align, overlayProps, rtl,
311
321
} = this . props ;
312
322
313
323
const useCSS = this . useCSSToPosition ( ) ;
@@ -326,7 +336,8 @@ export default class Dialog extends Component {
326
336
onRequestClose : onClose ,
327
337
needAdjust : false ,
328
338
disableScroll : true ,
329
- ref : this . getOverlayRef
339
+ ref : this . getOverlayRef ,
340
+ rtl,
330
341
} ;
331
342
if ( ! useCSS ) {
332
343
newOverlayProps . beforePosition = this . beforePosition ;
@@ -339,7 +350,7 @@ export default class Dialog extends Component {
339
350
return (
340
351
< Overlay { ...newOverlayProps } >
341
352
{ useCSS ?
342
- < div className = { `${ prefix } dialog-container` } >
353
+ < div className = { `${ prefix } dialog-container` } dir = { rtl ? "rtl" : undefined } >
343
354
{ inner }
344
355
</ div > :
345
356
inner }
0 commit comments