Merge pull request #51 from InsanusMokrassar/0.0.50

0.0.50
This commit is contained in:
InsanusMokrassar 2022-04-04 00:57:44 +06:00 committed by GitHub
commit 2d62f9847a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.0.50
* Add opportunity to customize content in title of `Nav` after text
## 0.0.49
* Now it is possible to use optional title in navs builders

View File

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

View File

@ -1,7 +1,6 @@
package dev.inmo.jsuikit.elements
import androidx.compose.runtime.Composable
import androidx.compose.runtime.snapshots.SnapshotStateList
import dev.inmo.jsuikit.buildAndAddAttribute
import dev.inmo.jsuikit.modifiers.*
import dev.inmo.jsuikit.utils.Milliseconds
@ -104,6 +103,7 @@ fun <T> Nav(
duration: Milliseconds? = null,
besidesTitleAndList: ContentBuilder<HTMLUListElement>? = null,
titleCustomizer: AttrBuilderContext<HTMLLIElement> = {},
afterTitleContentBuilder: ContentBuilder<HTMLLIElement> = {},
ulCustomizer: AttrBuilderContext<HTMLUListElement> = {},
elementAllocator: @Composable ElementScope<HTMLUListElement>.(T) -> Unit
) {
@ -123,7 +123,8 @@ fun <T> Nav(
NavHeader(
title,
*titleModifiers,
attributesCustomizer = titleCustomizer
attributesCustomizer = titleCustomizer,
afterTitleContentBuilder = afterTitleContentBuilder
)
}
besidesTitleAndList ?.let { it() }
@ -145,6 +146,7 @@ fun <T> DefaultNav(
duration: Milliseconds? = null,
besidesTitleAndList: ContentBuilder<HTMLUListElement>? = null,
titleCustomizer: AttrBuilderContext<HTMLLIElement> = {},
afterTitleContentBuilder: ContentBuilder<HTMLLIElement> = {},
ulCustomizer: AttrBuilderContext<HTMLUListElement> = {},
elementAllocator: @Composable ElementScope<HTMLUListElement>.(T) -> Unit
) = Nav(
@ -158,6 +160,7 @@ fun <T> DefaultNav(
duration,
besidesTitleAndList,
titleCustomizer,
afterTitleContentBuilder,
ulCustomizer,
elementAllocator
)
@ -174,6 +177,7 @@ fun <T> PrimaryNav(
duration: Milliseconds? = null,
besidesTitleAndList: ContentBuilder<HTMLUListElement>? = null,
titleCustomizer: AttrBuilderContext<HTMLLIElement> = {},
afterTitleContentBuilder: ContentBuilder<HTMLLIElement> = {},
ulCustomizer: AttrBuilderContext<HTMLUListElement> = {},
elementAllocator: @Composable ElementScope<HTMLUListElement>.(T) -> Unit
) = Nav(
@ -187,6 +191,7 @@ fun <T> PrimaryNav(
duration,
besidesTitleAndList,
titleCustomizer,
afterTitleContentBuilder,
ulCustomizer,
elementAllocator
)
@ -203,6 +208,7 @@ fun <T> SubNav(
duration: Milliseconds? = null,
besidesTitleAndList: ContentBuilder<HTMLUListElement>? = null,
titleCustomizer: AttrBuilderContext<HTMLLIElement> = {},
afterTitleContentBuilder: ContentBuilder<HTMLLIElement> = {},
ulCustomizer: AttrBuilderContext<HTMLUListElement> = {},
elementAllocator: @Composable ElementScope<HTMLUListElement>.(T) -> Unit
) = Nav(
@ -216,6 +222,7 @@ fun <T> SubNav(
duration,
besidesTitleAndList,
titleCustomizer,
afterTitleContentBuilder,
ulCustomizer,
elementAllocator
)
@ -225,6 +232,7 @@ fun NavHeader(
text: String,
vararg modifiers: UIKitModifier,
attributesCustomizer: AttrBuilderContext<HTMLLIElement> = {},
afterTitleContentBuilder: ContentBuilder<HTMLLIElement> = {}
) {
Li(
{
@ -233,6 +241,7 @@ fun NavHeader(
}
) {
Text(text)
afterTitleContentBuilder()
}
}