@codacy/ui-components 0.65.36 → 0.65.38
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.
- package/lib/MoreInfo/MoreInfo.js +5 -1
- package/lib/MoreInfo/types.d.ts +2 -0
- package/lib/Tooltip/Tooltip.js +20 -24
- package/package.json +1 -1
package/lib/MoreInfo/MoreInfo.js
CHANGED
|
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _Tooltip = require("../Tooltip");
|
|
12
12
|
var _ = require("..");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["helpContent", "textAlignment", "placement", "tooltipMaxWidth"];
|
|
14
|
+
var _excluded = ["helpContent", "textAlignment", "placement", "tooltipMaxWidth", "selfClose", "withArrow"];
|
|
15
15
|
var HelpIcon = function HelpIcon() {
|
|
16
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
|
|
17
17
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -43,12 +43,16 @@ var MoreInfo = exports.MoreInfo = function MoreInfo(_ref) {
|
|
|
43
43
|
textAlignment = _ref.textAlignment,
|
|
44
44
|
placement = _ref.placement,
|
|
45
45
|
tooltipMaxWidth = _ref.tooltipMaxWidth,
|
|
46
|
+
selfClose = _ref.selfClose,
|
|
47
|
+
withArrow = _ref.withArrow,
|
|
46
48
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
47
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
48
50
|
content: helpContent,
|
|
49
51
|
textAlignment: textAlignment,
|
|
50
52
|
placement: placement,
|
|
51
53
|
maxWidth: tooltipMaxWidth,
|
|
54
|
+
selfClose: selfClose,
|
|
55
|
+
withArrow: withArrow,
|
|
52
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, (0, _objectSpread2["default"])({
|
|
53
57
|
icon: HelpIcon,
|
|
54
58
|
color: "icon-enabled",
|
package/lib/MoreInfo/types.d.ts
CHANGED
package/lib/Tooltip/Tooltip.js
CHANGED
|
@@ -77,19 +77,17 @@ var Tooltip = exports.Tooltip = function Tooltip(_ref) {
|
|
|
77
77
|
styles = _usePopper.styles,
|
|
78
78
|
attributes = _usePopper.attributes;
|
|
79
79
|
var handleEnter = (0, _react.useCallback)(function () {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
}, [delay, selfClose]);
|
|
80
|
+
setTimer(function (prevTimer) {
|
|
81
|
+
if (prevTimer) {
|
|
82
|
+
clearTimeout(prevTimer);
|
|
83
|
+
}
|
|
84
|
+
return setTimeout(function () {
|
|
85
|
+
setVisible(true);
|
|
86
|
+
}, Math.max(delay, 500));
|
|
87
|
+
});
|
|
88
|
+
}, [delay]);
|
|
91
89
|
var handleOver = (0, _react.useCallback)(function () {
|
|
92
|
-
if (!
|
|
90
|
+
if (!visible) {
|
|
93
91
|
setTimer(function (prevTimer) {
|
|
94
92
|
if (prevTimer) {
|
|
95
93
|
clearTimeout(prevTimer);
|
|
@@ -99,19 +97,17 @@ var Tooltip = exports.Tooltip = function Tooltip(_ref) {
|
|
|
99
97
|
}, Math.max(delay, 500));
|
|
100
98
|
});
|
|
101
99
|
}
|
|
102
|
-
}, [delay,
|
|
100
|
+
}, [delay, visible]);
|
|
103
101
|
var handleLeave = (0, _react.useCallback)(function () {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
}, [selfClose]);
|
|
102
|
+
setTimer(function (prevTimer) {
|
|
103
|
+
if (prevTimer) {
|
|
104
|
+
clearTimeout(prevTimer);
|
|
105
|
+
}
|
|
106
|
+
return setTimeout(function () {
|
|
107
|
+
setVisible(false);
|
|
108
|
+
}, 500);
|
|
109
|
+
});
|
|
110
|
+
}, []);
|
|
115
111
|
(0, _react.useEffect)(function () {
|
|
116
112
|
if (selfClose) {
|
|
117
113
|
var timer = setTimeout(function () {
|