e

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accordion

func Accordion() *accordionElement

func Box

func Box(items ...any) *boxElement

func Button

func Button(text string, cb func(id string)) *buttonElement

func Card

func Card() *cardElement
func Carousel() *carouselElement

func Check

func Check(name, text string) *checkElement

func Col added in v0.1.1

func Col(width int, item any) *colElement

Col generates a col Element.

Parameters:

  • width: an integer representing the width of the colElement, 0-12, 0=auto.
  • item: any item that needs to be added to the colElement.

func Datalist added in v0.1.11

func Datalist(name, text string) *datalistElement
func Dropdown(text string) *dropdownElement

func Form

func Form(cb func(id string, info map[string]string)) *formElement

func Heading added in v0.1.9

func Heading(level uint, msg string) *headingElement

h1-h6,leven=1-6

func Image

func Image(url string) *imageElement

func InputGroup

func InputGroup(name, text string) *inputElement

func Label

func Label(text string) *labelElement
func Link(text, url string) *linkElement

func List

func List(in ...any) *listElement

func Map2Table added in v0.1.2

func Map2Table(keyWidth int, in map[string]any) *tableElement

keyWidth: 0-12, total width is 12, 0:auto

func Modal(btnText, title string) *modalElement
func Navbar(name string) *navbarElement

Navbar creates a new navbarElement with the given name.

Parameters: - name: a string representing the name of the navbarElement.

Returns: - a pointer to the created navbarElement.

func Pagination added in v0.1.4

func Pagination(items []string, cb func(id, item string)) *paginationElement

func Radio

func Radio(name string) *radioElement

func RangeInput

func RangeInput(name, text string) *rangeElement

func Row

func Row(items ...any) *rowElement

func Select

func Select(name string) *selectElement
func Sidebar(title string) *elementSidebar

func Table

func Table(head ...string) *tableElement

func Tabs

func Tabs() *tabsElement

func Textarea added in v0.1.7

func Textarea(name, title string) *textareaElement

func Video

func Video(url string) *videoElement

Video generates a video HTML element from the given URL. defults to Aspect16by9

Types

type HtmlToken

type HtmlToken struct {
	Info html.Token
	// contains filtered or unexported fields
}

func Loading

func Loading() *HtmlToken

func ParseHtml

func ParseHtml(text string) (*HtmlToken, error)

func (*HtmlToken) AddChild added in v0.1.1

func (n *HtmlToken) AddChild(child *HtmlToken) *HtmlToken

func (*HtmlToken) AfterElementLoadedFromFramwork added in v0.1.2

func (n *HtmlToken) AfterElementLoadedFromFramwork(p easyweb.Page)

func (*HtmlToken) Base added in v0.1.7

func (n *HtmlToken) Base() *HtmlToken

Base returns the HtmlToken itself. easy 'Set' its subclasses, or will lost callback event

func (*HtmlToken) ContainerID added in v0.1.7

func (n *HtmlToken) ContainerID() string

func (*HtmlToken) Copy added in v0.1.7

func (n *HtmlToken) Copy() *HtmlToken

Copy copy all element and clear the id

func (*HtmlToken) GetAttr

func (n *HtmlToken) GetAttr(k string) string

get Attribute

func (*HtmlToken) GetChilds added in v0.1.2

func (n *HtmlToken) GetChilds() []*HtmlToken

func (*HtmlToken) GetID

func (n *HtmlToken) GetID() string

func (*HtmlToken) GetText added in v0.1.2

func (n *HtmlToken) GetText() string

func (*HtmlToken) MessageCallbackFromFramwork

func (n *HtmlToken) MessageCallbackFromFramwork(id string, dataType easyweb.CbDataType, data []byte) bool

func (*HtmlToken) Refresh added in v0.1.9

func (n *HtmlToken) Refresh(p easyweb.Page) error

func (*HtmlToken) SetAttr added in v0.1.7

func (n *HtmlToken) SetAttr(k, v string) *HtmlToken

set Attribute, if v=="",will remove it

func (*HtmlToken) SetCb

func (n *HtmlToken) SetCb(typ string, cb ICallback) *HtmlToken

func (*HtmlToken) SetChild added in v0.1.5

func (n *HtmlToken) SetChild(child ...*HtmlToken) *HtmlToken

func (*HtmlToken) SetContainerID added in v0.1.7

func (n *HtmlToken) SetContainerID(cid string) *HtmlToken

If the same container id is set, the content will be updated when written multiple times.

func (*HtmlToken) String

func (n *HtmlToken) String() string

func (*HtmlToken) Traverse

func (n *HtmlToken) Traverse(cb ITraverseCb) error

type ICallback

type ICallback func(id string, dataType easyweb.CbDataType, data []byte)

type ITraverseCb

type ITraverseCb func(parent string, token *HtmlToken) error

type InputType added in v0.1.4

type InputType string
const (
	InputTypeButton   InputType = "button"
	InputTypeCheckbox InputType = "checkbox"
	InputTypeColor    InputType = "color"
	InputTypeDate     InputType = "date"
	InputTypeDatetime InputType = "datetime-local"
	InputTypeEmail    InputType = "email"
	InputTypeFile     InputType = "file"
	InputTypeHidden   InputType = "hidden"
	InputTypeImage    InputType = "image"
	InputTypeMonth    InputType = "month"
	InputTypeNumber   InputType = "number"
	InputTypePassword InputType = "password"
	InputTypeRadio    InputType = "radio"
	InputTypeRange    InputType = "range"
	InputTypeReset    InputType = "reset"
	InputTypeSearch   InputType = "search"
	InputTypeSubmit   InputType = "submit"
	InputTypeTel      InputType = "tel"
	InputTypeText     InputType = "text"
	InputTypeTime     InputType = "time"
	InputTypeUrl      InputType = "url"
	InputTypeWeek     InputType = "week"
)

Jump to

Keyboard shortcuts

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