feat: add draghandle prop to node
* specify a drag handle on the node Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { CSSProperties, HTMLAttributes } from 'vue'
|
import { Component, CSSProperties, DefineComponent } from 'vue'
|
||||||
|
|
||||||
interface EdgeTextProps extends HTMLAttributes {
|
interface EdgeTextProps {
|
||||||
x: number
|
x: number
|
||||||
y: number
|
y: number
|
||||||
label?:
|
label?:
|
||||||
| string
|
| string
|
||||||
| {
|
| {
|
||||||
component: any
|
component: Component | DefineComponent
|
||||||
props?: any
|
props?: Record<string, any>
|
||||||
}
|
}
|
||||||
labelStyle?: CSSProperties
|
labelStyle?: CSSProperties
|
||||||
labelShowBg?: boolean
|
labelShowBg?: boolean
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<DraggableCore
|
<DraggableCore
|
||||||
cancel=".nodrag"
|
cancel=".nodrag"
|
||||||
|
:handle="props.node.dragHandle"
|
||||||
:disabled="!draggable"
|
:disabled="!draggable"
|
||||||
:scale="scale"
|
:scale="scale"
|
||||||
:grid="props.snapGrid"
|
:grid="props.snapGrid"
|
||||||
|
|||||||
+17
-1
@@ -1,4 +1,4 @@
|
|||||||
import { CSSProperties } from 'vue'
|
import { Component, CSSProperties, DefineComponent } from 'vue'
|
||||||
import { BackgroundVariant, Dimensions, ElementId, FitViewParams, Position, XYPosition } from './flow'
|
import { BackgroundVariant, Dimensions, ElementId, FitViewParams, Position, XYPosition } from './flow'
|
||||||
import { Connection } from './connection'
|
import { Connection } from './connection'
|
||||||
import { Node } from './node'
|
import { Node } from './node'
|
||||||
@@ -56,3 +56,19 @@ export interface MiniMapNodeProps {
|
|||||||
strokeColor?: string
|
strokeColor?: string
|
||||||
strokeWidth?: number
|
strokeWidth?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EdgeTextProps {
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
|
label?:
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
component: Component | DefineComponent
|
||||||
|
props?: Record<string, any>
|
||||||
|
}
|
||||||
|
labelStyle?: CSSProperties
|
||||||
|
labelShowBg?: boolean
|
||||||
|
labelBgStyle?: any
|
||||||
|
labelBgPadding?: [number, number]
|
||||||
|
labelBgBorderRadius?: number
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export interface Node<T = any> {
|
|||||||
draggable?: boolean
|
draggable?: boolean
|
||||||
selectable?: boolean
|
selectable?: boolean
|
||||||
connectable?: boolean
|
connectable?: boolean
|
||||||
|
dragHandle?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GraphNode<T = any> extends Node<T> {
|
export interface GraphNode<T = any> extends Node<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user