mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-26 20:18:49 +00:00
extend divider
This commit is contained in:
parent
6dbff07692
commit
252fe4a295
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.0.25
|
## 0.0.25
|
||||||
|
|
||||||
|
* Full including of divider
|
||||||
|
|
||||||
## 0.0.24
|
## 0.0.24
|
||||||
|
|
||||||
* Add opportunity to fill space between header and body of table
|
* Add opportunity to fill space between header and body of table
|
||||||
|
@ -1,7 +1,40 @@
|
|||||||
package dev.inmo.jsuikit.elements
|
package dev.inmo.jsuikit.elements
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
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.jetbrains.compose.web.dom.Hr
|
||||||
|
import org.w3c.dom.HTMLHRElement
|
||||||
|
|
||||||
|
object Divider {
|
||||||
|
@Composable
|
||||||
|
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
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun Divider() = Hr({ classes("uk-divider-icon") })
|
|
||||||
|
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