scoop:scoop.ui.component:0.1.0
src/builders/checkbox.scoop
Selected production source · src/builders/checkbox.scoop
1
package scoop.ui.component3
import scoop.ui.*4
import scoop.ui.style.ThemeSource6
/** Shared options; the factory keeps external bindings and owned state distinct. */7
public class CheckboxBuilder internal constructor() {8
public var enabled: Boolean = true9
public var invalid: Boolean = false10
public var style: CheckboxStyle = checkboxStyle()11
public var theme: ThemeSource? = None12
public var key: ViewKey = ViewKey.Position13
public var focus: FocusOptions = FocusOptions()14
public var labelTarget: FieldTarget? = None15
public var semantics: ComponentSemantics = ComponentSemantics()17
public fun style(configure: CheckboxStyleBuilder.() -> Unit): Unit {18
style = style.copy(configure)19
}21
public fun focus(configure: FocusOptionsBuilder.() -> Unit): Unit {22
focus = focus.copy(configure)23
}24
internal fun snapshot(checked: Binding<CheckState>): CheckboxProps =25
CheckboxProps(checked, enabled, style, theme, focus, invalid, labelTarget, semantics)26
}