56 lines
1.5 KiB
JavaScript
56 lines
1.5 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, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import LazyRenderBox from './LazyRenderBox';
|
|
|
|
var PopupInner = function (_Component) {
|
|
_inherits(PopupInner, _Component);
|
|
|
|
function PopupInner() {
|
|
_classCallCheck(this, PopupInner);
|
|
|
|
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
}
|
|
|
|
PopupInner.prototype.render = function render() {
|
|
var props = this.props;
|
|
var className = props.className;
|
|
if (!props.visible) {
|
|
className += ' ' + props.hiddenClassName;
|
|
}
|
|
return React.createElement(
|
|
'div',
|
|
{
|
|
className: className,
|
|
onMouseEnter: props.onMouseEnter,
|
|
onMouseLeave: props.onMouseLeave,
|
|
onMouseDown: props.onMouseDown,
|
|
onTouchStart: props.onTouchStart,
|
|
style: props.style
|
|
},
|
|
React.createElement(
|
|
LazyRenderBox,
|
|
{ className: props.prefixCls + '-content', visible: props.visible },
|
|
props.children
|
|
)
|
|
);
|
|
};
|
|
|
|
return PopupInner;
|
|
}(Component);
|
|
|
|
PopupInner.propTypes = {
|
|
hiddenClassName: PropTypes.string,
|
|
className: PropTypes.string,
|
|
prefixCls: PropTypes.string,
|
|
onMouseEnter: PropTypes.func,
|
|
onMouseLeave: PropTypes.func,
|
|
onMouseDown: PropTypes.func,
|
|
onTouchStart: PropTypes.func,
|
|
children: PropTypes.any
|
|
};
|
|
|
|
|
|
export default PopupInner; |