list

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package list wraps Bootstrap List Group component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	*bs.Component
	// contains filtered or unexported fields
}

Group represents Bootstrap list group container.

func Attach

func Attach(id string) *Group

Attach binds a Bootstrap list group on page.

func Button

func Button(data [][]interface{}) *Group

Button returns a list group with <div> and <button> item.

func Link(data [][]interface{}) *Group

Link returns a list group with <div> and <a> item. The dataset must be slice of []interface{}{link, ...}

func New

func New(data [][]interface{}) *Group

New returns a list group with "<ul>"

func (*Group) Action

func (g *Group) Action() *Group

Action adds action style to all items.

func (*Group) Active

func (g *Group) Active(idx int, flag bool) *Group

Active actives nth item.

func (*Group) Add

func (g *Group) Add(content ...interface{}) *Item

Add adds a new item with content and returns the new item.

func (*Group) Disable

func (g *Group) Disable(idx int, flag bool) *Group

Disable disables nth item.

func (*Group) EnableItems

func (g *Group) EnableItems() *Group

EnableItems reset all items to enabled.

func (*Group) Flush

func (g *Group) Flush() *Group

Flush removes some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).

func (*Group) Foreach

func (g *Group) Foreach(fn func(int, *Item)) *Group

Foreach applies function fn on each item.

func (*Group) Horizontalize

func (g *Group) Horizontalize(vs ...string) *Group

Horizontalize returns a horizontal list group.

func (*Group) InactiveItems

func (g *Group) InactiveItems() *Group

InactiveItems resets all items to inactive.

func (*Group) Item

func (g *Group) Item(idx int) *Item

Item returns nth item.

func (*Group) Length

func (g *Group) Length() int

Length returns length of items.

func (*Group) Reset

func (g *Group) Reset() *Group

Reset reset all items to enabled and inactive.

type Item

type Item struct {
	*bs.Component
	// contains filtered or unexported fields
}

Item represents Bootstrap list group item.

func (*Item) Action

func (it *Item) Action() *Item

Action adds action style.

func (*Item) Active

func (it *Item) Active(flag bool) *Item

Active actives the item.

func (*Item) Actived

func (it *Item) Actived() bool

Actived returns boolean indicates whether or not the item is active.

func (*Item) Disable

func (it *Item) Disable(flag bool) *Item

Disable disables the item.

func (*Item) Disabled

func (it *Item) Disabled() bool

Disabled returns boolean indicates whether or not the item is disabled.

func (*Item) Parent

func (it *Item) Parent() *Group

Parent ...

func (*Item) Style

func (it *Item) Style(style bs.Style) *Item

Style adds bootstrap pre-defined style like primary, secondary and etc.

Jump to

Keyboard shortcuts

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