import type { FunctionalComponent } from 'vue' import { h } from 'vue' import BaseEdge from './BaseEdge' import { getSmoothStepPath } from './utils' import type { SmoothStepEdgeProps } from '~/types' import { Position } from '~/types' const SmoothStepEdge: FunctionalComponent = function ( { sourcePosition = Position.Bottom, targetPosition = Position.Top, ...props }, { attrs }, ) { const [path, labelX, labelY] = getSmoothStepPath({ sourcePosition, targetPosition, ...props, }) return h(BaseEdge, { path, labelX, labelY, ...props, ...attrs, }) } SmoothStepEdge.props = [ 'sourcePosition', 'targetPosition', 'label', 'labelStyle', 'labelShowBg', 'labelBgStyle', 'labelBgPadding', 'labelBgBorderRadius', 'sourceY', 'sourceX', 'targetX', 'targetY', 'borderRadius', 'markerEnd', 'markerStart', 'interactionWidth', 'offset', ] SmoothStepEdge.inheritAttrs = false SmoothStepEdge.compatConfig = { MODE: 3 } export default SmoothStepEdge