Merge pull request #31 from InsanusMokrassar/0.0.31

0.0.31
This commit is contained in:
InsanusMokrassar 2022-01-28 14:14:42 +06:00 committed by GitHub
commit 4479d9b0f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.0.31
* Support of `UIKitVisibility`
## 0.0.30 ## 0.0.30
* Add `UIKitComment` * Add `UIKitComment`

View File

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

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