Files
lan-manager/web/node_modules/element-plus/es/hooks/use-same-target/index.mjs
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

31 lines
716 B
JavaScript

import { NOOP } from "../../utils/functions.mjs";
//#region ../../packages/hooks/use-same-target/index.ts
const useSameTarget = (handleClick) => {
if (!handleClick) return {
onClick: NOOP,
onMousedown: NOOP,
onMouseup: NOOP
};
let mousedownTarget = false;
let mouseupTarget = false;
const onClick = (e) => {
if (mousedownTarget && mouseupTarget) handleClick(e);
mousedownTarget = mouseupTarget = false;
};
const onMousedown = (e) => {
mousedownTarget = e.target === e.currentTarget;
};
const onMouseup = (e) => {
mouseupTarget = e.target === e.currentTarget;
};
return {
onClick,
onMousedown,
onMouseup
};
};
//#endregion
export { useSameTarget };
//# sourceMappingURL=index.mjs.map