ui

package
v1.9.1-0...-6c713e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldSelect         string = "Select"
	FieldEmail          string = "Email"
	FieldInput          string = "Input"
	FieldPassword       string = "Password"
	FieldTextArea       string = "TextArea"
	FieldSwitch         string = "Switch"
	FieldCheckbox       string = "Checkbox"
	FieldRadioButton    string = "RadioButton"
	FieldConsole        string = "Console"
	FieldButton         string = "Button"
	ValidatorDigitsOnly string = "digitsOnly"

	ButtonSubmit string = "Submit"
	ButtonCancel string = "Cancel"

	ButtonDialogClose string = "CloseDialog"
	ButtonDialogOk    string = "OkDialog"
)

GenericField holds common field properties.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field interface {
	GetType() string
}

Field is an interface that all specific field types implement.

type Form

type Form struct {
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Fields      [][]FormField `json:"fields"`
}

func (*Form) ToJSON

func (f *Form) ToJSON() string

func (*Form) UnmarshalJSON

func (f *Form) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshals JSON data into a Form.

type FormField

type FormField struct {
	Key         string       `json:"key"`
	Type        string       `json:"type"`
	Label       string       `json:"label,omitempty"`
	LabelHidden bool         `json:"labelHidden"`
	Required    bool         `json:"required,omitempty"`
	Placeholder string       `json:"placeholder,omitempty"`
	Readonly    bool         `json:"readonly,omitempty"`
	Value       string       `json:"value"`
	Validator   string       `json:"validator,omitempty"`
	Items       []SelectItem `json:"items,omitempty"`
	Lines       int          `json:"lines,omitempty"`
}

FormField extends GenericField with additional common properties.

func (FormField) GetType

func (gf FormField) GetType() string

GetType returns the type of the field.

type InputField

type InputField struct {
	FormField
	Validator string `json:"validator,omitempty"`
}

type SelectItem

type SelectItem struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL