diff --git a/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/input/SelectListAnimation.kt b/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/input/SelectListAnimation.kt index cf1c28fad..4fc853ed7 100644 --- a/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/input/SelectListAnimation.kt +++ b/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/input/SelectListAnimation.kt @@ -61,7 +61,7 @@ class InteractiveSelectListBuilder(private val terminal: Terminal) { /** Set the list of items to select from */ @JvmName("entriesEntry") - fun entries(entries: List): InteractiveSelectListBuilder = apply { + fun entries(entries: Iterable): InteractiveSelectListBuilder = apply { config.entries = entries.toMutableList() } @@ -72,7 +72,7 @@ class InteractiveSelectListBuilder(private val terminal: Terminal) { /** Set the list of items to select from */ @JvmName("entriesString") - fun entries(entries: List): InteractiveSelectListBuilder = apply { + fun entries(entries: Iterable): InteractiveSelectListBuilder = apply { config.entries = entries.mapTo(mutableListOf()) { SelectList.Entry(it) } } @@ -288,8 +288,8 @@ class InteractiveSelectListBuilder(private val terminal: Terminal) { } } -private open class SelectInputAnimation( - final override val terminal: Terminal, +private class SelectInputAnimation( + override val terminal: Terminal, private val config: SelectConfig, private val singleSelect: Boolean, ) : InputReceiverAnimation?> { diff --git a/mordant/src/nonJsMain/kotlin/com/github/ajalt/mordant/input/InteractiveSelectList.kt b/mordant/src/nonJsMain/kotlin/com/github/ajalt/mordant/input/InteractiveSelectList.kt index c87349f3d..6120fad71 100644 --- a/mordant/src/nonJsMain/kotlin/com/github/ajalt/mordant/input/InteractiveSelectList.kt +++ b/mordant/src/nonJsMain/kotlin/com/github/ajalt/mordant/input/InteractiveSelectList.kt @@ -27,7 +27,7 @@ inline fun Terminal.interactiveSelectList( */ @JvmName("interactiveSelectListString") fun Terminal.interactiveSelectList( - entries: List, + entries: Iterable, title: String = "", ): String? { return interactiveSelectList { @@ -45,7 +45,7 @@ fun Terminal.interactiveSelectList( */ @JvmName("interactiveSelectListEntry") fun Terminal.interactiveSelectList( - entries: List, + entries: Iterable, title: String = "", ): String? { return interactiveSelectList { @@ -77,7 +77,7 @@ inline fun Terminal.interactiveMultiSelectList( */ @JvmName("interactiveMultiSelectListEntry") fun Terminal.interactiveMultiSelectList( - entries: List, + entries: Iterable, title: String = "", ): List? { return interactiveMultiSelectList { @@ -95,7 +95,7 @@ fun Terminal.interactiveMultiSelectList( */ @JvmName("interactiveMultiSelectListString") fun Terminal.interactiveMultiSelectList( - entries: List, + entries: Iterable, title: String = "", ): List? { return interactiveMultiSelectList {