mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2025-11-13 18:40:29 +00:00
global changes in packages
This commit is contained in:
30
src/main/kotlin/dev/inmo/jsuikit/elements/TextField.kt
Normal file
30
src/main/kotlin/dev/inmo/jsuikit/elements/TextField.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
package dev.inmo.jsuikit.elements
|
||||
|
||||
import androidx.compose.runtime.*
|
||||
import dev.inmo.jsuikit.defaults.modifers.UIKitModifier
|
||||
import dev.inmo.jsuikit.defaults.modifers.include
|
||||
import org.jetbrains.compose.web.attributes.*
|
||||
import org.jetbrains.compose.web.dom.Input
|
||||
|
||||
@Composable
|
||||
fun <T> TextField(
|
||||
type: InputType<T>,
|
||||
state: MutableState<T>,
|
||||
disabledState: State<Boolean>? = null,
|
||||
placeholder: String? = null,
|
||||
vararg modifiers: UIKitModifier
|
||||
) {
|
||||
Input(type) {
|
||||
classes("uk-input")
|
||||
include(*modifiers)
|
||||
|
||||
placeholder ?.let(::placeholder)
|
||||
|
||||
onChange { state.value = it.value }
|
||||
disabledState ?.let {
|
||||
if (it.value) {
|
||||
disabled()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user