dom

package
v0.0.0-...-ae86d3b Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainWrapperClassName is the class name for the main wrapper.
	MainWrapperClassName = "select-wrapper"
	// OptionsWrapperClassName is the class name for the options wrapper.
	OptionsWrapperClassName = "select-options-wrapper"
	// OptionClassName is the class name for an option.
	OptionClassName = "select-option"
	// OpenClassName is the class name for the open state.
	OpenClassName = "open"
)

Variables

This section is empty.

Functions

func APISelect

func APISelect(document js.Value, apiURL, inputName string, selected *selector.Selected) js.Value

APISelect returns a new select element. The options are gathered from the API. The input field on the select element is a search field. Once it changes, the options are filtered from the API. It allows the user to select an option from the filtered options. Also possible to add a new option.

func Button

func Button(document js.Value, label string) js.Value

Button returns a new button element.

func CheckBox

func CheckBox(document js.Value, inputName, inputID, inputLabel string, inputValue interface{}, selected bool) js.Value

CheckBox returns a new checkbox element.

func CheckBoxList

func CheckBoxList(document js.Value, listName, listLabel, listTitle, apiURL string) js.Value

CheckBoxList returns a new list of checkbox list elements.

func CreateElement

func CreateElement(document js.Value, tagName string, attrs map[string]interface{}) js.Value

CreateElement returns a new element.

func Div

func Div(document js.Value, attributes map[string]interface{}) js.Value

Div returns a new div element.

func Form

func Form(document js.Value, attributes map[string]interface{}) js.Value

Form returns a new form element.

func H1

func H1(document js.Value, text string) js.Value

H1 returns a new h1 element.

func Input

func Input(document js.Value, inputType string, attributes map[string]interface{}) js.Value

Input returns a new input element.

func Label

func Label(document js.Value, label, labelFor string) js.Value

Label returns a new label element.

func P

func P(document js.Value, text string) js.Value

P returns a new p element.

func SimpleAPISelect

func SimpleAPISelect(document js.Value, apiURL, inputName string, selected *selector.Selected) js.Value

SimpleAPISelect returns a simple select element. The document input parameter is the document. The next input parameter is the map of options.

func SimpleSelect

func SimpleSelect(document js.Value, options selector.SelectOptions, inputName string, selected *selector.Selected) js.Value

SimpleSelect returns a simple select element. The document input parameter is the document. The next input parameter is the map of options.

func Span

func Span(document js.Value, text, classList string) js.Value

Span returns a new span element.

func TextNode

func TextNode(document js.Value, text string) js.Value

TextNode returns a new text node.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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