23 lines
734 B
TypeScript
23 lines
734 B
TypeScript
import type { Component, FunctionalComponent } from 'vue'
|
|
import Handle from '../Handle/Handle.vue'
|
|
import type { NodeProps } from '~/types'
|
|
import { Position } from '~/types'
|
|
|
|
const OutputNode: FunctionalComponent<NodeProps> = function ({
|
|
targetPosition = Position.Top,
|
|
label,
|
|
connectable = true,
|
|
isValidTargetPos,
|
|
}) {
|
|
return [
|
|
h(Handle as Component, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
|
|
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
|
]
|
|
}
|
|
|
|
OutputNode.props = ['targetPosition', 'label', 'isValidTargetPos', 'connectable']
|
|
OutputNode.inheritAttrs = false
|
|
OutputNode.compatConfig = { MODE: 3 }
|
|
|
|
export default OutputNode
|