From 674fbbd4d5711def4218c150c3f5e3c923ba3f28 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 22 May 2022 23:21:10 +0600 Subject: [PATCH 1/3] start 0.1.4 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2251e9..f85421a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.1.4 + ## 0.1.3 * Add support of sections diff --git a/gradle.properties b/gradle.properties index 91e5a9e..91954dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.1.3 +version=0.1.4 From 4377ec3969bbfb2fe87cada821ffafc142ffb686 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 22 May 2022 23:21:25 +0600 Subject: [PATCH 2/3] improvements --- CHANGELOG.md | 2 + .../dev/inmo/jsuikit/modifiers/UIKitGrid.kt | 41 ++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f85421a..bb0f4bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.1.4 +* Improvements in `UIKitGrid` + ## 0.1.3 * Add support of sections diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt index b6d4833..b97b769 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt @@ -1,20 +1,41 @@ package dev.inmo.jsuikit.modifiers -sealed class UIKitGrid(suffix: String) : UIKitModifier { - override val classes: Array = arrayOf("uk-grid-$suffix") +import dev.inmo.jsuikit.utils.buildAttribute - sealed class Gap(suffix: String) : UIKitGrid(suffix) { +sealed class UIKitGrid(vararg classnames: String) : UIKitModifier { + override val classes: Array = classnames as Array - object Small : Gap("small") - object Medium : Gap("medium") - object Large : Gap("large") - object Collapse : Gap("collapse") + sealed class Gap(classname: String) : UIKitGrid(classname) { + + object Small : Gap("uk-grid-small") + object Medium : Gap("uk-grid-medium") + object Large : Gap("uk-grid-large") + object Collapse : Gap("uk-grid-collapse") } - object Divider : UIKitGrid("divider") + object Divider : UIKitGrid("uk-grid-divider") - object MatchHeight : UIKitGrid("match") - object ItemMatchHeight : UIKitGrid("item-match") + object MatchHeight : UIKitGrid("uk-grid-match") + object ItemMatchHeight : UIKitGrid("uk-grid-item-match") + class Custom internal constructor(override val otherAttrs: Map) : 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 + } + ) + ) + } } From 5afa92ef37a5bae42d4312eccfe43f0eb1a070ea Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 22 May 2022 23:45:21 +0600 Subject: [PATCH 3/3] UIKitSticky --- CHANGELOG.md | 1 + .../dev/inmo/jsuikit/modifiers/UIKitSticky.kt | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0f4bd..efd7c8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.1.4 * Improvements in `UIKitGrid` +* Add support of `UIKitSticky` ## 0.1.3 diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt new file mode 100644 index 0000000..00c2d71 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitSticky.kt @@ -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? = null, + overflowFlip: Boolean? = null, + animation: UIKitAnimation? = null, + classForActiveItems: String? = null, + classForInactiveItems: String? = null, + showOnUp: Boolean? = null, + media: String? = null, + targetOffset: CSSUnitValueTyped? = null +) : UIKitModifier { + override val otherAttrs: Map = 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" + } + } +}