mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-30 05:58:45 +00:00
commit
d8d4a7fcf1
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 0.0.25
|
||||
|
||||
* Full including of divider
|
||||
|
||||
## 0.0.24
|
||||
|
||||
* Add opportunity to fill space between header and body of table
|
||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.0.24
|
||||
version=0.0.25
|
||||
|
@ -1,7 +1,40 @@
|
||||
package dev.inmo.jsuikit.elements
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import dev.inmo.jsuikit.modifiers.*
|
||||
import org.jetbrains.compose.web.dom.AttrBuilderContext
|
||||
import org.jetbrains.compose.web.dom.Hr
|
||||
import org.w3c.dom.HTMLHRElement
|
||||
|
||||
object Divider {
|
||||
@Composable
|
||||
fun Divider() = Hr({ classes("uk-divider-icon") })
|
||||
fun Common(
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLHRElement> = {}
|
||||
) = Hr {
|
||||
include(*modifiers)
|
||||
attributesCustomizer()
|
||||
}
|
||||
@Composable
|
||||
fun Icon(
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLHRElement> = {}
|
||||
) = Common(
|
||||
*(modifiers + UIKitDivider.Icon), attributesCustomizer = attributesCustomizer
|
||||
)
|
||||
@Composable
|
||||
fun Small(
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLHRElement> = {}
|
||||
) = Common(
|
||||
*(modifiers + UIKitDivider.Small), attributesCustomizer = attributesCustomizer
|
||||
)
|
||||
@Composable
|
||||
fun Vertical(
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLHRElement> = {}
|
||||
) = Common(
|
||||
*(modifiers + UIKitDivider.Vertical), attributesCustomizer = attributesCustomizer
|
||||
)
|
||||
}
|
||||
|
||||
|
10
src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitDivider.kt
Normal file
10
src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitDivider.kt
Normal file
@ -0,0 +1,10 @@
|
||||
package dev.inmo.jsuikit.modifiers
|
||||
|
||||
sealed class UIKitDivider(classname: String) : UIKitModifier {
|
||||
override val classes: Array<String> = arrayOf(classname)
|
||||
|
||||
object Icon : UIKitDivider("uk-divider-icon")
|
||||
object Small : UIKitDivider("uk-divider-small")
|
||||
object Vertical : UIKitDivider("uk-divider-vertical")
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user