From f5189331957c8b0174552c3b9a9b6a03c3889855 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Jan 2022 00:00:42 +0600 Subject: [PATCH 1/2] start 0.0.17 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc7984..bf54d67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.0.17 + ## 0.0.16 * Add opportunity to customize `NavDivider` diff --git a/gradle.properties b/gradle.properties index c0a0404..9e81911 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.16 +version=0.0.17 From 9449eccec1df6e40ed6ebadcd2f03677ca0b38c0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Jan 2022 00:02:29 +0600 Subject: [PATCH 2/2] headingCustomizer -> headerCellCustomizer + add index and title parameters for it --- CHANGELOG.md | 3 +++ src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf54d67..d204cf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.0.17 +* In `DefaultTable` `headingCustomizer` has been renamed to `headerCellCustomizer` +* Add index and title parameters for `headerCellCustomizer` in `DefaultTable` + ## 0.0.16 * Add opportunity to customize `NavDivider` diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt index 5ef0b74..77db07e 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt @@ -14,7 +14,7 @@ fun DefaultTable( dataList: SnapshotStateList, vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, - headingCustomizer: AttrBuilderContext = {}, + headerCellCustomizer: AttrsBuilder.(i: Int, title: String) -> Unit = { _, _ -> }, rowAttributes: AttrsBuilder.(t: T) -> Unit = {}, cellCustomizer: AttrsBuilder.(i: Int, t: T) -> Unit = { _, _ -> }, cellFiller: @Composable ElementScope.(i: Int, t: T) -> Unit @@ -29,13 +29,13 @@ fun DefaultTable( ) { Thead { Tr { - heading.forEach { + heading.forEachIndexed { i, t -> Th( { - headingCustomizer() + headerCellCustomizer(i, t) } ) { - Text(it) + Text(t) } } }