From e46b2e0ddd8e2927c182b040eed08894a0ab65af Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jan 2022 22:41:18 +0600 Subject: [PATCH 1/2] start 0.0.15 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dec70b..fecddc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.0.15 + ## 0.0.14 * Add DefaultTable parameter cellCustomizer diff --git a/gradle.properties b/gradle.properties index 137b4d2..803cfe1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.14 +version=0.0.15 From 40c3c0f4370381c06d571986ecfe85d5e7a80011 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jan 2022 22:41:26 +0600 Subject: [PATCH 2/2] add support of link icons type --- CHANGELOG.md | 2 ++ .../kotlin/dev/inmo/jsuikit/elements/Icon.kt | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fecddc0..4cb325d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.0.15 +* Add support of link icons + ## 0.0.14 * Add DefaultTable parameter cellCustomizer diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt index 8e79559..e9e528e 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt @@ -219,10 +219,10 @@ sealed class Icon(val name: String) { } attributesCustomizer() } - if (type == UIKitIconType.Button) { - Button(configurer) - } else { - Span(configurer) + when (type) { + UIKitIconType.Default -> Span(configurer) + UIKitIconType.Link -> A(href = "#", configurer) + UIKitIconType.Button -> Button(configurer) } } @@ -243,4 +243,12 @@ sealed class Icon(val name: String) { attributesCustomizer: AttrBuilderContext = {}, onClick: ((Event) -> Unit)? = null ) = invoke(*modifiers, type = UIKitIconType.Default, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) + + @Composable + fun drawAsLink( + vararg modifiers: UIKitModifier, + ratio: Float? = null, + attributesCustomizer: AttrBuilderContext = {}, + onClick: ((Event) -> Unit)? = null + ) = invoke(*modifiers, type = UIKitIconType.Link, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) }