diff options
| author | Robert Jaros <rjaros@finn.pl> | 2018-02-25 01:04:24 +0100 |
|---|---|---|
| committer | Robert Jaros <rjaros@finn.pl> | 2018-02-25 01:04:24 +0100 |
| commit | 9a1effcf29b27cc2e60b927c2d737b6cad0289b7 (patch) | |
| tree | cd47309106493f869a7d7d5e9a43dcc99969dd4c /src/main/kotlin/pl/treksoft/kvision/form/text | |
| parent | c64b2c4b1f0c4e0e0d94d202715db4aaa47d9c65 (diff) | |
| download | kvision-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/text')
4 files changed, 8 insertions, 8 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt index c43f94ba..844e30ba 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt @@ -25,7 +25,7 @@ import com.github.snabbdom.VNode 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 /** * Base class for basic text components. @@ -85,7 +85,7 @@ abstract class AbstractTextInput( /** * The size of the input. */ - var size: INPUTSIZE? by refreshOnUpdate() + var size: InputSize? by refreshOnUpdate() override fun getSnClass(): List<StringBoolPair> { val cl = super.getSnClass().toMutableList() diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/Password.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/Password.kt index e2f9ab93..995243c9 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/text/Password.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/text/Password.kt @@ -32,7 +32,7 @@ import pl.treksoft.kvision.core.Container * @param rich determines if [label] can contain HTML code */ open class Password(value: String? = null, label: String? = null, rich: Boolean = false) : Text( - TEXTINPUTTYPE.PASSWORD, + TextInputType.PASSWORD, value, label, rich ) { companion object { diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/Text.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/Text.kt index ac9d0d9b..fd53adff 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/text/Text.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/text/Text.kt @@ -33,7 +33,7 @@ import pl.treksoft.kvision.core.Container * @param rich determines if [label] can contain HTML code */ open class Text( - type: TEXTINPUTTYPE = TEXTINPUTTYPE.TEXT, value: String? = null, + type: TextInputType = TextInputType.TEXT, value: String? = null, label: String? = null, rich: Boolean = false ) : AbstractText(label, rich) { @@ -70,7 +70,7 @@ open class Text( * It takes the same parameters as the constructor of the built component. */ fun Container.text( - type: TEXTINPUTTYPE = TEXTINPUTTYPE.TEXT, value: String? = null, + type: TextInputType = TextInputType.TEXT, value: String? = null, label: String? = null, rich: Boolean = false, init: (Text.() -> Unit)? = null ): Text { val text = Text(type, value, label, rich).apply { init?.invoke(this) } diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/TextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/TextInput.kt index 998bfb2c..bc6e178d 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/text/TextInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/text/TextInput.kt @@ -28,7 +28,7 @@ import pl.treksoft.kvision.core.StringPair /** * Text input types. */ -enum class TEXTINPUTTYPE(internal val type: String) { +enum class TextInputType(internal val type: String) { TEXT("text"), PASSWORD("password"), EMAIL("email"), @@ -46,7 +46,7 @@ enum class TEXTINPUTTYPE(internal val type: String) { * @param value text input value * @param classes a set of CSS class names */ -open class TextInput(type: TEXTINPUTTYPE = TEXTINPUTTYPE.TEXT, value: String? = null, classes: Set<String> = setOf()) : +open class TextInput(type: TextInputType = TextInputType.TEXT, value: String? = null, classes: Set<String> = setOf()) : AbstractTextInput(value, classes + "form-control") { /** @@ -85,7 +85,7 @@ open class TextInput(type: TEXTINPUTTYPE = TEXTINPUTTYPE.TEXT, value: String? = * It takes the same parameters as the constructor of the built component. */ fun Container.textInput( - type: TEXTINPUTTYPE = TEXTINPUTTYPE.TEXT, value: String? = null, classes: Set<String> = setOf(), + type: TextInputType = TextInputType.TEXT, value: String? = null, classes: Set<String> = setOf(), init: (TextInput.() -> Unit)? = null ): TextInput { val textInput = TextInput(type, value, classes).apply { init?.invoke(this) } |
