@team-monolith/cds 1.95.2 → 1.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,10 @@ export interface TooltipProps {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
/** 툴팁에 표시될 제목 텍스트 */
|
|
5
5
|
title?: string;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* 툴팁에 표시될 text 영역 값
|
|
8
|
+
* title이 없고 text가 null인 경우 툴팁을 표시하지 않음
|
|
9
|
+
*/
|
|
7
10
|
text: React.ReactNode;
|
|
8
11
|
/** `true` 값일때 Tooltip을 오픈합니다. */
|
|
9
12
|
open?: boolean;
|
|
@@ -20,7 +20,9 @@ import { Tooltip as MuiTooltip, } from "@mui/material";
|
|
|
20
20
|
*/
|
|
21
21
|
export const Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
22
22
|
const { title, text, children } = props, restProps = __rest(props, ["title", "text", "children"]);
|
|
23
|
-
return (_jsx(StyledTooltip, Object.assign({ ref: ref, title:
|
|
23
|
+
return (_jsx(StyledTooltip, Object.assign({ ref: ref, title:
|
|
24
|
+
// title이 없고 text가 null인 경우 툴팁을 표시하지 않음
|
|
25
|
+
!title && text === null ? null : (_jsxs(_Fragment, { children: [title && _jsx(TitleDiv, { children: title }), text] })) }, restProps, { children: children })));
|
|
24
26
|
});
|
|
25
27
|
// https://mui.com/material-ui/react-tooltip/#customization
|
|
26
28
|
const StyledTooltip = styled((_a) => {
|