mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 00:27:25 +00:00
remove deprecations
This commit is contained in:
parent
aa5015d079
commit
190b3ac53e
@ -2,6 +2,8 @@
|
||||
|
||||
## 0.2.0
|
||||
|
||||
**ALL DEPRECATIONS HAVE BEEN REMOVED**
|
||||
|
||||
* `Kotlin`: `1.7.0`
|
||||
* `Compose`: `1.2.0-alpha01-dev753`
|
||||
|
||||
|
@ -1,26 +1,8 @@
|
||||
package dev.inmo.jsuikit
|
||||
|
||||
import dev.inmo.jsuikit.modifiers.AttributeValue
|
||||
import dev.inmo.jsuikit.utils.*
|
||||
import org.jetbrains.compose.web.attributes.AttrsScope
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
class UIKitAttributeValueBuilder {
|
||||
private val attrs = mutableListOf<Pair<String, String>>()
|
||||
|
||||
infix fun String.to(other: String?) {
|
||||
other ?.let {
|
||||
attrs.add(Pair(this, other))
|
||||
}
|
||||
}
|
||||
|
||||
infix fun String.to(other: AttributeValue?) {
|
||||
this to other ?.name
|
||||
}
|
||||
|
||||
fun build(): String = attrs.joinToString(";") { (k, v) -> "$k: $v" }
|
||||
}
|
||||
|
||||
fun AttrsScope<*>.buildAndAddAttribute(
|
||||
attributeName: String,
|
||||
skipNullValues: Boolean = true,
|
||||
|
@ -43,25 +43,3 @@ fun <T> ListWithTitle(
|
||||
besidesTitleAndList ?.invoke()
|
||||
List(data, Attrs(*ulModifiers) { ulCustomizer(this) }, elementAllocator)
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("ListWithTitle", "dev.inmo.jsuikit.elements.ListWithTitle"))
|
||||
@Composable
|
||||
fun <T> List(
|
||||
title: String,
|
||||
data: SnapshotStateList<T>,
|
||||
vararg titleModifiers: UIKitModifier,
|
||||
ulModifiers: Array<UIKitModifier> = emptyArray(),
|
||||
besidesTitleAndList: (@Composable () -> Unit)? = null,
|
||||
titleCustomizer: AttrBuilderContext<HTMLHeadingElement> = {},
|
||||
ulCustomizer: AttrBuilderContext<HTMLUListElement> = {},
|
||||
elementAllocator: @Composable ElementScope<HTMLUListElement>.(T) -> Unit
|
||||
) = ListWithTitle(
|
||||
title,
|
||||
data,
|
||||
*titleModifiers,
|
||||
ulModifiers = ulModifiers,
|
||||
besidesTitleAndList = besidesTitleAndList,
|
||||
titleCustomizer = titleCustomizer,
|
||||
ulCustomizer = ulCustomizer,
|
||||
elementAllocator = elementAllocator
|
||||
)
|
||||
|
@ -22,33 +22,6 @@ fun Navbar(
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon. Use the variant with AttrsWithContentBuilders")
|
||||
@Composable
|
||||
fun Navbar(
|
||||
leftBuilder: NavbarNavBuilder?,
|
||||
centerBuilder: NavbarNavBuilder? = null,
|
||||
rightBuilder: NavbarNavBuilder? = null,
|
||||
vararg navModifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLElement> = {},
|
||||
) {
|
||||
Navbar(
|
||||
{
|
||||
include(*navModifiers)
|
||||
attributesCustomizer()
|
||||
}
|
||||
) {
|
||||
leftBuilder ?.let {
|
||||
Div({ include(UIKitNavbar.Alignment.Left) }) { it.draw() }
|
||||
}
|
||||
centerBuilder ?.let {
|
||||
Div({ include(UIKitNavbar.Alignment.Center) }) { it.draw() }
|
||||
}
|
||||
rightBuilder ?.let {
|
||||
Div({ include(UIKitNavbar.Alignment.Right) }) { it.draw() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Navbar(
|
||||
leftBuilder: AttrsWithContentBuilder<HTMLDivElement>? = null,
|
||||
|
@ -30,58 +30,3 @@ fun NavbarNav(
|
||||
vararg elements: AttrsWithContentBuilder<HTMLLIElement>,
|
||||
attrs: Attrs<HTMLUListElement> = Attrs.empty()
|
||||
) = NavbarNav(elements.toList(), attrs)
|
||||
|
||||
@Deprecated("Will be removed soon. Use NavbarNavPart with AttrsWithContentBuilder instead")
|
||||
interface NavbarNavElement {
|
||||
fun AttrsScope<HTMLLIElement>.setup() {}
|
||||
@Composable
|
||||
fun ElementScope<HTMLLIElement>.fill()
|
||||
|
||||
class Default(
|
||||
private val setupCallback: AttrsScope<HTMLLIElement>.() -> Unit,
|
||||
private val fillCallback: @Composable ElementScope<HTMLLIElement>.() -> Unit
|
||||
) : NavbarNavElement {
|
||||
override fun AttrsScope<HTMLLIElement>.setup() {
|
||||
setupCallback()
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun ElementScope<HTMLLIElement>.fill() {
|
||||
fillCallback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon. Use NavbarNavPart with AttrsWithContentBuilder instead")
|
||||
class NavbarNavBuilder(
|
||||
private val modifiers: Array<UIKitModifier>,
|
||||
private val elements: List<NavbarNavElement>,
|
||||
private val attributesCustomizer: AttrBuilderContext<HTMLUListElement> = {}
|
||||
) {
|
||||
constructor(
|
||||
modifiers: Array<UIKitModifier>,
|
||||
vararg elements: NavbarNavElement,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLUListElement> = {}
|
||||
) : this(modifiers, elements.toList(), attributesCustomizer)
|
||||
constructor(
|
||||
vararg elements: NavbarNavElement,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLUListElement> = {}
|
||||
) : this(emptyArray(), elements.toList(), attributesCustomizer)
|
||||
@Composable
|
||||
fun draw() {
|
||||
Ul(
|
||||
{
|
||||
include(UIKitNavbar.Nav, *modifiers)
|
||||
attributesCustomizer()
|
||||
}
|
||||
) {
|
||||
elements.forEach { element ->
|
||||
Li(
|
||||
{ element.apply { setup() } }
|
||||
) {
|
||||
element.apply { fill() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,14 +41,3 @@ fun <T> StandardInput(
|
||||
attributesCustomizer()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@Deprecated("Renamed", ReplaceWith("StandardInput", "dev.inmo.jsuikit.elements.StandardInput"))
|
||||
fun <T> TextField(
|
||||
type: InputType<T>,
|
||||
state: MutableState<T>,
|
||||
disabledState: State<Boolean>? = null,
|
||||
placeholder: String? = null,
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||
) = StandardInput(type, state, disabledState, placeholder, modifiers = modifiers, attributesCustomizer)
|
||||
|
Loading…
Reference in New Issue
Block a user