Latest updates from IceHrmPro
This commit is contained in:
42
web/node_modules/antd/es/slider/SliderTooltip.js
generated
vendored
Normal file
42
web/node_modules/antd/es/slider/SliderTooltip.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
import * as React from 'react';
|
||||
import Tooltip from '../tooltip';
|
||||
export default function SliderTooltip(props) {
|
||||
var visible = props.visible;
|
||||
var tooltipRef = React.useRef(null);
|
||||
var rafRef = React.useRef(null);
|
||||
|
||||
function cancelKeepAlign() {
|
||||
window.cancelAnimationFrame(rafRef.current);
|
||||
rafRef.current = null;
|
||||
}
|
||||
|
||||
function keepAlign() {
|
||||
if (rafRef.current !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
rafRef.current = window.requestAnimationFrame(function () {
|
||||
if (tooltipRef.current && tooltipRef.current.tooltip) {
|
||||
tooltipRef.current.tooltip.forcePopupAlign();
|
||||
}
|
||||
|
||||
rafRef.current = null;
|
||||
keepAlign();
|
||||
});
|
||||
}
|
||||
|
||||
React.useEffect(function () {
|
||||
if (visible) {
|
||||
keepAlign();
|
||||
} else {
|
||||
cancelKeepAlign();
|
||||
}
|
||||
|
||||
return cancelKeepAlign;
|
||||
}, [visible]);
|
||||
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
||||
ref: tooltipRef
|
||||
}, props));
|
||||
}
|
||||
Reference in New Issue
Block a user