diff --git a/CHANGELOG.md b/CHANGELOG.md index bf54d67..d204cf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.0.17 +* In `DefaultTable` `headingCustomizer` has been renamed to `headerCellCustomizer` +* Add index and title parameters for `headerCellCustomizer` in `DefaultTable` + ## 0.0.16 * Add opportunity to customize `NavDivider` diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt index 5ef0b74..77db07e 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt @@ -14,7 +14,7 @@ fun DefaultTable( dataList: SnapshotStateList, vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, - headingCustomizer: AttrBuilderContext = {}, + headerCellCustomizer: AttrsBuilder.(i: Int, title: String) -> Unit = { _, _ -> }, rowAttributes: AttrsBuilder.(t: T) -> Unit = {}, cellCustomizer: AttrsBuilder.(i: Int, t: T) -> Unit = { _, _ -> }, cellFiller: @Composable ElementScope.(i: Int, t: T) -> Unit @@ -29,13 +29,13 @@ fun DefaultTable( ) { Thead { Tr { - heading.forEach { + heading.forEachIndexed { i, t -> Th( { - headingCustomizer() + headerCellCustomizer(i, t) } ) { - Text(it) + Text(t) } } }