Files
ueblueprint/js/template/StringPinTemplate.js
barsdeveloper e901932953 WIP
2022-04-02 11:13:34 +02:00

30 lines
773 B
JavaScript

// @ts-check
import html from "./html"
import PinTemplate from "./PinTemplate"
/**
* @typedef {import("../element/PinElement").default} PinElement
*/
export default class StringPinTemplate extends PinTemplate {
hasInput() {
return true
}
/**
* @param {PinElement} pin
*/
renderInput(pin) {
const stopEventPropagation = "e => stopPropagation()"
return html`
<span class="ueb-pin-input">
<span class="ueb-pin-input-content" role="textbox" contenteditable="true"
onfocus="_ => this.closest('ueb-blueprint').editText = true"
onfocusout="_ => this.closest('ueb-blueprint').editText = false"
></span>
</span>
`
}
}