46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
var Content = function (_React$Component) {
|
|
_inherits(Content, _React$Component);
|
|
|
|
function Content() {
|
|
_classCallCheck(this, Content);
|
|
|
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
}
|
|
|
|
Content.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
var trigger = this.props.trigger;
|
|
|
|
if (trigger) {
|
|
trigger.forcePopupAlign();
|
|
}
|
|
};
|
|
|
|
Content.prototype.render = function render() {
|
|
var _props = this.props,
|
|
overlay = _props.overlay,
|
|
prefixCls = _props.prefixCls,
|
|
id = _props.id;
|
|
|
|
return React.createElement(
|
|
'div',
|
|
{ className: prefixCls + '-inner', id: id, role: 'tooltip' },
|
|
typeof overlay === 'function' ? overlay() : overlay
|
|
);
|
|
};
|
|
|
|
return Content;
|
|
}(React.Component);
|
|
|
|
Content.propTypes = {
|
|
prefixCls: PropTypes.string,
|
|
overlay: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
id: PropTypes.string,
|
|
trigger: PropTypes.any
|
|
};
|
|
export default Content; |