bootstrap

package
v0.0.0-...-0999587 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//AlertSuccess ...
	AlertSuccess = "alert-success"
	//AlertInfo ...
	AlertInfo = "alert-info"
	//AlertWarning ...
	AlertWarning = "alert-warning"
	//AlertDanger ..
	AlertDanger = "alert-danger"
)
View Source
const (
	//ColumnLarge <col-lg>
	ColumnLarge = "col-lg"
	//ColumnMedium <col-md>
	ColumnMedium = "col-md"
	//ColumnSmall <col-sm>
	ColumnSmall = "col-sm"
	//ColumnXtraSmall <col-xs>
	ColumnXtraSmall = "col-xs"
)
View Source
const (
	//ButtonDefault default bootstrap button
	ButtonDefault = "btn-default"
	//ButtonPrimary primary bootstrap button
	ButtonPrimary = "btn-primary"
)
View Source
const (
	//InputTypeText is <input type=text>
	InputTypeText = "text"
	//InputTypeFile is <input type=file>
	InputTypeFile = "file"
	//InputTypeCheckbox is <input type=checkbox>
	InputTypeCheckbox = "checkbox"
)
View Source
const (
	//ListUnordered is <ul>
	ListUnordered = "ul"
	//ListOrdered is <ol>
	ListOrdered = "ol"
	//DescriptionList is <dl>
	DescriptionList = "dl"
)
View Source
const NavbarDefault = "navbar-default"

NavbarDefault default navbar

View Source
const (
	//PanelDefault bootstrap default paenl
	PanelDefault = "panel-default"
)
View Source
const TableStripped = "table-striped"

TableStripped table is stripped

Variables

This section is empty.

Functions

func NewAlert

func NewAlert(title string, caption string, alertType string, dismissible bool) *gowd.Element

NewAlert returns new bootstrap alert

func NewButton

func NewButton(buttontype string, caption string) *gowd.Element

NewButton creates a new bootstrap <button> element

func NewCell

func NewCell(caption string) *gowd.Element

NewCell creates and adds new cell

func NewColumn

func NewColumn(size string, span int, elems ...*gowd.Element) *gowd.Element

NewColumn returns new bootstrap column

func NewContainer

func NewContainer(fluid bool, kids ...*gowd.Element) *gowd.Element

NewContainer returns new bootstrap container.

func NewElement

func NewElement(tag, class string, kids ...*gowd.Element) *gowd.Element

NewElement returns new bootstrap element

func NewFormGroup

func NewFormGroup(elems ...*gowd.Element) *gowd.Element

NewFormGroup returns new bootsrap form group

func NewInput

func NewInput(inputType string) *gowd.Element

NewInput creates a new input with a provided type

func NewInputGroup

func NewInputGroup(elems ...*gowd.Element) *gowd.Element

NewInputGroup creates new bootsrap input group from the given elements

func NewLinkButton

func NewLinkButton(caption string) *gowd.Element

NewLinkButton creates a new bootstrap link button (<a>)

func NewRow

func NewRow(elems ...*gowd.Element) *gowd.Element

NewRow return new bootstrap row

Types

type Checkbox

type Checkbox struct {
	*gowd.Element
	// contains filtered or unexported fields
}

Checkbox represents a checkbox with label

func NewCheckBox

func NewCheckBox(caption string, checked bool) *Checkbox

NewCheckBox creates a bootstrap checkbox with label

func (*Checkbox) Checked

func (cb *Checkbox) Checked() bool

Checked is true if the checkbox is checked

type FileButton

type FileButton struct {
	*gowd.Element
	// contains filtered or unexported fields
}

FileButton is an file-input linked to a button

func NewFileButton

func NewFileButton(buttontype string, caption string, foldersOnly bool) *FileButton

NewFileButton creates new 'file' input with a button

func (*FileButton) GetValue

func (fb *FileButton) GetValue() string

GetValue returns the selected file value

func (*FileButton) OnChange

func (fb *FileButton) OnChange(handler gowd.EventHandler)

OnChange registers the onchange event

type FormInput

type FormInput struct {
	*gowd.Element
	// contains filtered or unexported fields
}

FormInput is a bootstrap "form-group" input

