Option Lists
An admin UI often needs to constrain a field to a set of allowed values (dropdowns, multi-selects). Configuard models this with option lists.
- A row whose
keystarts with@is an option-list definition, not a config value. Only itsvaluematters, and it is always treated as a comma-separated list — regardless oftype/listType. - Other rows point at it from their
optionsfield with a template:"${@UIColors}".
// @UIColors (csl) value: 'Blue,Red,Green,Amber' ← the list// device.ui.accent (none) value: 'Amber', options: '${@UIColors}'How a Field Relates to Its List
Section titled “How a Field Relates to Its List”The field’s listType decides how many members its value may hold:
listType: none→ the value must be one member of the list.listType: csl/array→ the value may contain several members.- A value outside the list throws during
parseFlat().
Where They Show Up
Section titled “Where They Show Up”Option-list rows are excluded from build() — they aren’t real config, so
they never appear in .data. To resolve them, use
parseFlat(), which extracts every @-key into
a separate @ object (a trimmed, uncast string array) and expands each
options reference into that array — exactly what an editor UI needs to render
a control.
const { '@': optionLists, configList } = Configuard.parseFlat(rows);
optionLists;// { UIColors: ['Blue', 'Red', 'Green', 'Amber'] }See the Admin UI Workflow for the full round trip.