refactor(core): rename core pkg dir to core

This commit is contained in:
braks
2022-10-10 21:33:44 +02:00
committed by Braks
parent f7dd7f1803
commit 082050b164
87 changed files with 640 additions and 0 deletions
@@ -0,0 +1,56 @@
import type { FunctionalComponent } from 'vue'
import BaseEdge from './BaseEdge'
import { getStraightPath } from './utils'
import type { EdgeProps } from '~/types'
const StraightEdge: FunctionalComponent<EdgeProps> = function ({
label,
labelStyle = {},
labelShowBg = true,
labelBgStyle = {},
labelBgPadding,
labelBgBorderRadius,
sourceY,
sourceX,
targetX,
targetY,
markerEnd,
markerStart,
style,
}) {
const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY })
return h(BaseEdge, {
path,
labelX,
labelY,
label,
labelStyle,
labelShowBg,
labelBgStyle,
labelBgPadding,
labelBgBorderRadius,
style,
markerEnd,
markerStart,
})
}
StraightEdge.props = [
'label',
'labelStyle',
'labelShowBg',
'labelBgStyle',
'labelBgPadding',
'labelBgBorderRadius',
'sourceY',
'sourceX',
'targetX',
'targetY',
'markerEnd',
'markerStart',
'style',
]
StraightEdge.inheritAttrs = false
export default StraightEdge