func NewFormInput

func NewFormInput(inputType string, caption string) *FormInput

NewFormInput creates a bootstrap "form-group" containing an input with a given type and caption

func (*FormInput) GetValue

func (i *FormInput) GetValue() string

GetValue returns the input value

func (*FormInput) SetHelpText

func (i *FormInput) SetHelpText(help string)

SetHelpText sets the input help text

func (*FormInput) SetPlaceHolder

func (i *FormInput) SetPlaceHolder(placeHolder string)

SetPlaceHolder sets the input placeholder text

func (*FormInput) SetValue

func (i *FormInput) SetValue(value string)

SetValue sets the input value

type List

type List struct {
	*gowd.Element
	Items ListItems
}

List is a struct for <ul>, <ol>, <dl>

func NewList

func NewList(listType string, class string) *List

NewList creates a new list

func (*List) AddItem

func (l *List) AddItem(elem *gowd.Element) *gowd.Element

AddItem creates new LI, adds the elem to the li and returns the li to the caller.

type ListItems

type ListItems []*gowd.Element

ListItems a list of elements

type Navbar struct {
	*gowd.Element
	Lists []*List
	// contains filtered or unexported fields
}

Navbar is a bootstrap navbar element

func NewNavBar

func NewNavBar(navbarType string) *Navbar

NewNavBar creates new bootstrap navbar

func (nb *Navbar) AddList() *List

AddList adds a new list to the navbar, returns the list

type Pagination

type Pagination struct {
	*gowd.Element
	Items *List
}

Pagination is bootstrap pagination element

func NewPagination

func NewPagination() *Pagination

NewPagination creates new bootstrap pagination element

func (*Pagination) AddItem

func (p *Pagination) AddItem(caption string, active bool, handler gowd.EventHandler) *gowd.Element

AddItem adds page to the pagination

type Panel

type Panel struct {
	*gowd.Element
	Heading *gowd.Element
	Body    *gowd.Element
}

Panel is a bootstrap panel

func NewPanel

func NewPanel(panelType string) *Panel

NewPanel creates a new bootstrap panel with the provided type.

func (*Panel) AddTitle

func (p *Panel) AddTitle(title string) *gowd.Element

AddTitle sets or adds the panel title.

func (*Panel) AddToBody

func (p *Panel) AddToBody(elem *gowd.Element)

AddToBody adds element to panel body

func (*Panel) AddToHeading

func (p *Panel) AddToHeading(elem *gowd.Element)

AddToHeading adds element to panel heading

type ProgressBar

type ProgressBar struct {
	*gowd.Element
	// contains filtered or unexported fields
}

ProgressBar represents bootstrap progress-bar element

func NewProgressBar

func NewProgressBar() *ProgressBar

NewProgressBar creates new bootstrap progress bar element

func (*ProgressBar) SetPercent

func (pb *ProgressBar) SetPercent(percent int) error

SetPercent sets the value of the progress bar as a percentage

func (*ProgressBar) SetText

func (pb *ProgressBar) SetText(caption string)

SetText sets the progress bar's caption

func (*ProgressBar) SetValue

func (pb *ProgressBar) SetValue(now, max int) error

SetValue sets the progress value of the progress bar

type Table

type Table struct {
	*gowd.Element
	Head *gowd.Element
	Body *gowd.Element
	Rows []*TableRow
}

Table represents <table>

func NewTable

func NewTable(tableType string) *Table

NewTable creates a new table with type

func QuickTable

func QuickTable(tableType string, data map[string]interface{}) *Table

QuickTable creates a table from a given map with key-value pairs

func (*Table) AddHeader

func (t *Table) AddHeader(caption string) *gowd.Element

AddHeader adds an header row

func (*Table) AddRow

func (t *Table) AddRow() *TableRow

AddRow adds a row

type TableRow

type TableRow struct {
	*gowd.Element
}

TableRow represents a <tr>

func NewTableRow

func NewTableRow() *TableRow

NewTableRow creates a new table row

func (*TableRow) AddCells

func (tr *TableRow) AddCells(cells ...string)

AddCells adds cells to a table row

Jump to

Keyboard shortcuts

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