InputDropDown

fun InputDropDown(title: String, state: InputShellState, inputStyle: InputStyle = InputStyle.DataInputStyle(), itemCount: Int, onSearchOption: (String) -> Unit, fetchItem: (index: Int) -> DropdownItem, selectedItem: DropdownItem? = null, supportingTextData: List<SupportingTextData>? = null, legendData: LegendData? = null, isRequiredField: Boolean = false, modifier: Modifier = Modifier, onFocusChanged: (Boolean) -> Unit? = null, onResetButtonClicked: () -> Unit, onItemSelected: (index: Int, item: DropdownItem) -> Unit, showSearchBar: Boolean = true, expanded: Boolean = false, useDropDown: Boolean = true, loadOptions: () -> Unit, onDismiss: () -> Unit = {}, noResultsFoundString: String = provideStringResource("no_results_found"), searchToFindMoreString: String = provideStringResource("search_to_see_more"))

DHIS2 Input dropdown. Wraps DHIS · DropdownInputField.

Parameters

title

: controls the text to be shown for the title.

state

: Manages the InputShell state.

inputStyle

: Manages the InputShell style.

itemCount

: controls the number of items to be shown.

onSearchOption

: callback to search for an specific option.

fetchItem

: gets the item to display in the list.

selectedItem

: manages the value of the selected item.

supportingTextData

: is a list of SupportingTextData that manages all the messages to be shown.

legendData

: manages the legendComponent.

isRequiredField

: controls whether the field is mandatory or not.

onFocusChanged

: gives access to the onFocusChanged returns true if item is focused.

modifier

: allows a modifier to be passed externally.

onResetButtonClicked

: callback to when reset button is clicked.

onItemSelected

: callback to when a dropdown item is selected.

showSearchBar

: config whether to show search bar in the bottom sheet.

expanded

: config whether the dropdown should be initially displayed.

useDropDown

: use dropdown if true. Bottomsheet with search capability otherwise.

onDismiss

: gives access to the onDismiss event.

noResultsFoundString

: text to be shown in pop up when no results are found.