mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 08:37:24 +00:00
commit
1cf9655575
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.0.27
|
||||
|
||||
* `TextField` has been renamed to `StandardInput`
|
||||
* `StandardInput` now will look for changes in state
|
||||
|
||||
## 0.0.26
|
||||
|
||||
* Add UIKitColumn
|
||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.0.26
|
||||
version=0.0.27
|
||||
|
@ -9,7 +9,7 @@ import org.jetbrains.compose.web.dom.Input
|
||||
import org.w3c.dom.HTMLInputElement
|
||||
|
||||
@Composable
|
||||
fun <T> TextField(
|
||||
fun <T> StandardInput(
|
||||
type: InputType<T>,
|
||||
state: MutableState<T>,
|
||||
disabledState: State<Boolean>? = null,
|
||||
@ -23,7 +23,16 @@ fun <T> TextField(
|
||||
|
||||
placeholder ?.let(::placeholder)
|
||||
|
||||
onChange { state.value = it.value }
|
||||
state.value.let {
|
||||
when (it) {
|
||||
is String -> value(it)
|
||||
is Number -> value(it)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
onInput { state.value = it.value }
|
||||
|
||||
disabledState ?.let {
|
||||
if (it.value) {
|
||||
disabled()
|
||||
@ -32,3 +41,14 @@ fun <T> TextField(
|
||||
attributesCustomizer()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@Deprecated("Renamed", ReplaceWith("StandardInput", "dev.inmo.jsuikit.elements.StandardInput"))
|
||||
fun <T> TextField(
|
||||
type: InputType<T>,
|
||||
state: MutableState<T>,
|
||||
disabledState: State<Boolean>? = null,
|
||||
placeholder: String? = null,
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||
) = StandardInput(type, state, disabledState, placeholder, modifiers = modifiers, attributesCustomizer)
|
Loading…
Reference in New Issue
Block a user