mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 00:27:25 +00:00
add headerCustomizer to table
This commit is contained in:
parent
2a76519843
commit
598e481f75
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ out/
|
|||||||
|
|
||||||
secret.gradle
|
secret.gradle
|
||||||
local.properties
|
local.properties
|
||||||
|
local.*
|
||||||
|
|
||||||
kotlin-js-store/
|
kotlin-js-store/
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.0.23
|
## 0.0.23
|
||||||
|
|
||||||
|
* New parameter of tables `headerCustomizer`
|
||||||
|
|
||||||
## 0.0.22
|
## 0.0.22
|
||||||
|
|
||||||
* Add opportunity to customize table header cells
|
* Add opportunity to customize table header cells
|
||||||
|
@ -14,7 +14,8 @@ fun <T> DefaultTable(
|
|||||||
dataList: SnapshotStateList<T>,
|
dataList: SnapshotStateList<T>,
|
||||||
vararg tableModifiers: UIKitModifier,
|
vararg tableModifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
||||||
headerCellCustomizer: AttrsBuilder<HTMLTableCellElement>.(i: Int) -> Unit = { },
|
headerCustomizer: AttrBuilderContext<HTMLTableSectionElement> = {},
|
||||||
|
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 = { _, _ -> },
|
||||||
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
cellFiller: @Composable ElementScope<HTMLTableCellElement>.(i: Int, t: T) -> Unit
|
||||||
@ -27,7 +28,7 @@ fun <T> DefaultTable(
|
|||||||
attributesCustomizer()
|
attributesCustomizer()
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Thead {
|
Thead(headerCustomizer) {
|
||||||
Tr {
|
Tr {
|
||||||
headerBuilders.forEachIndexed { i, t ->
|
headerBuilders.forEachIndexed { i, t ->
|
||||||
Th(
|
Th(
|
||||||
@ -40,6 +41,7 @@ fun <T> DefaultTable(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tbody {
|
Tbody {
|
||||||
dataList.forEach {
|
dataList.forEach {
|
||||||
Tr(
|
Tr(
|
||||||
@ -68,6 +70,7 @@ fun <T> DefaultTable(
|
|||||||
dataList: SnapshotStateList<T>,
|
dataList: SnapshotStateList<T>,
|
||||||
vararg tableModifiers: UIKitModifier,
|
vararg tableModifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
||||||
|
headerCustomizer: AttrBuilderContext<HTMLTableSectionElement> = {},
|
||||||
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 = { _, _ -> },
|
||||||
@ -89,6 +92,7 @@ fun <T> DefaultTable(
|
|||||||
dataList,
|
dataList,
|
||||||
tableModifiers = tableModifiers,
|
tableModifiers = tableModifiers,
|
||||||
attributesCustomizer,
|
attributesCustomizer,
|
||||||
|
headerCustomizer,
|
||||||
headerCellCustomizer,
|
headerCellCustomizer,
|
||||||
rowAttributes,
|
rowAttributes,
|
||||||
cellCustomizer,
|
cellCustomizer,
|
||||||
|
Loading…
Reference in New Issue
Block a user