mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2026-01-10 23:39:27 +00:00
Compare commits
11 Commits
0.1.4
...
589fc62364
| Author | SHA1 | Date | |
|---|---|---|---|
| 589fc62364 | |||
| 767f5291a8 | |||
| 38819eba21 | |||
| e5223f8408 | |||
| 854bc9f8ca | |||
| 36f5d5661b | |||
| 2af001a4f1 | |||
| 68f1879114 | |||
| f16c93cf0d | |||
| 63dd8f1bf6 | |||
| fafb7e7e04 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.1.7
|
||||||
|
|
||||||
|
Add Toggle builder
|
||||||
|
|
||||||
|
## 0.1.6
|
||||||
|
|
||||||
|
* Add support of UIKitButton size and group
|
||||||
|
|
||||||
|
## 0.1.5
|
||||||
|
|
||||||
|
* Fix access to `UIKitSticky`
|
||||||
|
|
||||||
## 0.1.4
|
## 0.1.4
|
||||||
|
|
||||||
* Improvements in `UIKitGrid`
|
* Improvements in `UIKitGrid`
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ android.enableJetifier=true
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.1.4
|
version=0.1.7
|
||||||
|
|||||||
26
src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt
Normal file
26
src/jsMain/kotlin/dev/inmo/jsuikit/elements/Toggle.kt
Normal 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
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -12,5 +12,12 @@ sealed class UIKitButton(suffix: String?) : UIKitModifier {
|
|||||||
object Link : Type("link")
|
object Link : Type("link")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sealed class Size(suffix: String) : UIKitButton(suffix) {
|
||||||
|
object Small : Size("small")
|
||||||
|
object Large : Size("large")
|
||||||
|
}
|
||||||
|
|
||||||
|
object Group : UIKitButton("group")
|
||||||
|
|
||||||
companion object : UIKitButton(null)
|
companion object : UIKitButton(null)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import dev.inmo.jsuikit.utils.buildAttribute
|
|||||||
import org.jetbrains.compose.web.css.CSSUnitLengthOrPercentage
|
import org.jetbrains.compose.web.css.CSSUnitLengthOrPercentage
|
||||||
import org.jetbrains.compose.web.css.CSSUnitValueTyped
|
import org.jetbrains.compose.web.css.CSSUnitValueTyped
|
||||||
|
|
||||||
sealed class UIKitSticky(
|
class UIKitSticky(
|
||||||
position: Position? = null,
|
position: Position? = null,
|
||||||
start: String? = null,
|
start: String? = null,
|
||||||
end: String? = null,
|
end: String? = null,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ sealed class UIKitToggle(
|
|||||||
|
|
||||||
class Custom internal constructor(otherAttrs: Map<String, String>) : UIKitToggle(otherAttrs = otherAttrs)
|
class Custom internal constructor(otherAttrs: Map<String, String>) : UIKitToggle(otherAttrs = otherAttrs)
|
||||||
|
|
||||||
companion object {
|
companion object : UIKitToggle(otherAttrs = mapOf("uk-toggle" to "")) {
|
||||||
operator fun invoke(
|
operator fun invoke(
|
||||||
target: String? = null,
|
target: String? = null,
|
||||||
mode: Mode? = null,
|
mode: Mode? = null,
|
||||||
|
|||||||
Reference in New Issue
Block a user