diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-06-02 00:27:55 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-06-02 00:27:55 +0200 |
commit | d30d88968a5d5d068899acbf939a5e0dc2f395ed (patch) | |
tree | 355377b6d40d05028bb713b803a5f8050061a902 /sw-ui/src/main/kotlin/com/palantir | |
parent | Fix style (diff) | |
download | seven-wonders-d30d88968a5d5d068899acbf939a5e0dc2f395ed.tar.gz seven-wonders-d30d88968a5d5d068899acbf939a5e0dc2f395ed.tar.bz2 seven-wonders-d30d88968a5d5d068899acbf939a5e0dc2f395ed.zip |
Add blueprintjs's divider
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() +} |