tables

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLimits = []int{5, 10, 25, 50}

DefaultLimits is a list of default limits

Functions

func Next added in v1.0.32

func Next(p PaginationProps) htmx.Node

Next ...

func Pagination added in v1.0.22

func Pagination(p PaginationProps, children ...htmx.Node) htmx.Node

Pagination ...

func PaginationPropsFromContext added in v1.0.32

func PaginationPropsFromContext(c *fiber.Ctx) (limit int, offset int)

PaginationFromContext returns a new Pagination object based on the provided context.

func Prev added in v1.0.32

func Prev(p PaginationProps) htmx.Node

Prev ...

func Select added in v1.0.32

func Select(p SelectProps, children ...htmx.Node) htmx.Node

Select ...

func Table

func Table[S ~[]R, R Row](p TableProps, columns Columns[R], s S) htmx.Node

Table is a struct that contains the properties of a table

func TablePagination added in v1.0.32

func TablePagination(p TablePaginationProps, children ...htmx.Node) htmx.Node

TablePagination is a component that renders a table pagination

func TableToolbar added in v1.0.32

func TableToolbar(p TableToolbarProps, children ...htmx.Node) htmx.Node

TableToolbar is a component that renders a table toolbar

Types

type ColumnDef

type ColumnDef[R Row] struct {
	ID              string
	AccessorKey     string
	Header          func(p TableProps) htmx.Node
	Cell            func(p TableProps, row R) htmx.Node
	EnableSorting   bool
	EnableFiltering bool
}

ColumnDef returns a new column definition.

type Columns

type Columns[R Row] []ColumnDef[R]

Columns returns a new column definition.

type PaginationProps added in v1.0.32

type PaginationProps struct {
	ClassNames htmx.ClassNames
	Limit      int
	Offset     int
	Target     string
	Total      int
	URL        string
}

PaginationProps is a struct that contains the properties of a pagination

type Row added in v1.2.8

type Row interface {
	comparable
}

Row is a struct that contains the properties of a row

type SelectProps added in v1.0.32

type SelectProps struct {
	ClassNames htmx.ClassNames
	Limit      int
	Limits     []int
	Offset     int
	Target     string
	Total      int
	URL        string
}

SelectProps ...

type TablePaginationProps added in v1.0.32

type TablePaginationProps struct {
	ClassNames htmx.ClassNames
	Pagination htmx.Node
}

TablePaginationProps is a struct that contains the properties of a table pagination

type TableProps

type TableProps struct {
	ClassNames htmx.ClassNames
	ID         string
	Pagination htmx.Node
	Toolbar    htmx.Node
}

TableProps is a struct that contains the properties of a table

type TableToolbarProps added in v1.0.32

type TableToolbarProps struct {
	ClassNames htmx.ClassNames
}

TableToolbarProps is a struct that contains the properties of a table toolbar

Jump to

Keyboard shortcuts

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