Project a Selectoptions tree onto a set of selected values: returns a mirror
of the tree with every leaf marked selected and every group / submenu carrying a
rolled-up selectionState ('none' / 'some' / 'all' of its descendant leaves).
Bare-string options are normalized to { value, label }; structure and order are
preserved.
A pure function of (options, values) — it needs no Select instance and reads
nothing off the change event, so it behaves identically in controlled and
uncontrolled code. Pass the current value (a string, an array, or undefined)
and render a grouped summary, drive section indicators, or diff picks.
A value that appears under more than one section marks the leaf in every place it
occurs (selection is value-keyed), mirroring how the menu itself renders it.
Project a
Selectoptionstree onto a set of selected values: returns a mirror of the tree with every leaf markedselectedand every group / submenu carrying a rolled-upselectionState('none'/'some'/'all'of its descendant leaves). Bare-string options are normalized to{ value, label }; structure and order are preserved.A pure function of
(options, values)— it needs noSelectinstance and reads nothing off the change event, so it behaves identically in controlled and uncontrolled code. Pass the currentvalue(a string, an array, orundefined) and render a grouped summary, drive section indicators, or diff picks.A value that appears under more than one section marks the leaf in every place it occurs (selection is value-keyed), mirroring how the menu itself renders it.