@@ -808,14 +808,18 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
808
808
var isEmptyTip = _state4 . isEmptyTip ;
809
809
810
810
var tooltipClass = ( 0 , _classnames2 . default ) ( '__react_component_tooltip' , { 'show' : this . state . show && ! disable && ! isEmptyTip } , { 'border' : this . state . border } , { 'place-top' : this . state . place === 'top' } , { 'place-bottom' : this . state . place === 'bottom' } , { 'place-left' : this . state . place === 'left' } , { 'place-right' : this . state . place === 'right' } , { 'type-dark' : this . state . type === 'dark' } , { 'type-success' : this . state . type === 'success' } , { 'type-warning' : this . state . type === 'warning' } , { 'type-error' : this . state . type === 'error' } , { 'type-info' : this . state . type === 'info' } , { 'type-light' : this . state . type === 'light' } ) ;
811
+
812
+ var wrapper = ReactTooltip . supportedWrappers [ this . props . wrapper ] ;
813
+ if ( ! wrapper ) wrapper = ReactTooltip . supportedWrappers [ 'div' ] ;
814
+
811
815
if ( html ) {
812
- return _react2 . default . createElement ( 'div ' , _extends ( { className : tooltipClass + ' ' + extraClass
816
+ return _react2 . default . createElement ( 'wrapper ' , _extends ( { className : tooltipClass + ' ' + extraClass
813
817
} , ariaProps , {
814
818
'data-id' : 'tooltip' ,
815
819
dangerouslySetInnerHTML : { __html : placeholder } } ) ) ;
816
820
} else {
817
821
return _react2 . default . createElement (
818
- 'div ' ,
822
+ 'wrapper ' ,
819
823
_extends ( { className : tooltipClass + ' ' + extraClass
820
824
} , ariaProps , {
821
825
'data-id' : 'tooltip' } ) ,
@@ -849,9 +853,14 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
849
853
afterHide : _react . PropTypes . func ,
850
854
disable : _react . PropTypes . bool ,
851
855
scrollHide : _react . PropTypes . bool ,
852
- resizeHide : _react . PropTypes . bool
856
+ resizeHide : _react . PropTypes . bool ,
857
+ wrapper : _react . PropTypes . string
853
858
} , _class2 . defaultProps = {
854
- resizeHide : true
859
+ resizeHide : true ,
860
+ wrapper : 'div'
861
+ } , _class2 . supportedWrappers = {
862
+ 'div' : _react2 . default . DOM . div ,
863
+ 'span' : _react2 . default . DOM . span
855
864
} , _temp ) ) || _class ) || _class ) || _class ) || _class ;
856
865
857
866
/* export default not fit for standalone, it will exports {default:...} */
0 commit comments