summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt
diff options
context:
space:
mode:
Diffstat (limited to 'sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt')
-rw-r--r--sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt26
1 files changed, 26 insertions, 0 deletions
diff --git a/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt b/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt
index 928653c5..da6b6914 100644
--- a/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt
+++ b/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt
@@ -30,6 +30,7 @@ fun RBuilder.bpIcon(
fun RBuilder.bpButton(
minimal: Boolean = false,
+ small: Boolean = false,
large: Boolean = false,
disabled: Boolean = false,
title: String? = null,
@@ -42,6 +43,7 @@ fun RBuilder.bpButton(
attrs {
this.title = title
this.minimal = minimal
+ this.small = small
this.large = large
this.disabled = disabled
this.icon = icon
@@ -109,3 +111,27 @@ fun RBuilder.bpNonIdealState(
}
block()
}
+
+fun RBuilder.bpOverlay(
+ isOpen: Boolean,
+ autoFocus: Boolean = true,
+ enforceFocus: Boolean = true,
+ usePortal: Boolean = true,
+ hasBackdrop: Boolean = true,
+ canEscapeKeyClose: Boolean = true,
+ canOutsideClickClose: Boolean = true,
+ onClose: () -> Unit = {},
+ block: RHandler<IOverlayProps> = {}
+): ReactElement = child(Overlay::class) {
+ attrs {
+ this.isOpen = isOpen
+ this.autoFocus = autoFocus
+ this.enforceFocus = enforceFocus
+ this.usePortal = usePortal
+ this.hasBackdrop = hasBackdrop
+ this.canEscapeKeyClose = canEscapeKeyClose
+ this.canOutsideClickClose = canOutsideClickClose
+ this.onClose = { onClose() }
+ }
+ block()
+}
bgstack15