From d591af011d040d8ce2684f044b594d28ab358ef9 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 19 Oct 2017 15:22:42 +0200 Subject: Form controls: TextArea --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 23 +++-- .../pl/treksoft/kvision/form/AbstractText.kt | 84 +++++++++++++++++ .../pl/treksoft/kvision/form/AbstractTextInput.kt | 105 +++++++++++++++++++++ .../kotlin/pl/treksoft/kvision/form/CheckBox.kt | 5 + src/main/kotlin/pl/treksoft/kvision/form/Radio.kt | 5 + src/main/kotlin/pl/treksoft/kvision/form/Text.kt | 61 +----------- .../kotlin/pl/treksoft/kvision/form/TextArea.kt | 28 ++++++ .../pl/treksoft/kvision/form/TextAreaInput.kt | 47 +++++++++ .../kotlin/pl/treksoft/kvision/form/TextInput.kt | 95 +------------------ 9 files changed, 297 insertions(+), 156 deletions(-) create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/AbstractText.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/AbstractTextInput.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/TextArea.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/TextAreaInput.kt (limited to 'src/main/kotlin/pl/treksoft/kvision') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index afe49299..f1406505 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -4,14 +4,7 @@ import pl.treksoft.kvision.basic.Label import pl.treksoft.kvision.core.* import pl.treksoft.kvision.dropdown.DD.* import pl.treksoft.kvision.dropdown.DropDown -import pl.treksoft.kvision.form.CHECKBOXSTYLE -import pl.treksoft.kvision.form.CheckBox -import pl.treksoft.kvision.form.INPUTSIZE -import pl.treksoft.kvision.form.RADIOSTYLE -import pl.treksoft.kvision.form.Radio -import pl.treksoft.kvision.form.TEXTINPUTTYPE -import pl.treksoft.kvision.form.Text -import pl.treksoft.kvision.form.TextInput +import pl.treksoft.kvision.form.* import pl.treksoft.kvision.html.* import pl.treksoft.kvision.html.TAG.DIV import pl.treksoft.kvision.html.TAG.H1 @@ -90,6 +83,20 @@ class Showcase : ApplicationBase() { val text = Text(placeholder = "Pole formularza", maxlength = 5, label = "To jest pole") root.add(text) + val textareainput = TextAreaInput(cols = 5, rows = 2, placeholder = "...", value = "To jest tekst\nTo jest tekst2") + root.add(textareainput) + + val textarea = TextArea(cols = 5, rows = 2, placeholder = "...", value = "To jest tekst\nTo jest tekst2", label = "Pole długie") + root.add(textarea) + textarea.setEventListener