rc-tooltip
Advanced tools
Comparing version 6.2.1 to 6.3.0
@@ -9,3 +9,4 @@ import * as React from 'react'; | ||
style?: React.CSSProperties; | ||
innerClassName?: string; | ||
} | ||
export default function Popup(props: ContentProps): React.JSX.Element; |
@@ -7,3 +7,4 @@ import classNames from 'classnames'; | ||
id = props.id, | ||
overlayInnerStyle = props.overlayInnerStyle, | ||
innerStyle = props.overlayInnerStyle, | ||
innerClassName = props.innerClassName, | ||
className = props.className, | ||
@@ -15,7 +16,7 @@ style = props.style; | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-inner"), | ||
className: classNames("".concat(prefixCls, "-inner"), innerClassName), | ||
id: id, | ||
role: "tooltip", | ||
style: overlayInnerStyle | ||
style: innerStyle | ||
}, typeof children === 'function' ? children() : children)); | ||
} |
@@ -28,3 +28,13 @@ import type { ArrowType, TriggerProps, TriggerRef } from '@rc-component/trigger'; | ||
zIndex?: number; | ||
styles?: TooltipStyles; | ||
classNames?: TooltipClassNames; | ||
} | ||
export interface TooltipStyles { | ||
root?: React.CSSProperties; | ||
inner?: React.CSSProperties; | ||
} | ||
export interface TooltipClassNames { | ||
root?: string; | ||
inner?: string; | ||
} | ||
export interface TooltipRef extends TriggerRef { | ||
@@ -31,0 +41,0 @@ } |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
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"]; | ||
var _excluded = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow", "classNames", "styles"]; | ||
import Trigger from '@rc-component/trigger'; | ||
@@ -10,2 +10,3 @@ import * as React from 'react'; | ||
import Popup from "./Popup"; | ||
import classNames from 'classnames'; | ||
var Tooltip = function Tooltip(props, ref) { | ||
@@ -42,2 +43,4 @@ var overlayClassName = props.overlayClassName, | ||
showArrow = _props$showArrow === void 0 ? true : _props$showArrow, | ||
tooltipClassNames = props.classNames, | ||
tooltipStyles = props.styles, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -57,7 +60,8 @@ var triggerRef = useRef(null); | ||
id: id, | ||
overlayInnerStyle: overlayInnerStyle | ||
innerClassName: tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.inner, | ||
overlayInnerStyle: _objectSpread(_objectSpread({}, overlayInnerStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.inner) | ||
}, overlay); | ||
}; | ||
return /*#__PURE__*/React.createElement(Trigger, _extends({ | ||
popupClassName: overlayClassName, | ||
popupClassName: classNames(overlayClassName, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.root), | ||
prefixCls: prefixCls, | ||
@@ -79,3 +83,3 @@ popup: getPopupElement, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
popupStyle: overlayStyle, | ||
popupStyle: _objectSpread(_objectSpread({}, overlayStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.root), | ||
mouseEnterDelay: mouseEnterDelay, | ||
@@ -82,0 +86,0 @@ arrow: showArrow |
@@ -9,3 +9,4 @@ import * as React from 'react'; | ||
style?: React.CSSProperties; | ||
innerClassName?: string; | ||
} | ||
export default function Popup(props: ContentProps): React.JSX.Element; |
@@ -17,3 +17,4 @@ "use strict"; | ||
id = props.id, | ||
overlayInnerStyle = props.overlayInnerStyle, | ||
innerStyle = props.overlayInnerStyle, | ||
innerClassName = props.innerClassName, | ||
className = props.className, | ||
@@ -25,7 +26,7 @@ style = props.style; | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-inner"), | ||
className: (0, _classnames.default)("".concat(prefixCls, "-inner"), innerClassName), | ||
id: id, | ||
role: "tooltip", | ||
style: overlayInnerStyle | ||
style: innerStyle | ||
}, typeof children === 'function' ? children() : children)); | ||
} |
@@ -28,3 +28,13 @@ import type { ArrowType, TriggerProps, TriggerRef } from '@rc-component/trigger'; | ||
zIndex?: number; | ||
styles?: TooltipStyles; | ||
classNames?: TooltipClassNames; | ||
} | ||
export interface TooltipStyles { | ||
root?: React.CSSProperties; | ||
inner?: React.CSSProperties; | ||
} | ||
export interface TooltipClassNames { | ||
root?: string; | ||
inner?: string; | ||
} | ||
export interface TooltipRef extends TriggerRef { | ||
@@ -31,0 +41,0 @@ } |
@@ -17,3 +17,4 @@ "use strict"; | ||
var _Popup = _interopRequireDefault(require("./Popup")); | ||
var _excluded = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"]; | ||
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", "classNames", "styles"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -52,2 +53,4 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
showArrow = _props$showArrow === void 0 ? true : _props$showArrow, | ||
tooltipClassNames = props.classNames, | ||
tooltipStyles = props.styles, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -67,7 +70,8 @@ var triggerRef = (0, _react.useRef)(null); | ||
id: id, | ||
overlayInnerStyle: overlayInnerStyle | ||
innerClassName: tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.inner, | ||
overlayInnerStyle: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, overlayInnerStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.inner) | ||
}, overlay); | ||
}; | ||
return /*#__PURE__*/React.createElement(_trigger.default, (0, _extends2.default)({ | ||
popupClassName: overlayClassName, | ||
popupClassName: (0, _classnames.default)(overlayClassName, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.root), | ||
prefixCls: prefixCls, | ||
@@ -89,3 +93,3 @@ popup: getPopupElement, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
popupStyle: overlayStyle, | ||
popupStyle: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, overlayStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.root), | ||
mouseEnterDelay: mouseEnterDelay, | ||
@@ -92,0 +96,0 @@ arrow: showArrow |
{ | ||
"name": "rc-tooltip", | ||
"version": "6.2.1", | ||
"version": "6.3.0", | ||
"description": "React Tooltip", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
54299
903