Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-tooltip

Package Overview
Dependencies
Maintainers
8
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tooltip - npm Package Compare versions

Comparing version 5.2.2 to 5.3.0

14

es/Popup.js

@@ -5,9 +5,9 @@ import * as React from 'react';

var showArrow = props.showArrow,
arrowContent = props.arrowContent,
children = props.children,
prefixCls = props.prefixCls,
id = props.id,
overlayInnerStyle = props.overlayInnerStyle,
className = props.className,
style = props.style;
arrowContent = props.arrowContent,
children = props.children,
prefixCls = props.prefixCls,
id = props.id,
overlayInnerStyle = props.overlayInnerStyle,
className = props.className,
style = props.style;
return /*#__PURE__*/React.createElement("div", {

@@ -14,0 +14,0 @@ className: classNames("".concat(prefixCls, "-content"), className),

import _extends from "@babel/runtime/helpers/esm/extends";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"];
import * as React from 'react';

@@ -10,35 +12,35 @@ import { useRef, useImperativeHandle, forwardRef } from 'react';

import Popup from './Popup';
import classNames from 'classnames';
var Tooltip = function Tooltip(props, ref) {
var overlayClassName = props.overlayClassName,
_props$trigger = props.trigger,
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
_props$mouseEnterDela = props.mouseEnterDelay,
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
_props$mouseLeaveDela = props.mouseLeaveDelay,
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
overlayStyle = props.overlayStyle,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
children = props.children,
onVisibleChange = props.onVisibleChange,
afterVisibleChange = props.afterVisibleChange,
transitionName = props.transitionName,
animation = props.animation,
motion = props.motion,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'right' : _props$placement,
_props$align = props.align,
align = _props$align === void 0 ? {} : _props$align,
_props$destroyTooltip = props.destroyTooltipOnHide,
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
defaultVisible = props.defaultVisible,
getTooltipContainer = props.getTooltipContainer,
overlayInnerStyle = props.overlayInnerStyle,
arrowContent = props.arrowContent,
overlay = props.overlay,
id = props.id,
showArrow = props.showArrow,
restProps = _objectWithoutProperties(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"]);
_props$trigger = props.trigger,
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
_props$mouseEnterDela = props.mouseEnterDelay,
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
_props$mouseLeaveDela = props.mouseLeaveDelay,
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
overlayStyle = props.overlayStyle,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
children = props.children,
onVisibleChange = props.onVisibleChange,
afterVisibleChange = props.afterVisibleChange,
transitionName = props.transitionName,
animation = props.animation,
motion = props.motion,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'right' : _props$placement,
_props$align = props.align,
align = _props$align === void 0 ? {} : _props$align,
_props$destroyTooltip = props.destroyTooltipOnHide,
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
defaultVisible = props.defaultVisible,
getTooltipContainer = props.getTooltipContainer,
overlayInnerStyle = props.overlayInnerStyle,
arrowContent = props.arrowContent,
overlay = props.overlay,
id = props.id,
_props$showArrow = props.showArrow,
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
restProps = _objectWithoutProperties(props, _excluded);
var domRef = useRef(null);

@@ -48,9 +50,6 @@ useImperativeHandle(ref, function () {

});
var extraProps = _objectSpread({}, restProps);
if ('visible' in props) {
extraProps.popupVisible = props.visible;
}
var getPopupElement = function getPopupElement() {

@@ -66,6 +65,4 @@ return /*#__PURE__*/React.createElement(Popup, {

};
var destroyTooltip = false;
var autoDestroy = false;
if (typeof destroyTooltipOnHide === 'boolean') {

@@ -78,5 +75,4 @@ destroyTooltip = destroyTooltipOnHide;

}
return /*#__PURE__*/React.createElement(Trigger, _extends({
popupClassName: overlayClassName,
popupClassName: classNames(overlayClassName, _defineProperty({}, "".concat(prefixCls, "-show-arrow"), showArrow)),
prefixCls: prefixCls,

@@ -103,3 +99,2 @@ popup: getPopupElement,

};
export default /*#__PURE__*/forwardRef(Tooltip);
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -15,8 +14,5 @@ value: true

exports.default = void 0;
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
var _Popup = _interopRequireDefault(require("./Popup"));
var _default = _Tooltip.default;
exports.default = _default;

@@ -6,3 +6,3 @@ "use strict";

});
exports.default = exports.placements = void 0;
exports.placements = exports.default = void 0;
var autoAdjustOverflow = {

@@ -9,0 +9,0 @@ adjustX: 1,

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {

@@ -11,16 +9,15 @@ value: true

exports.default = Popup;
var React = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function Popup(props) {
var showArrow = props.showArrow,
arrowContent = props.arrowContent,
children = props.children,
prefixCls = props.prefixCls,
id = props.id,
overlayInnerStyle = props.overlayInnerStyle,
className = props.className,
style = props.style;
arrowContent = props.arrowContent,
children = props.children,
prefixCls = props.prefixCls,
id = props.id,
overlayInnerStyle = props.overlayInnerStyle,
className = props.className,
style = props.style;
return /*#__PURE__*/React.createElement("div", {

@@ -27,0 +24,0 @@ className: (0, _classnames.default)("".concat(prefixCls, "-content"), className),

"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof3 = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {

@@ -11,50 +9,47 @@ value: true

exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _rcTrigger = _interopRequireDefault(require("rc-trigger"));
var _placements = require("./placements");
var _Popup = _interopRequireDefault(require("./Popup"));
var _classnames = _interopRequireDefault(require("classnames"));
var _excluded = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var Tooltip = function Tooltip(props, ref) {
var overlayClassName = props.overlayClassName,
_props$trigger = props.trigger,
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
_props$mouseEnterDela = props.mouseEnterDelay,
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
_props$mouseLeaveDela = props.mouseLeaveDelay,
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
overlayStyle = props.overlayStyle,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
children = props.children,
onVisibleChange = props.onVisibleChange,
afterVisibleChange = props.afterVisibleChange,
transitionName = props.transitionName,
animation = props.animation,
motion = props.motion,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'right' : _props$placement,
_props$align = props.align,
align = _props$align === void 0 ? {} : _props$align,
_props$destroyTooltip = props.destroyTooltipOnHide,
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
defaultVisible = props.defaultVisible,
getTooltipContainer = props.getTooltipContainer,
overlayInnerStyle = props.overlayInnerStyle,
arrowContent = props.arrowContent,
overlay = props.overlay,
id = props.id,
showArrow = props.showArrow,
restProps = (0, _objectWithoutProperties2.default)(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"]);
_props$trigger = props.trigger,
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
_props$mouseEnterDela = props.mouseEnterDelay,
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
_props$mouseLeaveDela = props.mouseLeaveDelay,
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
overlayStyle = props.overlayStyle,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
children = props.children,
onVisibleChange = props.onVisibleChange,
afterVisibleChange = props.afterVisibleChange,
transitionName = props.transitionName,
animation = props.animation,
motion = props.motion,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'right' : _props$placement,
_props$align = props.align,
align = _props$align === void 0 ? {} : _props$align,
_props$destroyTooltip = props.destroyTooltipOnHide,
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
defaultVisible = props.defaultVisible,
getTooltipContainer = props.getTooltipContainer,
overlayInnerStyle = props.overlayInnerStyle,
arrowContent = props.arrowContent,
overlay = props.overlay,
id = props.id,
_props$showArrow = props.showArrow,
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
var domRef = (0, React.useRef)(null);

@@ -65,7 +60,5 @@ (0, React.useImperativeHandle)(ref, function () {

var extraProps = (0, _objectSpread2.default)({}, restProps);
if ('visible' in props) {
extraProps.popupVisible = props.visible;
}
var getPopupElement = function getPopupElement() {

@@ -81,6 +74,4 @@ return /*#__PURE__*/React.createElement(_Popup.default, {

};
var destroyTooltip = false;
var autoDestroy = false;
if (typeof destroyTooltipOnHide === 'boolean') {

@@ -93,5 +84,4 @@ destroyTooltip = destroyTooltipOnHide;

}
return /*#__PURE__*/React.createElement(_rcTrigger.default, (0, _extends2.default)({
popupClassName: overlayClassName,
popupClassName: (0, _classnames.default)(overlayClassName, (0, _defineProperty2.default)({}, "".concat(prefixCls, "-show-arrow"), showArrow)),
prefixCls: prefixCls,

@@ -118,5 +108,3 @@ popup: getPopupElement,

};
var _default = /*#__PURE__*/(0, React.forwardRef)(Tooltip);
exports.default = _default;
{
"name": "rc-tooltip",
"version": "5.2.2",
"version": "5.3.0",
"description": "React Tooltip",

@@ -43,14 +43,12 @@ "keywords": [

"classnames": "^2.3.1",
"rc-trigger": "^5.0.0"
"rc-trigger": "^5.3.1"
},
"devDependencies": {
"@testing-library/react": "^13.4.0",
"@types/jest": "^26.0.0",
"@types/react": "^17.0.15",
"@types/react-dom": "^16.9.2",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/warning": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"dumi": "^2.1.1",
"eslint": "^7.1.0",

@@ -62,4 +60,4 @@ "father": "^2.23.1",

"np": "^7.1.0",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.0.5"

@@ -66,0 +64,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc