mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 16:47:24 +00:00
commit
1f36657857
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.0.12
|
||||||
|
|
||||||
|
* Add `rowAttributes` to table fun
|
||||||
|
|
||||||
## 0.0.11
|
## 0.0.11
|
||||||
|
|
||||||
* Upfill `Nav` and `UIKitNav`
|
* Upfill `Nav` and `UIKitNav`
|
||||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.0.11
|
version=0.0.12
|
||||||
|
@ -3,6 +3,7 @@ package dev.inmo.jsuikit.elements
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.snapshots.SnapshotStateList
|
import androidx.compose.runtime.snapshots.SnapshotStateList
|
||||||
import dev.inmo.jsuikit.modifiers.*
|
import dev.inmo.jsuikit.modifiers.*
|
||||||
|
import org.jetbrains.compose.web.attributes.AttrsBuilder
|
||||||
import org.jetbrains.compose.web.dom.*
|
import org.jetbrains.compose.web.dom.*
|
||||||
import org.jetbrains.compose.web.dom.Text
|
import org.jetbrains.compose.web.dom.Text
|
||||||
import org.w3c.dom.*
|
import org.w3c.dom.*
|
||||||
@ -14,6 +15,7 @@ fun <T> DefaultTable(
|
|||||||
vararg tableModifiers: UIKitModifier,
|
vararg tableModifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
||||||
headingCustomizer: AttrBuilderContext<HTMLTableCellElement> = {},
|
headingCustomizer: AttrBuilderContext<HTMLTableCellElement> = {},
|
||||||
|
rowAttributes: AttrsBuilder<HTMLTableRowElement>.(t: T) -> Unit = {},
|
||||||
cellFiller: @Composable (i: Int, t: T) -> Unit
|
cellFiller: @Composable (i: Int, t: T) -> Unit
|
||||||
) {
|
) {
|
||||||
val headingIndexes = heading.indices
|
val headingIndexes = heading.indices
|
||||||
@ -39,7 +41,11 @@ fun <T> DefaultTable(
|
|||||||
}
|
}
|
||||||
Tbody {
|
Tbody {
|
||||||
dataList.forEach {
|
dataList.forEach {
|
||||||
Tr {
|
Tr(
|
||||||
|
{
|
||||||
|
rowAttributes(it)
|
||||||
|
}
|
||||||
|
) {
|
||||||
headingIndexes.forEach { i ->
|
headingIndexes.forEach { i ->
|
||||||
Td {
|
Td {
|
||||||
cellFiller(i, it)
|
cellFiller(i, it)
|
||||||
|
Loading…
Reference in New Issue
Block a user