Merge pull request #14 from InsanusMokrassar/0.0.14

0.0.14
This commit is contained in:
InsanusMokrassar 2022-01-21 22:20:16 +06:00 committed by GitHub
commit 2db4e48571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.0.14
* Add DefaultTable parameter cellCustomizer
## 0.0.13 ## 0.0.13
* Add `Icon#Custom` * Add `Icon#Custom`

View File

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

View File

@ -16,7 +16,8 @@ fun <T> DefaultTable(
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {}, attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
headingCustomizer: AttrBuilderContext<HTMLTableCellElement> = {}, headingCustomizer: AttrBuilderContext<HTMLTableCellElement> = {},
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {}, rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
cellFiller: @Composable (i: Int, t: T) -> Unit cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
) { ) {
val headingIndexes = heading.indices val headingIndexes = heading.indices
Table( Table(
@ -47,7 +48,11 @@ fun <T> DefaultTable(
} }
) { ) {
headingIndexes.forEach { i -> headingIndexes.forEach { i ->
Td { Td(
{
cellCustomizer(i, it)
}
) {
cellFiller(i, it) cellFiller(i, it)
} }
} }