Merge pull request #25 from InsanusMokrassar/0.0.25

0.0.25
This commit is contained in:
InsanusMokrassar 2022-01-25 20:29:04 +06:00 committed by GitHub
commit d8d4a7fcf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 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

@ -9,4 +9,4 @@ android.enableJetifier=true
# Project data # Project data
group=dev.inmo group=dev.inmo
version=0.0.24 version=0.0.25

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

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