UNPKG

@flatbiz/antd

Version:
66 lines (62 loc) 2.01 kB
/*! @flatjs/forge MIT @flatbiz/antd */ import _QuestionCircleOutlined from '@ant-design/icons/es/icons/QuestionCircleOutlined.js'; import { Space, Tooltip } from 'antd'; import { isUndefinedOrNull } from '@flatbiz/utils'; import { jsxs, jsx } from 'react/jsx-runtime'; /** * title + tooltip * @deprecated 已过期,请使用 TipsWrapper 组件 */ var TableTitleTooltip = function TableTitleTooltip(props) { var tooltip = props.tooltip; var gap = isUndefinedOrNull(props.gap) ? 3 : props.gap; if (typeof tooltip === 'string') { return /*#__PURE__*/jsxs(Space, { size: gap, className: props.className, style: props.style, children: [/*#__PURE__*/jsx("span", { children: props.title }), /*#__PURE__*/jsx(Tooltip, { title: tooltip, children: /*#__PURE__*/jsx("span", { style: { opacity: 0.7 }, children: /*#__PURE__*/jsx(_QuestionCircleOutlined, {}) }) })] }); } var hoverArea = isUndefinedOrNull(tooltip.hoverArea) ? 'icon' : tooltip.hoverArea; if (hoverArea === 'icon') { return /*#__PURE__*/jsxs(Space, { size: gap, className: props.className, style: props.style, children: [/*#__PURE__*/jsx("span", { children: props.title }), /*#__PURE__*/jsx(Tooltip, { title: tooltip.content, children: /*#__PURE__*/jsx("span", { children: tooltip.icon || /*#__PURE__*/jsx(_QuestionCircleOutlined, {}) }) })] }); } return /*#__PURE__*/jsx(Tooltip, { title: tooltip.content, children: /*#__PURE__*/jsxs(Space, { size: gap, className: props.className, style: props.style, children: [/*#__PURE__*/jsx("span", { children: props.title }), /*#__PURE__*/jsx("span", { children: tooltip.icon || /*#__PURE__*/jsx(_QuestionCircleOutlined, {}) })] }) }); }; export { TableTitleTooltip as T }; //# sourceMappingURL=title-render-DGYUo6yV.js.map