From 475afeb78ba86509dc4ba196ec0cc3ca11a474d8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 12 Mar 2022 00:05:54 +0600 Subject: [PATCH 1/4] start 0.0.43 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ad16d..d9d5fd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.0.43 + ## 0.0.42 * Migration to compose 1.1.0 diff --git a/gradle.properties b/gradle.properties index cbd324d..046fce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.42 +version=0.0.43 From 3ddb22341c9583623aa9f682128c23da36bc9865 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 12 Mar 2022 00:06:47 +0600 Subject: [PATCH 2/4] additions in UIKitScreenSizeModifier and support of Tile --- CHANGELOG.md | 3 +++ .../kotlin/dev/inmo/jsuikit/elements/Tile.kt | 21 +++++++++++++++++++ .../modifiers/UIKitScreenSizeModifier.kt | 9 ++++++++ .../dev/inmo/jsuikit/modifiers/UIKitTile.kt | 15 +++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 src/jsMain/kotlin/dev/inmo/jsuikit/elements/Tile.kt create mode 100644 src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTile.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d5fd5..c886dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.0.43 +* Several new extensions for `UIKitModifier` like `UIKitModifier#onSmallScreen` +* Support of `Tile` + ## 0.0.42 * Migration to compose 1.1.0 diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Tile.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Tile.kt new file mode 100644 index 0000000..5a533c3 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Tile.kt @@ -0,0 +1,21 @@ +package dev.inmo.jsuikit.elements + +import androidx.compose.runtime.Composable +import dev.inmo.jsuikit.modifiers.UIKitTile +import dev.inmo.jsuikit.modifiers.include +import dev.inmo.jsuikit.utils.Attrs +import org.jetbrains.compose.web.dom.ContentBuilder +import org.jetbrains.compose.web.dom.Div +import org.w3c.dom.HTMLDivElement + +@Composable +fun Tile( + attrs: Attrs = Attrs.empty(), + contentBuilder: ContentBuilder +) = Div( + { + include(UIKitTile) + attrs.builder(this) + }, + contentBuilder +) diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt index f5e4248..61d2871 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt @@ -20,3 +20,12 @@ sealed class UIKitScreenSizeModifier(val name: String) { } fun UIKitModifier.applyWhenScreenSizeIs(size: UIKitScreenSizeModifier) = size.modify(this) + +val UIKitModifier.onSmallScreens + get() = applyWhenScreenSizeIs(UIKitScreenSizeModifier.Small) +val UIKitModifier.onMediumScreens + get() = applyWhenScreenSizeIs(UIKitScreenSizeModifier.Medium) +val UIKitModifier.onLargeScreens + get() = applyWhenScreenSizeIs(UIKitScreenSizeModifier.Large) +val UIKitModifier.onXLargeScreens + get() = applyWhenScreenSizeIs(UIKitScreenSizeModifier.XLarge) diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTile.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTile.kt new file mode 100644 index 0000000..49a2161 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTile.kt @@ -0,0 +1,15 @@ +package dev.inmo.jsuikit.modifiers + +sealed class UIKitTile( + override val classes: Array = emptyArray(), + override val otherAttrs: Map = emptyMap() +) : UIKitModifier { + + object Default : UIKitTile(arrayOf("uk-tile-default")) + object Muted : UIKitTile(arrayOf("uk-tile-muted")) + object Primary : UIKitTile(arrayOf("uk-tile-primary")) + object Secondary : UIKitTile(arrayOf("uk-tile-secondary")) + + companion object : UIKitTile(arrayOf("uk-tile")) + +} From 43e3ed742d00f10b84b6023478c1af4a7cb97541 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 12 Mar 2022 00:07:32 +0600 Subject: [PATCH 3/4] update gradle wrapper --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e589..00e33ed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 38a884cc16d49f345484918a708bc56cc96905f3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 12 Mar 2022 00:16:57 +0600 Subject: [PATCH 4/4] add defaults in content builders of Grid and GridColumn --- src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt index d0c357e..bc31bce 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt @@ -10,7 +10,7 @@ import org.w3c.dom.HTMLDivElement fun GridColumn( vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, - builder: @Composable ElementScope.() -> Unit + builder: @Composable ElementScope.() -> Unit = {} ) { Div( { @@ -30,7 +30,7 @@ fun Grid( marginClass: String? = null, firstColumnClass: String? = null, attributesCustomizer: AttrBuilderContext = {}, - builder: @Composable ElementScope.() -> Unit + builder: @Composable ElementScope.() -> Unit = {} ) { val attrs = listOfNotNull( if (masonry) "masonry" to "true" else null,