update: Add slots to CustomConnectionLine.vue, Edge.vue, Node.vue

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent b3d276bfb8
commit 9d9a90e9a7
25 changed files with 363 additions and 391 deletions
+28
View File
@@ -0,0 +1,28 @@
import { Ref } from 'vue'
import { ElementId, Transform } from './types'
import { D3Zoom, D3Selection, PanOnScrollMode, KeyCode } from './panel'
import { Connection } from '@/src'
export type UpdateNodeInternals = (nodeId: ElementId) => void
export interface UseZoomOptions {
selectionKeyCode?: KeyCode
zoomActivationKeyCode?: KeyCode
paneMoveable?: boolean
defaultZoom?: number
defaultPosition?: [number, number]
zoomOnScroll?: boolean
zoomOnPinch?: boolean
panOnScroll?: boolean
panOnScrollSpeed?: number
panOnScrollMode?: PanOnScrollMode
zoomOnDoubleClick?: boolean
}
export interface UseZoom {
transform: Ref<Transform>
d3Zoom: Ref<D3Zoom>
d3Selection: Ref<D3Selection>
}
export type ValidConnectionFunc = (connection: Connection) => boolean
-3
View File
@@ -1,4 +1,3 @@
import { DefineComponent } from 'vue'
import { ElementId, Position } from './types'
import { HandleType } from '~/types/handle'
@@ -27,8 +26,6 @@ export type ConnectionLineComponentProps = {
connectionLineType: ConnectionLineType
}
export type CustomConnectionLine = DefineComponent<ConnectionLineComponentProps | any, any, any, any>
export type OnConnectFunc = (connection: Connection) => void
export type OnConnectStartParams = {
nodeId: ElementId | undefined
+1
View File
@@ -7,3 +7,4 @@ export * from './node'
export * from './panel'
export * from './store'
export * from './hooks'
export * from './composables'
+1 -2
View File
@@ -1,7 +1,7 @@
import { CSSProperties, HTMLAttributes } from 'vue'
import { Edge, EdgeType } from './edge'
import { Node, NodeExtent, NodeType, TranslateExtent } from './node'
import { CustomConnectionLine, ConnectionLineType, ConnectionMode } from '~/types/connection'
import { ConnectionLineType, ConnectionMode } from '~/types/connection'
import { KeyCode, PanOnScrollMode } from '~/types/panel'
export type ElementId = string
@@ -96,7 +96,6 @@ export interface FlowOptions extends Omit<HTMLAttributes, 'onLoad'> {
connectionMode?: ConnectionMode
connectionLineType?: ConnectionLineType
connectionLineStyle?: CSSProperties
connectionLineComponent?: CustomConnectionLine
deleteKeyCode?: KeyCode
selectionKeyCode?: KeyCode
multiSelectionKeyCode?: KeyCode