OpenClose

abstract class OpenClose : WithJob

Base class that provides all functionality needed for components, that have some "open" and "close" state of representation.

Just extend from this class to gain and provide access to the basic data binding openState that holds the central state, the opened data-flow and expressive handler like close or open to set the state.

Typical examples of OpenClose based components are modal dialogs or all popup-components, that appear and disappear based upon user interaction.

There are some protected functions in order to configure the appropriate actions for opening and closing based upon user interaction like pressing some keys or clicking with the mouse:

  • toggleOnClicksEnterAndSpace

  • closeOnEscape

  • closeOnBlur

Constructors

Link copied to clipboard
fun OpenClose()

Functions

Link copied to clipboard
open fun errorHandler(cause: Throwable)
Link copied to clipboard
open infix fun <A> Flow<A>.handledBy(handler: Handler<A>)
open infix fun <A> Flow<A>.handledBy(execute: suspend (A) -> Unit): Job
open infix fun <E : Event> Flow<E>.handledBy(handler: Handler<Unit>)
open infix fun <E : Event> Flow<E>.handledBy(execute: suspend (E) -> Unit): Job

Properties

Link copied to clipboard
val close: SimpleHandler<Unit>
Link copied to clipboard
abstract val job: Job
Link copied to clipboard
val open: SimpleHandler<Unit>
Link copied to clipboard
val opened: Flow<Boolean>
Link copied to clipboard
Link copied to clipboard
val toggle: SimpleHandler<Unit>

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard