mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-02 06:50:09 +00:00
Compare commits
No commits in common. "fafb7e7e04e0bebfc523f3cc6118205eaf145f93" and "efd9cb80e17d01e624bc42527ed3b70ce046fb23" have entirely different histories.
fafb7e7e04
...
efd9cb80e1
@ -1,10 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 0.1.4
|
|
||||||
|
|
||||||
* Improvements in `UIKitGrid`
|
|
||||||
* Add support of `UIKitSticky`
|
|
||||||
|
|
||||||
## 0.1.3
|
## 0.1.3
|
||||||
|
|
||||||
* Add support of sections
|
* Add support of sections
|
||||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.1.4
|
version=0.1.3
|
||||||
|
@ -1,41 +1,20 @@
|
|||||||
package dev.inmo.jsuikit.modifiers
|
package dev.inmo.jsuikit.modifiers
|
||||||
|
|
||||||
import dev.inmo.jsuikit.utils.buildAttribute
|
sealed class UIKitGrid(suffix: String) : UIKitModifier {
|
||||||
|
override val classes: Array<String> = arrayOf("uk-grid-$suffix")
|
||||||
|
|
||||||
sealed class UIKitGrid(vararg classnames: String) : UIKitModifier {
|
sealed class Gap(suffix: String) : UIKitGrid(suffix) {
|
||||||
override val classes: Array<String> = classnames as Array<String>
|
|
||||||
|
|
||||||
sealed class Gap(classname: String) : UIKitGrid(classname) {
|
object Small : Gap("small")
|
||||||
|
object Medium : Gap("medium")
|
||||||
object Small : Gap("uk-grid-small")
|
object Large : Gap("large")
|
||||||
object Medium : Gap("uk-grid-medium")
|
object Collapse : Gap("collapse")
|
||||||
object Large : Gap("uk-grid-large")
|
|
||||||
object Collapse : Gap("uk-grid-collapse")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object Divider : UIKitGrid("uk-grid-divider")
|
object Divider : UIKitGrid("divider")
|
||||||
|
|
||||||
object MatchHeight : UIKitGrid("uk-grid-match")
|
object MatchHeight : UIKitGrid("match")
|
||||||
object ItemMatchHeight : UIKitGrid("uk-grid-item-match")
|
object ItemMatchHeight : UIKitGrid("item-match")
|
||||||
|
|
||||||
class Custom internal constructor(override val otherAttrs: Map<String, String>) : UIKitGrid()
|
|
||||||
|
|
||||||
companion object : UIKitGrid("uk-grid") {
|
|
||||||
operator fun invoke(
|
|
||||||
margin: UIKitMargin? = null,
|
|
||||||
firstColumnClass: String? = null,
|
|
||||||
masonry: Boolean? = null,
|
|
||||||
parallax: UInt? = null
|
|
||||||
) = Custom(
|
|
||||||
mapOf(
|
|
||||||
buildAttribute("uk-grid") {
|
|
||||||
margin to margin ?.classes ?.joinToString(" ")
|
|
||||||
"first-column" to firstColumnClass
|
|
||||||
"masonry" to masonry
|
|
||||||
"parallax" to parallax
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
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