aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form/FieldLabel.kt
diff options
context:
space:
mode:
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)
+ }
+
+}