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. --- .../kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kvision-modules/kvision-bootstrap-typeahead-remote/src') diff --git a/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt b/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt index 42412ae4..0693756b 100644 --- a/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt +++ b/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt @@ -30,6 +30,7 @@ import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.remote.JsonRpcRequest import pl.treksoft.kvision.remote.KVServiceManager import pl.treksoft.kvision.utils.JSON +import pl.treksoft.kvision.utils.set import kotlin.browser.window /** @@ -86,12 +87,14 @@ fun Container.typeaheadRemoteInput( function: suspend T.(String?, String?) -> List, stateFunction: (() -> String)? = null, items: Int? = 8, minLength: Int = 1, delay: Int = 0, - type: TextInputType = TextInputType.TEXT, value: String? = null, classes: Set = setOf(), + type: TextInputType = TextInputType.TEXT, value: String? = null, + classes: Set? = null, + className: String? = null, init: (TypeaheadRemoteInput.() -> Unit)? = null ): TypeaheadRemoteInput { val typeaheadRemoteInput = TypeaheadRemoteInput( - serviceManager, function, stateFunction, items, minLength, delay, type, value, classes + serviceManager, function, stateFunction, items, minLength, delay, type, value, classes ?: className.set ).apply { init?.invoke(this) } -- cgit