mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-27 04:28:46 +00:00
add opportunity to now show dialog automatically
This commit is contained in:
parent
5dff8d69f2
commit
432a5744b3
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.4.3
|
## 0.4.3
|
||||||
|
|
||||||
|
* Add opportunity to now show dialog automatically
|
||||||
|
|
||||||
## 0.4.2
|
## 0.4.2
|
||||||
|
|
||||||
* `Compose`: `1.2.2`
|
* `Compose`: `1.2.2`
|
||||||
|
@ -36,6 +36,7 @@ fun Dialog(
|
|||||||
footerAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
footerAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
||||||
footerBuilder: ContentBuilder<HTMLDivElement>? = null,
|
footerBuilder: ContentBuilder<HTMLDivElement>? = null,
|
||||||
bodyAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
bodyAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
||||||
|
autoShow: Boolean = true,
|
||||||
bodyBuilder: ContentBuilder<HTMLDivElement>
|
bodyBuilder: ContentBuilder<HTMLDivElement>
|
||||||
) {
|
) {
|
||||||
Div(
|
Div(
|
||||||
@ -99,9 +100,11 @@ fun Dialog(
|
|||||||
}
|
}
|
||||||
htmlElement.addEventListener("hidden", wrapper)
|
htmlElement.addEventListener("hidden", wrapper)
|
||||||
|
|
||||||
|
if (autoShow) {
|
||||||
UIKit.modal("#${htmlElement.id}") ?.show()
|
UIKit.modal("#${htmlElement.id}") ?.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -112,6 +115,7 @@ fun Dialog(
|
|||||||
hidden: (() -> Unit)? = null,
|
hidden: (() -> Unit)? = null,
|
||||||
footerBuilder: (@Composable () -> Unit)? = null,
|
footerBuilder: (@Composable () -> Unit)? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
||||||
|
autoShow: Boolean = true,
|
||||||
bodyBuilder: @Composable () -> Unit
|
bodyBuilder: @Composable () -> Unit
|
||||||
) = Dialog(
|
) = Dialog(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
@ -130,6 +134,7 @@ fun Dialog(
|
|||||||
attributesCustomizer = {
|
attributesCustomizer = {
|
||||||
attributesCustomizer()
|
attributesCustomizer()
|
||||||
},
|
},
|
||||||
|
autoShow = autoShow,
|
||||||
bodyBuilder = {
|
bodyBuilder = {
|
||||||
bodyBuilder()
|
bodyBuilder()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user