aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2017-10-19 12:04:37 +0200
committerRobert Jaros <rjaros@finn.pl>2017-10-19 12:04:37 +0200
commit3ef71f681eeb1a832bbd0f95d01958617529bae7 (patch)
tree7ed5dae4696f24c1a527013ad42b6a5268558ead /src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt
parentdaa6f55e70e85c15c55ef06fd2912d95ea4922fc (diff)
downloadkvision-3ef71f681eeb1a832bbd0f95d01958617529bae7.tar.gz
kvision-3ef71f681eeb1a832bbd0f95d01958617529bae7.tar.bz2
kvision-3ef71f681eeb1a832bbd0f95d01958617529bae7.zip
Refactoring styled component
Form controls: input, password, checkbox
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt b/src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt
new file mode 100644
index 00000000..92b014d4
--- /dev/null
+++ b/src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt
@@ -0,0 +1,14 @@
+package pl.treksoft.kvision.form
+
+import pl.treksoft.kvision.html.TAG
+import pl.treksoft.kvision.html.Tag
+import pl.treksoft.kvision.snabbdom.StringPair
+
+open class FieldLabel(private val forId: String, text: String? = null, rich: Boolean = false) : Tag(TAG.LABEL,
+ text, rich) {
+
+ override fun getSnAttrs(): List<StringPair> {
+ return super.getSnAttrs() + ("for" to forId)
+ }
+
+}