chore(core): update functional component types
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { isNumber } from '@vueuse/core'
|
import { isNumber } from '@vueuse/core'
|
||||||
import type { FunctionalComponent } from 'vue'
|
import type { Component, FunctionalComponent } from 'vue'
|
||||||
import EdgeText from './EdgeText.vue'
|
import EdgeText from './EdgeText.vue'
|
||||||
import type { BaseEdgeProps } from '~/types'
|
import type { BaseEdgeProps } from '~/types'
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function (
|
|||||||
})
|
})
|
||||||
: null,
|
: null,
|
||||||
label && isNumber(labelX) && isNumber(labelY)
|
label && isNumber(labelX) && isNumber(labelY)
|
||||||
? h(EdgeText, {
|
? h(EdgeText as Component, {
|
||||||
x: labelX,
|
x: labelX,
|
||||||
y: labelY,
|
y: labelY,
|
||||||
label,
|
label,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FunctionalComponent } from 'vue'
|
import type { Component, FunctionalComponent } from 'vue'
|
||||||
import Handle from '../Handle/Handle.vue'
|
import Handle from '../Handle/Handle.vue'
|
||||||
import type { NodeProps } from '~/types'
|
import type { NodeProps } from '~/types'
|
||||||
import { Position } from '~/types'
|
import { Position } from '~/types'
|
||||||
@@ -12,9 +12,9 @@ const DefaultNode: FunctionalComponent<NodeProps> = function ({
|
|||||||
isValidSourcePos,
|
isValidSourcePos,
|
||||||
}) {
|
}) {
|
||||||
return [
|
return [
|
||||||
h(Handle, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
|
h(Handle as Component, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
|
||||||
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
||||||
h(Handle, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
|
h(Handle as Component, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FunctionalComponent } from 'vue'
|
import type { Component, FunctionalComponent } from 'vue'
|
||||||
import Handle from '../Handle/Handle.vue'
|
import Handle from '../Handle/Handle.vue'
|
||||||
import type { NodeProps } from '~/types'
|
import type { NodeProps } from '~/types'
|
||||||
import { Position } from '~/types'
|
import { Position } from '~/types'
|
||||||
@@ -11,7 +11,7 @@ const InputNode: FunctionalComponent<NodeProps> = function ({
|
|||||||
}) {
|
}) {
|
||||||
return [
|
return [
|
||||||
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
||||||
h(Handle, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
|
h(Handle as Component, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FunctionalComponent } from 'vue'
|
import type { Component, FunctionalComponent } from 'vue'
|
||||||
import Handle from '../Handle/Handle.vue'
|
import Handle from '../Handle/Handle.vue'
|
||||||
import type { NodeProps } from '~/types'
|
import type { NodeProps } from '~/types'
|
||||||
import { Position } from '~/types'
|
import { Position } from '~/types'
|
||||||
@@ -10,7 +10,7 @@ const OutputNode: FunctionalComponent<NodeProps> = function ({
|
|||||||
isValidTargetPos,
|
isValidTargetPos,
|
||||||
}) {
|
}) {
|
||||||
return [
|
return [
|
||||||
h(Handle, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
|
h(Handle as Component, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
|
||||||
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user