remove datastar range component
This commit is contained in:
@@ -14,7 +14,6 @@ type RangeProps struct {
|
|||||||
Size string
|
Size string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: usage requires alpine.js
|
|
||||||
templ Range(props RangeProps) {
|
templ Range(props RangeProps) {
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
<label
|
<label
|
||||||
@@ -53,46 +52,3 @@ templ Range(props RangeProps) {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: usage requires datastar.js
|
|
||||||
templ DatastarRange(props RangeProps) {
|
|
||||||
<div class="form-control">
|
|
||||||
<label
|
|
||||||
class="label space-x-1"
|
|
||||||
data-signals={ fmt.Sprintf("{value: %d}", props.Value) }
|
|
||||||
>
|
|
||||||
if props.Label != "" {
|
|
||||||
<span
|
|
||||||
class={
|
|
||||||
templ.KV("text-xs", props.Size == "xs"),
|
|
||||||
templ.KV("text-sm", props.Size == "sm"),
|
|
||||||
templ.KV("text-lg", props.Size == "lg"),
|
|
||||||
templ.KV("text-xl", props.Size == "xl"),
|
|
||||||
}
|
|
||||||
>{ props.Label }</span>
|
|
||||||
}
|
|
||||||
<input
|
|
||||||
type="range"
|
|
||||||
if props.ID != "" {
|
|
||||||
id={ props.ID }
|
|
||||||
}
|
|
||||||
name={ props.Name }
|
|
||||||
min={ fmt.Sprintf("%d", props.Min) }
|
|
||||||
max={ fmt.Sprintf("%d", props.Max) }
|
|
||||||
class={
|
|
||||||
"range", props.Class,
|
|
||||||
templ.KV("range-xs", props.Size == "xs"),
|
|
||||||
templ.KV("range-sm", props.Size == "sm"),
|
|
||||||
templ.KV("range-lg", props.Size == "lg"),
|
|
||||||
templ.KV("range-xl", props.Size == "xl"),
|
|
||||||
}
|
|
||||||
step={ fmt.Sprintf("%d", props.Step) }
|
|
||||||
data-bind-value
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-full max-w-7"
|
|
||||||
data-text="$value"
|
|
||||||
></div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user