@luminati-io/uikit 3.3.2 → 3.3.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -36004,6 +36004,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
36004
36004
|
|
36005
36005
|
|
36006
36006
|
var assign = Object.assign;
|
36007
|
+
var DEFAULT_CLOSE_DELAY = 200;
|
36007
36008
|
var withPopover = function withPopover(Comp, PopoverComp) {
|
36008
36009
|
var popoverOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
36009
36010
|
var WithPopover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef(function (props, ref) {
|
@@ -36016,7 +36017,9 @@ var withPopover = function withPopover(Comp, PopoverComp) {
|
|
36016
36017
|
var placement = popoverOptions.placement,
|
36017
36018
|
zIndex = popoverOptions.zIndex,
|
36018
36019
|
wrapperClassName = popoverOptions.wrapperClassName,
|
36019
|
-
wrapperStyle = popoverOptions.wrapperStyle
|
36020
|
+
wrapperStyle = popoverOptions.wrapperStyle,
|
36021
|
+
interactive = popoverOptions.interactive,
|
36022
|
+
delay = popoverOptions.delay;
|
36020
36023
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
36021
36024
|
_useState2 = _slicedToArray(_useState, 2),
|
36022
36025
|
referenceElement = _useState2[0],
|
@@ -36029,11 +36032,19 @@ var withPopover = function withPopover(Comp, PopoverComp) {
|
|
36029
36032
|
_useStateWithCallback2 = _slicedToArray(_useStateWithCallback, 2),
|
36030
36033
|
popoverVisible = _useStateWithCallback2[0],
|
36031
36034
|
setPopoverVisible = _useStateWithCallback2[1];
|
36035
|
+
var timer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
36036
|
+
var close_delay = delay || DEFAULT_CLOSE_DELAY;
|
36032
36037
|
var showPopover = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
36033
|
-
|
36038
|
+
clearTimeout(timer.current);
|
36039
|
+
timer.current = setTimeout(function () {
|
36040
|
+
return setPopoverVisible(true);
|
36041
|
+
}, interactive ? delay : 0);
|
36034
36042
|
}, []);
|
36035
36043
|
var hidePopover = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
36036
|
-
|
36044
|
+
clearTimeout(timer.current);
|
36045
|
+
timer.current = setTimeout(function () {
|
36046
|
+
return setPopoverVisible(false);
|
36047
|
+
}, interactive ? close_delay : 0);
|
36037
36048
|
}, []);
|
36038
36049
|
var togglePopover = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
36039
36050
|
return setPopoverVisible(function (v) {
|
@@ -36077,7 +36088,9 @@ var withPopover = function withPopover(Comp, PopoverComp) {
|
|
36077
36088
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Comp, _extends({
|
36078
36089
|
ref: ref
|
36079
36090
|
}, compProps, {
|
36080
|
-
popover: popoverApi
|
36091
|
+
popover: popoverApi,
|
36092
|
+
onPointerEnter: interactive ? showPopover : undefined,
|
36093
|
+
onPointerLeave: interactive ? hidePopover : undefined
|
36081
36094
|
}))), popoverVisible && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PopoverContainer, {
|
36082
36095
|
ref: setPopperElement,
|
36083
36096
|
style: styles.popper,
|
@@ -36086,6 +36099,8 @@ var withPopover = function withPopover(Comp, PopoverComp) {
|
|
36086
36099
|
portalTarget: portalTarget,
|
36087
36100
|
zIndex: zIndex
|
36088
36101
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PopoverComp, _extends({}, restPopoverProps, {
|
36102
|
+
onPointerEnter: showPopover,
|
36103
|
+
onPointerLeave: hidePopover,
|
36089
36104
|
popover: popoverApi
|
36090
36105
|
}))));
|
36091
36106
|
});
|
@@ -41269,7 +41284,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
41269
41284
|
var SnackbarContent = function SnackbarContent(props) {
|
41270
41285
|
var header = props.header,
|
41271
41286
|
children = props.children;
|
41272
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Container, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_2__.Label, {
|
41287
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Container, null, !!header && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_2__.Label, {
|
41273
41288
|
variant: "lg",
|
41274
41289
|
color: "gray_11_50"
|
41275
41290
|
}, header), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_2__.Paragraph, {
|