layout

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 3 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

	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(
	pc *glazed.CommandContext,
) (*Layout, error)

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 map[string]*parameters.ParameterDefinition,
	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