Compare commits

..

6 Commits

Author SHA1 Message Date
65703d1c22 add Icon#Custom 2022-01-21 21:37:16 +06:00
814045a43f start 0.0.13 2022-01-21 21:37:07 +06:00
1f36657857 Merge pull request #12 from InsanusMokrassar/0.0.12
0.0.12
2022-01-21 20:29:00 +06:00
a2830e5e85 add rowAttributes customizer for tables 2022-01-21 20:28:19 +06:00
484564e323 start 0.0.12 2022-01-21 20:27:31 +06:00
b5e93bc829 Merge pull request #11 from InsanusMokrassar/0.0.11
0.0.11
2022-01-21 11:32:00 +06:00
4 changed files with 18 additions and 2 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## 0.0.13
* Add `Icon#Custom`
## 0.0.12
* Add `rowAttributes` to table fun
## 0.0.11
* Upfill `Nav` and `UIKitNav`

View File

@@ -9,4 +9,4 @@ android.enableJetifier=true
# Project data
group=dev.inmo
version=0.0.11
version=0.0.13

View File

@@ -226,6 +226,8 @@ sealed class Icon(val name: String) {
}
}
class Custom(name: String) : Icon(name)
@Composable
fun drawAsButton(
vararg modifiers: UIKitModifier,

View File

@@ -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 <T> DefaultTable(
vararg tableModifiers: UIKitModifier,
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
headingCustomizer: AttrBuilderContext<HTMLTableCellElement> = {},
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
cellFiller: @Composable (i: Int, t: T) -> Unit
) {
val headingIndexes = heading.indices
@@ -39,7 +41,11 @@ fun <T> DefaultTable(
}
Tbody {
dataList.forEach {
Tr {
Tr(
{
rowAttributes(it)
}
) {
headingIndexes.forEach { i ->
Td {
cellFiller(i, it)