mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2025-09-16 05:50:00 +00:00
add opportunity to now show dialog automatically
This commit is contained in:
@@ -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,7 +100,9 @@ fun Dialog(
|
|||||||
}
|
}
|
||||||
htmlElement.addEventListener("hidden", wrapper)
|
htmlElement.addEventListener("hidden", wrapper)
|
||||||
|
|
||||||
UIKit.modal("#${htmlElement.id}") ?.show()
|
if (autoShow) {
|
||||||
|
UIKit.modal("#${htmlElement.id}") ?.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user