aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Widget.kt6
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/AbstractText.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt8
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/time/DateTime.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/Root.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/table/Cell.kt1
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt1
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/table/Row.kt1
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/window/Window.kt2
15 files changed, 20 insertions, 17 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
index ac3ba143..03222d6f 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
@@ -551,12 +551,12 @@ open class Widget(classes: Set<String> = setOf()) : StyledComponent() {
): Array<out Any> {
return if (icon != null) {
if (icon.startsWith("fa-")) {
- arrayOf(KVManager.virtualize("<i class='fa $icon'></i>"), " " + label)
+ arrayOf(KVManager.virtualize("<i class='fa $icon'></i>"), " $label")
} else {
- arrayOf(KVManager.virtualize("<span class='glyphicon glyphicon-$icon'></span>"), " " + label)
+ arrayOf(KVManager.virtualize("<span class='glyphicon glyphicon-$icon'></span>"), " $label")
}
} else if (image != null) {
- arrayOf(KVManager.virtualize("<img src='$image' alt='' />"), " " + label)
+ arrayOf(KVManager.virtualize("<img src='$image' alt='' />"), " $label")
} else {
arrayOf(label)
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
index 3ea85d4a..44396951 100644
--- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
@@ -133,7 +133,7 @@ open class DropDown(
button.width = value
}
- private val idc = "kv_dropdown_" + counter
+ private val idc = "kv_dropdown_$counter"
internal val button: DropDownButton = DropDownButton(
idc, text, icon, style,
disabled, setOf("dropdown")
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 c274d999..80790bdd 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckBox.kt
@@ -125,7 +125,7 @@ open class CheckBox(
input.size = value
}
- private val idc = "kv_form_checkbox_" + counter
+ private val idc = "kv_form_checkbox_$counter"
final override val input: CheckInput = CheckInput(
CheckInputType.CHECKBOX, value,
setOf("styled")
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 a4dc851c..31ad41a2 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/Radio.kt
@@ -135,7 +135,7 @@ open class Radio(
input.size = value
}
- private val idc = "kv_form_radio_" + counter
+ private val idc = "kv_form_radio_$counter"
final override val input: CheckInput = CheckInput(CheckInputType.RADIO, value).apply {
this.id = idc
this.extraValue = extraValue
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt b/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt
index 2e9b5562..0e5c7693 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt
@@ -184,7 +184,7 @@ open class Select(
input.size = value
}
- private val idc = "kv_form_select_" + counter
+ private val idc = "kv_form_select_$counter"
final override val input: SelectInput = SelectInput(
options, value, multiple, ajaxOptions,
setOf("form-control")
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 7a6a535d..c96bae26 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
@@ -177,7 +177,7 @@ open class Spinner(
input.size = value
}
- protected val idc = "kv_form_spinner_" + counter
+ protected val idc = "kv_form_spinner_$counter"
final override val input: SpinnerInput = SpinnerInput(value, min, max, step, decimals, buttonsType, forceType)
.apply { id = idc }
final override val flabel: FieldLabel = FieldLabel(idc, label, rich)
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractText.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractText.kt
index 26a88f1e..c946af8c 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractText.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractText.kt
@@ -129,7 +129,7 @@ abstract class AbstractText(label: String? = null, rich: Boolean = false) :
* @suppress
* Internal property
*/
- protected val idc = "kv_form_text_" + counter
+ protected val idc = "kv_form_text_$counter"
abstract override val input: AbstractTextInput
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/text/RichTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
index de8bb320..4ab0a59b 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
@@ -69,7 +69,7 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf())
} else {
this.getElementJQuery()?.on("trix-change", { _, _ ->
if (trixId != null) {
- val v = document.getElementById("trix-input-" + trixId)?.let { jQuery(it).`val`() as String? }
+ val v = document.getElementById("trix-input-$trixId")?.let { jQuery(it).`val`() as String? }
value = if (v != null && v.isNotEmpty()) {
v
} else {
@@ -90,14 +90,14 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf())
}
override fun afterDestroy() {
- document.getElementById("trix-input-" + trixId)?.let { jQuery(it).remove() }
- document.getElementById("trix-toolbar-" + trixId)?.let { jQuery(it).remove() }
+ document.getElementById("trix-input-$trixId")?.let { jQuery(it).remove() }
+ document.getElementById("trix-toolbar-$trixId")?.let { jQuery(it).remove() }
trixId = null
}
@Suppress("UnsafeCastFromDynamic")
override fun refreshState() {
- val v = document.getElementById("trix-input-" + trixId)?.let { jQuery(it).`val`() as String? }
+ val v = document.getElementById("trix-input-$trixId")?.let { jQuery(it).`val`() as String? }
if (value != v) {
val editor = this.getElement().asDynamic().editor
value?.let {
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTime.kt b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTime.kt
index 29cb664d..f8b77893 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTime.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTime.kt
@@ -176,7 +176,7 @@ open class DateTime(
input.size = value
}
- private val idc = "kv_form_time_" + counter
+ private val idc = "kv_form_time_$counter"
final override val input: DateTimeInput = DateTimeInput(value, format).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/panel/Root.kt b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
index d81b103d..8223023e 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
@@ -54,7 +54,7 @@ class Root(id: String, private val fixed: Boolean = false, init: (Root.() -> Uni
}
override fun render(): VNode {
- return render("div#" + id, childrenVNodes() + modalsVNodes())
+ return render("div#$id", childrenVNodes() + modalsVNodes())
}
internal fun addModal(modal: Modal) {
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt
index 3c7acbe5..178baddf 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt
@@ -120,7 +120,7 @@ internal class Splitter(private val splitPanel: SplitPanel, direction: Direction
TAG.DIV,
classes = setOf("splitter-" + direction.dir)
) {
- private val idc = "kv_splitter_" + counter
+ private val idc = "kv_splitter_$counter"
init {
counter++
diff --git a/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt b/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
index ea59ed81..8ea26327 100644
--- a/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
@@ -26,6 +26,7 @@ open class Cell(
) : Tag(TAG.TD, text, rich, align, classes) {
init {
+ @Suppress("LeakingThis")
init?.invoke(this)
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt b/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
index 26ea24d2..d6ab2c18 100644
--- a/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
@@ -26,6 +26,7 @@ open class HeaderCell(
) : Tag(TAG.TH, text, rich, align, classes) {
init {
+ @Suppress("LeakingThis")
init?.invoke(this)
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/table/Row.kt b/src/main/kotlin/pl/treksoft/kvision/table/Row.kt
index d408f699..a2b23ff7 100644
--- a/src/main/kotlin/pl/treksoft/kvision/table/Row.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/table/Row.kt
@@ -18,6 +18,7 @@ open class Row(classes: Set<String> = setOf(), init: (Row.() -> Unit)? = null) :
) {
init {
+ @Suppress("LeakingThis")
init?.invoke(this)
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
index 79c31e8d..b85c584b 100644
--- a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
@@ -126,7 +126,7 @@ open class Window(
private var isResizeEvent = false
init {
- id = "kv_window_" + counter
+ id = "kv_window_$counter"
position = Position.ABSOLUTE
overflow = Overflow.HIDDEN
@Suppress("LeakingThis")