| | |
| | | import { on } from '/@/utils/domUtils'; |
| | | import { isServer } from '/@/utils/is'; |
| | | import { on } from '@/utils/domUtils'; |
| | | import { isServer } from '@/utils/is'; |
| | | import type { ComponentPublicInstance, DirectiveBinding, ObjectDirective } from 'vue'; |
| | | |
| | | type DocumentHandler = <T extends MouseEvent>(mouseup: T, mousedown: T) => void; |
| | |
| | | let startClick: MouseEvent; |
| | | |
| | | if (!isServer) { |
| | | on(document, 'mousedown', (e: MouseEvent) => (startClick = e)); |
| | | on(document, 'mouseup', (e: MouseEvent) => { |
| | | on(document, 'mousedown', (e: Event) => (startClick = e as MouseEvent)); |
| | | on(document, 'mouseup', (e: Event) => { |
| | | for (const { documentHandler } of nodeList.values()) { |
| | | documentHandler(e, startClick); |
| | | documentHandler(e as MouseEvent, startClick); |
| | | } |
| | | }); |
| | | } |