Compare commits

..

3 Commits

Author SHA1 Message Date
589fc62364
Merge pull request #62 from InsanusMokrassar/0.1.7
0.1.7
2022-05-29 10:45:29 +06:00
767f5291a8 add Toggle builder 2022-05-29 09:43:23 +06:00
38819eba21 start 0.1.7 2022-05-29 09:43:14 +06:00
4 changed files with 32 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.1.7
Add Toggle builder
## 0.1.6
* Add support of UIKitButton size and group

View File

@ -9,4 +9,4 @@ android.enableJetifier=true
# Project data
group=dev.inmo
version=0.1.6
version=0.1.7

View File

@ -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<HTMLButtonElement>,
contentBuilder: ContentBuilder<HTMLButtonElement>
) {
Button(
{
include(UIKitToggle)
type(ButtonType.Button)
attrs.builder(this)
},
contentBuilder
)
}

View File

@ -38,7 +38,7 @@ sealed class UIKitToggle(
class Custom internal constructor(otherAttrs: Map<String, String>) : UIKitToggle(otherAttrs = otherAttrs)
companion object {
companion object : UIKitToggle(otherAttrs = mapOf("uk-toggle" to "")) {
operator fun invoke(
target: String? = null,
mode: Mode? = null,