mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-23 10:38:45 +00:00
add onClick callback into Close#drawAsButton
This commit is contained in:
parent
c337dd2b2d
commit
04a94cfabe
@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.jsuikit.elements
|
package dev.inmo.jsuikit.elements
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.web.events.SyntheticMouseEvent
|
||||||
import dev.inmo.jsuikit.modifiers.UIKitClose
|
import dev.inmo.jsuikit.modifiers.UIKitClose
|
||||||
import dev.inmo.jsuikit.modifiers.include
|
import dev.inmo.jsuikit.modifiers.include
|
||||||
import dev.inmo.jsuikit.utils.Attrs
|
import dev.inmo.jsuikit.utils.Attrs
|
||||||
@ -28,12 +29,16 @@ object Close {
|
|||||||
@Composable
|
@Composable
|
||||||
fun drawAsButton(
|
fun drawAsButton(
|
||||||
attrs: Attrs<HTMLButtonElement> = Attrs.empty(),
|
attrs: Attrs<HTMLButtonElement> = Attrs.empty(),
|
||||||
contentBuilder: ContentBuilder<HTMLButtonElement> = {}
|
contentBuilder: ContentBuilder<HTMLButtonElement> = {},
|
||||||
|
onClick: ((SyntheticMouseEvent) -> Unit)? = null
|
||||||
) = Button(
|
) = Button(
|
||||||
{
|
{
|
||||||
type(ButtonType.Button)
|
type(ButtonType.Button)
|
||||||
include(UIKitClose)
|
include(UIKitClose)
|
||||||
attrs.builder(this)
|
attrs.builder(this)
|
||||||
|
onClick ?.let {
|
||||||
|
onClick(onClick)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
contentBuilder
|
contentBuilder
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user