mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2026-04-10 03:22:28 +00:00
add Tab support
This commit is contained in:
@@ -3,7 +3,9 @@ package dev.inmo.jsuikit.utils
|
||||
import dev.inmo.jsuikit.modifiers.UIKitModifier
|
||||
import dev.inmo.jsuikit.modifiers.include
|
||||
import org.jetbrains.compose.web.attributes.AttrsScope
|
||||
import org.jetbrains.compose.web.attributes.HtmlAttrMarker
|
||||
import org.jetbrains.compose.web.attributes.builders.InputAttrsScope
|
||||
import org.jetbrains.compose.web.dom.AttrBuilderContext
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.HTMLInputElement
|
||||
|
||||
|
||||
@@ -4,13 +4,19 @@ import androidx.compose.runtime.Composable
|
||||
import org.jetbrains.compose.web.dom.ContentBuilder
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Composable
|
||||
inline fun optionallyDraw (
|
||||
vararg bools: Boolean,
|
||||
whatToDraw: @Composable () -> Unit
|
||||
) {
|
||||
if (bools.any { it }) {
|
||||
whatToDraw()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
inline fun <T : Element> optionallyDraw (
|
||||
attrs: Attrs<T>? = null,
|
||||
noinline contentBuilder: ContentBuilder<T>? = null,
|
||||
whatToDraw: @Composable () -> Unit
|
||||
) {
|
||||
if (attrs != null || contentBuilder != null) {
|
||||
whatToDraw()
|
||||
}
|
||||
}
|
||||
) = optionallyDraw(attrs != null || contentBuilder != null, whatToDraw = whatToDraw)
|
||||
|
||||
Reference in New Issue
Block a user