ui

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

View Source
var CashSourceOptions = []CashSourceOption{
	{Code: model.AcctCash, LabelKey: "account.cash_label"},
	{Code: model.AcctBank, LabelKey: "account.bank_label"},
	{Code: model.AcctEWallet, LabelKey: "account.ewallet_label"},
}

CashSourceOptions lists accounts a "paid from" selector should offer. 2100 (Accounts Payable) is deliberately excluded — paying FROM a liability account doesn't make sense.

Functions

func AccountLabel added in v0.5.1

func AccountLabel(ctx context.Context, code string) string

AccountLabel renders a cash/bank/e-wallet account code as a human label, falling back to the raw code for anything else.

func ContentGrid added in v0.1.1

func ContentGrid() templ.Component

func DetailItem added in v0.1.1

func DetailItem(label string) templ.Component

func DetailList added in v0.1.1

func DetailList() templ.Component

func EmptyState added in v0.1.1

func EmptyState(title, description string, icon templ.Component) templ.Component

func FormGrid added in v0.1.1

func FormGrid() templ.Component

func FormatDate

func FormatDate(ctx context.Context, t time.Time) string

FormatDate formats t as a date-only string, day/month order chosen by ctx's detected locale.

func FormatDateTime

func FormatDateTime(ctx context.Context, t time.Time) string

FormatDateTime formats t as a date+time (24h) string, day/month order chosen by ctx's detected locale.

func FormatMoney

func FormatMoney(ctx context.Context, cents int64) string

FormatMoney formats an int64 smallest-currency-unit value (x100, e.g. 2500000 → "25,000", 250050 → "2,500.50") using ctx's detected locale for digit grouping and decimal/thousands separators.

func ImageCompressScript added in v0.5.1

func ImageCompressScript() templ.Component

func MoneyInputProps added in v0.5.1

func MoneyInputProps(p input.Props) input.Props

MoneyInputProps adapts p for a money-formatted field. Native number inputs can't hold formatted values like "12,500.50", so this renders as a text input with locale-aware thousands/decimal formatting applied client-side by money-input.js (marked via the inputmode and data-tui-money-input hints).

func PageHeader(title, subtitle string) templ.Component

func PaginationBar added in v0.5.1

func PaginationBar(props PaginationBarProps) templ.Component

PaginationBar renders a complete Previous/page-numbers/Next pager, or nothing if the results fit on a single page.

func ProductGrid added in v0.1.1

func ProductGrid() templ.Component

func ScrollX added in v0.5.1

func ScrollX() templ.Component

ScrollX wraps wide content (tables, etc.) so it scrolls horizontally within its own container instead of breaking the page layout on narrow viewports. templui's table.Table() has no built-in scroll wrapper.

func SplitLayout added in v0.1.1

func SplitLayout(left, right templ.Component, rightWidth string) templ.Component

func StatCard added in v0.1.1

func StatCard(kicker, value, meta, hint string) templ.Component

func StatGrid added in v0.1.1

func StatGrid() templ.Component

Types

type CashSourceOption added in v0.5.1

type CashSourceOption struct {
	Code     string
	LabelKey string
}

CashSourceOption is one entry in a "paid from" selector.

type PaginationBarProps added in v0.5.1

type PaginationBarProps struct {
	BasePath   string
	Query      url.Values
	Page       int
	PerPage    int
	TotalItems int
}

PaginationBarProps holds the data needed to render a full pager for a paginated list. Query should hold every filter to preserve across page links (search, per_page if non-default, etc.) but must NOT include "page" itself.

Jump to

Keyboard shortcuts

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