mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
26 lines
773 B
JavaScript
Executable File
26 lines
773 B
JavaScript
Executable File
import NodeTemplate from "../template/NodeTemplate"
|
|
import SelectableDraggable from "./SelectableDraggable"
|
|
|
|
export default class GraphNode extends SelectableDraggable {
|
|
|
|
constructor() {
|
|
super(new NodeTemplate())
|
|
this.graphNodeName = 'n/a'
|
|
this.inputs = []
|
|
this.outputs = []
|
|
}
|
|
|
|
connectedCallback() {
|
|
const type = this.getAttribute('type')?.trim()
|
|
super.connectedCallback()
|
|
this.classList.add('ueb-node')
|
|
if (this.selected) {
|
|
this.classList.add('ueb-selected')
|
|
}
|
|
this.style.setProperty('--ueb-position-x', this.location[0])
|
|
this.style.setProperty('--ueb-position-y', this.location[1])
|
|
}
|
|
}
|
|
|
|
customElements.define('u-node', GraphNode)
|