ui

package
v1.0.0-...-3fe6b38 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounds

type Bounds struct {
	Rect     html.Rect
	Position html.Position
	Overflow html.Overflow
}

func (*Bounds) Impose

func (b *Bounds) Impose(el *html.Element) *html.Element

type Classer

type Classer interface {
	// Get class name.
	Class() string

	// Get the class name that class extends. The return value is nil if no class is exetnded.
	ExtendedClass() Classer
}

type Component

type Component struct {
	Tag
}

Component is the base class for all UI components.

func (Component) Class

func (Component) Class() string

Get class name.

func (Component) ExtendedClass

func (Component) ExtendedClass() Classer

Get the class name that class extends.

func (Component) Impose

func (Component) Impose(el *html.Element)

Impose attributes to HTML Element.

func (Component) Render

func (Component) Render(parent *html.Element, viewport html.Rect) (*html.Element, error)

Render content into HTML Element.

type ComponentClass

type ComponentClass struct{}

Class of the Component.

func (ComponentClass) Class

func (ComponentClass) Class() string

func (ComponentClass) ExtendedClass

func (ComponentClass) ExtendedClass() Classer

type Componenter

type Componenter interface {
	Classer
	html.Renderer
	html.Imposer
}

type ItemRenderer

type ItemRenderer interface {
	html.Renderer

	// Items returns the slice of child components.
	Items() []Componenter

	// Len returns the number of child items.
	Len() int
}

ItemRenderer is responsible for rendering child components in parent bounds.

type Tag

type Tag struct {
	Id        html.Id
	Class     html.Class
	Style     html.Style
	Attribute html.Attribute
}

func (*Tag) Element

func (t *Tag) Element() *html.Element

type Text

type Text struct {
	Tag
	Bounds
	Text string
	Type TextType
}

Simple text component.

func (Text) Class

func (Text) Class() string

Get class name.

func (Text) ExtendedClass

func (Text) ExtendedClass() Classer

Get the class name that class extends.

func (Text) Impose

func (Text) Impose(el *html.Element)

Impose attributes to HTML Element.

func (*Text) Render

func (txt *Text) Render(parent *html.Element, viewport html.Rect) (*html.Element, error)

Render content into HTML Element.

type TextClass

type TextClass struct{}

Class of the Text.

func (TextClass) Class

func (TextClass) Class() string

func (TextClass) ExtendedClass

func (TextClass) ExtendedClass() Classer

type TextType

type TextType uint8
const (
	TextPlain TextType = iota
	TextParagraph
	TextCite
	TextBlockquote
	TextPreformatted
	TextCode
)

Type of the text container.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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