layout

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Name string

	Label   string
	Options []Option
	Default interface{}
	Help    string

	// this can be used to customizes the HTML output
	// see https://github.com/go-go-golems/parka/issues/28
	CSS      string
	Id       string
	Classes  string
	Template string
	Type     string

	ParameterDefinition *parameters.ParameterDefinition

	Value interface{}
}

type Layout

type Layout struct {
	Sections []*Section
}

Layout might look at first similar to glazed_layout.Layout, but it is actually the parsed and computed version used to render an HTML form.

func ComputeLayout

func ComputeLayout(
	cmd cmds.Command,
	parsedLayers *layers.ParsedLayers,
) (*Layout, error)
type Link struct {
	Href  string
	Text  string
	Class string
}

type Option

type Option struct {
	Label string
	Value interface{}
}

type Row

type Row struct {
	Inputs  []Input
	Style   string
	Classes string
}

type Section

type Section struct {
	Title            string
	ShortDescription string
	LongDescription  string
	Style            string
	Classes          string
	Rows             []Row
}

func NewSectionFromParameterDefinitions

func NewSectionFromParameterDefinitions(
	pds *parameters.ParameterDefinitions,
	values map[string]interface{},
	options ...SectionOption) *Section

type SectionOption

type SectionOption func(*Section)

func WithSectionLongDescription

func WithSectionLongDescription(desc string) SectionOption

func WithSectionShortDescription

func WithSectionShortDescription(desc string) SectionOption

func WithSectionTitle

func WithSectionTitle(title string) SectionOption

Jump to

Keyboard shortcuts

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