mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-26 20:18:49 +00:00
add DropAre, UIKitPlaceholder and UIKitForm#Custom now have nullable target
This commit is contained in:
parent
a596516c79
commit
556ab4e090
@ -2,6 +2,10 @@
|
||||
|
||||
## 0.0.41
|
||||
|
||||
* Add `DropArea`
|
||||
* Add `UIKitPlaceholder`
|
||||
* `UIKitForm#Custom` now have nullable param target
|
||||
|
||||
## 0.0.40
|
||||
|
||||
* All `DefaultTable` functions now use `Iterable` as data type
|
||||
|
24
src/jsMain/kotlin/dev/inmo/jsuikit/elements/DropArea.kt
Normal file
24
src/jsMain/kotlin/dev/inmo/jsuikit/elements/DropArea.kt
Normal file
@ -0,0 +1,24 @@
|
||||
package dev.inmo.jsuikit.elements
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import dev.inmo.jsuikit.modifiers.*
|
||||
import dev.inmo.jsuikit.utils.Attrs
|
||||
import org.jetbrains.compose.web.attributes.InputType
|
||||
import org.jetbrains.compose.web.dom.*
|
||||
import org.w3c.dom.HTMLDivElement
|
||||
import org.w3c.dom.HTMLInputElement
|
||||
|
||||
@Composable
|
||||
fun DropArea(
|
||||
attrs: Attrs<HTMLDivElement> = Attrs.empty(),
|
||||
inputAttrs: Attrs<HTMLInputElement> = Attrs.empty(),
|
||||
contentBuilder: ContentBuilder<HTMLDivElement> = {}
|
||||
) = Div(
|
||||
{
|
||||
include(UIKitPlaceholder, UIKitForm.Custom())
|
||||
attrs.builder(this)
|
||||
}
|
||||
) {
|
||||
Input(InputType.File, attrs = { inputAttrs.builder.invoke(this) })
|
||||
contentBuilder(this)
|
||||
}
|
@ -47,7 +47,7 @@ sealed class UIKitForm(
|
||||
object Icon : UIKitForm("uk-form-icon")
|
||||
|
||||
class Custom(
|
||||
target: String = "true"
|
||||
target: String? = null
|
||||
) : UIKitForm(
|
||||
otherAttrs = mapOf(
|
||||
buildAttribute("uk-form-custom") {
|
||||
|
@ -0,0 +1,5 @@
|
||||
package dev.inmo.jsuikit.modifiers
|
||||
|
||||
object UIKitPlaceholder : UIKitModifier {
|
||||
override val classes: Array<String> = arrayOf("uk-placeholder")
|
||||
}
|
Loading…
Reference in New Issue
Block a user