pds-dev-kit-web-test 2.5.189 → 2.5.190
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.
@@ -52,6 +52,7 @@ function BasicButtonGroup(_a) {
|
|
52
52
|
var _d = (0, react_1.useState)(null), hoveredButtonIndex = _d[0], setHoveredButtonIndex = _d[1];
|
53
53
|
var _e = (0, react_1.useState)(null), tooltipSizeOffset = _e[0], setTooltipSizeOffset = _e[1];
|
54
54
|
var _f = (0, react_1.useState)(null), tooltipPositionOffset = _f[0], setTooltipPositionOffset = _f[1];
|
55
|
+
var _g = (0, react_1.useState)(false), canShowTooltip = _g[0], setCanShowTooltip = _g[1];
|
55
56
|
var tooltipRef = (0, react_1.useRef)(null);
|
56
57
|
var tooltipPositionTargetRef = (0, react_1.useRef)(null);
|
57
58
|
/**
|
@@ -62,6 +63,7 @@ function BasicButtonGroup(_a) {
|
|
62
63
|
(0, react_1.useEffect)(function () {
|
63
64
|
if (hoveredButtonIndex === null) {
|
64
65
|
setTooltipSizeOffset(null);
|
66
|
+
setCanShowTooltip(false);
|
65
67
|
return;
|
66
68
|
}
|
67
69
|
if (tooltipPositionTargetRef.current) {
|
@@ -81,6 +83,8 @@ function BasicButtonGroup(_a) {
|
|
81
83
|
height: tooltipRef.current.offsetHeight,
|
82
84
|
width: tooltipRef.current.offsetWidth
|
83
85
|
});
|
86
|
+
// 모든 위치 계산이 완료된 후에 툴팁을 보여줍니다
|
87
|
+
setCanShowTooltip(true);
|
84
88
|
}
|
85
89
|
}, [hoveredButtonIndex]);
|
86
90
|
var getColorKey = function (buttonState, iconColorTheme) {
|
@@ -103,9 +107,10 @@ function BasicButtonGroup(_a) {
|
|
103
107
|
: "center_".concat(tooltipPosition)
|
104
108
|
});
|
105
109
|
var isHoveredButton = index === hoveredButtonIndex;
|
110
|
+
var canShowTooltip = tooltipSizeOffset && tooltipPositionOffset;
|
106
111
|
return ((0, jsx_runtime_1.jsxs)(S_BasicButton, __assign({ size: size, onClick: function (e) { return onClick && onClick(e); }, onMouseDown: function (e) { return onMouseDown && onMouseDown(e); }, onPointerEnter: function () { return setHoveredButtonIndex(index); }, onPointerLeave: function () { return setHoveredButtonIndex(null); }, disabled: state === 'disabled' || buttonState === 'disabled' }, { children: [(0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, fillType: iconFillType, colorKey: getColorKey(buttonState, iconColorTheme) }), tooltipText &&
|
107
112
|
isHoveredButton &&
|
108
|
-
|
113
|
+
canShowTooltip && // 위치 계산이 완료된 후에만 렌더링
|
109
114
|
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(S_TooltipWrapper, __assign({ className: "TooltipWrapper", ref: tooltipRef, tooltipPositionCss: tooltipPositionCss, size: size }, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: tooltipText, colorOverride: "ui_cpnt_textlabel_button_tooltip", styleTheme: "caption2Regular", colorTheme: "sysTextSecondary" }) })), document.getElementById('tooltip-root'))] }), iconName + index));
|
110
115
|
}) })));
|
111
116
|
}
|
@@ -132,7 +137,7 @@ var S_BasicButton = styled_components_1.default.button(templateObject_5 || (temp
|
|
132
137
|
var theme = _a.theme;
|
133
138
|
return theme.ui_cpnt_basicbuttongroup_base_disabled;
|
134
139
|
});
|
135
|
-
var S_TooltipWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n
|
140
|
+
var S_TooltipWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", ";\n"], ["\n ", "\n ", ";\n"])), systemUI_1.TooltipWrapperStyle, function (_a) {
|
136
141
|
var tooltipPositionCss = _a.tooltipPositionCss;
|
137
142
|
return tooltipPositionCss;
|
138
143
|
});
|