@yamada-ui/popover
Advanced tools
Comparing version 0.2.13 to 0.2.14
@@ -123,8 +123,8 @@ "use strict"; | ||
tabIndex: -1, | ||
onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, (event) => { | ||
if (closeOnEsc && event.key === "Escape") | ||
onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, (ev) => { | ||
if (closeOnEsc && ev.key === "Escape") | ||
onClose(); | ||
}), | ||
onBlur: (0, import_utils.handlerAll)(props2.onBlur, (event) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(event); | ||
onBlur: (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const targetIsPopover = (0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
@@ -141,4 +141,4 @@ const targetIsTrigger = (0, import_utils.isContains)(triggerRef.current, relatedTarget); | ||
}); | ||
popoverProps.onMouseLeave = (0, import_utils.handlerAll)(props2.onMouseLeave, (event) => { | ||
if (event.nativeEvent.relatedTarget === null) | ||
popoverProps.onMouseLeave = (0, import_utils.handlerAll)(props2.onMouseLeave, (ev) => { | ||
if (ev.nativeEvent.relatedTarget === null) | ||
return; | ||
@@ -175,4 +175,11 @@ isHoveringRef.current = false; | ||
}; | ||
if (trigger === "click") | ||
if (trigger === "click") { | ||
triggerProps.onClick = (0, import_utils.handlerAll)(props2.onClick, onToggle); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const isValidBlur = !(0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
if (isOpen && closeOnBlur && isValidBlur) | ||
onClose(); | ||
}); | ||
} | ||
if (trigger === "hover") { | ||
@@ -183,4 +190,4 @@ triggerProps.onFocus = (0, import_utils.handlerAll)(props2.onFocus, () => { | ||
}); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (event) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(event); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const isValidBlur = !(0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
@@ -190,4 +197,4 @@ if (isOpen && closeOnBlur && isValidBlur) | ||
}); | ||
triggerProps.onKeyDown = (0, import_utils.handlerAll)(props2.onKeyDown, (event) => { | ||
if (event.key === "Escape") | ||
triggerProps.onKeyDown = (0, import_utils.handlerAll)(props2.onKeyDown, (ev) => { | ||
if (ev.key === "Escape") | ||
onClose(); | ||
@@ -194,0 +201,0 @@ }); |
@@ -115,8 +115,8 @@ "use strict"; | ||
tabIndex: -1, | ||
onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, (event) => { | ||
if (closeOnEsc && event.key === "Escape") | ||
onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, (ev) => { | ||
if (closeOnEsc && ev.key === "Escape") | ||
onClose(); | ||
}), | ||
onBlur: (0, import_utils.handlerAll)(props2.onBlur, (event) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(event); | ||
onBlur: (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const targetIsPopover = (0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
@@ -133,4 +133,4 @@ const targetIsTrigger = (0, import_utils.isContains)(triggerRef.current, relatedTarget); | ||
}); | ||
popoverProps.onMouseLeave = (0, import_utils.handlerAll)(props2.onMouseLeave, (event) => { | ||
if (event.nativeEvent.relatedTarget === null) | ||
popoverProps.onMouseLeave = (0, import_utils.handlerAll)(props2.onMouseLeave, (ev) => { | ||
if (ev.nativeEvent.relatedTarget === null) | ||
return; | ||
@@ -167,4 +167,11 @@ isHoveringRef.current = false; | ||
}; | ||
if (trigger === "click") | ||
if (trigger === "click") { | ||
triggerProps.onClick = (0, import_utils.handlerAll)(props2.onClick, onToggle); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const isValidBlur = !(0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
if (isOpen && closeOnBlur && isValidBlur) | ||
onClose(); | ||
}); | ||
} | ||
if (trigger === "hover") { | ||
@@ -175,4 +182,4 @@ triggerProps.onFocus = (0, import_utils.handlerAll)(props2.onFocus, () => { | ||
}); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (event) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(event); | ||
triggerProps.onBlur = (0, import_utils.handlerAll)(props2.onBlur, (ev) => { | ||
const relatedTarget = (0, import_utils.getEventRelatedTarget)(ev); | ||
const isValidBlur = !(0, import_utils.isContains)(popoverRef.current, relatedTarget); | ||
@@ -182,4 +189,4 @@ if (isOpen && closeOnBlur && isValidBlur) | ||
}); | ||
triggerProps.onKeyDown = (0, import_utils.handlerAll)(props2.onKeyDown, (event) => { | ||
if (event.key === "Escape") | ||
triggerProps.onKeyDown = (0, import_utils.handlerAll)(props2.onKeyDown, (ev) => { | ||
if (ev.key === "Escape") | ||
onClose(); | ||
@@ -186,0 +193,0 @@ }); |
{ | ||
"name": "@yamada-ui/popover", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "Yamada UI popover component", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"@yamada-ui/motion": "0.3.8", | ||
"@yamada-ui/use-popper": "0.2.10", | ||
"@yamada-ui/use-popper": "0.3.0", | ||
"@yamada-ui/use-disclosure": "0.2.5", | ||
@@ -46,0 +46,0 @@ "@yamada-ui/use-focus": "0.1.4", |
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
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
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
76250
2105
+ Added@yamada-ui/use-popper@0.3.0(transitive)
- Removed@yamada-ui/use-popper@0.2.10(transitive)
Updated@yamada-ui/use-popper@0.3.0