mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2025-12-05 13:55:39 +00:00
now project is multiplatform and correctly working
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.jsuikit.modifiers
|
||||
|
||||
import org.jetbrains.compose.web.attributes.AttrsBuilder
|
||||
|
||||
interface UIKitModifier {
|
||||
val classes: Array<String>
|
||||
get() = emptyArray()
|
||||
val otherAttrs: Map<String, String>
|
||||
get() = emptyMap()
|
||||
}
|
||||
|
||||
fun AttrsBuilder<*>.include(vararg container: UIKitModifier?) {
|
||||
container.forEach {
|
||||
it ?.classes ?.let { newClasses -> classes(*newClasses) }
|
||||
it ?.otherAttrs ?.let { attrs -> attrs.forEach { (k, v) -> attr(k, v) } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user