Scoop API

scoop:scoop.ui.component:0.1.0

src/builders/checkbox.scoop

Selected production source · src/builders/checkbox.scoop

1package scoop.ui.component
3import scoop.ui.*
4import scoop.ui.style.ThemeSource
6/** Shared options; the factory keeps external bindings and owned state distinct. */
7public class CheckboxBuilder internal constructor() {
8 public var enabled: Boolean = true
9 public var invalid: Boolean = false
10 public var style: CheckboxStyle = checkboxStyle()
11 public var theme: ThemeSource? = None
12 public var key: ViewKey = ViewKey.Position
13 public var focus: FocusOptions = FocusOptions()
14 public var labelTarget: FieldTarget? = None
15 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)