From a4343ed3c4021db99de0fbc3f7c76929ad758265 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 10 Nov 2017 11:06:05 +0100 Subject: RichText form components --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 37 ++++++++-- .../kotlin/pl/treksoft/kvision/core/KVManager.kt | 2 + .../kvision/form/text/AbstractTextInput.kt | 20 +++--- .../pl/treksoft/kvision/form/text/RichText.kt | 19 +++++ .../pl/treksoft/kvision/form/text/RichTextInput.kt | 83 ++++++++++++++++++++++ .../pl/treksoft/kvision/form/text/TextAreaInput.kt | 2 +- .../pl/treksoft/kvision/form/text/TextInput.kt | 2 +- 7 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/text/RichText.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index b6444720..084b60d6 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -7,19 +7,20 @@ import pl.treksoft.kvision.data.DataComponent import pl.treksoft.kvision.data.DataContainer import pl.treksoft.kvision.dropdown.DD.* import pl.treksoft.kvision.dropdown.DropDown -import pl.treksoft.kvision.form.check.CheckBox import pl.treksoft.kvision.form.INPUTSIZE -import pl.treksoft.kvision.form.text.TEXTINPUTTYPE -import pl.treksoft.kvision.form.text.Text -import pl.treksoft.kvision.form.text.TextArea -import pl.treksoft.kvision.form.text.TextAreaInput -import pl.treksoft.kvision.form.text.TextInput +import pl.treksoft.kvision.form.check.CheckBox import pl.treksoft.kvision.form.select.AjaxOptions import pl.treksoft.kvision.form.select.SELECTWIDTHTYPE import pl.treksoft.kvision.form.select.Select import pl.treksoft.kvision.form.select.SelectInput import pl.treksoft.kvision.form.select.SelectOptGroup import pl.treksoft.kvision.form.select.SelectOption +import pl.treksoft.kvision.form.text.RichText +import pl.treksoft.kvision.form.text.TEXTINPUTTYPE +import pl.treksoft.kvision.form.text.Text +import pl.treksoft.kvision.form.text.TextArea +import pl.treksoft.kvision.form.text.TextAreaInput +import pl.treksoft.kvision.form.text.TextInput import pl.treksoft.kvision.html.* import pl.treksoft.kvision.html.TAG.DIV import pl.treksoft.kvision.html.TAG.H1 @@ -217,6 +218,25 @@ class Showcase : ApplicationBase() { } root.add(mbuttons8) + val htmlArea = RichText("testBoldzik", "Pole html").apply { + size = INPUTSIZE.SMALL + placeholder = "Wprowadź rich text" + width = 50.perc() + inputHeight = 200.px() + } + root.add(htmlArea) + htmlArea.setEventListener { + change = { + console.log(self.value) + } + } + val mbuttons9 = Button("Sprawdz html").setEventListener