mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-26 20:18:49 +00:00
add opportunity to fill space between header and body of table
This commit is contained in:
parent
95edaf1cfe
commit
b449caae13
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.0.24
|
## 0.0.24
|
||||||
|
|
||||||
|
* Add opportunity to fill space between header and body of table
|
||||||
|
|
||||||
## 0.0.23
|
## 0.0.23
|
||||||
|
|
||||||
* New parameter of tables `headerCustomizer`
|
* New parameter of tables `headerCustomizer`
|
||||||
|
@ -18,6 +18,7 @@ fun <T> DefaultTable(
|
|||||||
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int) -> Unit = {},
|
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int) -> Unit = {},
|
||||||
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
|
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
|
||||||
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
|
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
|
||||||
|
betweenHeaderAndBodyFiller: ContentBuilder<HTMLTableElement> = {},
|
||||||
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
||||||
) {
|
) {
|
||||||
val headingIndexes = headerBuilders.indices
|
val headingIndexes = headerBuilders.indices
|
||||||
@ -41,7 +42,7 @@ fun <T> DefaultTable(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
betweenHeaderAndBodyFiller()
|
||||||
Tbody {
|
Tbody {
|
||||||
dataList.forEach {
|
dataList.forEach {
|
||||||
Tr(
|
Tr(
|
||||||
@ -74,6 +75,7 @@ fun <T> DefaultTable(
|
|||||||
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, title: String) -> Unit = { _, _ -> },
|
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, title: String) -> Unit = { _, _ -> },
|
||||||
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
|
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
|
||||||
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
|
cellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int, t: T) -> Unit = { _, _ -> },
|
||||||
|
betweenHeaderAndBodyFiller: ContentBuilder<HTMLTableElement> = {},
|
||||||
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
||||||
) {
|
) {
|
||||||
val headersByIndex = heading.mapIndexed { index, s -> index to s }.toMap()
|
val headersByIndex = heading.mapIndexed { index, s -> index to s }.toMap()
|
||||||
@ -96,6 +98,7 @@ fun <T> DefaultTable(
|
|||||||
headerCellCustomizer,
|
headerCellCustomizer,
|
||||||
rowAttributes,
|
rowAttributes,
|
||||||
cellCustomizer,
|
cellCustomizer,
|
||||||
|
betweenHeaderAndBodyFiller,
|
||||||
cellFiller
|
cellFiller
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user