From 484564e323e7563b95f9c4faba45fe7cdf307554 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jan 2022 20:27:31 +0600 Subject: [PATCH 1/2] start 0.0.12 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f330600..6094566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.0.12 + ## 0.0.11 * Upfill `Nav` and `UIKitNav` diff --git a/gradle.properties b/gradle.properties index abf9a9a..acc4fcb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.11 +version=0.0.12 From a2830e5e8581b47bb12c9ca69e613cf82e519fe7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jan 2022 20:28:19 +0600 Subject: [PATCH 2/2] add rowAttributes customizer for tables --- CHANGELOG.md | 2 ++ src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6094566..fb1bd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.0.12 +* Add `rowAttributes` to table fun + ## 0.0.11 * Upfill `Nav` and `UIKitNav` diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt index e0059fa..bb0a43f 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt @@ -3,6 +3,7 @@ package dev.inmo.jsuikit.elements import androidx.compose.runtime.Composable import androidx.compose.runtime.snapshots.SnapshotStateList import dev.inmo.jsuikit.modifiers.* +import org.jetbrains.compose.web.attributes.AttrsBuilder import org.jetbrains.compose.web.dom.* import org.jetbrains.compose.web.dom.Text import org.w3c.dom.* @@ -14,6 +15,7 @@ fun DefaultTable( vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, headingCustomizer: AttrBuilderContext = {}, + rowAttributes: AttrsBuilder.(t: T) -> Unit = {}, cellFiller: @Composable (i: Int, t: T) -> Unit ) { val headingIndexes = heading.indices @@ -39,7 +41,11 @@ fun DefaultTable( } Tbody { dataList.forEach { - Tr { + Tr( + { + rowAttributes(it) + } + ) { headingIndexes.forEach { i -> Td { cellFiller(i, it)