aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-11-05 10:50:01 +0100
committerRobert Jaros <rjaros@finn.pl>2019-11-05 10:50:01 +0100
commita128f5e1a8e70530380d30cc0cb5168fe7a9bdea (patch)
treebf944d07b476e95ce97cdc17512246cc099d76fd /kvision-modules
parentbd5ca4eb07b8b7f6cff1ac8abfb34cfb638076e4 (diff)
downloadkvision-a128f5e1a8e70530380d30cc0cb5168fe7a9bdea.tar.gz
kvision-a128f5e1a8e70530380d30cc0cb5168fe7a9bdea.tar.bz2
kvision-a128f5e1a8e70530380d30cc0cb5168fe7a9bdea.zip
Add labels/fields horizontal ratio option for FormPanel component.
Diffstat (limited to 'kvision-modules')
-rw-r--r--kvision-modules/kvision-bootstrap-spinner/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt11
1 files changed, 6 insertions, 5 deletions
diff --git a/kvision-modules/kvision-bootstrap-spinner/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt b/kvision-modules/kvision-bootstrap-spinner/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
index 450d4466..ac0e9836 100644
--- a/kvision-modules/kvision-bootstrap-spinner/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
+++ b/kvision-modules/kvision-bootstrap-spinner/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
@@ -25,6 +25,7 @@ import pl.treksoft.kvision.core.Container
import pl.treksoft.kvision.core.StringBoolPair
import pl.treksoft.kvision.core.Widget
import pl.treksoft.kvision.form.FieldLabel
+import pl.treksoft.kvision.form.FormHorizontalRatio
import pl.treksoft.kvision.form.InvalidFeedback
import pl.treksoft.kvision.form.NumberFormControl
import pl.treksoft.kvision.html.ButtonStyle
@@ -243,13 +244,13 @@ open class Spinner(
input.blur()
}
- override fun styleForHorizontalFormPanel() {
+ override fun styleForHorizontalFormPanel(horizontalRatio: FormHorizontalRatio) {
addCssClass("row")
- flabel.addCssClass("col-sm-2")
+ flabel.addCssClass("col-sm-${horizontalRatio.labels}")
flabel.addCssClass("col-form-label")
- input.addSurroundingCssClass("col-sm-10")
- invalidFeedback.addCssClass("offset-sm-2")
- invalidFeedback.addCssClass("col-sm-10")
+ input.addSurroundingCssClass("col-sm-${horizontalRatio.fields}")
+ invalidFeedback.addCssClass("offset-sm-${horizontalRatio.labels}")
+ invalidFeedback.addCssClass("col-sm-${horizontalRatio.fields}")
}
companion object {