Documentation
¶
Overview ¶
templ: version: v0.3.1020
Index ¶
- Variables
- func NewAppConfig() *apps.AppConfig
- func RenderTelepathAdapterHTML(ctx context.Context, obj widgets.Widget) []interface{}
- type BaseBlock
- func (b *BaseBlock) Adapter(ctx context.Context) telepath.Adapter
- func (b *BaseBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (b *BaseBlock) Field() fields.Field
- func (b *BaseBlock) FormContext(name string, value interface{}, context ctx.Context) *BlockContext
- func (b *BaseBlock) GetDefault() interface{}
- func (b *BaseBlock) HasChanged(initial, data interface{}) bool
- func (b *BaseBlock) HelpText(ctx context.Context) string
- func (b *BaseBlock) Label(ctx context.Context) string
- func (b *BaseBlock) Media() media.Media
- func (b *BaseBlock) Name() string
- func (b *BaseBlock) Render(ctx context.Context, w io.Writer, value interface{}, context ctx.Context) error
- func (b *BaseBlock) RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (b *BaseBlock) SetDefault(def interface{})
- func (b *BaseBlock) SetField(field fields.Field)
- func (b *BaseBlock) SetHelpText(helpText any)
- func (b *BaseBlock) SetLabel(label any)
- func (b *BaseBlock) SetName(name string)
- func (b *BaseBlock) Validate(ctx context.Context, value interface{}) []error
- func (b *BaseBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
- func (b *BaseBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
- func (b *BaseBlock) ValueFromDataDict(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) (interface{}, []error)
- func (b *BaseBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) bool
- func (b *BaseBlock) ValueToForm(value interface{}) interface{}
- func (b *BaseBlock) ValueToGo(value interface{}) (interface{}, error)
- type BaseBlockValidationError
- func (m *BaseBlockValidationError[T]) AddError(key T, err ...error) *BaseBlockValidationError[T]
- func (m *BaseBlockValidationError[T]) AddNonBlockError(err error)
- func (m *BaseBlockValidationError[T]) Error() string
- func (m *BaseBlockValidationError[T]) Get(key T) []error
- func (m *BaseBlockValidationError[T]) HasErrors() bool
- func (m *BaseBlockValidationError[T]) Len() int
- func (m *BaseBlockValidationError[T]) MarshalJSON() ([]byte, error)
- type Block
- type BlockContext
- type BlockFormField
- func (bw *BlockFormField) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (bw *BlockFormField) Default() interface{}
- func (bw *BlockFormField) HasChanged(initial, data interface{}) bool
- func (bw *BlockFormField) SetHelpText(helpText func(ctx context.Context) string)
- func (bw *BlockFormField) SetLabel(label func(ctx context.Context) string)
- func (bw *BlockFormField) Validate(ctx context.Context, value interface{}) []error
- func (bw *BlockFormField) ValueToForm(value interface{}) interface{}
- func (bw *BlockFormField) ValueToGo(value interface{}) (interface{}, error)
- type BlockWidget
- func (bw *BlockWidget) BindField(field forms.Field)
- func (bw *BlockWidget) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (bw *BlockWidget) Field() forms.Field
- func (bw *BlockWidget) FormType() string
- func (bw *BlockWidget) GetContextData(c context.Context, id, name string, value interface{}, attrs map[string]string) ctx.Context
- func (bw *BlockWidget) Hide(hidden bool)
- func (bw *BlockWidget) IdForLabel(name string) string
- func (bw *BlockWidget) IsHidden() bool
- func (bw *BlockWidget) Media() media.Media
- func (bw *BlockWidget) Render(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (bw *BlockWidget) RenderWithErrors(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (bw *BlockWidget) SetAttrs(attrs map[string]string)
- func (bw *BlockWidget) Validate(ctx context.Context, value interface{}) []error
- func (bw *BlockWidget) ValueFromDataDict(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) (interface{}, []error)
- func (bw *BlockWidget) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) bool
- func (bw *BlockWidget) ValueToForm(value interface{}) interface{}
- func (bw *BlockWidget) ValueToGo(value interface{}) (interface{}, error)
- type BoundBlockValue
- type BoundValue
- func (l *BoundValue[T]) BindToModel(model attrs.Definer, field attrs.Field) error
- func (l *BoundValue[T]) Block() Block
- func (l *BoundValue[T]) DBType() dbtype.Type
- func (l *BoundValue[T]) Data() interface{}
- func (l *BoundValue[T]) GoString() string
- func (l *BoundValue[T]) LoadData(raw json.RawMessage) error
- func (l *BoundValue[T]) MarshalJSON() ([]byte, error)
- func (l *BoundValue[T]) Render(c context.Context, w io.Writer, ctxt ctx.Context) error
- func (l *BoundValue[T]) Scan(value interface{}) (err error)
- func (l *BoundValue[T]) String() string
- func (l *BoundValue[T]) UnmarshalJSON(data []byte) error
- func (l BoundValue[T]) Value() (driver.Value, error)
- type FieldBlock
- func CharBlock(opts ...func(*FieldBlock)) *FieldBlock
- func DateBlock(opts ...func(*FieldBlock)) *FieldBlock
- func DateTimeBlock(opts ...func(*FieldBlock)) *FieldBlock
- func EmailBlock(opts ...func(*FieldBlock)) *FieldBlock
- func FormFieldBlock(field fields.Field, datatype any, opts ...func(*FieldBlock)) *FieldBlock
- func NewFieldBlock(opts ...func(*FieldBlock)) *FieldBlock
- func NumberBlock(opts ...func(*FieldBlock)) *FieldBlock
- func PasswordBlock(opts ...func(*FieldBlock)) *FieldBlock
- func TextBlock(opts ...func(*FieldBlock)) *FieldBlock
- func (b *FieldBlock) Adapter(ctx context.Context) telepath.Adapter
- func (b *FieldBlock) RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (b *FieldBlock) RenderTempl(id, name string, value interface{}, telepath string, errors []error, ...) templ.Component
- type FieldBlockValue
- type JSONListBlockData
- type JSONStreamBlockData
- type Length
- type ListBlock
- func (m *ListBlock) Adapter(ctx context.Context) telepath.Adapter
- func (l *ListBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (l *ListBlock) GetDefault() interface{}
- func (l *ListBlock) HasChanged(initial, data interface{}) bool
- func (l *ListBlock) MaxNum() int
- func (l *ListBlock) MinNum() int
- func (b *ListBlock) Render(ctx context.Context, w io.Writer, value interface{}, context ctx.Context) error
- func (l *ListBlock) RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (l *ListBlock) RenderTempl(id, name string, valueArr *ListBlockValue, telepath string, ...) templ.Component
- func (l *ListBlock) Validate(ctx context.Context, value interface{}) []error
- func (l *ListBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
- func (s *ListBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
- func (l *ListBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, ...) (interface{}, []error)
- func (b *ListBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) bool
- func (l *ListBlock) ValueToForm(value interface{}) interface{}
- func (l *ListBlock) ValueToGo(value interface{}) (interface{}, error)
- type ListBlockData
- type ListBlockValue
- type OptFunc
- func WithBlockField[T Block](name string, block Block) OptFunc[T]
- func WithDefault[T Block](def interface{}) OptFunc[T]
- func WithHelpText[T Block](text any) OptFunc[T]
- func WithLabel[T Block](label any) OptFunc[T]
- func WithMax[T Block](max int) OptFunc[T]
- func WithMin[T Block](min int) OptFunc[T]
- func WithTemplate[T Block](template string) OptFunc[T]
- func WithValidators[T any](validators ...func(context.Context, interface{}) error) OptFunc[T]
- type RenderableValue
- type StreamBlock
- func (m *StreamBlock) Adapter(ctx context.Context) telepath.Adapter
- func (l *StreamBlock) AddField(name string, block Block)
- func (l *StreamBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (l *StreamBlock) HasChanged(initial, data interface{}) bool
- func (l *StreamBlock) MaxNum() int
- func (l *StreamBlock) MinNum() int
- func (b *StreamBlock) Render(ctx context.Context, w io.Writer, value interface{}, context ctx.Context) error
- func (l *StreamBlock) RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (s *StreamBlock) RenderTempl(id, name string, valueArr *StreamBlockValue, telepath string, ...) templ.Component
- func (l *StreamBlock) Validate(ctx context.Context, value interface{}) []error
- func (l *StreamBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
- func (s *StreamBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
- func (l *StreamBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, ...) (interface{}, []error)
- func (b *StreamBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) bool
- func (l *StreamBlock) ValueToForm(value interface{}) interface{}
- func (l *StreamBlock) ValueToGo(value interface{}) (interface{}, error)
- type StreamBlockData
- type StreamBlockValue
- type StructBlock
- func (m *StructBlock) Adapter(ctx context.Context) telepath.Adapter
- func (m *StructBlock) AddField(name string, block Block)
- func (m *StructBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
- func (m *StructBlock) Field() fields.Field
- func (m *StructBlock) GetDefault() interface{}
- func (m *StructBlock) HasChanged(initial, data interface{}) bool
- func (m *StructBlock) Name() string
- func (b *StructBlock) Render(ctx context.Context, w io.Writer, value interface{}, context ctx.Context) error
- func (m *StructBlock) RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, ...) error
- func (b *StructBlock) RenderTempl(id, name string, valueMap map[string]interface{}, telepath string, ...) templ.Component
- func (m *StructBlock) SetName(name string)
- func (m *StructBlock) Validate(ctx context.Context, value interface{}) []error
- func (l *StructBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
- func (s *StructBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
- func (m *StructBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, ...) (interface{}, []error)
- func (m *StructBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, ...) bool
- func (m *StructBlock) ValueToForm(value interface{}) interface{}
- func (m *StructBlock) ValueToGo(value interface{}) (interface{}, error)
- type StructBlockValue
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AppConfig *apps.AppConfig
)
View Source
var (
JSContext = telepath.NewContext()
)
Functions ¶
func NewAppConfig ¶
Types ¶
type BaseBlock ¶
type BaseBlock struct {
Name_ string `json:"-"`
Template string `json:"-"`
FormField fields.Field `json:"-"`
Validators []func(context.Context, interface{}) error `json:"-"`
Default func() interface{} `json:"-"`
DataType any
ValueFromDBFunc func(b *BaseBlock, j json.RawMessage) (interface{}, error) `json:"-"`
LabelFunc func(ctx context.Context) string `json:"-"`
HelpFunc func(ctx context.Context) string `json:"-"`
}
func NewBaseBlock ¶
func (*BaseBlock) FormContext ¶
func (b *BaseBlock) FormContext(name string, value interface{}, context ctx.Context) *BlockContext
func (*BaseBlock) GetDefault ¶
func (b *BaseBlock) GetDefault() interface{}
func (*BaseBlock) HasChanged ¶ added in v1.7.2
func (*BaseBlock) RenderForm ¶
func (*BaseBlock) SetDefault ¶ added in v1.7.2
func (b *BaseBlock) SetDefault(def interface{})
func (*BaseBlock) SetHelpText ¶ added in v1.7.2
func (*BaseBlock) ValueAtPath ¶ added in v1.7.2
func (b *BaseBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
func (*BaseBlock) ValueFromDB ¶ added in v1.7.2
func (b *BaseBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
func (*BaseBlock) ValueFromDataDict ¶
func (b *BaseBlock) ValueFromDataDict(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)
func (*BaseBlock) ValueOmittedFromData ¶
func (b *BaseBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool
func (*BaseBlock) ValueToForm ¶
func (b *BaseBlock) ValueToForm(value interface{}) interface{}
type BaseBlockValidationError ¶
type BaseBlockValidationError[T comparable] struct { Errors map[T][]error NonBlockErrors []error }
func NewBlockErrors ¶
func NewBlockErrors[T comparable](errors ...error) *BaseBlockValidationError[T]
func (*BaseBlockValidationError[T]) AddError ¶
func (m *BaseBlockValidationError[T]) AddError(key T, err ...error) *BaseBlockValidationError[T]
func (*BaseBlockValidationError[T]) AddNonBlockError ¶
func (m *BaseBlockValidationError[T]) AddNonBlockError(err error)
func (*BaseBlockValidationError[T]) Error ¶
func (m *BaseBlockValidationError[T]) Error() string
func (*BaseBlockValidationError[T]) Get ¶
func (m *BaseBlockValidationError[T]) Get(key T) []error
func (*BaseBlockValidationError[T]) HasErrors ¶
func (m *BaseBlockValidationError[T]) HasErrors() bool
func (*BaseBlockValidationError[T]) Len ¶
func (m *BaseBlockValidationError[T]) Len() int
func (*BaseBlockValidationError[T]) MarshalJSON ¶
func (m *BaseBlockValidationError[T]) MarshalJSON() ([]byte, error)
type Block ¶
type Block interface {
Name() string
SetName(name string)
SetLabel(label any)
SetHelpText(helpText any)
SetDefault(def interface{})
Label(ctx context.Context) string
HelpText(ctx context.Context) string
Field() fields.Field
SetField(field fields.Field)
ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
ValueFromDB(value json.RawMessage) (interface{}, error)
RenderForm(ctx context.Context, w io.Writer, id, name string, value interface{}, errors []error, context ctx.Context) error
Render(ctx context.Context, w io.Writer, value interface{}, context ctx.Context) error
HasChanged(initial, data interface{}) bool
GetDefault() interface{}
telepath.AdapterGetter
media.MediaDefiner
widgets.FormValuer
forms.Validator
forms.Cleaner
}
type BlockContext ¶
type BlockContext struct {
Request_ *http.Request
BlockDef Block
ID string
Name string
BlockHTML template.HTML
Value interface{}
Errors []error
Attrs map[string]string
Context ctx.Context
}
func NewBlockContext ¶
func NewBlockContext(b Block, context ctx.Context) *BlockContext
func (*BlockContext) Data ¶ added in v1.7.2
func (bc *BlockContext) Data() map[string]interface{}
func (*BlockContext) Get ¶
func (bc *BlockContext) Get(name string) interface{}
func (*BlockContext) Request ¶
func (bc *BlockContext) Request() *http.Request
func (*BlockContext) Set ¶
func (bc *BlockContext) Set(name string, value interface{})
type BlockFormField ¶
func BlockField ¶
func BlockField(block Block, opts ...func(fields.Field)) *BlockFormField
func (*BlockFormField) Clean ¶
func (bw *BlockFormField) Clean(ctx context.Context, value interface{}) (interface{}, error)
func (*BlockFormField) Default ¶ added in v1.7.2
func (bw *BlockFormField) Default() interface{}
func (*BlockFormField) HasChanged ¶ added in v1.7.2
func (bw *BlockFormField) HasChanged(initial, data interface{}) bool
func (*BlockFormField) SetHelpText ¶ added in v1.7.2
func (bw *BlockFormField) SetHelpText(helpText func(ctx context.Context) string)
func (*BlockFormField) SetLabel ¶ added in v1.7.2
func (bw *BlockFormField) SetLabel(label func(ctx context.Context) string)
func (*BlockFormField) Validate ¶
func (bw *BlockFormField) Validate(ctx context.Context, value interface{}) []error
func (*BlockFormField) ValueToForm ¶
func (bw *BlockFormField) ValueToForm(value interface{}) interface{}
func (*BlockFormField) ValueToGo ¶
func (bw *BlockFormField) ValueToGo(value interface{}) (interface{}, error)
type BlockWidget ¶
func NewBlockWidget ¶
func NewBlockWidget(blockDef Block) *BlockWidget
func (*BlockWidget) BindField ¶ added in v1.7.2
func (bw *BlockWidget) BindField(field forms.Field)
func (*BlockWidget) Clean ¶
func (bw *BlockWidget) Clean(ctx context.Context, value interface{}) (interface{}, error)
func (*BlockWidget) Field ¶ added in v1.7.2
func (bw *BlockWidget) Field() forms.Field
func (*BlockWidget) FormType ¶ added in v1.6.7
func (bw *BlockWidget) FormType() string
func (*BlockWidget) GetContextData ¶
func (*BlockWidget) Hide ¶
func (bw *BlockWidget) Hide(hidden bool)
func (*BlockWidget) IdForLabel ¶
func (bw *BlockWidget) IdForLabel(name string) string
func (*BlockWidget) IsHidden ¶
func (bw *BlockWidget) IsHidden() bool
func (*BlockWidget) Media ¶
func (bw *BlockWidget) Media() media.Media
func (*BlockWidget) RenderWithErrors ¶
func (*BlockWidget) SetAttrs ¶
func (bw *BlockWidget) SetAttrs(attrs map[string]string)
func (*BlockWidget) Validate ¶
func (bw *BlockWidget) Validate(ctx context.Context, value interface{}) []error
func (*BlockWidget) ValueFromDataDict ¶
func (bw *BlockWidget) ValueFromDataDict(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)
func (*BlockWidget) ValueOmittedFromData ¶
func (bw *BlockWidget) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool
func (*BlockWidget) ValueToForm ¶
func (bw *BlockWidget) ValueToForm(value interface{}) interface{}
func (*BlockWidget) ValueToGo ¶
func (bw *BlockWidget) ValueToGo(value interface{}) (interface{}, error)
type BoundBlockValue ¶ added in v1.7.2
type BoundBlockValue interface {
Block() Block
Data() interface{}
}
type BoundValue ¶ added in v1.7.2
type BoundValue[T any] struct { BlockObject Block `json:"-"` V T `json:"-"` // contains filtered or unexported fields }
func NewBlockValue ¶ added in v1.7.2
func NewBlockValue[T any](block Block, data T) *BoundValue[T]
func (*BoundValue[T]) BindToModel ¶ added in v1.7.2
func (*BoundValue[T]) Block ¶ added in v1.7.2
func (l *BoundValue[T]) Block() Block
func (*BoundValue[T]) DBType ¶ added in v1.7.2
func (l *BoundValue[T]) DBType() dbtype.Type
func (*BoundValue[T]) Data ¶ added in v1.7.2
func (l *BoundValue[T]) Data() interface{}
func (*BoundValue[T]) GoString ¶ added in v1.7.2
func (l *BoundValue[T]) GoString() string
func (*BoundValue[T]) LoadData ¶ added in v1.7.2
func (l *BoundValue[T]) LoadData(raw json.RawMessage) error
func (*BoundValue[T]) MarshalJSON ¶ added in v1.7.2
func (l *BoundValue[T]) MarshalJSON() ([]byte, error)
func (*BoundValue[T]) Scan ¶ added in v1.7.2
func (l *BoundValue[T]) Scan(value interface{}) (err error)
func (*BoundValue[T]) String ¶ added in v1.7.2
func (l *BoundValue[T]) String() string
func (*BoundValue[T]) UnmarshalJSON ¶ added in v1.7.2
func (l *BoundValue[T]) UnmarshalJSON(data []byte) error
type FieldBlock ¶
type FieldBlock struct {
*BaseBlock
}
func CharBlock ¶
func CharBlock(opts ...func(*FieldBlock)) *FieldBlock
func DateBlock ¶
func DateBlock(opts ...func(*FieldBlock)) *FieldBlock
func DateTimeBlock ¶
func DateTimeBlock(opts ...func(*FieldBlock)) *FieldBlock
func EmailBlock ¶
func EmailBlock(opts ...func(*FieldBlock)) *FieldBlock
func FormFieldBlock ¶ added in v1.7.2
func FormFieldBlock(field fields.Field, datatype any, opts ...func(*FieldBlock)) *FieldBlock
func NewFieldBlock ¶
func NewFieldBlock(opts ...func(*FieldBlock)) *FieldBlock
func NumberBlock ¶
func NumberBlock(opts ...func(*FieldBlock)) *FieldBlock
func PasswordBlock ¶
func PasswordBlock(opts ...func(*FieldBlock)) *FieldBlock
func TextBlock ¶
func TextBlock(opts ...func(*FieldBlock)) *FieldBlock
func (*FieldBlock) RenderForm ¶
func (*FieldBlock) RenderTempl ¶
type FieldBlockValue ¶ added in v1.7.2
type FieldBlockValue = BoundValue[interface{}]
type JSONListBlockData ¶ added in v1.7.2
type JSONListBlockData struct {
ID uuid.UUID `json:"id"`
Order int `json:"order"`
Data json.RawMessage `json:"data"`
}
type JSONStreamBlockData ¶ added in v1.7.2
type JSONStreamBlockData struct {
ID uuid.UUID `json:"id"`
Type string `json:"type"`
Data json.RawMessage `json:"data"`
}
type ListBlock ¶
func NewListBlock ¶
func (*ListBlock) GetDefault ¶
func (l *ListBlock) GetDefault() interface{}
func (*ListBlock) HasChanged ¶ added in v1.7.2
func (*ListBlock) RenderForm ¶
func (*ListBlock) RenderTempl ¶
func (l *ListBlock) RenderTempl(id, name string, valueArr *ListBlockValue, telepath string, listBlockErrors *BaseBlockValidationError[int], tplCtx ctx.Context) templ.Component
func (*ListBlock) ValueAtPath ¶ added in v1.7.2
func (l *ListBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
func (*ListBlock) ValueFromDB ¶ added in v1.7.2
func (s *ListBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
func (*ListBlock) ValueFromDataDict ¶
func (l *ListBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)
func (*ListBlock) ValueOmittedFromData ¶
func (b *ListBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool
func (*ListBlock) ValueToForm ¶
func (l *ListBlock) ValueToForm(value interface{}) interface{}
type ListBlockData ¶ added in v1.7.2
type ListBlockValue ¶
type ListBlockValue = BoundValue[[]*ListBlockData]
type OptFunc ¶
type OptFunc[T any] func(T)
func WithBlockField ¶ added in v1.7.2
func WithDefault ¶ added in v1.7.2
func WithHelpText ¶
func WithTemplate ¶ added in v1.7.2
type RenderableValue ¶ added in v1.7.2
type StreamBlock ¶ added in v1.7.2
type StreamBlock struct {
*BaseBlock `json:"-"`
Children *orderedmap.OrderedMap[string, Block] `json:"-"`
Min int `json:"-"`
Max int `json:"-"`
}
func NewStreamBlock ¶ added in v1.7.2
func NewStreamBlock(opts ...func(*StreamBlock)) *StreamBlock
func (*StreamBlock) Adapter ¶ added in v1.7.2
func (m *StreamBlock) Adapter(ctx context.Context) telepath.Adapter
func (*StreamBlock) AddField ¶ added in v1.7.2
func (l *StreamBlock) AddField(name string, block Block)
func (*StreamBlock) Clean ¶ added in v1.7.2
func (l *StreamBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
func (*StreamBlock) HasChanged ¶ added in v1.7.2
func (l *StreamBlock) HasChanged(initial, data interface{}) bool
func (*StreamBlock) MaxNum ¶ added in v1.7.2
func (l *StreamBlock) MaxNum() int
func (*StreamBlock) MinNum ¶ added in v1.7.2
func (l *StreamBlock) MinNum() int
func (*StreamBlock) RenderForm ¶ added in v1.7.2
func (*StreamBlock) RenderTempl ¶ added in v1.7.2
func (s *StreamBlock) RenderTempl(id, name string, valueArr *StreamBlockValue, telepath string, streamBlockErrors *BaseBlockValidationError[int], tplCtx ctx.Context) templ.Component
func (*StreamBlock) Validate ¶ added in v1.7.2
func (l *StreamBlock) Validate(ctx context.Context, value interface{}) []error
func (*StreamBlock) ValueAtPath ¶ added in v1.7.2
func (l *StreamBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
func (*StreamBlock) ValueFromDB ¶ added in v1.7.2
func (s *StreamBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
func (*StreamBlock) ValueFromDataDict ¶ added in v1.7.2
func (l *StreamBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)
func (*StreamBlock) ValueOmittedFromData ¶ added in v1.7.2
func (b *StreamBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool
func (*StreamBlock) ValueToForm ¶ added in v1.7.2
func (l *StreamBlock) ValueToForm(value interface{}) interface{}
func (*StreamBlock) ValueToGo ¶ added in v1.7.2
func (l *StreamBlock) ValueToGo(value interface{}) (interface{}, error)
type StreamBlockData ¶ added in v1.7.2
type StreamBlockValue ¶ added in v1.7.2
type StreamBlockValue = BoundValue[[]*StreamBlockData]
type StructBlock ¶
type StructBlock struct {
*BaseBlock
Fields *orderedmap.OrderedMap[string, Block]
}
func NewStructBlock ¶
func NewStructBlock(opts ...func(*StructBlock)) *StructBlock
func (*StructBlock) AddField ¶
func (m *StructBlock) AddField(name string, block Block)
func (*StructBlock) Clean ¶
func (m *StructBlock) Clean(ctx context.Context, value interface{}) (interface{}, error)
func (*StructBlock) Field ¶
func (m *StructBlock) Field() fields.Field
func (*StructBlock) GetDefault ¶
func (m *StructBlock) GetDefault() interface{}
func (*StructBlock) HasChanged ¶ added in v1.7.2
func (m *StructBlock) HasChanged(initial, data interface{}) bool
func (*StructBlock) Name ¶
func (m *StructBlock) Name() string
func (*StructBlock) RenderForm ¶
func (*StructBlock) RenderTempl ¶
func (b *StructBlock) RenderTempl(id, name string, valueMap map[string]interface{}, telepath string, errors *BaseBlockValidationError[string], tplCtx ctx.Context) templ.Component
func (*StructBlock) SetName ¶
func (m *StructBlock) SetName(name string)
func (*StructBlock) Validate ¶
func (m *StructBlock) Validate(ctx context.Context, value interface{}) []error
func (*StructBlock) ValueAtPath ¶ added in v1.7.2
func (l *StructBlock) ValueAtPath(bound BoundBlockValue, parts []string) (interface{}, error)
func (*StructBlock) ValueFromDB ¶ added in v1.7.2
func (s *StructBlock) ValueFromDB(value json.RawMessage) (interface{}, error)
func (*StructBlock) ValueFromDataDict ¶
func (m *StructBlock) ValueFromDataDict(ctx context.Context, d url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)
func (*StructBlock) ValueOmittedFromData ¶
func (m *StructBlock) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool
func (*StructBlock) ValueToForm ¶
func (m *StructBlock) ValueToForm(value interface{}) interface{}
func (*StructBlock) ValueToGo ¶
func (m *StructBlock) ValueToGo(value interface{}) (interface{}, error)
type StructBlockValue ¶ added in v1.7.2
type StructBlockValue = BoundValue[map[string]interface{}]
Click to show internal directories.
Click to hide internal directories.