@clayui/tooltip
Advanced tools
Comparing version 3.35.3 to 3.36.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.36.0](https://github.com/liferay/clay/compare/v3.35.3...v3.36.0) (2021-09-23) | ||
### Bug Fixes | ||
- **@clayui/tooltip:** forces tooltip to be repositioned when the x-axis is modified ([b62313c](https://github.com/liferay/clay/commit/b62313c)) | ||
- **@clayui/tooltip:** stop the always showing warnings ([3858bfe](https://github.com/liferay/clay/commit/3858bfe)) | ||
- **@clyaui/tooltip:** fixes error when not forcing Tooltip repositioning when X axis is modified ([187f1ef](https://github.com/liferay/clay/commit/187f1ef)) | ||
## [3.35.3](https://github.com/liferay/clay/compare/v3.35.2...v3.35.3) (2021-09-09) | ||
@@ -8,0 +16,0 @@ |
@@ -36,2 +36,6 @@ "use strict"; | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
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; } | ||
@@ -43,6 +47,2 @@ | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
var ALIGNMENTS = ['top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left']; | ||
@@ -69,2 +69,8 @@ var ALIGNMENTS_MAP = { | ||
}; | ||
var ALIGNMENTS_FORCE_MAP = _objectSpread(_objectSpread({}, ALIGNMENTS_INVERSE_MAP), {}, { | ||
bctc: 'top-left', | ||
tcbc: 'bottom-left' | ||
}); | ||
var initialState = { | ||
@@ -280,3 +286,3 @@ align: 'top', | ||
var points = ALIGNMENTS_MAP[align || 'top']; | ||
var newAlignmentString = (0, _shared.doAlign)({ | ||
var alignment = (0, _shared.doAlign)({ | ||
overflow: { | ||
@@ -289,10 +295,16 @@ adjustX: autoAlign, | ||
targetElement: titleNodeRef.current | ||
}).points.join(''); | ||
}); | ||
var alignmentString = alignment.points.join(''); | ||
var pointsString = points.join(''); | ||
if (pointsString !== newAlignmentString) { | ||
if (alignment.overflow.adjustX) { | ||
dispatch({ | ||
align: ALIGNMENTS_INVERSE_MAP[newAlignmentString], | ||
align: ALIGNMENTS_FORCE_MAP[alignmentString], | ||
type: 'align' | ||
}); | ||
} else if (pointsString !== alignmentString) { | ||
dispatch({ | ||
align: ALIGNMENTS_INVERSE_MAP[alignmentString], | ||
type: 'align' | ||
}); | ||
} | ||
@@ -302,4 +314,4 @@ } | ||
"production" !== "production" ? (0, _warning.default)(!children && !scope, '<TooltipProvider />: You must use at least one of the following props: `children` or `scope`.') : void 0; | ||
"production" !== "production" ? (0, _warning.default)(children && scope, '<TooltipProvider />: If you want to use `scope`, use <TooltipProvider /> as a singleton and do not pass `children`.') : void 0; | ||
"production" !== "production" ? (0, _warning.default)(typeof children === 'undefined' && typeof scope !== 'undefined' || typeof scope === 'undefined' && typeof children !== 'undefined', '<TooltipProvider />: You must use at least one of the following props: `children` or `scope`.') : void 0; | ||
"production" !== "production" ? (0, _warning.default)(typeof children !== 'undefined' || typeof scope !== 'undefined', '<TooltipProvider />: If you want to use `scope`, use <TooltipProvider /> as a singleton and do not pass `children`.') : void 0; | ||
"production" !== "production" ? (0, _warning.default)((children === null || children === void 0 ? void 0 : children.type) !== _react.default.Fragment, '<TooltipProvider />: React Fragment is not allowed as a child to TooltipProvider. Child must be a single HTML element that accepts `onMouseOver` and `onMouseOut`.') : void 0; | ||
@@ -306,0 +318,0 @@ var titleContent = contentRenderer({ |
{ | ||
"name": "@clayui/tooltip", | ||
"version": "3.35.3", | ||
"version": "3.36.0", | ||
"description": "ClayTooltip component", | ||
@@ -29,3 +29,3 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@clayui/shared": "^3.35.3", | ||
"@clayui/shared": "^3.36.0", | ||
"classnames": "^2.2.6", | ||
@@ -42,3 +42,3 @@ "warning": "^4.0.3" | ||
], | ||
"gitHead": "65f493494e896cc49cf5ba50c9f5c347270e6793" | ||
"gitHead": "e91895f788381be22112ad3e98a755a7992ff448" | ||
} |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
42633
831
0
Updated@clayui/shared@^3.36.0