list

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptableType

type AdaptableType interface {
	Class(s ...string)
	ID(id string)
	Attr(key string, val string)
	Body(items ...app.UI)
	UI() app.UI
	Aria(s string, s2 string)
	DataSet(s string, s2 string)
	TabIndex(i int)
	Href(href string)
}

type EventType

type EventType string
const Action EventType = "MDCList:action"
const Select EventType = "MDCList:select"

type Group

type Group struct {
	app.Compo
	Items []*GroupItem
}

func (*Group) Render

func (g *Group) Render() app.UI

type GroupItem

type GroupItem struct {
	SubHeader string
	List      *List
}

type Item

type Item struct {
	app.Compo
	base.JsUtil
	Type      ItemType
	Graphic   icon.MaterialIcon
	Value     string
	Text      string
	Secondary string
	Href      string
	Name      string
	// contains filtered or unexported fields
}

func (*Item) OnMount

func (i *Item) OnMount(_ app.Context)

func (*Item) Render

func (i *Item) Render() app.UI

type ItemSelectState

type ItemSelectState int
const (
	ItemSelectStateNone ItemSelectState = iota
	ItemSelectStateTabZero
	ItemSelectStateSelected
	ItemSelectStateNotSelected
)

type ItemType

type ItemType uint
const (
	ItemTypeNone ItemType = iota
	ItemTypeOption
	ItemTypeRadio
	ItemTypeCheckbox
	ItemTypeDivider
	ItemTypeAnchor
)

type Items

type Items []*Item

Items allows setting up the state of a list of items before the first render. Setting the tab index or pre-selected item and associated attributes of the items in the list.

func (Items) Select

func (items Items) Select(index int) Items

func (Items) SelectHref

func (items Items) SelectHref(href string) Items

func (Items) SelectedItemText

func (items Items) SelectedItemText() (result string)

SelectedItemText returns the text of the currently selected item or empty if no selection made.

This should be called after Select()

func (Items) UIList

func (items Items) UIList() (uis []app.UI)

type List

type List struct {
	app.Compo
	base.JsUtil
	Id      string
	Items   []app.UI
	TwoLine bool
	Type    Type
	// contains filtered or unexported fields
}

func (*List) OnMount

func (l *List) OnMount(ctx app.Context)

func (*List) Render

func (l *List) Render() app.UI

func (*List) Select

func (l *List) Select(idx int)

type Type

type Type int

Type drives the rendering of the list

const (
	None Type = iota
	SingleSelection
	RadioGroup
	CheckBox
	Navigation
)

Jump to

Keyboard shortcuts

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