@luminati-io/uikit 5.0.8-beta.1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -45398,7 +45398,11 @@ var Tooltip = function Tooltip(_ref) {
|
|
45398
45398
|
trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
|
45399
45399
|
className = _ref.className,
|
45400
45400
|
_ref$variant = _ref.variant,
|
45401
|
-
variant = _ref$variant === void 0 ? 'black' : _ref$variant
|
45401
|
+
variant = _ref$variant === void 0 ? 'black' : _ref$variant,
|
45402
|
+
_ref$showDelay = _ref.showDelay,
|
45403
|
+
showDelay = _ref$showDelay === void 0 ? 0 : _ref$showDelay,
|
45404
|
+
_ref$hideDelay = _ref.hideDelay,
|
45405
|
+
hideDelay = _ref$hideDelay === void 0 ? 0 : _ref$hideDelay;
|
45402
45406
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
|
45403
45407
|
_useState2 = _slicedToArray(_useState, 2),
|
45404
45408
|
referenceElement = _useState2[0],
|
@@ -45415,20 +45419,25 @@ var Tooltip = function Tooltip(_ref) {
|
|
45415
45419
|
_useState8 = _slicedToArray(_useState7, 2),
|
45416
45420
|
visible = _useState8[0],
|
45417
45421
|
setVisible = _useState8[1];
|
45418
|
-
var
|
45422
|
+
var closeTimer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
|
45423
|
+
var showTimer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
|
45419
45424
|
var show = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
45420
|
-
clearTimeout(
|
45421
|
-
|
45422
|
-
|
45425
|
+
clearTimeout(closeTimer.current);
|
45426
|
+
showTimer.current = setTimeout(function () {
|
45427
|
+
return setVisible(true);
|
45428
|
+
}, showDelay);
|
45429
|
+
}, [showDelay]);
|
45423
45430
|
var hide = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
45424
|
-
clearTimeout(
|
45425
|
-
|
45431
|
+
clearTimeout(closeTimer.current);
|
45432
|
+
clearTimeout(showTimer.current);
|
45433
|
+
closeTimer.current = setTimeout(function () {
|
45426
45434
|
return setVisible(false);
|
45427
|
-
}, interactive ? CLOSE_DELAY :
|
45428
|
-
}, [interactive]);
|
45435
|
+
}, interactive ? CLOSE_DELAY : hideDelay);
|
45436
|
+
}, [interactive, hideDelay]);
|
45429
45437
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
45430
45438
|
return function () {
|
45431
|
-
clearTimeout(
|
45439
|
+
clearTimeout(closeTimer.current);
|
45440
|
+
clearTimeout(showTimer.current);
|
45432
45441
|
};
|
45433
45442
|
}, []);
|
45434
45443
|
var _usePopper = (0,react_popper__WEBPACK_IMPORTED_MODULE_6__.usePopper)(referenceElement, popperElement, {
|
@@ -45490,7 +45499,9 @@ Tooltip.propTypes = {
|
|
45490
45499
|
noWrap: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
|
45491
45500
|
interactive: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
|
45492
45501
|
trigger: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['hover', 'focus']),
|
45493
|
-
variant: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['black', 'white'])
|
45502
|
+
variant: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['black', 'white']),
|
45503
|
+
showDelay: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
|
45504
|
+
hideDelay: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
|
45494
45505
|
};
|
45495
45506
|
var withTooltip = function withTooltip(Comp, tooltipProps) {
|
45496
45507
|
return function WithTooltip(props) {
|