modified: web/components/base/input.templ modified: web/components/base/input_templ.go modified: web/components/base/range.templ modified: web/components/base/range_templ.go modified: web/components/base/select.templ modified: web/components/base/select_templ.go modified: web/components/base/textarea.templ modified: web/components/base/textarea_templ.go modified: web/components/icons.templ modified: web/components/icons_templ.go modified: web/components/issue.templ modified: web/components/issue_templ.go modified: web/components/layout.templ modified: web/components/layout_templ.go new file: web/components/sidebar.templ new file: web/components/sidebar_templ.go new file: web/components/status.templ new file: web/components/status_templ.go modified: web/handler/issues.go new file: web/handler/task.go modified: web/input.css deleted: web/package-lock.json deleted: web/package.json modified: web/routes/layout.templ modified: web/routes/layout_templ.go modified: web/server/routes.go modified: web/server/server.go modified: web/web.go
54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
package base
|
|
|
|
import "fmt"
|
|
|
|
type RangeProps struct {
|
|
ID string
|
|
Label string
|
|
Name string
|
|
Value int
|
|
Min int
|
|
Max int
|
|
Step int
|
|
Class string
|
|
Size string
|
|
}
|
|
|
|
templ Range(props RangeProps) {
|
|
<div class="form-control">
|
|
<label
|
|
for={ props.Name }
|
|
class="label space-x-1 w-full"
|
|
x-data={ 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"
|
|
id={ props.Name }
|
|
name={ props.Name }
|
|
min={ fmt.Sprintf("%d", props.Min) }
|
|
max={ fmt.Sprintf("%d", props.Max) }
|
|
x-model="value"
|
|
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) }
|
|
/>
|
|
<div x-text="value" class="w-full max-w-7"></div>
|
|
</label>
|
|
</div>
|
|
}
|