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 # Changelog
## 0.0.50
* Add opportunity to customize content in title of `Nav` after text
## 0.0.49 ## 0.0.49
* Now it is possible to use optional title in navs builders * Now it is possible to use optional title in navs builders

View File

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

View File

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