From 2a76519843c830dd5a7dbc2fcd81258695c3bb27 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Jan 2022 20:12:48 +0600 Subject: [PATCH 1/2] start 0.0.23 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- local.make_version.sh | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 local.make_version.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a7f160..68795f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.0.23 + ## 0.0.22 * Add opportunity to customize table header cells diff --git a/gradle.properties b/gradle.properties index 330e4bb..ec5b8c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.22 +version=0.0.23 diff --git a/local.make_version.sh b/local.make_version.sh new file mode 100755 index 0000000..659ca91 --- /dev/null +++ b/local.make_version.sh @@ -0,0 +1 @@ +git add -A && git stash && git checkout master && git pull && git checkout -b "$1" && nano gradle.properties CHANGELOG.md && git add -A && git commit -m "start $1" && git stash pop && git add -A && nano CHANGELOG.md && git add -A && git commit -m "$2" && git push --set-upstream origin "$1" && ./gradlew clean && ./gradlew publishToMavenLocal From 598e481f75f0b4fa88843d4de1075d6ca2a3d8cd Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Jan 2022 20:13:03 +0600 Subject: [PATCH 2/2] add headerCustomizer to table --- .gitignore | 1 + CHANGELOG.md | 2 ++ src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 032b956..790348e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ out/ secret.gradle local.properties +local.* kotlin-js-store/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 68795f9..e7f03dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.0.23 +* New parameter of tables `headerCustomizer` + ## 0.0.22 * Add opportunity to customize table header cells diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt index 911eae9..f58c05f 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt @@ -14,7 +14,8 @@ fun DefaultTable( dataList: SnapshotStateList, vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, - headerCellCustomizer: AttrsBuilder.(i: Int) -> Unit = { }, + headerCustomizer: AttrBuilderContext = {}, + headerCellCustomizer: AttrsBuilder.(i: Int) -> Unit = {}, rowAttributes: AttrsBuilder.(t: T) -> Unit = {}, cellCustomizer: AttrsBuilder.(i: Int, t: T) -> Unit = { _, _ -> }, cellFiller: @Composable ElementScope.(i: Int, t: T) -> Unit @@ -27,7 +28,7 @@ fun DefaultTable( attributesCustomizer() } ) { - Thead { + Thead(headerCustomizer) { Tr { headerBuilders.forEachIndexed { i, t -> Th( @@ -40,6 +41,7 @@ fun DefaultTable( } } } + Tbody { dataList.forEach { Tr( @@ -68,6 +70,7 @@ fun DefaultTable( dataList: SnapshotStateList, vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, + headerCustomizer: AttrBuilderContext = {}, headerCellCustomizer: AttrsBuilder.(i: Int, title: String) -> Unit = { _, _ -> }, rowAttributes: AttrsBuilder.(t: T) -> Unit = {}, cellCustomizer: AttrsBuilder.(i: Int, t: T) -> Unit = { _, _ -> }, @@ -89,6 +92,7 @@ fun DefaultTable( dataList, tableModifiers = tableModifiers, attributesCustomizer, + headerCustomizer, headerCellCustomizer, rowAttributes, cellCustomizer,