mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-18 12:24:51 +08:00
Input typing and condition
This commit is contained in:
24
js/template/IntPinTemplate.js
Normal file
24
js/template/IntPinTemplate.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { html, nothing } from "lit"
|
||||
import INumericPinTemplate from "./INumericPinTemplate"
|
||||
|
||||
/** @typedef {import("../entity/IntegerEntity").default} IntEntity */
|
||||
|
||||
/** @extends INumericPinTemplate<IntEntity> */
|
||||
export default class IntPinTemplate extends INumericPinTemplate {
|
||||
|
||||
setDefaultValue(values = [], rawValues = values) {
|
||||
this.element.setDefaultValue(values[0])
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
if (this.element.isInput() && !this.element.isLinked) {
|
||||
return html`
|
||||
<div class="ueb-pin-input">
|
||||
<ueb-input .singleLine="${true}" .innerText="${this.element.entity.DefaultValue.toString()}">
|
||||
</ueb-input>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
return nothing
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user