Documentation ¶
Index ¶
- Variables
- func NumberField(n any) interfaces.FormField
- func TagMapToElementAttributes(t tags.TagMap, fields ...string) string
- type BoolField
- func (i *BoolField) FormValues(v []string) error
- func (i BoolField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i BoolField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *BoolField) Scan(src interface{}) error
- func (i BoolField) Value() (driver.Value, error)
- type CheckBoxField
- func (i *CheckBoxField) FormValues(v []string) error
- func (i CheckBoxField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i CheckBoxField) LabelHTML(_ *request.Request, name string, display string, tags tags.TagMap) interfaces.Element
- func (i *CheckBoxField) Scan(src interface{}) error
- func (i CheckBoxField) Value() (driver.Value, error)
- type DateField
- func (i *DateField) FormValues(v []string) error
- func (i DateField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i DateField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *DateField) Scan(src interface{}) error
- func (i DateField) Value() (driver.Value, error)
- type DateTimeField
- func (i *DateTimeField) FormValues(v []string) error
- func (i DateTimeField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i DateTimeField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *DateTimeField) Scan(src interface{}) error
- func (i DateTimeField) Value() (driver.Value, error)
- type DoubleMultipleSelectField
- func (i *DoubleMultipleSelectField) FormValues(v []string) error
- func (i *DoubleMultipleSelectField) Initial(r *request.Request, model any, fieldName string)
- func (i DoubleMultipleSelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i DoubleMultipleSelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *DoubleMultipleSelectField) Scan(src interface{}) error
- func (i DoubleMultipleSelectField) Value() (driver.Value, error)
- func (i DoubleMultipleSelectField) Values() []string
- type ElementType
- type FileField
- func (i *FileField) FormFiles(files []interfaces.File) error
- func (i FileField) InputHTML(r *request.Request, form_name string, tags tags.TagMap) interfaces.Element
- func (i FileField) LabelHTML(r *request.Request, form_name, display_text string, tags tags.TagMap) interfaces.Element
- func (i FileField) ListDisplay() string
- func (i *FileField) Save(filer fs.Filer, media_url, pathInFiler string) error
- func (i *FileField) Scan(value interface{}) error
- func (i FileField) String() string
- func (i FileField) Value() (driver.Value, error)
- type FloatField
- func (i *FloatField) FormValues(v []string) error
- func (i FloatField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i FloatField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *FloatField) Scan(src interface{}) error
- func (i FloatField) Value() (driver.Value, error)
- type FormFile
- type IntField
- func (i *IntField) FormValues(v []string) error
- func (i IntField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i IntField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *IntField) Scan(src interface{}) error
- func (i IntField) Value() (driver.Value, error)
- type MultipleSelectField
- func (i *MultipleSelectField) FormValues(v []string) error
- func (i *MultipleSelectField) Initial(r *request.Request, model any, fieldName string)
- func (i MultipleSelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i MultipleSelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *MultipleSelectField) Scan(src interface{}) error
- func (i MultipleSelectField) Value() (driver.Value, error)
- type Option
- type SelectField
- func (i *SelectField) FormValues(v []string) error
- func (i *SelectField) Initial(r *request.Request, model any, fieldName string)
- func (i SelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i SelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *SelectField) Scan(src interface{}) error
- func (i SelectField) Value() (driver.Value, error)
- type SliceField
- func (i *SliceField[T]) FormValues(v []string) error
- func (i *SliceField[T]) Initial(r *request.Request, model any, fieldName string)
- func (i SliceField[T]) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i SliceField[T]) LabelHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i *SliceField[T]) Scan(src interface{}) error
- func (i SliceField[T]) Value() (driver.Value, error)
- type StringField
- func (i *StringField) FormValues(v []string) error
- func (i StringField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i StringField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *StringField) Scan(src interface{}) error
- func (i StringField) Value() (driver.Value, error)
- type TextField
- func (i *TextField) FormValues(v []string) error
- func (i TextField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
- func (i TextField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
- func (i *TextField) Scan(src interface{}) error
- func (i TextField) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AllTagsInput = []string{
"class",
"style",
"placeholder",
"rows",
"cols",
"selected",
"multiple",
"disabled",
"readonly",
"required",
"autofocus",
"autocomplete",
"min",
"max",
"step",
}
excludes the name, selected, value, type
View Source
var AllTagsLabel = []string{
"labelclass",
"labelid",
"labelstyle",
}
Functions ¶
func NumberField ¶
func NumberField(n any) interfaces.FormField
Types ¶
type BoolField ¶
type BoolField bool
func (*BoolField) FormValues ¶
type CheckBoxField ¶
type CheckBoxField []string
func (*CheckBoxField) FormValues ¶
func (i *CheckBoxField) FormValues(v []string) error
func (CheckBoxField) InputHTML ¶
func (i CheckBoxField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (CheckBoxField) LabelHTML ¶
func (i CheckBoxField) LabelHTML(_ *request.Request, name string, display string, tags tags.TagMap) interfaces.Element
func (*CheckBoxField) Scan ¶
func (i *CheckBoxField) Scan(src interface{}) error
type DateField ¶
func (*DateField) FormValues ¶
type DateTimeField ¶
func (*DateTimeField) FormValues ¶
func (i *DateTimeField) FormValues(v []string) error
func (DateTimeField) InputHTML ¶
func (i DateTimeField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (DateTimeField) LabelHTML ¶
func (i DateTimeField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*DateTimeField) Scan ¶
func (i *DateTimeField) Scan(src interface{}) error
type DoubleMultipleSelectField ¶
type DoubleMultipleSelectField struct { Left []interfaces.Option `json:"left"` // Left values will be stored on the database! Right []interfaces.Option `json:"-"` // Right will not be stored in the database! }
When using this field with the forms, you should fill the right and left values.
The left values will be stored on the database, and the values on the right will not be stored.
func (*DoubleMultipleSelectField) FormValues ¶
func (i *DoubleMultipleSelectField) FormValues(v []string) error
func (*DoubleMultipleSelectField) Initial ¶
func (i *DoubleMultipleSelectField) Initial(r *request.Request, model any, fieldName string)
func (DoubleMultipleSelectField) InputHTML ¶
func (i DoubleMultipleSelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (DoubleMultipleSelectField) LabelHTML ¶
func (i DoubleMultipleSelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*DoubleMultipleSelectField) Scan ¶
func (i *DoubleMultipleSelectField) Scan(src interface{}) error
func (DoubleMultipleSelectField) Value ¶
func (i DoubleMultipleSelectField) Value() (driver.Value, error)
func (DoubleMultipleSelectField) Values ¶
func (i DoubleMultipleSelectField) Values() []string
type ElementType ¶
type ElementType string
func (ElementType) HTML ¶
func (e ElementType) HTML() template.HTML
func (ElementType) String ¶
func (e ElementType) String() string
type FileField ¶
type FileField struct { Path string `json:"path"` URL string `json:"url"` File interfaces.File `json:"-"` }
Easily create files inside of forms.
FileField will save as JSON inside a database.
func (FileField) ListDisplay ¶
type FloatField ¶
type FloatField float64
func (*FloatField) FormValues ¶
func (i *FloatField) FormValues(v []string) error
func (FloatField) InputHTML ¶
func (i FloatField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (FloatField) LabelHTML ¶
func (i FloatField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*FloatField) Scan ¶
func (i *FloatField) Scan(src interface{}) error
type IntField ¶
type IntField int64
func (*IntField) FormValues ¶
type MultipleSelectField ¶
type MultipleSelectField []string
func (*MultipleSelectField) FormValues ¶
func (i *MultipleSelectField) FormValues(v []string) error
func (*MultipleSelectField) Initial ¶
func (i *MultipleSelectField) Initial(r *request.Request, model any, fieldName string)
func (MultipleSelectField) InputHTML ¶
func (i MultipleSelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (MultipleSelectField) LabelHTML ¶
func (i MultipleSelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*MultipleSelectField) Scan ¶
func (i *MultipleSelectField) Scan(src interface{}) error
type SelectField ¶
type SelectField []string
func (*SelectField) FormValues ¶
func (i *SelectField) FormValues(v []string) error
func (*SelectField) Initial ¶
func (i *SelectField) Initial(r *request.Request, model any, fieldName string)
func (SelectField) InputHTML ¶
func (i SelectField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (SelectField) LabelHTML ¶
func (i SelectField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*SelectField) Scan ¶
func (i *SelectField) Scan(src interface{}) error
type SliceField ¶
type SliceField[T any] []T
func (*SliceField[T]) FormValues ¶
func (i *SliceField[T]) FormValues(v []string) error
func (*SliceField[T]) Initial ¶
func (i *SliceField[T]) Initial(r *request.Request, model any, fieldName string)
func (SliceField[T]) InputHTML ¶
func (i SliceField[T]) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (SliceField[T]) LabelHTML ¶
func (i SliceField[T]) LabelHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (*SliceField[T]) Scan ¶
func (i *SliceField[T]) Scan(src interface{}) error
type StringField ¶
type StringField string
func (*StringField) FormValues ¶
func (i *StringField) FormValues(v []string) error
func (StringField) InputHTML ¶
func (i StringField) InputHTML(_ *request.Request, name string, tags tags.TagMap) interfaces.Element
func (StringField) LabelHTML ¶
func (i StringField) LabelHTML(_ *request.Request, name string, display_text string, tags tags.TagMap) interfaces.Element
func (*StringField) Scan ¶
func (i *StringField) Scan(src interface{}) error
Click to show internal directories.
Click to hide internal directories.