The built-in table (spec/05 §6.1), "macaw.table": an HTML <table> of whole rows, of
kind :content, :pure.
- parameters:
caption(text,"Table");identity(text,""), the field naming each row,""for rows that can't be selected;sort(text,"", bindable), the field rows are sorted by;order("asc"or"desc", bindable);first(number,0, bindable), the first row a live table's range shows;remove(text,""), the words of each row's remove control,""for none; - declarations: one slot,
rows, whose optionalcolumnsrole names the fields shown, in order (any type, many), when unbound every column in the delivered table's order (Macaw.Data.Table.names/1: name order for rows given as maps); events"sort","select","range"and"remove"; default actions onsortsettingsortandorderfrom the event's value, so it sorts with no declarations, and onrangesettingfirst; it writesselectionas an identity; it observes:activateand:select; reading load:scan; - budget: the rows its declared height shows at 32 px a row, times four, at least 10;
- range: in
:live, the rows its height shows and an overscan of half as many on each side, from itsfirstrow, the rest counted by an empty<tbody class="mw-gap" data-mw-gap="N">before and after them; itsrangeevent's default action setsfirst, which its request never reads, so moving it fetches nothing; - markup: a capped or stale table draws its notice above its rows; a caption, a header of scoped
<th>each holding a real button that emitssortwith the next sort as its value (%{"sort" => field, "order" => next},"desc"on the column sorted ascending, else"asc"), the sorted column'saria-sort, a row per delivered row sorted whensortnames a column (nil last, ties in delivered order), and with anidentityfield aselectbutton in each row's first cell and the row's id from its identity; handed a selection in its context (spec/03 §1.7.7), the row holding itmw-selectedwitharia-current, every othermw-muted; with anidentityandremovewords, each row ends in a cell holding its remove control (spec/05 §6.8), a button emittingremovewith the row's identity as its value, its accessible name the words and the identity ("Remove Hyacinth"), or with no socket and the host's links a POST form sending the same event; none where the core says the viewer may not change the rows; - keyed rows: a table's render is
Macaw.Builtin.Table.Rows, its head, each row as{key, version, markup}, its tail and its scope, safe HTML that flattens to the markup above in every mode, each row keyed by its identity's spelling, else its position in the delivery, so a runtime placing rows by key sends only the rows that changed, and versioned by its chunk's version, its place there and its mark, so a runtime can keep a row's markup by scope and version; handed the rows its runtime holds (macaw_component'sheldassign), a row held by the render's scope and its version takes the held markup and isn't drawn, the bytes unchanged (#465); - stylesheet:
stylesheet/0, served atstylesheet_path/0, its content address.
Summary
Functions
The table's one static stylesheet: the table, its caption, cells, header and select buttons, the sorted column's mark and the selected and muted rows, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.
The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).
Functions
@spec stylesheet() :: String.t()
The table's one static stylesheet: the table, its caption, cells, header and select buttons, the sorted column's mark and the selected and muted rows, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.
@spec stylesheet_path() :: String.t()
The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).