e

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 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 Card

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

func Check

func Check(name, text string) *checkElement

func Datalist added in v0.1.11

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

func Form

func Form(cb func(p easyweb.Page, id string, info map[string]string)) *formElement

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(p easyweb.Page, id, item string)) *paginationElement

func Radio

func Radio(name string) *radioElement

func RangeInput

func RangeInput(name, text string) *rangeElement

func Row

func Row(items ...IElement) *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 (*HtmlToken) Add added in v0.2.0

func (n *HtmlToken) Add(in ...IElement) IElement

add children or text

func (*HtmlToken) AddAny1 added in v0.2.0

func (n *HtmlToken) AddAny1(in ...any) IElement

add children or text

func (*HtmlToken) AfterElementLoadedFromFramwork added in v0.1.2

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

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() IElement

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() []IElement

func (HtmlToken) GetID

func (n HtmlToken) GetID() string

func (HtmlToken) GetText added in v0.1.2

func (n HtmlToken) GetText() string

func (HtmlToken) HtmlTag added in v0.2.0

func (n HtmlToken) HtmlTag() string

func (HtmlToken) MessageCallbackFromFramwork

func (n HtmlToken) MessageCallbackFromFramwork(p easyweb.Page, 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) IElement

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

func (*HtmlToken) SetCb

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

func (*HtmlToken) SetChild added in v0.1.5

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

func (*HtmlToken) SetContainerID added in v0.1.7

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

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

func (*HtmlToken) SetText added in v0.2.0

func (n *HtmlToken) SetText(text string) IElement

func (HtmlToken) String

func (n HtmlToken) String() string

func (*HtmlToken) Traverse

func (n *HtmlToken) Traverse(parent IElement, cb ITraverseCb) error

type ICallback

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

type IElement added in v0.2.0

type IElement interface {
	String() string
	GetID() string
	GetAttr(k string) string
	//set Attribute, if v=="",will remove it
	SetAttr(k, v string) IElement
	SetCb(typ string, cb ICallback) IElement
	AfterElementLoadedFromFramwork(p easyweb.Page)
	MessageCallbackFromFramwork(p easyweb.Page, id string, dataType easyweb.CbDataType, data []byte) bool
	Traverse(parent IElement, cb ITraverseCb) error
	Add(in ...IElement) IElement
	SetChild(child ...IElement) IElement
	SetContainerID(cid string) IElement
	ContainerID() string
	GetChilds() []IElement
	Copy() IElement
	GetText() string
	SetText(text string) IElement
	Refresh(p easyweb.Page) error
	HtmlTag() string
}

func Box

func Box(items ...any) IElement

func Button

func Button(text string, cb func(p easyweb.Page, id string)) IElement

func Col added in v0.1.1

func Col(width int, item IElement) IElement

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 Div added in v0.2.0

func Div(text string) IElement

<div>text</div>

func H added in v0.2.0

func H(level uint, msg string) IElement

h1-h6,level=1-6

func Image

func Image(url string) IElement

func Loading

func Loading() IElement

func MustParseHtml added in v0.2.0

func MustParseHtml(text string) IElement

func P added in v0.2.0

func P(text string) IElement

<p>text</p>

func ParseHtml

func ParseHtml(text string) (IElement, error)

func Text added in v0.2.0

func Text(text string) IElement

type ITraverseCb

type ITraverseCb func(parent, token IElement) 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