ocadotechnology/hexagonjs

Picker/AutocompletePicker: Create a combined module

Opened this issue · 0 comments

Context

The current Picker/AutocompletePicker work in a very similar way but have largely different implementations.

We should create a new combined picker with an api something like:

Picker:
    items: (Array, function[String => Array], Promise[Array], Function[String => Promise[Array]]),
    renderer: (item) => selection - the item renderer,
    searchBoxVisible: (true/false) => sets / get the search box visiblility,
    filterer: (function(searchTerm, item) => true/false),
    disabled: (true/false) => sets / gets the disabled state
    groupBy: (function(item) => string) - sets / gets the groupby function that allows one level of grouping in the picker items. If set to undefined, no grouping is performed
    value: (value) => sets/gets the value
    hide: () => hides the dropdown,
    on: (event) => emits events when things happen in the picker
      change - the value changes
      showstart - the dropdown starts to be shown
      show - the dropdown is shown
      showend - the dropdown starts to be shown
      hidestart - the dropdown starts to be hidden
      hide - the dropdown is hidden
      hideend - the dropdown starts to be hidden