iguazio.dashboard-react-controls 2.0.5 → 2.0.6
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.
|
@@ -83,7 +83,7 @@ FormCheckBox.propTypes = {
|
|
|
83
83
|
className: _propTypes.default.string,
|
|
84
84
|
highlightLabel: _propTypes.default.bool,
|
|
85
85
|
name: _propTypes.default.string.isRequired,
|
|
86
|
-
label: _propTypes.default.string,
|
|
86
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
87
87
|
readOnly: _propTypes.default.bool
|
|
88
88
|
};
|
|
89
89
|
var _default = exports.default = /*#__PURE__*/_react.default.memo(FormCheckBox);
|
|
@@ -66,36 +66,38 @@ const Tooltip = _ref => {
|
|
|
66
66
|
If the child node is a text node and the text of the child node inside the container is greater than the width of the container, then show tooltip.
|
|
67
67
|
*/
|
|
68
68
|
child.nodeType === Node.TEXT_NODE && parentRef.current.scrollWidth > parentRef.current.offsetWidth));
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
setShow(show);
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
if (show) {
|
|
72
|
+
var _parentRef$current$ge, _parentRef$current, _tooltipRef$current$g, _tooltipRef$current;
|
|
73
|
+
let {
|
|
74
|
+
height,
|
|
75
|
+
top,
|
|
76
|
+
bottom
|
|
77
|
+
} = (_parentRef$current$ge = parentRef === null || parentRef === void 0 || (_parentRef$current = parentRef.current) === null || _parentRef$current === void 0 ? void 0 : _parentRef$current.getBoundingClientRect()) !== null && _parentRef$current$ge !== void 0 ? _parentRef$current$ge : {};
|
|
78
|
+
const {
|
|
79
|
+
height: tooltipHeight,
|
|
80
|
+
width: tooltipWidth
|
|
81
|
+
} = (_tooltipRef$current$g = (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 ? void 0 : _tooltipRef$current.getBoundingClientRect()) !== null && _tooltipRef$current$g !== void 0 ? _tooltipRef$current$g : {
|
|
82
|
+
height: 0,
|
|
83
|
+
width: 0
|
|
84
|
+
};
|
|
85
|
+
const leftPosition = event.x - (event.x + tooltipWidth - window.innerWidth + offset);
|
|
86
|
+
const left = event.x + tooltipWidth + offset > window.innerWidth ? leftPosition > offset ? leftPosition : offset : event.x + offset;
|
|
87
|
+
if (top + height + offset + tooltipHeight >= window.innerHeight) {
|
|
88
|
+
const topPosition = bottom - height - offset - tooltipHeight;
|
|
89
|
+
setStyle({
|
|
90
|
+
top: topPosition > 0 ? topPosition : offset,
|
|
91
|
+
left
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
setStyle({
|
|
95
|
+
top: top + height + offset,
|
|
96
|
+
left
|
|
97
|
+
});
|
|
98
|
+
}
|
|
97
99
|
}
|
|
98
|
-
}
|
|
100
|
+
}, 0);
|
|
99
101
|
}
|
|
100
102
|
}, [hidden, textShow, show]);
|
|
101
103
|
const clearStyles = (0, _lodash.debounce)(() => {
|
package/dist/types.js
CHANGED
|
@@ -81,7 +81,7 @@ const SELECT_OPTION = exports.SELECT_OPTION = _propTypes.default.shape({
|
|
|
81
81
|
hidden: _propTypes.default.bool,
|
|
82
82
|
icon: _propTypes.default.element,
|
|
83
83
|
id: _propTypes.default.string.isRequired,
|
|
84
|
-
label: _propTypes.default.string.isRequired,
|
|
84
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]).isRequired,
|
|
85
85
|
labelHtml: _propTypes.default.string,
|
|
86
86
|
status: _propTypes.default.string,
|
|
87
87
|
subLabel: _propTypes.default.string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|