portal/src/jsMain/kotlin/de/westermann/kwebview/components/OptionView.kt
2019-02-05 22:18:15 +01:00

32 lines
No EOL
694 B
Kotlin

package de.westermann.kwebview.components
import de.westermann.kwebview.View
import de.westermann.kwebview.createHtmlView
import org.w3c.dom.HTMLOptionElement
class OptionView<T>(val value: T) : View(createHtmlView<HTMLOptionElement>()) {
override val html = super.html as HTMLOptionElement
var htmlValue: String
get() = html.value
set(value) {
html.value = value
}
var text: String
get() = html.text
set(value) {
html.text = value
}
val index: Int
get() = html.index
var selected: Boolean
get() = html.selected
set(value) {
html.selected = value
}
}