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 ¶
- Variables
- func AccountLabel(ctx context.Context, code string) string
- func ContentGrid() templ.Component
- func DetailItem(label string) templ.Component
- func DetailList() templ.Component
- func EmptyState(title, description string, icon templ.Component) templ.Component
- func FormGrid() templ.Component
- func FormatDate(ctx context.Context, t time.Time) string
- func FormatDateTime(ctx context.Context, t time.Time) string
- func FormatMoney(ctx context.Context, cents int64) string
- func ImageCompressScript() templ.Component
- func MoneyInputProps(p input.Props) input.Props
- func PageHeader(title, subtitle string) templ.Component
- func PaginationBar(props PaginationBarProps) templ.Component
- func ProductGrid() templ.Component
- func ScrollX() templ.Component
- func SplitLayout(left, right templ.Component, rightWidth string) templ.Component
- func StatCard(kicker, value, meta, hint string) templ.Component
- func StatGrid() templ.Component
- type CashSourceOption
- type PaginationBarProps
Constants ¶
This section is empty.
Variables ¶
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
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 DetailItem ¶ added in v0.1.1
func DetailList ¶ added in v0.1.1
func EmptyState ¶ added in v0.1.1
func FormatDate ¶
FormatDate formats t as a date-only string, day/month order chosen by ctx's detected locale.
func FormatDateTime ¶
FormatDateTime formats t as a date+time (24h) string, day/month order chosen by ctx's detected locale.
func FormatMoney ¶
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 MoneyInputProps ¶ added in v0.5.1
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 ¶ added in v0.1.1
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 ScrollX ¶ added in v0.5.1
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
Types ¶
type CashSourceOption ¶ added in v0.5.1
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.