The options of a select, in every shape the components accept, read into one shape.
An option is a string or number (label and value alike), a {label, value} tuple, a
keyword entry label: value, or a map with :label and :value (and optionally
:disabled; any other keys are kept for the :option and :item slots). A group is
{group_label, [options]}.
iex> LineaUI.Components.Select.Options.normalize(["Wedding", {"Other", "other"}])
[
%{type: :option, label: "Wedding", value: "Wedding", disabled: false, data: "Wedding"},
%{type: :option, label: "Other", value: "other", disabled: false, data: {"Other", "other"}}
]
Summary
Functions
The option whose value is value, among options; a value that is not one of them becomes its own option.
The options alone, with the groups flattened.
Reads a list of options and groups.
The values of a select's value as a list of strings.
Types
Functions
The option whose value is value, among options; a value that is not one of them becomes its own option.
The options alone, with the groups flattened.
Reads a list of options and groups.
The values of a select's value as a list of strings.