Try Install Learn Blog API Packages GitHub
Pages
mint-ui

Search
Basic information
Entities
Versions
Dependencies
mint-color 0.9.0 <= v < 1.0.0

Ui.Picker

A base component for implementing custom pickers (date, select).

States

status
:
Ui.Picker.Status
=
Ui.Picker.Status::Idle

Whether or not the dropdown is shown.

Properties

disabled
:
Bool
=
false

Whether or not the picker is disabled.

icon
:
Html
=
Ui.Icons:CHEVRON_DOWN

The icon to display at the right side of the label.

invalid
:
Bool
=
false

Whether or not the picker is invalid.

label
:
Maybe(Html)
=
Maybe::Nothing

The label to display if there is a value.

matchWidth
:
Bool
=
false

Whether or not the dropdown should match the width of the input.

offset
:
Number
=
5

The offset of the dropdown from the input.

onEnter
:
Function(Html.Event, Bool)
=
(event : Html.Event) { true }

A handler for the enter event, if it returns true the picker is closed.

onKeyDown
:
Function(Html.Event, Promise(Void))
=
Promise.never1

A handler for the keydown event if the picker is open or focused.

panel
:
Html
=
<></>

The content of the dropdown.

placeholder
:
String
=
""

The placeholder to show when there is no value selected.

position
:
Ui.Position
=
Ui.Position::BottomRight

The position of the dropdown.

size
:
Ui.Size
=
Ui.Size::Inherit

The size of the picker.

Functions

handleClicks
:
Promise(Void)

Handles the up events.

handleClose
:
Promise(Void)

Handler for the close event.

handleFocus
(
event
:
Html.Event
)
:
Promise(Void)

Handler for the focus event (shows the dropdown).

handleKeyDown
(
event
:
Html.Event
)

Handles the keydown event:

  • on ESCAPE key it hides the dropdown
  • on ENTER key it hides the dropdown if the handler returns true
  • on SPACE key it shows the dropdown
handleTabIn
:
Promise(Void)

Handler for the tab in event.

hideDropdown
:
Promise(Void)

Hides the dropdown.

render
:
Html

Renders the component.

showDropdown
:
Promise(Void)

Shows the dropdown.