diff options
Diffstat (limited to 'sw-ui/src/main/kotlin/com/palantir')
-rw-r--r-- | sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDivider.kt | 20 | ||||
-rw-r--r-- | sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDivider.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDivider.kt new file mode 100644 index 00000000..8ccef232 --- /dev/null +++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDivider.kt @@ -0,0 +1,20 @@ +@file:JsModule("@blueprintjs/core") +package com.palantir.blueprintjs + +import react.PureComponent +import react.RState +import react.ReactElement + +external interface IDividerProps : IProps { + var tagName: Any? + get() = definedExternally + set(value) = definedExternally +} + +open external class Divider : PureComponent<IDividerProps, RState> { + override fun render(): ReactElement + + companion object { + var displayName: String + } +} diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt index 1a7638dc..d486f818 100644 --- a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt +++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt @@ -200,3 +200,15 @@ fun RBuilder.bpHtmlTable( } block() } + +fun RBuilder.bpDivider( + tagName: String? = null, + block: RHandler<IDividerProps> = {} +): ReactElement = child(Divider::class) { + attrs { + if (tagName != null) { + this.tagName = tagName + } + } + block() +} |