@clayui/tooltip
Advanced tools
Comparing version 3.0.6 to 3.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.1.0](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.4...@clayui/tooltip@3.1.0) (2020-01-31) | ||
### Bug Fixes | ||
- **css:** allow newline characters to display properly for tooltips ([2265d10](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/commit/2265d10)) | ||
- **drop-down:** use dom-align instead of metal-position ([335ff38](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/commit/335ff38)) | ||
### Features | ||
- **tooltip:** allow custom renderer for TooltipProvider content ([bf64914](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/commit/bf64914)) | ||
## [3.0.6](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.4...@clayui/tooltip@3.0.6) (2020-01-20) | ||
@@ -8,0 +19,0 @@ |
import React from 'react'; | ||
declare type TContentRenderer = (props: { | ||
targetNode?: HTMLElement | null; | ||
title: string; | ||
}) => React.ReactElement | React.ReactNode; | ||
declare const TooltipProvider: React.FunctionComponent<{ | ||
autoAlign?: boolean; | ||
children: React.ReactElement; | ||
contentRenderer?: TContentRenderer; | ||
delay?: number; | ||
}>; | ||
export default TooltipProvider; |
@@ -110,2 +110,6 @@ "use strict"; | ||
children = _ref2.children, | ||
_ref2$contentRenderer = _ref2.contentRenderer, | ||
contentRenderer = _ref2$contentRenderer === void 0 ? function (props) { | ||
return props.title; | ||
} : _ref2$contentRenderer, | ||
_ref2$delay = _ref2.delay, | ||
@@ -118,3 +122,4 @@ delay = _ref2$delay === void 0 ? 600 : _ref2$delay; | ||
align = _React$useReducer2$.align, | ||
message = _React$useReducer2$.message, | ||
_React$useReducer2$$m = _React$useReducer2$.message, | ||
message = _React$useReducer2$$m === void 0 ? '' : _React$useReducer2$$m, | ||
show = _React$useReducer2$.show, | ||
@@ -204,3 +209,6 @@ dispatch = _React$useReducer2[1]; // Using `any` type since TS incorrectly infers setTimeout to be from NodeJS | ||
show: true | ||
}, message)), _react.default.cloneElement(children, _objectSpread({}, children.props, { | ||
}, contentRenderer({ | ||
targetNode: targetRef.current, | ||
title: message | ||
}))), _react.default.cloneElement(children, _objectSpread({}, children.props, { | ||
onMouseOut: handleHide, | ||
@@ -207,0 +215,0 @@ onMouseOver: handleShow |
{ | ||
"name": "@clayui/tooltip", | ||
"version": "3.0.6", | ||
"version": "3.1.0", | ||
"description": "ClayTooltip component", | ||
@@ -29,3 +29,3 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@clayui/shared": "^3.0.6", | ||
"@clayui/shared": "^3.0.7", | ||
"classnames": "^2.2.6", | ||
@@ -43,3 +43,3 @@ "dom-align": "^1.10.2", | ||
], | ||
"gitHead": "c57d995c58f23d16de65faf6cc958227421b9fa3" | ||
"gitHead": "b0887defbc8bf6ed2e50ffaa9858ceba1d353f49" | ||
} |
Sorry, the diff of this file is not supported yet
25482
563
Updated@clayui/shared@^3.0.7