From 38819eba2196adda7c07e2dfae7d77c14e11a090 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 29 May 2022 09:43:14 +0600 Subject: [PATCH 1/2] start 0.1.7 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47b5424..ce18656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.1.7 + ## 0.1.6 * Add support of UIKitButton size and group diff --git a/gradle.properties b/gradle.properties index e3a1059..b22a5f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.1.6 +version=0.1.7 From 767f5291a8ec187e2a51c7570eefa8cf5d12cf55 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 29 May 2022 09:43:23 +0600 Subject: [PATCH 2/2] add Toggle builder --- CHANGELOG.md | 2 ++ .../dev/inmo/jsuikit/elements/Toggle.kt | 26 +++++++++++++++++++ .../dev/inmo/jsuikit/modifiers/UIKitToggle.kt | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index ce18656..382af4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.1.7 +Add Toggle builder + ## 0.1.6 * Add support of UIKitButton size and group diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt new file mode 100644 index 0000000..ab6c6a1 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt @@ -0,0 +1,26 @@ +package dev.inmo.jsuikit.elements + +import androidx.compose.runtime.Composable +import dev.inmo.jsuikit.modifiers.UIKitToggle +import dev.inmo.jsuikit.modifiers.include +import dev.inmo.jsuikit.utils.Attrs +import org.jetbrains.compose.web.attributes.ButtonType +import org.jetbrains.compose.web.attributes.type +import org.jetbrains.compose.web.dom.Button +import org.jetbrains.compose.web.dom.ContentBuilder +import org.w3c.dom.HTMLButtonElement + +@Composable +fun Toggle( + attrs: Attrs, + contentBuilder: ContentBuilder +) { + Button( + { + include(UIKitToggle) + type(ButtonType.Button) + attrs.builder(this) + }, + contentBuilder + ) +} diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitToggle.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitToggle.kt index e91be23..5b8311f 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitToggle.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitToggle.kt @@ -38,7 +38,7 @@ sealed class UIKitToggle( class Custom internal constructor(otherAttrs: Map) : UIKitToggle(otherAttrs = otherAttrs) - companion object { + companion object : UIKitToggle(otherAttrs = mapOf("uk-toggle" to "")) { operator fun invoke( target: String? = null, mode: Mode? = null,