diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-01-17 19:29:30 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-01-17 19:29:30 +0100 |
commit | 31c9d3c4121107974a8419752aa7face5c96f821 (patch) | |
tree | 77aaac10c5a120b028c14f53ab74eb5491f4a443 /src/main/kotlin/pl/treksoft/kvision/form/spinner | |
parent | 646e82e383850447fd4d10f71ecc0aeab11623e0 (diff) | |
download | kvision-31c9d3c4121107974a8419752aa7face5c96f821.tar.gz kvision-31c9d3c4121107974a8419752aa7face5c96f821.tar.bz2 kvision-31c9d3c4121107974a8419752aa7face5c96f821.zip |
Code formatting (Kotlin Style Guide)
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/spinner')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt | 12 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt | 10 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt b/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt index c6084fa8..5e2c460b 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt @@ -8,10 +8,12 @@ import pl.treksoft.kvision.panel.SimplePanel import pl.treksoft.kvision.snabbdom.SnOn import pl.treksoft.kvision.snabbdom.StringBoolPair -open class Spinner(value: Number? = null, min: Int = 0, max: Int = DEFAULT_MAX, step: Double = DEFAULT_STEP, - decimals: Int = 0, buttonsType: BUTTONSTYPE = BUTTONSTYPE.VERTICAL, - forceType: FORCETYPE = FORCETYPE.NONE, label: String? = null, - rich: Boolean = false) : SimplePanel(setOf("form-group")), NumberFormControl { +open class Spinner( + value: Number? = null, min: Int = 0, max: Int = DEFAULT_MAX, step: Double = DEFAULT_STEP, + decimals: Int = 0, buttonsType: BUTTONSTYPE = BUTTONSTYPE.VERTICAL, + forceType: FORCETYPE = FORCETYPE.NONE, label: String? = null, + rich: Boolean = false +) : SimplePanel(setOf("form-group")), NumberFormControl { override var value get() = input.value @@ -91,7 +93,7 @@ open class Spinner(value: Number? = null, min: Int = 0, max: Int = DEFAULT_MAX, protected val idc = "kv_form_spinner_" + counter final override val input: SpinnerInput = SpinnerInput(value, min, max, step, decimals, buttonsType, forceType) - .apply { id = idc } + .apply { id = idc } final override val flabel: FieldLabel = FieldLabel(idc, label, rich) final override val validationInfo: HelpBlock = HelpBlock().apply { visible = false } diff --git a/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt index b7d0f959..139a8ba9 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt @@ -25,10 +25,12 @@ const val DEFAULT_STEP = 1.0 const val DEFAULT_MAX = 100 @Suppress("TooManyFunctions") -open class SpinnerInput(value: Number? = null, min: Int = 0, max: Int = DEFAULT_MAX, step: Double = DEFAULT_STEP, - decimals: Int = 0, buttonsType: BUTTONSTYPE = BUTTONSTYPE.VERTICAL, - forceType: FORCETYPE = FORCETYPE.NONE, - classes: Set<String> = setOf()) : Widget(classes + "form-control") { +open class SpinnerInput( + value: Number? = null, min: Int = 0, max: Int = DEFAULT_MAX, step: Double = DEFAULT_STEP, + decimals: Int = 0, buttonsType: BUTTONSTYPE = BUTTONSTYPE.VERTICAL, + forceType: FORCETYPE = FORCETYPE.NONE, + classes: Set<String> = setOf() +) : Widget(classes + "form-control") { init { this.addSurroundingCssClass("input-group") |