mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-13 03:37:31 +08:00
Input typing and condition
This commit is contained in:
@@ -32,7 +32,7 @@ export default class BoolPinTemplate extends PinTemplate {
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
if (this.element.isInput()) {
|
||||
if (this.element.isInput() && !this.element.isLinked) {
|
||||
return html`
|
||||
<input type="checkbox" class="ueb-pin-input" ?checked="${this.element.defaultValue}" />
|
||||
`
|
||||
|
||||
@@ -96,7 +96,7 @@ export default class IInputPinTemplate extends PinTemplate {
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
if (this.element.isInput()) {
|
||||
if (this.element.isInput() && !this.element.isLinked) {
|
||||
// @ts-expect-error
|
||||
const singleLine = this.constructor.singleLineInput
|
||||
// @ts-expect-error
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export default class LinearColorPinTemplate extends IInputPinTemplate {
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
if (this.element.isInput()) {
|
||||
if (this.element.isInput() && !this.element.isLinked) {
|
||||
return html`
|
||||
<span class="ueb-pin-input" data-linear-color="${this.element.defaultValue.toString()}"
|
||||
style="--ueb-linear-color: rgba(${this.element.defaultValue.toString()})">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { html } from "lit"
|
||||
import { html, nothing } from "lit"
|
||||
import IInputPinTemplate from "./IInputPinTemplate"
|
||||
import INumericPinTemplate from "./INumericPinTemplate"
|
||||
import Utility from "../Utility"
|
||||
@@ -14,7 +14,7 @@ export default class RealPinTemplate extends INumericPinTemplate {
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
if (this.element.isInput()) {
|
||||
if (this.element.isInput() && !this.element.isLinked) {
|
||||
return html`
|
||||
<div class="ueb-pin-input">
|
||||
<ueb-input .singleLine="${true}"
|
||||
@@ -23,6 +23,6 @@ export default class RealPinTemplate extends INumericPinTemplate {
|
||||
</div>
|
||||
`
|
||||
}
|
||||
return html``
|
||||
return nothing
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user