diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
commit | 134cb687c4e05fd81a03b682505f9fb9d741a8d7 (patch) | |
tree | f9f41f28c01dc29d1d4fdd576cc9b21958fd9c3b /kvision-modules/kvision-bootstrap-upload/src | |
parent | 4a2aa49e0e561c1bc25aa962449fa2fcce9207ba (diff) | |
download | kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.gz kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.bz2 kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.zip |
Add new className parameter to all DSL builder functions.
Diffstat (limited to 'kvision-modules/kvision-bootstrap-upload/src')
2 files changed, 5 insertions, 3 deletions
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<String> = setOf(), + classes: Set<String>? = 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 ) |