/** * @file Tooltip * @description * @author fex */ import React from 'react'; import cx from 'classnames'; import {classPrefix, classnames} from '../themes/default'; import {ClassNamesFn, themeable} from '../theme'; interface TooltipProps extends React.HTMLProps { title?: string; classPrefix: string; classnames: ClassNamesFn; theme?: string; className?: string; style?: any; arrowProps?: any; placement?: string; [propName: string]: any; } export class Tooltip extends React.Component { static defaultProps = { className: '' }; render() { const { classPrefix: ns, className, title, children, arrowProps, style, placement, arrowOffsetLeft, arrowOffsetTop, positionLeft, positionTop, classnames: cx, activePlacement, ...rest } = this.props; return (
{title ?
{title}
: null}
{children}
); } } export default themeable(Tooltip);