add DropAre, UIKitPlaceholder and UIKitForm#Custom now have nullable target

This commit is contained in:
InsanusMokrassar 2022-03-02 16:52:58 +06:00
parent a596516c79
commit 556ab4e090
4 changed files with 34 additions and 1 deletions

View File

@ -2,6 +2,10 @@
## 0.0.41 ## 0.0.41
* Add `DropArea`
* Add `UIKitPlaceholder`
* `UIKitForm#Custom` now have nullable param target
## 0.0.40 ## 0.0.40
* All `DefaultTable` functions now use `Iterable` as data type * All `DefaultTable` functions now use `Iterable` as data type

View 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)
}

View File

@ -47,7 +47,7 @@ sealed class UIKitForm(
object Icon : UIKitForm("uk-form-icon") object Icon : UIKitForm("uk-form-icon")
class Custom( class Custom(
target: String = "true" target: String? = null
) : UIKitForm( ) : UIKitForm(
otherAttrs = mapOf( otherAttrs = mapOf(
buildAttribute("uk-form-custom") { buildAttribute("uk-form-custom") {

View File

@ -0,0 +1,5 @@
package dev.inmo.jsuikit.modifiers
object UIKitPlaceholder : UIKitModifier {
override val classes: Array<String> = arrayOf("uk-placeholder")
}