UIKitVisibility

This commit is contained in:
InsanusMokrassar 2022-01-28 14:14:27 +06:00
parent 15340eadb1
commit cef131b1d0
2 changed files with 32 additions and 0 deletions

View File

@ -2,6 +2,8 @@
## 0.0.31 ## 0.0.31
* Support of `UIKitVisibility`
## 0.0.30 ## 0.0.30
* Add `UIKitComment` * Add `UIKitComment`

View File

@ -0,0 +1,30 @@
package dev.inmo.jsuikit.modifiers
sealed class UIKitVisibility(classname: String) : UIKitModifier {
override val classes: Array<String> = arrayOf(classname)
sealed class Hidden(suffix: String?) : UIKitModifier {
override val classes: Array<String> = arrayOf("uk-hidden${suffix ?.let { "-$it" } ?: ""}")
object Hover : Hidden("hover")
sealed class Touch(suffix: String?) : Hidden(suffix) {
override val classes: Array<String> = arrayOf("${suffix ?: ""}touch")
object No : Touch("no")
companion object : Touch(null)
}
companion object : Hidden(null) {
val NoTouch = Touch.No
}
}
sealed class Invisible(suffix: String?) : UIKitModifier {
override val classes: Array<String> = arrayOf("uk-invisible${suffix ?.let { "-$it" } ?: ""}")
object Hover : Invisible("hover")
companion object : Invisible(null)
}
}