@rkmodules/rules 0.0.177 → 0.0.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.css +1 -0
- package/dist/index.cjs.js +13 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.css +1 -0
- package/dist/index.esm.mjs +13 -0
- package/dist/index.esm.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
package/dist/index.esm.mjs
CHANGED
|
@@ -7062,6 +7062,19 @@ function Menu(_a) {
|
|
|
7062
7062
|
var handleClose = function () {
|
|
7063
7063
|
setOpen(false);
|
|
7064
7064
|
};
|
|
7065
|
+
React.useEffect(function () {
|
|
7066
|
+
if (!open)
|
|
7067
|
+
return;
|
|
7068
|
+
var handleClickOutside = function (event) {
|
|
7069
|
+
if (!event.target.closest(".".concat(styles$2.MenuCanvas))) {
|
|
7070
|
+
setOpen(false);
|
|
7071
|
+
}
|
|
7072
|
+
};
|
|
7073
|
+
document.addEventListener("click", handleClickOutside);
|
|
7074
|
+
return function () {
|
|
7075
|
+
document.removeEventListener("click", handleClickOutside);
|
|
7076
|
+
};
|
|
7077
|
+
}, [open]);
|
|
7065
7078
|
return (React.createElement("div", { className: styles$2.Menu },
|
|
7066
7079
|
React.createElement("div", { onClick: handleOpen }, handle),
|
|
7067
7080
|
open && (React.createElement("div", { className: styles$2.MenuCanvas, onClick: handleClose }, children))));
|