Move entities decode methods to entities

This commit is contained in:
barsdeveloper
2023-01-28 23:33:08 +01:00
parent daf6abf038
commit 2ccb0dc519
15 changed files with 538 additions and 520 deletions

View File

@@ -1,5 +1,4 @@
import { html, nothing } from "lit"
import Configuration from "../../Configuration"
import ElementFactory from "../../element/ElementFactory"
import ISelectableDraggableTemplate from "../ISelectableDraggableTemplate"
import SVGIcon from "../../SVGIcon"
@@ -34,7 +33,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
}
getColor() {
return Configuration.nodeColor(this.element)
return this.element.entity.nodeColor()
}
render() {
@@ -62,7 +61,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
}
renderNodeIcon() {
return Configuration.nodeIcon(this.element)
return this.element.entity.nodeIcon()
}
renderNodeName() {

View File

@@ -1,5 +1,4 @@
import { html, nothing } from "lit"
import Configuration from "../../Configuration"
import ITemplate from "../ITemplate"
import MouseCreateLink from "../../input/mouse/MouseCreateLink"
import SVGIcon from "../../SVGIcon"
@@ -103,7 +102,7 @@ export default class PinTemplate extends ITemplate {
/** @param {PropertyValues} changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties)
this.element.style.setProperty("--ueb-pin-color-rgb", Configuration.pinColor(this.element).cssText)
this.element.style.setProperty("--ueb-pin-color-rgb", this.element.entity.pinColor().cssText)
this.#iconElement = this.element.querySelector(".ueb-pin-icon svg") ?? this.element
}