diff options
Diffstat (limited to 'kvision-modules/kvision-bootstrap-typeahead-remote/src')
-rw-r--r-- | kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt | 7 |
1 files changed, 5 insertions, 2 deletions
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 <T : Any> Container.typeaheadRemoteInput( function: suspend T.(String?, String?) -> List<String>, stateFunction: (() -> String)? = null, items: Int? = 8, minLength: Int = 1, delay: Int = 0, - type: TextInputType = TextInputType.TEXT, value: String? = null, classes: Set<String> = setOf(), + type: TextInputType = TextInputType.TEXT, value: String? = null, + classes: Set<String>? = null, + className: String? = null, init: (TypeaheadRemoteInput<T>.() -> Unit)? = null ): TypeaheadRemoteInput<T> { 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) } |