mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
30 lines
773 B
JavaScript
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>
|
|
`
|
|
}
|
|
}
|