react-tiny-popover
Advanced tools
Comparing version 6.0.9 to 6.0.10
@@ -10,4 +10,4 @@ export interface ContentLocation { | ||
parentRect: ClientRect; | ||
position: PopoverPosition | 'custom'; | ||
align: PopoverAlign | 'custom'; | ||
position?: PopoverPosition; | ||
align?: PopoverAlign; | ||
padding: number; | ||
@@ -28,3 +28,3 @@ nudgedLeft: number; | ||
popoverRect: ClientRect; | ||
position: PopoverPosition; | ||
position?: PopoverPosition; | ||
arrowSize: number; | ||
@@ -59,4 +59,4 @@ arrowColor: string; | ||
content: ContentRenderer | JSX.Element; | ||
positions?: Exclude<PopoverPosition, 'custom'>[]; | ||
align?: Exclude<PopoverAlign, 'custom'>; | ||
positions?: PopoverPosition[]; | ||
align?: PopoverAlign; | ||
padding?: number; | ||
@@ -63,0 +63,0 @@ reposition?: boolean; |
@@ -63,20 +63,22 @@ "use strict"; | ||
var _a, _b; | ||
if (isOpen && shouldUpdate && childRef.current && popoverRef.current) { | ||
var childRect = (_a = childRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); | ||
var popoverRect = (_b = popoverRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect(); | ||
if (!util_1.rectsAreEqual(childRect, { | ||
top: popoverState.childRect.top, | ||
left: popoverState.childRect.left, | ||
width: popoverState.childRect.width, | ||
height: popoverState.childRect.height, | ||
bottom: popoverState.childRect.top + popoverState.childRect.height, | ||
right: popoverState.childRect.left + popoverState.childRect.width, | ||
}) || | ||
popoverRect.width !== popoverState.popoverRect.width || | ||
popoverRect.height !== popoverState.popoverRect.height || | ||
popoverState.padding !== padding || | ||
popoverState.align !== align || | ||
positions !== prevPositions.current || | ||
contentLocation !== prevContentLocation.current || | ||
reposition !== prevReposition.current) { | ||
if (isOpen && shouldUpdate) { | ||
var childRect = (_a = childRef === null || childRef === void 0 ? void 0 : childRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); | ||
var popoverRect = (_b = popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect(); | ||
if (childRect != null && | ||
popoverRect != null && | ||
(!util_1.rectsAreEqual(childRect, { | ||
top: popoverState.childRect.top, | ||
left: popoverState.childRect.left, | ||
width: popoverState.childRect.width, | ||
height: popoverState.childRect.height, | ||
bottom: popoverState.childRect.top + popoverState.childRect.height, | ||
right: popoverState.childRect.left + popoverState.childRect.width, | ||
}) || | ||
popoverRect.width !== popoverState.popoverRect.width || | ||
popoverRect.height !== popoverState.popoverRect.height || | ||
popoverState.padding !== padding || | ||
popoverState.align !== align || | ||
positions !== prevPositions.current || | ||
contentLocation !== prevContentLocation.current || | ||
reposition !== prevReposition.current)) { | ||
positionPopover(); | ||
@@ -83,0 +85,0 @@ } |
@@ -63,3 +63,2 @@ "use strict"; | ||
case 'top': | ||
default: | ||
return { | ||
@@ -72,2 +71,6 @@ borderLeft: arrowSize + "px solid transparent", | ||
}; | ||
default: | ||
return { | ||
display: 'hidden', | ||
}; | ||
} | ||
@@ -74,0 +77,0 @@ })())); |
@@ -30,4 +30,2 @@ "use strict"; | ||
parentRect: parentRect, | ||
position: 'custom', | ||
align: 'custom', | ||
padding: padding, | ||
@@ -46,4 +44,2 @@ nudgedTop: 0, | ||
parentRect: parentRect, | ||
position: 'custom', | ||
align: 'custom', | ||
padding: padding, | ||
@@ -50,0 +46,0 @@ nudgedTop: 0, |
{ | ||
"name": "react-tiny-popover", | ||
"version": "6.0.9", | ||
"version": "6.0.10", | ||
"description": "A simple and highly customizable popover react higher order component with no other dependencies! Typescript friendly.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
107441
683