@antadesign/anta
    Preparing search index...

    Function optionsWithSelectionUnreviewed

    • Project a Select options 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.

      Type Parameters

      Parameters

      Returns SelectedItem<V>[]

      const tree = optionsWithSelection(options, values)
      // tree[1] === { label: 'Engineering', selectionState: 'some', options: [
      // { value: 'eng-fe', label: 'Frontend', selected: false }, … ] }