mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
30 lines
907 B
JavaScript
30 lines
907 B
JavaScript
import { html } from "lit"
|
|
import IInputPinTemplate from "./IInputPinTemplate"
|
|
import INumericPinTemplate from "./INumericPinTemplate"
|
|
import Utility from "../Utility"
|
|
|
|
/**
|
|
* @template {Number} T
|
|
* @extends INumericPinTemplate<T>
|
|
*/
|
|
export default class RealPinTemplate extends INumericPinTemplate {
|
|
|
|
setDefaultValue(values = [], rawValues = values) {
|
|
this.element.setDefaultValue(values[0])
|
|
}
|
|
|
|
renderInput() {
|
|
if (this.element.isInput()) {
|
|
return html`
|
|
<div class="ueb-pin-input">
|
|
<span class="ueb-pin-input-content" role="textbox" contenteditable="true"
|
|
.innerText="${
|
|
IInputPinTemplate.stringFromUEToInput(Utility.minDecimals(this.element.entity.DefaultValue))
|
|
}"></span>
|
|
</div>
|
|
`
|
|
}
|
|
return html``
|
|
}
|
|
}
|