From 6502e0923e0594a82cb9302ccdfa6e206e5b8552 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 5 Mar 2023 14:41:30 +0600 Subject: [PATCH] DefaultInput -> StandardInput --- CHANGELOG.md | 1 + .../inmo/jsuikit/elements/StandardInput.kt | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 486b0d1..e5dfa5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.6.1 +* `DefaultInput` has been renamed to `StandardInput` * `Compose`: `1.3.1-rc02` ## 0.6.0 diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt index dab38d2..4c4aca0 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt @@ -9,12 +9,12 @@ import org.jetbrains.compose.web.dom.Input import org.w3c.dom.HTMLInputElement @Composable -fun DefaultInput( +fun StandardInput( type: InputType, value: T, + vararg modifiers: UIKitModifier, disabled: Boolean = false, placeholder: String? = null, - vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, onChange: (T) -> Unit ) { @@ -41,6 +41,18 @@ fun DefaultInput( } } +@Deprecated("Renamed", ReplaceWith("StandardInput(type, value, *modifiers, disabled, placeholder, attributesCustomizer, onChange)")) +@Composable +fun DefaultInput( + type: InputType, + value: T, + disabled: Boolean = false, + placeholder: String? = null, + vararg modifiers: UIKitModifier, + attributesCustomizer: AttrBuilderContext = {}, + onChange: (T) -> Unit +) = StandardInput(type, value, modifiers = modifiers, disabled, placeholder, attributesCustomizer, onChange) + @Composable fun StandardInput( type: InputType, @@ -49,12 +61,12 @@ fun StandardInput( placeholder: String? = null, vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, -) = DefaultInput( +) = StandardInput( type, state.value, + modifiers = modifiers, disabledState ?.value == true, placeholder, - modifiers = modifiers, attributesCustomizer = attributesCustomizer ) { state.value = it