Merge pull request #24 from InsanusMokrassar/0.0.24

0.0.24
This commit is contained in:
InsanusMokrassar 2022-01-25 20:22:41 +06:00 committed by GitHub
commit e94585fc7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.0.24
* Add opportunity to fill space between header and body of table
## 0.0.23
* New parameter of tables `headerCustomizer`

View File

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

View File

@ -18,6 +18,7 @@ fun <T> DefaultTable(
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int) -> Unit = {},
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
betweenHeaderAndBodyFiller: ContentBuilder<HTMLTableElement> = {},
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
) {
val headingIndexes = headerBuilders.indices
@ -41,7 +42,7 @@ fun <T> DefaultTable(
}
}
}
betweenHeaderAndBodyFiller()
Tbody {
dataList.forEach {
Tr(
@ -74,6 +75,7 @@ fun <T> DefaultTable(
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, title: String) -> Unit = { _, _ -> },
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
betweenHeaderAndBodyFiller: ContentBuilder<HTMLTableElement> = {},
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
) {
val headersByIndex = heading.mapIndexed { index, s -> index to s }.toMap()
@ -96,6 +98,7 @@ fun <T> DefaultTable(
headerCellCustomizer,
rowAttributes,
cellCustomizer,
betweenHeaderAndBodyFiller,
cellFiller
)
}