From 134cb687c4e05fd81a03b682505f9fb9d741a8d7 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 9 May 2020 23:53:57 +0200 Subject: Add new className parameter to all DSL builder functions. --- .../src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt | 2 +- .../src/main/kotlin/pl/treksoft/kvision/form/upload/UploadInput.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'kvision-modules/kvision-bootstrap-upload/src/main/kotlin') diff --git a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt index 96672587..1f28f252 100644 --- a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt +++ b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt @@ -215,7 +215,7 @@ open class Upload( this.id = idc this.name = name } - final override val flabel: FieldLabel = FieldLabel(idc, label, rich) + final override val flabel: FieldLabel = FieldLabel(idc, label, rich, setOf("control-label")) final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply { visible = false } init { diff --git a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/UploadInput.kt b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/UploadInput.kt index 5bdaad9b..3930ace2 100644 --- a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/UploadInput.kt +++ b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/UploadInput.kt @@ -36,6 +36,7 @@ import pl.treksoft.kvision.i18n.I18n import pl.treksoft.kvision.types.KFile import pl.treksoft.kvision.utils.getContent import pl.treksoft.kvision.utils.obj +import pl.treksoft.kvision.utils.set import kotlin.reflect.KProperty1 /** @@ -369,10 +370,11 @@ open class UploadInput(uploadUrl: String? = null, multiple: Boolean = false, cla fun Container.uploadInput( uploadUrl: String? = null, multiple: Boolean = false, - classes: Set = setOf(), + classes: Set? = null, + className: String? = null, init: (UploadInput.() -> Unit)? = null ): UploadInput { - val uploadInput = UploadInput(uploadUrl, multiple, classes).apply { + val uploadInput = UploadInput(uploadUrl, multiple, classes ?: className.set).apply { init?.invoke( this ) -- cgit