diff options
Diffstat (limited to 'kvision-modules/kvision-bootstrap-upload')
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 ) |