Files
nebula/pkg/wa/combobox_templ.go

1013 lines
36 KiB
Go

// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.960
// Code generated by wa-generator. DO NOT EDIT.
// Source: Web Awesome wa-combobox
package wa
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import (
"github.com/a-h/templ"
)
// Comboboxes combine a text input with a listbox, allowing users to filter and select from predefined options or enter ...
//
// Web Awesome component: <wa-combobox>
// ComboboxProps holds all properties for the wa-combobox component
type ComboboxProps struct {
// The name of the combobox, submitted as a name/value pair with form data.
Name string `attr:"name"`
// The combobox's value. This will be a string for single select or an array for multi-select.
Value string `attr:"value"`
// The combobox's size.
// Valid values: "small", "medium", "large"
Size string `attr:"size"`
// Placeholder text to show as a hint when the combobox is empty.
Placeholder string `attr:"placeholder"`
// Allows more than one option to be selected.
Multiple bool `attr:"multiple"`
// The maximum number of selected options to show when multiple is true. After the maximum, "+n" will be shown to
MaxOptionsVisible float64 `attr:"max-options-visible"`
// Disables the combobox control.
Disabled bool `attr:"disabled"`
// Adds a clear button when the combobox is not empty.
WithClear bool `attr:"with-clear"`
// Indicates whether or not the combobox is open. You can toggle this attribute to show and hide the menu, or you can
Open bool `attr:"open"`
// The combobox's visual appearance.
// Valid values: "filled", "outlined", "filled-outlined"
Appearance string `attr:"appearance"`
// Draws a pill-style combobox with rounded edges.
Pill bool `attr:"pill"`
// The combobox's label. If you need to display HTML, use the label slot instead.
Label string `attr:"label"`
// The preferred placement of the combobox's menu. Note that the actual placement may vary as needed to keep the
// Valid values: "top", "bottom"
Placement string `attr:"placement"`
// The combobox's hint. If you need to display HTML, use the hint slot instead.
Hint string `attr:"hint"`
// Used for SSR purposes when a label is slotted in. Will show the label on first render.
WithLabel bool `attr:"with-label"`
// Used for SSR purposes when hint is slotted in. Will show the hint on first render.
WithHint bool `attr:"with-hint"`
// The combobox's required attribute.
Required bool `attr:"required"`
// The autocomplete behavior of the combobox.
// Valid values: "list", "none"
Autocomplete string `attr:"autocomplete"`
// When true, allows the user to enter a value that doesn't match any of the options. Only applies to single-select
AllowCustomValue bool `attr:"allow-custom-value"`
// Events
// Emitted when the control receives input.
OnInput string `attr:"x-on:input"`
// Emitted when the control's value changes.
OnChange string `attr:"x-on:change"`
// Emitted when the control gains focus.
OnFocus string `attr:"x-on:focus"`
// Emitted when the control loses focus.
OnBlur string `attr:"x-on:blur"`
// Emitted when the control's value is cleared.
OnClear string `attr:"x-on:wa-clear"`
// Emitted when the combobox's menu opens.
OnShow string `attr:"x-on:wa-show"`
// Emitted after the combobox's menu opens and all animations are complete.
OnAfterShow string `attr:"x-on:wa-after-show"`
// Emitted when the combobox's menu closes.
OnHide string `attr:"x-on:wa-hide"`
// Emitted after the combobox's menu closes and all animations are complete.
OnAfterHide string `attr:"x-on:wa-after-hide"`
// Emitted when the form control has been checked for validity and its constraints aren't satisfied.
OnInvalid string `attr:"x-on:wa-invalid"`
// Slots contains named slot content
Slots ComboboxSlots
// Attrs contains additional HTML attributes
Attrs templ.Attributes
}
// ComboboxSlots holds named slot content for the component
type ComboboxSlots struct {
// The input's label. Alternatively, you can use the label attribute.
Label templ.Component
// An element, such as <wa-icon>, placed at the start of the combobox.
Start templ.Component
// An element, such as <wa-icon>, placed at the end of the combobox.
End templ.Component
// An icon to use in lieu of the default clear icon.
ClearIcon templ.Component
// The icon to show when the control is expanded and collapsed. Rotates on open and close.
ExpandIcon templ.Component
// Text that describes how to use the input. Alternatively, you can use the hint attribute.
Hint templ.Component
}
// ComboboxBuilder provides a fluent API for constructing ComboboxProps
type ComboboxBuilder struct {
props ComboboxProps
}
// NewCombobox creates a new builder for wa-combobox
func NewCombobox() *ComboboxBuilder {
return &ComboboxBuilder{}
}
// Name sets the name attribute
// The name of the combobox, submitted as a name/value pair with form data.
func (b *ComboboxBuilder) Name(v string) *ComboboxBuilder {
b.props.Name = v
return b
}
// Value sets the value attribute
// The combobox's value. This will be a string for single select or an array for multi-select.
func (b *ComboboxBuilder) Value(v string) *ComboboxBuilder {
b.props.Value = v
return b
}
// Size sets the size attribute
// The combobox's size.
func (b *ComboboxBuilder) Size(v string) *ComboboxBuilder {
b.props.Size = v
return b
}
// Placeholder sets the placeholder attribute
// Placeholder text to show as a hint when the combobox is empty.
func (b *ComboboxBuilder) Placeholder(v string) *ComboboxBuilder {
b.props.Placeholder = v
return b
}
// Multiple sets the multiple attribute
// Allows more than one option to be selected.
func (b *ComboboxBuilder) Multiple(v bool) *ComboboxBuilder {
b.props.Multiple = v
return b
}
// MaxOptionsVisible sets the max-options-visible attribute
// The maximum number of selected options to show when multiple is true. After the maximum, "+n" will be shown to
func (b *ComboboxBuilder) MaxOptionsVisible(v float64) *ComboboxBuilder {
b.props.MaxOptionsVisible = v
return b
}
// Disabled sets the disabled attribute
// Disables the combobox control.
func (b *ComboboxBuilder) Disabled(v bool) *ComboboxBuilder {
b.props.Disabled = v
return b
}
// WithClear sets the with-clear attribute
// Adds a clear button when the combobox is not empty.
func (b *ComboboxBuilder) WithClear(v bool) *ComboboxBuilder {
b.props.WithClear = v
return b
}
// Open sets the open attribute
// Indicates whether or not the combobox is open. You can toggle this attribute to show and hide the menu, or you can
func (b *ComboboxBuilder) Open(v bool) *ComboboxBuilder {
b.props.Open = v
return b
}
// Appearance sets the appearance attribute
// The combobox's visual appearance.
func (b *ComboboxBuilder) Appearance(v string) *ComboboxBuilder {
b.props.Appearance = v
return b
}
// Pill sets the pill attribute
// Draws a pill-style combobox with rounded edges.
func (b *ComboboxBuilder) Pill(v bool) *ComboboxBuilder {
b.props.Pill = v
return b
}
// Label sets the label attribute
// The combobox's label. If you need to display HTML, use the label slot instead.
func (b *ComboboxBuilder) Label(v string) *ComboboxBuilder {
b.props.Label = v
return b
}
// Placement sets the placement attribute
// The preferred placement of the combobox's menu. Note that the actual placement may vary as needed to keep the
func (b *ComboboxBuilder) Placement(v string) *ComboboxBuilder {
b.props.Placement = v
return b
}
// Hint sets the hint attribute
// The combobox's hint. If you need to display HTML, use the hint slot instead.
func (b *ComboboxBuilder) Hint(v string) *ComboboxBuilder {
b.props.Hint = v
return b
}
// WithLabel sets the with-label attribute
// Used for SSR purposes when a label is slotted in. Will show the label on first render.
func (b *ComboboxBuilder) WithLabel(v bool) *ComboboxBuilder {
b.props.WithLabel = v
return b
}
// WithHint sets the with-hint attribute
// Used for SSR purposes when hint is slotted in. Will show the hint on first render.
func (b *ComboboxBuilder) WithHint(v bool) *ComboboxBuilder {
b.props.WithHint = v
return b
}
// Required sets the required attribute
// The combobox's required attribute.
func (b *ComboboxBuilder) Required(v bool) *ComboboxBuilder {
b.props.Required = v
return b
}
// Autocomplete sets the autocomplete attribute
// The autocomplete behavior of the combobox.
func (b *ComboboxBuilder) Autocomplete(v string) *ComboboxBuilder {
b.props.Autocomplete = v
return b
}
// AllowCustomValue sets the allow-custom-value attribute
// When true, allows the user to enter a value that doesn't match any of the options. Only applies to single-select
func (b *ComboboxBuilder) AllowCustomValue(v bool) *ComboboxBuilder {
b.props.AllowCustomValue = v
return b
}
// OnInput sets the handler for input event
// Emitted when the control receives input.
func (b *ComboboxBuilder) OnInput(handler string) *ComboboxBuilder {
b.props.OnInput = handler
return b
}
// OnChange sets the handler for change event
// Emitted when the control's value changes.
func (b *ComboboxBuilder) OnChange(handler string) *ComboboxBuilder {
b.props.OnChange = handler
return b
}
// OnFocus sets the handler for focus event
// Emitted when the control gains focus.
func (b *ComboboxBuilder) OnFocus(handler string) *ComboboxBuilder {
b.props.OnFocus = handler
return b
}
// OnBlur sets the handler for blur event
// Emitted when the control loses focus.
func (b *ComboboxBuilder) OnBlur(handler string) *ComboboxBuilder {
b.props.OnBlur = handler
return b
}
// OnClear sets the handler for wa-clear event
// Emitted when the control's value is cleared.
func (b *ComboboxBuilder) OnClear(handler string) *ComboboxBuilder {
b.props.OnClear = handler
return b
}
// OnShow sets the handler for wa-show event
// Emitted when the combobox's menu opens.
func (b *ComboboxBuilder) OnShow(handler string) *ComboboxBuilder {
b.props.OnShow = handler
return b
}
// OnAfterShow sets the handler for wa-after-show event
// Emitted after the combobox's menu opens and all animations are complete.
func (b *ComboboxBuilder) OnAfterShow(handler string) *ComboboxBuilder {
b.props.OnAfterShow = handler
return b
}
// OnHide sets the handler for wa-hide event
// Emitted when the combobox's menu closes.
func (b *ComboboxBuilder) OnHide(handler string) *ComboboxBuilder {
b.props.OnHide = handler
return b
}
// OnAfterHide sets the handler for wa-after-hide event
// Emitted after the combobox's menu closes and all animations are complete.
func (b *ComboboxBuilder) OnAfterHide(handler string) *ComboboxBuilder {
b.props.OnAfterHide = handler
return b
}
// OnInvalid sets the handler for wa-invalid event
// Emitted when the form control has been checked for validity and its constraints aren't satisfied.
func (b *ComboboxBuilder) OnInvalid(handler string) *ComboboxBuilder {
b.props.OnInvalid = handler
return b
}
// LabelSlot sets the label slot content
// The input's label. Alternatively, you can use the label attribute.
func (b *ComboboxBuilder) LabelSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.Label = c
return b
}
// StartSlot sets the start slot content
// An element, such as <wa-icon>, placed at the start of the combobox.
func (b *ComboboxBuilder) StartSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.Start = c
return b
}
// EndSlot sets the end slot content
// An element, such as <wa-icon>, placed at the end of the combobox.
func (b *ComboboxBuilder) EndSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.End = c
return b
}
// ClearIconSlot sets the clear-icon slot content
// An icon to use in lieu of the default clear icon.
func (b *ComboboxBuilder) ClearIconSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.ClearIcon = c
return b
}
// ExpandIconSlot sets the expand-icon slot content
// The icon to show when the control is expanded and collapsed. Rotates on open and close.
func (b *ComboboxBuilder) ExpandIconSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.ExpandIcon = c
return b
}
// HintSlot sets the hint slot content
// Text that describes how to use the input. Alternatively, you can use the hint attribute.
func (b *ComboboxBuilder) HintSlot(c templ.Component) *ComboboxBuilder {
b.props.Slots.Hint = c
return b
}
// Attr adds a custom HTML attribute
func (b *ComboboxBuilder) Attr(name, value string) *ComboboxBuilder {
if b.props.Attrs == nil {
b.props.Attrs = templ.Attributes{}
}
b.props.Attrs[name] = value
return b
}
// Attrs merges multiple attributes
func (b *ComboboxBuilder) Attrs(attrs templ.Attributes) *ComboboxBuilder {
if b.props.Attrs == nil {
b.props.Attrs = templ.Attributes{}
}
for k, v := range attrs {
b.props.Attrs[k] = v
}
return b
}
// Props returns the built properties
func (b *ComboboxBuilder) Props() ComboboxProps {
return b.props
}
// Build returns the props (alias for Props for semantic clarity)
func (b *ComboboxBuilder) Build() ComboboxProps {
return b.props
}
// Combobox renders the wa-combobox component
func Combobox(props ComboboxProps) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<wa-combobox")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if props.Name != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(props.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 393, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Value != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(props.Value)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 396, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Size != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " size=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(props.Size)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 399, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Placeholder != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(props.Placeholder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 402, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Multiple {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " multiple")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.MaxOptionsVisible != 0 {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " max-options-visible=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(templ.Sprintf("%v", props.MaxOptionsVisible))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 408, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Disabled {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " disabled")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.WithClear {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " with-clear")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Open {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " open")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Appearance != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " appearance=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(props.Appearance)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 420, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Pill {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " pill")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Label != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " label=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(props.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 426, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Placement != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, " placement=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(props.Placement)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 429, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Hint != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, " hint=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(props.Hint)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 432, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.WithLabel {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " with-label")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.WithHint {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " with-hint")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Required {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, " required")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Autocomplete != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " autocomplete=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(props.Autocomplete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 444, Col: 36}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.AllowCustomValue {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " allow-custom-value")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnInput != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, " x-on:input=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnInput)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 450, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnChange != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, " x-on:change=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnChange)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 453, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnFocus != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, " x-on:focus=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnFocus)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 456, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnBlur != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, " x-on:blur=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnBlur)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 459, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnClear != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, " x-on:wa-clear=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnClear)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 462, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnShow != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, " x-on:wa-show=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnShow)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 465, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnAfterShow != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, " x-on:wa-after-show=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnAfterShow)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 468, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnHide != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, " x-on:wa-hide=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnHide)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 471, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnAfterHide != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, " x-on:wa-after-hide=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnAfterHide)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 474, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.OnInvalid != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, " x-on:wa-invalid=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(props.OnInvalid)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/wa/combobox.templ`, Line: 477, Col: 36}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templ.RenderAttributes(ctx, templ_7745c5c3_Buffer, props.Attrs)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if props.Slots.Label != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<div slot=\"label\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.Label.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Slots.Start != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<div slot=\"start\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.Start.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Slots.End != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<div slot=\"end\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.End.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Slots.ClearIcon != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<div slot=\"clear-icon\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.ClearIcon.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Slots.ExpandIcon != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<div slot=\"expand-icon\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.ExpandIcon.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if props.Slots.Hint != nil {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<div slot=\"hint\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = props.Slots.Hint.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</wa-combobox>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
// ComboboxFunc renders with a builder function for inline configuration
func ComboboxFunc(fn func(*ComboboxBuilder)) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
b := NewCombobox()
fn(b)
templ_7745c5c3_Var23 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
templ_7745c5c3_Err = Combobox(b.Props()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var23), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
var _ = templruntime.GeneratedTemplate