rc-tooltip
Advanced tools
Comparing version 4.0.3 to 4.1.0
@@ -20,3 +20,5 @@ import React from 'react'; | ||
getTooltipContainer?: (node: HTMLElement) => HTMLElement; | ||
destroyTooltipOnHide?: boolean; | ||
destroyTooltipOnHide?: boolean | { | ||
keepParent?: boolean; | ||
}; | ||
align?: AlignType; | ||
@@ -23,0 +25,0 @@ arrowContent?: React.ReactNode; |
@@ -0,1 +1,3 @@ | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -69,2 +71,13 @@ | ||
var destroyTooltip = false; | ||
var autoDestroy = false; | ||
if (typeof destroyTooltipOnHide === 'boolean') { | ||
destroyTooltip = destroyTooltipOnHide; | ||
} else if (destroyTooltipOnHide && _typeof(destroyTooltipOnHide) === 'object') { | ||
var keepParent = destroyTooltipOnHide.keepParent; | ||
destroyTooltip = keepParent === true; | ||
autoDestroy = keepParent === false; | ||
} | ||
return React.createElement(Trigger, Object.assign({ | ||
@@ -85,3 +98,4 @@ popupClassName: overlayClassName, | ||
defaultPopupVisible: defaultVisible, | ||
destroyPopupOnHide: destroyTooltipOnHide, | ||
destroyPopupOnHide: destroyTooltip, | ||
autoDestroy: autoDestroy, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
@@ -88,0 +102,0 @@ popupStyle: overlayStyle, |
@@ -20,3 +20,5 @@ import React from 'react'; | ||
getTooltipContainer?: (node: HTMLElement) => HTMLElement; | ||
destroyTooltipOnHide?: boolean; | ||
destroyTooltipOnHide?: boolean | { | ||
keepParent?: boolean; | ||
}; | ||
align?: AlignType; | ||
@@ -23,0 +25,0 @@ arrowContent?: React.ReactNode; |
"use strict"; | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -24,2 +22,4 @@ value: true | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -88,2 +88,13 @@ | ||
var destroyTooltip = false; | ||
var autoDestroy = false; | ||
if (typeof destroyTooltipOnHide === 'boolean') { | ||
destroyTooltip = destroyTooltipOnHide; | ||
} else if (destroyTooltipOnHide && _typeof(destroyTooltipOnHide) === 'object') { | ||
var keepParent = destroyTooltipOnHide.keepParent; | ||
destroyTooltip = keepParent === true; | ||
autoDestroy = keepParent === false; | ||
} | ||
return _react.default.createElement(_rcTrigger.default, Object.assign({ | ||
@@ -104,3 +115,4 @@ popupClassName: overlayClassName, | ||
defaultPopupVisible: defaultVisible, | ||
destroyPopupOnHide: destroyTooltipOnHide, | ||
destroyPopupOnHide: destroyTooltip, | ||
autoDestroy: autoDestroy, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
@@ -107,0 +119,0 @@ popupStyle: overlayStyle, |
{ | ||
"name": "rc-tooltip", | ||
"version": "4.0.3", | ||
"version": "4.1.0", | ||
"description": "React Tooltip", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"dependencies": { | ||
"rc-trigger": "^4.0.0" | ||
"rc-trigger": "^4.2.1" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
@@ -185,5 +185,5 @@ # rc-tooltip | ||
<td>destroyTooltipOnHide</td> | ||
<td>boolean</td> | ||
<td>boolean | { keepParent: boolean }</td> | ||
<td>false</td> | ||
<td>whether destroy tooltip when tooltip is hidden</td> | ||
<td>whether destroy tooltip when tooltip is hidden.In general, destroyTooltipOnHide will only remove itself instead of parent container of it.Parent container will be removed include tooltip when keepParent is true</td> | ||
</tr> | ||
@@ -190,0 +190,0 @@ <tr> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50909
845
Updatedrc-trigger@^4.2.1