extend divider

This commit is contained in:
InsanusMokrassar 2022-01-25 20:28:50 +06:00
parent 6dbff07692
commit 252fe4a295
3 changed files with 47 additions and 2 deletions

View File

@ -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

View File

@ -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 @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
)
}

View 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")
}