From d30d88968a5d5d068899acbf939a5e0dc2f395ed Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Tue, 2 Jun 2020 00:27:55 +0200 Subject: Add blueprintjs's divider --- .../kotlin/com/palantir/blueprintjs/BpDivider.kt | 20 ++++++++++++++++++++ .../com/palantir/blueprintjs/blueprintjsHelpers.kt | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDivider.kt 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 { + 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 = {} +): ReactElement = child(Divider::class) { + attrs { + if (tagName != null) { + this.tagName = tagName + } + } + block() +} -- cgit