Macaw.Builtin.Sort (macaw v0.6.0)

Copy Markdown View Source

The built-in sort (spec/05 §6.7), "macaw.sort": a choice of the field a table sorts by and its order, of kind :control, :pure (#452).

  • parameters: label (text, "Sort"), the choices' legend; field (text, "Sort by") and order (text, "Order"), the labels of the field's and the order's selects;
  • declarations: the event "sort", its value %{"sort" => field, "order" => order} as the table's own sort event carries it; its placement's actions set the table cell's per-cell state, declared on the surface with its legal values: %{on: "sort", set: "birds.sort", value: {:event, [:value, "sort"]}} and the same of "order". Either may be left out, and the control offers the one it sets;
  • choices (Macaw.Control): the field's options are its state's legal values, the order's its own ("asc" and "desc", written Ascending and Descending);
  • markup: a <fieldset> of two labeled native <select>s under its legend, or one labeled select, as the filter's (Macaw.Builtin.Filter);
  • stylesheet: stylesheet/0, the controls' own, served at stylesheet_path/0.

Summary

Functions

The sort's one static stylesheet, the controls' own (the shared controls sheet).

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).

Functions

stylesheet()

@spec stylesheet() :: String.t()

The sort's one static stylesheet, the controls' own (the shared controls sheet).

stylesheet_path()

@spec stylesheet_path() :: String.t()

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).