mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2025-12-08 07:15:39 +00:00
now project is multiplatform and correctly working
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package dev.inmo.jsuikit.modifiers
|
||||
|
||||
class UIKitTooltipModifier(
|
||||
text: String,
|
||||
align: Align? = null,
|
||||
delay: Int? = null,
|
||||
offset: Int? = null,
|
||||
duration: Int? = null,
|
||||
animation: UIKitAnimation? = null
|
||||
) : UIKitModifier {
|
||||
private val parametersMap = listOfNotNull(
|
||||
"title" to text,
|
||||
align ?.let { it.k to it.v },
|
||||
delay ?.let { "delay" to it.toString() },
|
||||
offset ?.let { "offset" to it.toString() },
|
||||
duration ?.let { "duration" to it.toString() },
|
||||
animation ?.let { "animation" to it.name },
|
||||
)
|
||||
override val otherAttrs: Map<String, String> = mapOf(
|
||||
"uk-tooltip" to parametersMap.joinToString(";") { (k, v) -> "$k: $v" }
|
||||
)
|
||||
|
||||
sealed class Align(name: String) {
|
||||
val k = "pos"
|
||||
val v = name
|
||||
|
||||
sealed class Top(suffix: String) : Align("top$suffix") {
|
||||
|
||||
object Center : Top("")
|
||||
object Left : Top("-left")
|
||||
object Right : Top("-right")
|
||||
|
||||
}
|
||||
|
||||
sealed class Bottom(suffix: String) : Align("bottom$suffix") {
|
||||
|
||||
object Center : Bottom("")
|
||||
object Left : Bottom("-left")
|
||||
object Right : Bottom("-right")
|
||||
|
||||
}
|
||||
|
||||
object Left : Align("left")
|
||||
object Right : Align("right")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user