aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form/check
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-25 01:04:24 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-25 01:04:24 +0100
commit9a1effcf29b27cc2e60b927c2d737b6cad0289b7 (patch)
treecd47309106493f869a7d7d5e9a43dcc99969dd4c /src/main/kotlin/pl/treksoft/kvision/form/check
parentc64b2c4b1f0c4e0e0d94d202715db4aaa47d9c65 (diff)
downloadkvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.tar.gz
kvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.tar.bz2
kvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.zip
Change enum classes names for better readability.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/check')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt6
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt10
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt6
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt4
4 files changed, 13 insertions, 13 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt
index e76a1c7a..c274d999 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt
@@ -34,7 +34,7 @@ import pl.treksoft.kvision.utils.SnOn
/**
* Checkbox style options.
*/
-enum class CHECKBOXSTYLE(internal val className: String) {
+enum class CheckBoxStyle(internal val className: String) {
DEFAULT("checkbox-default"),
PRIMARY("checkbox-primary"),
SUCCESS("checkbox-success"),
@@ -107,7 +107,7 @@ open class CheckBox(
/**
* The style (one of Bootstrap standard colors) of the input.
*/
- var style: CHECKBOXSTYLE? by refreshOnUpdate()
+ var style: CheckBoxStyle? by refreshOnUpdate()
/**
* Determines if the checkbox is rendered as a circle.
*/
@@ -127,7 +127,7 @@ open class CheckBox(
private val idc = "kv_form_checkbox_" + counter
final override val input: CheckInput = CheckInput(
- CHECKINPUTTYPE.CHECKBOX, value,
+ CheckInputType.CHECKBOX, value,
setOf("styled")
).apply { id = idc }
final override val flabel: FieldLabel = FieldLabel(idc, label, rich, classes = setOf())
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
index 9e0c1fa9..a9e7b33d 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
@@ -27,12 +27,12 @@ import pl.treksoft.kvision.core.Container
import pl.treksoft.kvision.core.StringBoolPair
import pl.treksoft.kvision.core.StringPair
import pl.treksoft.kvision.core.Widget
-import pl.treksoft.kvision.form.INPUTSIZE
+import pl.treksoft.kvision.form.InputSize
/**
* Type of the check input control (checkbox or radio).
*/
-enum class CHECKINPUTTYPE(internal val type: String) {
+enum class CheckInputType(internal val type: String) {
CHECKBOX("checkbox"),
RADIO("radio")
}
@@ -46,7 +46,7 @@ enum class CHECKINPUTTYPE(internal val type: String) {
* @param classes a set of CSS class names
*/
open class CheckInput(
- type: CHECKINPUTTYPE = CHECKINPUTTYPE.CHECKBOX, value: Boolean = false,
+ type: CheckInputType = CheckInputType.CHECKBOX, value: Boolean = false,
classes: Set<String> = setOf()
) : Widget(classes) {
@@ -93,7 +93,7 @@ open class CheckInput(
/**
* The size of the input.
*/
- var size: INPUTSIZE? by refreshOnUpdate()
+ var size: InputSize? by refreshOnUpdate()
override fun render(): VNode {
return render("input")
@@ -159,7 +159,7 @@ open class CheckInput(
* It takes the same parameters as the constructor of the built component.
*/
fun Container.checkInput(
- type: CHECKINPUTTYPE = CHECKINPUTTYPE.CHECKBOX, value: Boolean = false,
+ type: CheckInputType = CheckInputType.CHECKBOX, value: Boolean = false,
classes: Set<String> = setOf(), init: (CheckInput.() -> Unit)? = null
): CheckInput {
val checkInput = CheckInput(type, value, classes).apply { init?.invoke(this) }
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt
index 0cf85fc5..a4dc851c 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt
@@ -34,7 +34,7 @@ import pl.treksoft.kvision.utils.SnOn
/**
* Radio style options.
*/
-enum class RADIOSTYLE(internal val className: String) {
+enum class RadioStyle(internal val className: String) {
DEFAULT("radio-default"),
PRIMARY("radio-primary"),
SUCCESS("radio-success"),
@@ -117,7 +117,7 @@ open class Radio(
/**
* The style (one of Bootstrap standard colors) of the input.
*/
- var style: RADIOSTYLE? by refreshOnUpdate()
+ var style: RadioStyle? by refreshOnUpdate()
/**
* Determines if the radio button is rendered as a square.
*/
@@ -136,7 +136,7 @@ open class Radio(
}
private val idc = "kv_form_radio_" + counter
- final override val input: CheckInput = CheckInput(CHECKINPUTTYPE.RADIO, value).apply {
+ final override val input: CheckInput = CheckInput(CheckInputType.RADIO, value).apply {
this.id = idc
this.extraValue = extraValue
this.name = name
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt
index e5b04a47..8a4a84bd 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt
@@ -27,7 +27,7 @@ import pl.treksoft.kvision.core.StringPair
import pl.treksoft.kvision.core.Widget
import pl.treksoft.kvision.form.FieldLabel
import pl.treksoft.kvision.form.HelpBlock
-import pl.treksoft.kvision.form.INPUTSIZE
+import pl.treksoft.kvision.form.InputSize
import pl.treksoft.kvision.form.StringFormControl
import pl.treksoft.kvision.form.select.Select
import pl.treksoft.kvision.panel.SimplePanel
@@ -87,7 +87,7 @@ open class RadioGroup(
set(value) {
flabel.rich = value
}
- override var size: INPUTSIZE? = null
+ override var size: InputSize? = null
private val idc = "kv_form_radiogroup_" + Select.counter
final override val input = Widget()