mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-23 10:38:45 +00:00
UIKitSticky
This commit is contained in:
parent
4377ec3969
commit
5afa92ef37
@ -3,6 +3,7 @@
|
|||||||
## 0.1.4
|
## 0.1.4
|
||||||
|
|
||||||
* Improvements in `UIKitGrid`
|
* Improvements in `UIKitGrid`
|
||||||
|
* Add support of `UIKitSticky`
|
||||||
|
|
||||||
## 0.1.3
|
## 0.1.3
|
||||||
|
|
||||||
|
47
src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt
Normal file
47
src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package dev.inmo.jsuikit.modifiers
|
||||||
|
|
||||||
|
import dev.inmo.jsuikit.utils.buildAttribute
|
||||||
|
import org.jetbrains.compose.web.css.CSSUnitLengthOrPercentage
|
||||||
|
import org.jetbrains.compose.web.css.CSSUnitValueTyped
|
||||||
|
|
||||||
|
sealed class UIKitSticky(
|
||||||
|
position: Position? = null,
|
||||||
|
start: String? = null,
|
||||||
|
end: String? = null,
|
||||||
|
offset: CSSUnitValueTyped<CSSUnitLengthOrPercentage>? = null,
|
||||||
|
overflowFlip: Boolean? = null,
|
||||||
|
animation: UIKitAnimation? = null,
|
||||||
|
classForActiveItems: String? = null,
|
||||||
|
classForInactiveItems: String? = null,
|
||||||
|
showOnUp: Boolean? = null,
|
||||||
|
media: String? = null,
|
||||||
|
targetOffset: CSSUnitValueTyped<CSSUnitLengthOrPercentage>? = null
|
||||||
|
) : UIKitModifier {
|
||||||
|
override val otherAttrs: Map<String, String> = mapOf(
|
||||||
|
buildAttribute("uk-sticky") {
|
||||||
|
"position" to position ?.name
|
||||||
|
"start" to start
|
||||||
|
"end" to end
|
||||||
|
"offset" to offset ?.toString()
|
||||||
|
"overflow-flip" to overflowFlip
|
||||||
|
"animation" to animation
|
||||||
|
"cls-active" to classForActiveItems
|
||||||
|
"cls-inactive" to classForInactiveItems
|
||||||
|
"show-on-up" to showOnUp
|
||||||
|
"media" to media
|
||||||
|
"target-offset" to targetOffset ?.toString()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
sealed interface Position {
|
||||||
|
val name: String
|
||||||
|
object Top : Position {
|
||||||
|
override val name: String
|
||||||
|
get() = "top"
|
||||||
|
}
|
||||||
|
object Bottom : Position {
|
||||||
|
override val name: String
|
||||||
|
get() = "bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user