chore(core): cleanup and replace const with function

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-07 12:27:41 +01:00
committed by Braks
parent 5abe4ca2e5
commit bb2c4f449a
16 changed files with 183 additions and 164 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import type { Ref } from 'vue'
import type { Actions, GraphNode, HandleElement, Position } from '~/types'
export const getHandleBounds = (selector: string, nodeElement: HTMLDivElement, zoom: number): HandleElement[] | undefined => {
export function getHandleBounds(selector: string, nodeElement: HTMLDivElement, zoom: number): HandleElement[] | undefined {
const handles = nodeElement.querySelectorAll(`.vue-flow__handle${selector}`)
if (!handles || !handles.length) {
@@ -24,14 +24,14 @@ export const getHandleBounds = (selector: string, nodeElement: HTMLDivElement, z
})
}
export const handleNodeClick = (
export function handleNodeClick(
node: GraphNode,
multiSelectionActive: boolean,
addSelectedNodes: Actions['addSelectedNodes'],
removeSelectedNodes: Actions['removeSelectedNodes'],
nodesSelectionActive: Ref<boolean>,
unselect = false,
) => {
) {
nodesSelectionActive.value = false
if (!node.selected) {