pds-dev-kit-web-test 2.5.192 → 2.5.194
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.
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
function hoverTypeSystemUICssGenerator(_a) {
|
11
11
|
var baseSize = _a.baseSize, sizeOffset = _a.sizeOffset, positionOffset = _a.positionOffset, systemUIPosition = _a.systemUIPosition, _b = _a.distance, distance = _b === void 0 ? 8 : _b;
|
12
12
|
if (!sizeOffset || !positionOffset) {
|
13
|
-
return '';
|
13
|
+
return 'visibility: hidden;';
|
14
14
|
}
|
15
15
|
var end = positionOffset.left, bottom = positionOffset.bottom, top = positionOffset.top;
|
16
16
|
var width = sizeOffset.width, height = sizeOffset.height;
|
@@ -52,10 +52,8 @@ 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];
|
56
55
|
var tooltipRef = (0, react_1.useRef)(null);
|
57
56
|
var tooltipPositionTargetRef = (0, react_1.useRef)(null);
|
58
|
-
console.log('canShowTooltip', canShowTooltip);
|
59
57
|
/**
|
60
58
|
* @when : hoveredButtonIndex 변경되었을 때
|
61
59
|
* @expected : tooltipPositionTargetRef, tooltipRef 의 위치를 업데이트합니다.
|
@@ -64,7 +62,6 @@ function BasicButtonGroup(_a) {
|
|
64
62
|
(0, react_1.useEffect)(function () {
|
65
63
|
if (hoveredButtonIndex === null) {
|
66
64
|
setTooltipSizeOffset(null);
|
67
|
-
setCanShowTooltip(false);
|
68
65
|
return;
|
69
66
|
}
|
70
67
|
if (tooltipPositionTargetRef.current) {
|
@@ -84,8 +81,6 @@ function BasicButtonGroup(_a) {
|
|
84
81
|
height: tooltipRef.current.offsetHeight,
|
85
82
|
width: tooltipRef.current.offsetWidth
|
86
83
|
});
|
87
|
-
// 모든 위치 계산이 완료된 후에 툴팁을 보여줍니다
|
88
|
-
setCanShowTooltip(true);
|
89
84
|
}
|
90
85
|
}, [hoveredButtonIndex]);
|
91
86
|
var getColorKey = function (buttonState, iconColorTheme) {
|
@@ -108,7 +103,6 @@ function BasicButtonGroup(_a) {
|
|
108
103
|
: "center_".concat(tooltipPosition)
|
109
104
|
});
|
110
105
|
var isHoveredButton = index === hoveredButtonIndex;
|
111
|
-
// const canShowTooltip = tooltipSizeOffset && tooltipPositionOffset;
|
112
106
|
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 &&
|
113
107
|
isHoveredButton &&
|
114
108
|
(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));
|